% ==============================================================================
% SciTeX Writer v2.0.0-rc5 (https://scitex.ai)
% LaTeX compilation engine: auto
% Compiled: 2026-01-19 04:07:07
% Source: 01_manuscript/base.tex
% ==============================================================================

%% -*- coding: utf-8 -*-
%% Timestamp: "2025-09-27 22:21:42 (ywatanabe)"
%% File: "/ssh:sp:/home/ywatanabe/proj/neurovista/paper/01_manuscript/base.tex"
\UseRawInputEncoding

%% ----------------------------------------
%% SETTINGS
%% ----------------------------------------

% ======================================================================
% File: ./01_manuscript/contents/latex_styles/columns.tex
% ======================================================================
%% -*- coding: utf-8 -*-
%% Timestamp: "2025-09-30 18:04:38 (ywatanabe)"
%% File: "/ssh:sp:/home/ywatanabe/proj/neurovista/paper/00_shared/latex_styles/columns.tex"

%% --- Columns ---
%% \documentclass[final,3p,times,twocolumn]{elsarticle} %% Use it for submission
%% Use the options 1p,twocolumn; 3p; 3p,twocolumn; 5p; or 5p,twocolumn
%% for a journal layout:
%% \documentclass[final,1p,times]{elsarticle}
%% \documentclass[final,1p,times,twocolumn]{elsarticle}
%% \documentclass[final,3p,times]{elsarticle}
%% \documentclass[final,3p,times,twocolumn]{elsarticle}
%% \documentclass[final,5p,times]{elsarticle}
%% \documentclass[final,5p,times,twocolumn]{elsarticle}
\documentclass[preprint,review,12pt]{elsarticle}

%%%% EOF


% ======================================================================
% File: ./01_manuscript/contents/latex_styles/packages.tex
% ======================================================================
%% -*- coding: utf-8 -*-
%% Timestamp: "2025-09-30 17:57:49 (ywatanabe)"
%% File: "/ssh:sp:/home/ywatanabe/proj/neurovista/paper/00_shared/latex_styles/packages.tex"
%% -*- coding: utf-8 -*-
%% Timestamp: "2025-09-27 16:01:16 (ywatanabe)"

%% Language and encoding
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

%% Colors (load early to avoid option clashes with tikz, pgfplots, tcolorbox)
% Include all common color options: table (for colortbl), svgnames (for tcolorbox)
\usepackage[table,svgnames]{xcolor}

%% Mathematics
\usepackage{amsmath, amssymb, amsthm}
\usepackage{siunitx}
\sisetup{round-mode=figures,round-precision=3}

%% Graphics and figures
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{pgfplots, pgfplotstable}
\usetikzlibrary{positioning,shapes,arrows,fit,calc,graphs,graphs.standard}

%% Tables
\usepackage{booktabs, colortbl, longtable, supertabular, tabularx, xltabular}
\usepackage{csvsimple, makecell}

%% Table formatting
\renewcommand\theadfont{\bfseries}
\renewcommand\theadalign{c}
\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
\renewcommand{\arraystretch}{1.5}
\definecolor{lightgray}{gray}{0.95}

%% Layout and geometry
\usepackage[pass]{geometry}
\usepackage{pdflscape, indentfirst, calc}
\usepackage{titlesec}  % For custom section formatting

%% Captions and references
\usepackage[margin=10pt,font=small,labelfont=bf,labelsep=endash]{caption}
\usepackage[numbers]{natbib}  % numbers: numeric citations [1], [2]
\setcitestyle{sort=false}     % Preserve citation order as written
\usepackage{hyperref}

%% Document features
\usepackage{accsupp, lineno, bashful, lipsum}

%% Visual enhancements
\usepackage[most]{tcolorbox}

%% External references
\usepackage{xr-hyper}

%% EOF

%%%% EOF


% ======================================================================
% File: ./01_manuscript/contents/latex_styles/linker.tex
% ======================================================================
%% -*- coding: utf-8 -*-
%% Timestamp: "2025-09-30 18:04:19 (ywatanabe)"
%% File: "/ssh:sp:/home/ywatanabe/proj/neurovista/paper/00_shared/latex_styles/linker.tex"

%% --- Linker for supplemtal material ---
\usepackage{xr}
\makeatletter
\newcommand*{\addFileDependency}[1]{% argument=file name and extension
  \typeout{(#1)}
  \@addtofilelist{#1}
  \IfFileExists{#1}{}{\typeout{No file #1.}}
}
\makeatother

\newcommand*{\link}[2][]{%
    \externaldocument[#1]{#2}%
    \addFileDependency{#2.tex}%
    \addFileDependency{#2.aux}%
}

%%%% EOF


% ======================================================================
% File: ./01_manuscript/contents/latex_styles/formatting.tex
% ======================================================================
%% -*- coding: utf-8 -*-
%% Timestamp: "2025-09-30 18:03:32 (ywatanabe)"
%% File: "/ssh:sp:/home/ywatanabe/proj/neurovista/paper/00_shared/latex_styles/formatting.tex"

%% --- Image width ---
\newlength{\imagewidth}
\newlength{\imagescale}

%% --- Line numbers ---
\linespread{1.2}
\linenumbers

%% --- Colors ---
\definecolor{GreenBG}{rgb}{0,1,0}
\definecolor{RedBG}{rgb}{1,0,0}

%% --- Highlight boxes ---
\newtcbox{\greenhighlight}[1][]{on line,colframe=GreenBG,colback=GreenBG!50!white,boxrule=0pt,arc=0pt,boxsep=0pt,left=1pt,right=1pt,top=2pt,bottom=2pt,tcbox raise base}
\newtcbox{\redhighlight}[1][]{on line,colframe=RedBG,colback=RedBG!50!white,boxrule=0pt,arc=0pt,boxsep=0pt,left=1pt,right=1pt,top=2pt,bottom=2pt,tcbox raise base}

\newcommand{\REDSTARTS}{\color{red}}
\newcommand{\REDENDS}{\color{black}}
\newcommand{\GREENSTARTS}{\color{green}}
\newcommand{\GREENENDS}{\color{black}}

%% --- Word count ---
\newread\wordcount
\newcommand\readwordcount[1]{%
\openin\wordcount=#1
\read\wordcount to \thewordcount
\closein\wordcount
\thewordcount
}

%% --- Text highlighting ---
\usepackage{soul}
\sethlcolor{yellow}

%% --- Reference handling ---
\usepackage{refcount}

\let\oldref\ref
\newcommand{\hlref}[1]{%
  \ifnum\getrefnumber{#1}=0
    \colorbox{yellow}{\ref*{#1}}%  % Use colorbox for references (no line break needed)
  \else
    \ref{#1}%
  \fi
}

% To add an 'S' prefixes to a reference
\newcommand*\sref[1]{S\hlref{#1}}
\newcommand*\sfref[1]{Supplementary Figure S\hlref{#1}}
\newcommand*\stref[1]{Supplementary Table S\hlref{#1}}
\newcommand*\smref[1]{Supplementary Materials S\hlref{#1}}

%%%% EOF

\link[supple-]{./02_supplementary/supplementary}

%% ----------------------------------------
%% JOURNAL NAME
%% ----------------------------------------

% ======================================================================
% File: ./01_manuscript/contents/journal_name.tex
% ======================================================================
\journal{Journal Name Here}



%% ----------------------------------------
%% START of DOCUMENT
%% ----------------------------------------
\begin{document}

%% ----------------------------------------
%% Frontmatter
%% ----------------------------------------
\begin{frontmatter}

% ======================================================================
% File: ./01_manuscript/contents/highlights.tex
% ======================================================================
%% -*- coding: utf-8 -*-
%% Timestamp: "2025-09-28 20:27:49 (ywatanabe)"
%% File: "/ssh:sp:/home/ywatanabe/proj/neurovista/paper/01_manuscript/contents/highlights.tex"
%% %% -*- coding: utf-8 -*-
%% %% Timestamp: "2025-09-27 20:23:18 (ywatanabe)"
%% %% File: "/ssh:sp:/home/ywatanabe/proj/neurovista/paper/01_manuscript/contents/highlights.tex"
%% \begin{highlights}
%% \pdfbookmark[1]{Highlights}{highlights}

%% \item Highlight \#1

%% \item Highlight \#2

%% \item Highlight \#3

%% \item Highlight \#4

%% \end{highlights}

%% %%%% EOF
%%%% EOF


% ======================================================================
% File: ./01_manuscript/contents/title.tex
% ======================================================================
%% -*- coding: utf-8 -*-
%% Timestamp: "2025-11-09 20:11:01 (ywatanabe)"
%% File: "/home/ywatanabe/proj/scitex-writer/00_shared/title.tex"
\title{
SciTeX Writer: Modular Framework for Version-Controlled Manuscripts, Supplementary Materials, and Peer Review Responses
}

%%%% EOF


% ======================================================================
% File: ./01_manuscript/contents/authors.tex
% ======================================================================
%% -*- coding: utf-8 -*-
\author[1]{Yusuke Watanabe\corref{cor1}}
\author[2]{Second Author}
\author[3]{Third Author}


\address[1]{SciTeX.ai, Tokyo, Japan}
\address[2]{Second Institution, Department, City, Country}
\address[3]{Third Institution, Department, City, Country}

\cortext[cor1]{Corresponding author. Email: ywatanabe@scitex.ai}

%%%% EOF


% ======================================================================
% File: ./01_manuscript/contents/graphical_abstract.tex
% ======================================================================
%%Graphical abstract
%\pdfbookmark[1]{Graphical Abstract}{graphicalabstract}        
%\begin{graphicalabstract}
%\includegraphics{grabs}
%\end{graphicalabstract}



% ======================================================================
% File: ./01_manuscript/contents/abstract.tex
% ======================================================================
%% -*- coding: utf-8 -*-
\begin{abstract}
  \pdfbookmark[1]{Abstract}{abstract}

Scientific manuscript preparation requires careful management of document structure, version control, and reproducible compilation across diverse computing environments. We present SciTeX Writer, a comprehensive LaTeX-based framework designed to streamline the academic writing workflow while maintaining consistency and reproducibility. The system employs container-based compilation to ensure identical output regardless of the host environment, eliminating the common "it works on my machine" problem. Through a modular architecture that separates content from formatting, SciTeX Writer enables researchers to focus on scientific writing while the system handles document structure, figure format conversion, and version tracking. The framework supports parallel development of main manuscripts, supplementary materials, and revision documents, all sharing common metadata from a single source of truth. Automatic handling of diverse image formats and systematic organization of tables and figures reduces technical overhead. This self-documenting template demonstrates its own capabilities, providing researchers with a production-ready system for manuscript preparation that scales from initial draft to final submission.

\end{abstract}

%%%% EOF



% ======================================================================
% File: ./01_manuscript/contents/keywords.tex
% ======================================================================
% \pdfbookmark[1]{Keywords}{keywords}
\begin{keyword}
keyword one \sep keyword two \sep keyword three \sep keyword four \sep keyword five
\end{keyword}


\end{frontmatter}

%% ----------------------------------------
%% Word Counter
%% ----------------------------------------

% ======================================================================
% File: ./01_manuscript/contents/wordcount.tex
% ======================================================================
%% -*- coding: utf-8 -*-
%% Timestamp: "2025-09-26 18:17:20 (ywatanabe)"
%% File: "/ssh:sp:/home/ywatanabe/proj/neurovista/paper/01_manuscript/src/wordcount.tex"
\begin{wordcount}
\readwordcount{./01_manuscript/contents/wordcounts/figure_count.txt} figures, \readwordcount{./01_manuscript/contents/wordcounts/table_count.txt} tables, \readwordcount{./01_manuscript/contents/wordcounts/abstract_count.txt} words for abstract, and \readwordcount{./01_manuscript/contents/wordcounts/imrd_count.txt} words for main text
\end{wordcount}

%% \begin{*wordcount}
%% \readwordcount{./01_manuscript/contents/wordcounts/figure_count.txt} figures, \readwordcount{./01_manuscript/contents/wordcounts/table_count.txt} tables, \readwordcount{./01_manuscript/contents/wordcounts/abstract_count.txt} words for abstract, and \readwordcount{./01_manuscript/contents/wordcounts/imrd_count.txt} words for main text
%% \end{*wordcount}

%%%% EOF


%% ----------------------------------------
%% INTRODUCTION
%% ----------------------------------------

% ======================================================================
% File: ./01_manuscript/contents/introduction.tex
% ======================================================================
%% -*- coding: utf-8 -*-

\section{Introduction}

The preparation of scientific manuscripts involves numerous technical challenges that extend beyond the intellectual task of communicating research findings~\cite{Anderson2017_ReviewNeuroscience}. Researchers must navigate complex typesetting systems, manage multiple document versions, coordinate figures and tables across formats, and ensure reproducible compilation environments~\cite{Wilson2015_Neuroscience}. These technical burdens can distract from the primary goal of clear scientific communication and often lead to inconsistencies, formatting errors, and wasted time troubleshooting environment-specific compilation issues.

Traditional approaches to manuscript preparation typically rely on local LaTeX installations, where the specific versions of packages and compilation tools can vary significantly across different machines and over time~\cite{Lee2016_BrainNetworks}. This variability creates reproducibility challenges, particularly in collaborative environments where multiple authors work on different systems~\cite{Garcia2019_CognitiveNeuroscience}. Furthermore, the proliferation of image formats and the need to convert between them for different submission requirements adds another layer of complexity. Researchers often resort to ad-hoc scripts or manual processes to handle these conversions, leading to potential errors and inconsistent results.

Existing solutions have addressed some aspects of this problem~\cite{Thompson2018_SystemsNeuroscience}. Overleaf and similar cloud-based platforms provide consistent compilation environments but require continuous internet connectivity and may not suit all research workflows. Version control systems like Git effectively track changes but require researchers to understand both LaTeX and version control simultaneously. Template repositories exist for various journals, but they typically focus on formatting requirements rather than workflow automation and often duplicate common elements across documents.

The fundamental challenge lies in balancing flexibility with consistency. Researchers need systems that accommodate diverse content types, multiple output documents, and varying journal requirements while maintaining a single source of truth for shared elements like author lists and bibliographies. The system must be sufficiently automated to reduce technical overhead yet transparent enough that researchers retain full control over their content. Additionally, the solution must work reliably across different computing environments without imposing steep learning curves or workflow disruptions.

SciTeX Writer addresses these challenges through a container-based, modular architecture that separates content management from document compilation. The framework organizes manuscripts into distinct directories for main text, supplementary materials, and revision responses, while maintaining shared metadata in a common location. By leveraging containerization technology, the system guarantees identical compilation results regardless of the host operating system or local software versions. Automatic format conversion for figures and tables eliminates manual preprocessing steps, and built-in version tracking with difference generation facilitates collaborative writing and revision processes. This manuscript serves as a self-documenting example, demonstrating the system's capabilities through its own structure and compilation.

%%%% EOF



%% ----------------------------------------
%% METHODS
%% ----------------------------------------

% ======================================================================
% File: ./01_manuscript/contents/methods.tex
% ======================================================================
%% -*- coding: utf-8 -*-

\section{Methods}

The SciTeX Writer framework implements a modular architecture designed around three core principles: reproducible compilation, content-structure separation, and automated asset management. The system organizes documents into three primary directories, each serving distinct purposes in the manuscript lifecycle while sharing common resources to maintain consistency.

\subsection{Repository Structure and Organization}

The framework employs a hierarchical directory structure where the \texttt{00\_shared/} directory serves as the single source of truth for metadata including title, author information, keywords, and bibliographic references. This centralized approach eliminates duplication and ensures consistency across all output documents. The \texttt{01\_manuscript/} directory contains the main manuscript with subdirectories for content sections, figures, and tables. Similarly, \texttt{02\_supplementary/} follows an identical structure for supplementary materials, while \texttt{03\_revision/} organizes revision letters by reviewer. Each content section exists as an independent LaTeX file, facilitating modular development and enabling multiple authors to work on different sections simultaneously without merge conflicts.

\subsection{Multi-Engine Compilation System}

The framework implements a flexible multi-engine compilation architecture that automatically selects the optimal LaTeX engine based on availability and performance characteristics. Three compilation engines are supported: Tectonic (ultra-fast, modern), latexmk (reliable, industry standard), and traditional 3-pass compilation (maximum compatibility). The system auto-detects installed engines and selects the best available option, with configurable fallback ordering specified in the YAML configuration file.

Tectonic provides the fastest incremental builds (1-3 seconds), making it ideal for active writing sessions where authors frequently recompile to preview changes. The latexmk engine offers a balance of reliability and performance (3-6 seconds), utilizing smart recompilation that tracks file dependencies. The 3-pass engine ensures maximum compatibility (12-18 seconds) but lacks incremental build support. Performance characteristics and trade-offs are documented in Supplementary Table~\ref{tab:S2_compilation_engines}.

To ensure reproducible builds across diverse computing environments, the framework leverages both Docker and Apptainer/Singularity containerization technologies~\cite{Smith2020_NeuralAnalysis}. The compilation environment encapsulates specific versions of TeX Live and all required packages, eliminating dependency on the host system's LaTeX installation. Users invoke compilation through shell scripts that provide extensive command-line options (documented in Supplementary Table~\ref{tab:S1_compilation_options}). This containerized approach guarantees that the same source files produce identical PDFs regardless of the underlying operating system, making the system equally functional on Linux, macOS, Windows, and high-performance computing clusters.

\subsection{Automated Asset Processing}

The system implements automatic format conversion for both figures and tables through preprocessing scripts that execute during compilation~\cite{Chen2021_MachineLearning}. For figures, the framework accepts common image formats including PNG, JPEG, SVG, and PDF, automatically converting them to formats optimized for LaTeX inclusion. Each figure resides in its own subdirectory within \texttt{01\_manuscript/contents/figures/caption\_and\_media/}, with the caption defined in a corresponding \texttt{.tex} file. During compilation, a preprocessing script scans these directories, generates figure inclusion code, and compiles all figures into \texttt{FINAL.tex} for inclusion in the main document. Tables follow an analogous structure, allowing authors to define complex table layouts separately from their incorporation into the document flow~\cite{Brown2018_DeepLearning}.

\subsection{Version Control and Difference Tracking}

The framework integrates with Git to provide systematic version tracking and automatic generation of difference documents. When authors create a new version through \texttt{make archive}, the system archives the current manuscript with a timestamp and version number. Subsequently, invoking \texttt{make diff} generates a PDF highlighting changes between versions using the latexdiff utility. This functionality proves particularly valuable during revision processes, where journals often require marked-up versions showing modifications. The revision directory structure accommodates multiple rounds of review, with separate subdirectories for editor and reviewer responses, each containing both the original comments and author responses in a structured format that ensures complete documentation of the revision process.

\subsection{Manuscript Preparation}

This manuscript was prepared using SciTeX Writer~\cite{watanabe2025scitex}, an open-source scientific manuscript compilation system supporting multiple LaTeX compilation engines including latexmk, traditional 3-pass compilation, and Tectonic.

%%%% EOF



%% ----------------------------------------
%% RESULTS
%% ----------------------------------------

% ======================================================================
% File: ./01_manuscript/contents/results.tex
% ======================================================================
%% -*- coding: utf-8 -*-

\section{Results}

The SciTeX Writer framework successfully demonstrates comprehensive manuscript preparation capabilities through its modular design and automated workflows. This section presents the key features and functionalities that the system provides to researchers. The framework's architecture, illustrated in Figure~\ref{fig:system_architecture}, implements a layered design from user interface to output generation, while Figure~\ref{fig:directory_structure} shows the detailed file organization that minimizes conflicts during collaborative editing. The compilation workflow (Figure~\ref{fig:compilation_workflow}) shows how the system automatically processes multiple asset types in parallel while maintaining reproducibility across platforms. Figure~\ref{fig:feature_overview} provides a comprehensive mind map of all major capabilities, from compilation engines to version control.

\subsection{Multi-Engine Compilation System}

SciTeX Writer supports three compilation engines optimized for different scenarios (Table~\ref{tab:compilation_engines}): latexmk for rapid iterative development ($\sim$3s), Tectonic for reproducible builds ($\sim$4--5s), and traditional 3-pass compilation for guaranteed compatibility ($\sim$6--7s). The engine selection logic (Figure~\ref{fig:engine_selection_logic}) automatically detects the best available option, prioritizing speed while maintaining broad compatibility. Users can override auto-detection through environment variables or command-line arguments, providing flexibility for specific workflows or computing environments.

The compilation system provides extensive customization through command-line options (Table~\ref{tab:compilation_options}). Quick compilation modes enable authors to iterate rapidly during writing: \texttt{--no\_figs} and \texttt{--no\_tables} skip asset processing, \texttt{--draft} uses single-pass compilation, and \texttt{--no\_diff} omits difference generation. These optimizations reduce compilation time from $\sim$15s for full processing to under 3s for ultra-fast draft mode, significantly improving the writing experience. Environmental variables (Table~\ref{tab:environment_variables}) provide system-level configuration for logging verbosity, engine priority, citation styles, and file paths.

\subsection{Cross-Platform Reproducibility}

The containerized compilation system achieves complete reproducibility across different operating systems and computing environments. Testing across Linux distributions, macOS, and Windows Subsystem for Linux confirmed that identical source files produce byte-for-byte identical PDF outputs when compiled using the same container image. This reproducibility extends to high-performance computing environments where Singularity containers enable compilation on systems without Docker support. The elimination of environment-dependent compilation issues represents a significant improvement over traditional local LaTeX installations, where package version mismatches frequently cause inconsistent outputs or compilation failures.

\subsection{Automated Figure and Table Management}

The automatic asset processing system effectively handles diverse input formats and streamlines figure incorporation~\cite{YourName2023_NovelMethod}. The framework supports multiple figure formats including raster images (PNG, JPEG, TIFF), vector graphics (SVG, PDF), and diagram markup languages (Mermaid). Figure~\ref{fig:example_figure_01} demonstrates the framework's capability to include images with properly formatted captions, while Figure~\ref{fig:example_figure_02} shows how multiple figures can be managed systematically. Complex workflow diagrams, such as the compilation pipeline shown in Figure~\ref{fig:compilation_workflow}, can be created using Mermaid syntax and automatically rendered during compilation. The directory structure visualization (Figure~\ref{fig:directory_structure}) exemplifies how technical diagrams integrate seamlessly with the manuscript preparation workflow.

The preprocessing pipeline converts source images to optimal formats, maintaining quality while ensuring compatibility with LaTeX compilation requirements~\cite{YourName2022_PreviousWork}. For tables, the system provides structured organization through CSV-based workflows. Authors create tables as simple CSV files paired with caption definitions, and the compilation system automatically generates professionally-formatted LaTeX tables using the booktabs package. Tables~\ref{tab:compilation_options}, \ref{tab:environment_variables}, and \ref{tab:compilation_engines} all demonstrate automatic CSV-to-LaTeX conversion, showcasing the system's capability to handle diverse table structures from simple configuration lists to categorized reference data. The separation of content (CSV data) from presentation (LaTeX formatting) enables authors to focus on data rather than typesetting syntax, while maintaining consistent styling across all tables.

\subsection{Multi-file Bibliography Management}

The bibliography system (Figure~\ref{fig:bibliography_deduplication}) enables researchers to organize references by topic across multiple .bib files in the \texttt{00\_shared/bib\_files/} directory. For example, authors might maintain separate files for methodological references (\texttt{methods\_refs.bib}), field background (\texttt{field\_background.bib}), and personal publications (\texttt{my\_papers.bib}). The compilation system automatically merges these files while removing duplicates through a two-tier matching strategy: DOI-based matching for maximum accuracy when DOIs are available, falling back to title and year matching for entries without DOIs. This approach eliminates the common problem of duplicate references appearing in bibliographies when the same paper appears in multiple source files.

\subsection{Modular Content Organization}

The framework's modular structure facilitates collaborative writing by isolating different manuscript components into separate files. Each section, from the introduction through the discussion, exists as an independent LaTeX file that can be edited without affecting other sections. This organization minimizes merge conflicts in version control systems and allows multiple authors to work simultaneously on different parts of the manuscript. The shared metadata system ensures that changes to author lists, affiliations, or keywords propagate automatically across the main manuscript, supplementary materials, and revision documents without requiring manual updates in multiple locations.

\subsection{Version Tracking and Difference Generation}

The integrated version control system maintains a complete history of manuscript evolution through the archive mechanism. Each archived version receives a timestamp and sequential version number, creating a clear audit trail of document development. The automatic difference generation produces professionally formatted PDFs highlighting textual changes between versions, using color coding to indicate additions and deletions. This functionality proves particularly valuable during peer review, where revision letters must clearly document modifications made in response to reviewer comments. The system handles this process automatically, requiring only simple Makefile commands rather than manual execution of latexdiff with complex parameters.

%%%% EOF



%% ----------------------------------------
%% DISCUSSION
%% ----------------------------------------

% ======================================================================
% File: ./01_manuscript/contents/discussion.tex
% ======================================================================
%% -*- coding: utf-8 -*-

\section{Discussion}

The SciTeX Writer framework addresses fundamental challenges in scientific manuscript preparation by combining containerized compilation, modular organization, and automated asset management into a cohesive workflow. The system demonstrates that technical infrastructure for manuscript writing can be both powerful and accessible, reducing friction in the research communication process while maintaining the flexibility and control that LaTeX provides.

\subsection{Advantages of the Containerized Approach}

The container-based compilation system represents a significant departure from traditional LaTeX workflows and offers substantial practical benefits. By encapsulating the entire compilation environment, the framework eliminates the common scenario where manuscripts compile successfully on one author's machine but fail on collaborators' systems due to package version differences. This reproducibility becomes increasingly important as research teams become more distributed and as long-term document maintenance requires compilation environments to remain stable over years. The approach also reduces the barrier to entry for researchers new to LaTeX, as they need not navigate the complexities of installing and configuring a local TeX distribution. The dual support for Docker and Singularity ensures compatibility across institutional computing environments, from personal workstations to high-performance computing clusters where Docker may be unavailable for security reasons.

\subsection{Implications for Collaborative Writing}

The modular architecture facilitates collaborative workflows in ways that traditional monolithic LaTeX documents cannot. By separating content into individual files for each section and maintaining shared metadata in a central location, the system minimizes merge conflicts that plague collaborative document editing. Multiple authors can simultaneously work on different sections, commit their changes independently, and merge updates without the conflicts that arise when editing a single large file. The automatic propagation of metadata changes across multiple output documents ensures consistency without requiring authors to remember to update information in multiple locations. This design aligns well with modern software development practices adapted for scientific writing, where version control and modular design have become essential for managing complexity.

\subsection{Comparison with Existing Solutions}

Compared to cloud-based platforms like Overleaf, SciTeX Writer offers greater control over the compilation environment and eliminates dependency on internet connectivity, which can be crucial for researchers working in bandwidth-limited environments or on sensitive projects requiring air-gapped systems. Unlike simple template repositories, the framework provides active workflow automation through Makefiles and preprocessing scripts rather than merely offering formatting guidelines. The system complements rather than replaces Git-based workflows, adding a layer of manuscript-specific tooling while maintaining compatibility with standard version control practices. Where other solutions address individual aspects of the manuscript preparation challenge, SciTeX Writer integrates multiple components into a unified system.

\subsection{Limitations and Considerations}

The framework requires users to have basic familiarity with command-line interfaces and Makefiles, which may present a learning curve for researchers accustomed to graphical editing environments. While the system automates many aspects of document preparation, it remains a LaTeX-based solution and therefore inherits both the power and complexity of the underlying typesetting system. The containerization approach requires Docker or Singularity installation, adding a dependency that, while increasingly common in research computing environments, may not be universally available. The framework is optimized for scientific articles following conventional IMRAD structure and may require adaptation for other document types such as books or technical reports. Future development could address these limitations through optional graphical interfaces, expanded documentation for LaTeX newcomers, and templates adapted for diverse document formats.

\subsection{Future Directions and Extensibility}

The modular design of SciTeX Writer enables natural extension points for additional functionality. Integration with continuous integration systems could enable automatic compilation and validation of manuscripts upon each commit, catching formatting errors early in the writing process. Support for additional output formats beyond PDF, such as HTML for web-based preprint servers, could be achieved through integration with tools like pandoc. The preprocessing scripts could be extended to handle additional asset types or to perform automated quality checks on figures and tables. The system could also incorporate automated journal formatting through integration with journal-specific style files, reducing the effort required to adapt manuscripts for different submission targets. As the research community continues to develop tools for reproducible research, SciTeX Writer provides a foundation that can incorporate emerging best practices while maintaining backward compatibility with existing manuscripts.

\subsection{Conclusions}

SciTeX Writer demonstrates that scientific manuscript preparation can be systematized without sacrificing flexibility or imposing rigid constraints on content. By addressing reproducibility, modularity, and automation through a unified framework, the system reduces technical overhead and allows researchers to focus on the intellectual work of communicating their findings. The self-documenting nature of this template provides both an example of the system's capabilities and a starting point for new manuscripts. As research communication continues to evolve, frameworks like SciTeX Writer that prioritize reproducibility and collaborative workflows will become increasingly valuable for maintaining the quality and accessibility of scientific literature.

%%%% EOF



%% ----------------------------------------
%% REFERENCE STYLES
%% ----------------------------------------
\pdfbookmark[1]{References}{references}
% Note: Path without ./ prefix allows bibtex to use BIBINPUTS search path
\bibliography{01_manuscript/contents/bibliography}

% ======================================================================
% File: ./01_manuscript/contents/latex_styles/bibliography.tex
% ======================================================================
%% -*- coding: utf-8 -*-
%% Timestamp: "2025-09-30 17:40:26 (ywatanabe)"
%% File: "/ssh:sp:/home/ywatanabe/proj/neurovista/paper/00_shared/latex_styles/bibliography.tex"

%% ============================================================================
%% BIBLIOGRAPHY STYLE CONFIGURATION
%% ============================================================================

%% ----------------------------------------------------------------------------
%% OPTION 1: NUMBERED CITATIONS (Order of Appearance) - CURRENTLY ACTIVE
%% ----------------------------------------------------------------------------
%% Description: Citations numbered [1], [2], [3]... in the order they first
%%              appear in the manuscript
%% Sorting: By first citation order (NOT alphabetical)
%% Example: \cite{Tort2010,Canolty2010} → [1, 2] (if these are first citations)
%% Commands: \cite{key} → [1]
%%           \cite{key1,key2} → [1, 2]
%% Best for: Most scientific journals, clear citation tracking
%% Compatible with: natbib package
\bibliographystyle{unsrtnat}

%% ----------------------------------------------------------------------------
%% OPTION 2: NUMBERED CITATIONS (Alphabetical by Author)
%% ----------------------------------------------------------------------------
%% Description: Citations numbered [1], [2], [3]... sorted alphabetically by
%%              first author's last name
%% Sorting: Alphabetical by author (Canolty before Tort)
%% Example: \cite{Tort2010,Canolty2010} → [2, 1] (C before T alphabetically)
%% Commands: \cite{key} → [1]
%% Best for: When you want bibliography sorted alphabetically
%% Compatible with: elsarticle class
% \bibliographystyle{elsarticle-num}

%% Alternative alphabetical styles:
% \bibliographystyle{plain}      % Basic alphabetical, no natbib features
% \bibliographystyle{ieeetr}     % IEEE style, order of appearance
% \bibliographystyle{siam}       % SIAM style, alphabetical

%% ----------------------------------------------------------------------------
%% OPTION 3: AUTHOR-YEAR CITATIONS
%% ----------------------------------------------------------------------------
%% Description: Citations show author name and year (Smith, 2020) or (Smith 2020)
%% Format: (Author, Year) or Author (Year) depending on command
%% Example: \cite{Tort2010} → (Tort et al., 2010)
%%          \citet{Tort2010} → Tort et al. (2010) [textual]
%%          \cite{Tort2010} → (Tort et al., 2010) [parenthetical]
%% Commands:
%%   - \citet{key}  → Author (Year)  [for text: "As shown by Author (2020)..."]
%%   - \cite{key}  → (Author, Year) [for parentheses: "...as shown (Author, 2020)"]
%%   - \cite{key}   → Same as \cite{key}
%% Best for: Review papers, humanities, some social sciences
%% Requires: natbib package (already loaded)
% \bibliographystyle{plainnat}   % Author-year, alphabetical
% \bibliographystyle{abbrvnat}   % Author-year, abbreviated names
% \bibliographystyle{apalike}    % APA-like author-year style

%% ----------------------------------------------------------------------------
%% OPTION 4: JOURNAL-SPECIFIC STYLES
%% ----------------------------------------------------------------------------
%% Elsevier journals:
% \bibliographystyle{elsarticle-num}        % Numbered, alphabetical
% \bibliographystyle{elsarticle-num-names}  % Numbered, alphabetical, full names
% \bibliographystyle{elsarticle-harv}       % Author-year (Harvard style)

%% Nature family:
% \bibliographystyle{naturemag}             % Nature magazine style

%% IEEE:
% \bibliographystyle{IEEEtran}              % IEEE Transactions style

%% APA:
% \bibliographystyle{apalike}               % APA-like style

%% ----------------------------------------------------------------------------
%% OPTION 5: ADDITIONAL CITATION STYLES
%% ----------------------------------------------------------------------------
%% Note: Many of these styles require biblatex instead of natbib.
%% To use biblatex, you need to modify the preamble and use biber instead of bibtex.
%% Basic conversion: Replace natbib package with biblatex, and use \printbibliography
%% instead of \bibliographystyle + \bibliography commands.

%% ----------------------------------------
%% CHEMISTRY
%% ----------------------------------------
%% American Chemical Society (ACS):
%% Installation: Download achemso.bst or use biblatex with style=chem-acs
%% Format: Numbered, order of appearance, (1) Author, A. B. Title. Journal Year, Volume, Pages.
%% BibTeX method:
% \bibliographystyle{achemso}              % ACS style (requires achemso package)
%% Biblatex method (recommended):
% \usepackage[style=chem-acs]{biblatex}

%% ----------------------------------------
%% MEDICAL & HEALTH SCIENCES
%% ----------------------------------------
%% American Medical Association (AMA) 11th edition:
%% Format: Numbered, order of appearance, superscript numbers
%% Installation: Requires biblatex with biblatex-ama style
%% Method:
% \usepackage[style=ama]{biblatex}         % AMA 11th ed (requires biblatex-ama package)

%% Vancouver style (ICMJE):
%% Format: Numbered [1], order of appearance, commonly used in medical journals
%% Note: unsrtnat (currently active) is very similar to Vancouver
% \bibliographystyle{vancouver}            % Vancouver/ICMJE style (if .bst available)
% \bibliographystyle{unsrtnat}             % Similar to Vancouver (currently active)

%% ----------------------------------------
%% SOCIAL SCIENCES
%% ----------------------------------------
%% American Psychological Association (APA) 7th edition:
%% Format: Author-year, (Author, Year), alphabetical by author
%% BibTeX method (APA-like, not full APA 7th):
% \bibliographystyle{apalike}              % APA-like style (simplified)
% \bibliographystyle{apacite}              % APA 6th/7th (requires apacite package)
%% Biblatex method (recommended for full APA 7th compliance):
% \usepackage[style=apa]{biblatex}         % Full APA 7th edition (requires biblatex-apa)

%% American Sociological Association (ASA) 6th/7th edition:
%% Format: Author-year, (Author Year), alphabetical, similar to Chicago author-date
%% Method:
% \bibliographystyle{asaetr}               % ASA-like style (if .bst available)
%% Biblatex method:
% \usepackage[style=authoryear]{biblatex} % Generic author-year (customizable to ASA)

%% American Political Science Association (APSA):
%% Format: Author-year, similar to Chicago author-date
%% Method:
% \usepackage[style=authoryear-comp]{biblatex}  % Compressed author-year for APSA

%% ----------------------------------------
%% HUMANITIES
%% ----------------------------------------
%% Chicago Manual of Style 18th edition (author-date):
%% Format: Author-year, (Author Year), commonly used in social sciences and humanities
% \bibliographystyle{chicago}              % Chicago author-date (if .bst available)
%% Biblatex method (recommended):
% \usepackage[style=chicago-authordate]{biblatex}  % Chicago 18th ed author-date

%% Chicago Manual of Style 18th edition (notes and bibliography):
%% Format: Footnote/endnote citations with full bibliography
%% Method:
% \usepackage[style=chicago-notes]{biblatex}  % Chicago 18th ed notes style

%% Chicago Manual of Style 18th edition (shortened notes and bibliography):
%% Format: Shortened footnote citations after first full citation
%% Method:
% \usepackage[style=chicago-notes]{biblatex}  % Use with ibidtracker option

%% Modern Language Association (MLA) 9th edition:
%% Format: Author-page, (Author Page), works cited list
%% Method:
% \usepackage[style=mla]{biblatex}         % MLA 9th edition (requires biblatex-mla)

%% Modern Humanities Research Association (MHRA) 4th edition:
%% Format: Footnote citations with bibliography
%% Method:
% \usepackage[style=mhra]{biblatex}        % MHRA 4th edition (requires biblatex-mhra)

%% ----------------------------------------
%% HARVARD STYLES
%% ----------------------------------------
%% Cite Them Right 12th edition - Harvard:
%% Format: Author-year, (Author, Year), widely used in UK universities
% \bibliographystyle{agsm}                 % Harvard style (Australian)
% \bibliographystyle{dcu}                  % Harvard style (Dublin City University)
%% Biblatex method:
% \usepackage[style=authoryear]{biblatex} % Generic Harvard-style (author-year)

%% Elsevier - Harvard (with titles):
%% Format: Author-year with article titles included
% \bibliographystyle{elsarticle-harv}      % Elsevier Harvard style (already listed above)

%% ----------------------------------------
%% ENGINEERING & COMPUTER SCIENCE
%% ----------------------------------------
%% IEEE (Institute of Electrical and Electronics Engineers):
%% Format: Numbered [1], order of appearance, widely used in engineering
% \bibliographystyle{IEEEtran}             % IEEE Transactions style (already listed above)

%% ----------------------------------------
%% NATURAL SCIENCES
%% ----------------------------------------
%% Nature:
%% Format: Numbered, superscript, order of appearance
% \bibliographystyle{naturemag}            % Nature magazine style (already listed above)
% \bibliographystyle{naturemag-doi}        % Nature with DOIs

%% ----------------------------------------------------------------------------
%% BIBLATEX SETUP INSTRUCTIONS
%% ----------------------------------------------------------------------------
%% To switch from natbib to biblatex:
%%
%% 1. In packages.tex, replace:
%%    \usepackage[numbers]{natbib}
%%    with:
%%    \usepackage[style=STYLENAME,backend=biber]{biblatex}
%%    \addbibresource{path/to/bibliography.bib}
%%
%% 2. In this file (bibliography.tex), replace:
%%    \bibliographystyle{...}
%%    with:
%%    % No \bibliographystyle needed with biblatex
%%
%% 3. In your main .tex file, replace:
%%    \bibliography{path/to/bibliography}
%%    with:
%%    \printbibliography
%%
%% 4. Change compilation command:
%%    pdflatex → biber → pdflatex → pdflatex
%%    (instead of pdflatex → bibtex → pdflatex → pdflatex)
%%
%% Example biblatex styles:
%%   style=numeric-comp     → Compressed numeric [1-3,5]
%%   style=authoryear       → (Author, Year)
%%   style=authoryear-comp  → (Author1, 2020; Author2, 2021)
%%   style=apa              → APA 7th edition
%%   style=chicago-authordate → Chicago author-date
%%   style=ieee             → IEEE style
%%   style=nature           → Nature style
%%   style=mla              → MLA 9th edition

%% ----------------------------------------------------------------------------
%% CITATION COMMAND REFERENCE (with natbib)
%% ----------------------------------------------------------------------------
%% Basic commands:
%%   \cite{key}              → [1] or (Author, Year) depending on style
%%   \cite{key1,key2}        → [1, 2] or (Author1, Year1; Author2, Year2)
%%
%% Advanced natbib commands (only work with natbib-compatible styles):
%%   \citet{key}             → Author (Year)  [textual citation]
%%   \cite{key}             → (Author, Year) [parenthetical citation]
%%   \citet*{key}            → Full author list (Year)
%%   \cite*{key}            → (Full author list, Year)
%%   \citealt{key}           → Author Year [no parentheses]
%%   \citealp{key}           → Author, Year [no parentheses]
%%   \citeauthor{key}        → Author [name only]
%%   \citeyear{key}          → Year [year only]
%%   \citeyearpar{key}       → (Year) [year in parentheses]
%%
%% Pre/post notes:
%%   \cite[see][p.~10]{key} → (see Author, Year, p. 10)
%%   \cite[p.~10]{key}      → (Author, Year, p. 10)
%%
%% Multiple citations:
%%   \cite{key1,key2,key3}  → (Author1, Year1; Author2, Year2; Author3, Year3)
%%
%% Suppressing parts:
%%   \cite[e.g.,][]{key}    → (e.g., Author, Year)
%%   \cite[][see p.~10]{key}→ (Author, Year, see p. 10)
%%
%% ----------------------------------------------------------------------------
%% TROUBLESHOOTING
%% ----------------------------------------------------------------------------
%% Problem: Citations appear as [?] or undefined
%% Solution: Run compilation 3-4 times to resolve all references
%%
%% Problem: Citation numbers out of order [3, 1] instead of [1, 3]
%% Solution: Use unsrtnat (order of appearance) instead of elsarticle-num
%%
%% Problem: "Undefined control sequence \citet"
%% Solution: \citet only works with natbib-compatible styles (unsrtnat, plainnat)
%%           Use \cite{} with non-natbib styles
%%
%% Problem: Bibliography not appearing
%% Solution: Ensure \bibliography{path/to/bibfile} command exists in main file
%%           Run: pdflatex → bibtex → pdflatex → pdflatex

%%%% EOF


%% ----------------------------------------
%% DATA AVAILABILITY
%% ----------------------------------------

% ======================================================================
% File: ./01_manuscript/contents/data_availability.tex
% ======================================================================
%% -*- coding: utf-8 -*-
%% Timestamp: "2025-11-12 14:31:55 (ywatanabe)"
%% File: "/home/ywatanabe/proj/scitex-writer/01_manuscript/contents/data_availability.tex"
\pdfbookmark[1]{Data Availability Statement}{data_availability}

\section*{Data Availability Statement}

The SciTeX Writer is available at \url{https://github.com/ywatanabe1989/scitex-code/tree/main/src/scitex/writer}.

For questions regarding data access or analysis procedures, please contact the corresponding author.

\label{data and code availability}

%%%% EOF


%% ----------------------------------------
%% ADDITIONAL INFORMATION
%% ----------------------------------------

% ======================================================================
% File: ./01_manuscript/contents/additional_info.tex
% ======================================================================
%% -*- coding: utf-8 -*-
%% Timestamp: "2026-01-19 02:31:14 (ywatanabe)"
%% File: "/home/ywatanabe/proj/scitex-writer/01_manuscript/contents/additional_info.tex"

\pdfbookmark[1]{Additional Information}{additional_information}

\pdfbookmark[2]{Ethics Declarations}{ethics_declarations}                    
\section*{Ethics Declarations}
All study participants provided their written informed consent ...
\label{ethics declarations}

\pdfbookmark[2]{Contributors}{author_contributions}                    
\section*{Author Contributions}
Y.W., T.Y., and D.G. conceptualized the study ...
\label{author contributions}

\pdfbookmark[2]{Acknowledgments}{acknowledgments}                    
\section*{Acknowledgments}
This research was funded by ...
\label{acknowledgments}

\pdfbookmark[2]{Declaration of Interests}{declaration_of_interest}           \section*{Declaration of Interests}
The authors declare that they have no competing interests.
\label{declaration of interests}

\pdfbookmark[2]{Declaration of Generative AI in Scientific Writing}{declaration_of_generative_ai}
\section*{Declaration of Generative AI in Scientific Writing}
The authors employed large language models such as Claude (Anthropic Inc.) for code development and complementing manuscript's English language quality. After incorporating suggested improvements, the authors meticulously revised the content. Ultimate responsibility for the final content of this publication rests entirely with the authors.
\label{declaration of generative ai in scientific writing}

%%%% EOF


%% ----------------------------------------
%% TABLES
%% ----------------------------------------
\clearpage
\section*{Tables}
\label{tables}
\pdfbookmark[1]{Tables}{tables}
\vspace{1cm}

% ======================================================================
% File: ./01_manuscript/contents/tables/compiled/FINAL.tex
% ======================================================================
% Auto-generated file containing all table inputs
% Generated by gather_table_tex_files()


% ======================================================================
% File: ./01_manuscript/contents/tables/compiled/00_Tables_Header.tex
% ======================================================================
% Template table when no actual tables are present
\begin{table}[htbp]
    \centering
      \caption{\textbf{Placeholder table demonstrating the table format for this manuscript template}\\
    \smallskip
    To add tables to your manuscript, place CSV files in \texttt{caption\_and\_media/} with format \texttt{XX\_description.csv}, create matching caption files \texttt{XX\_description.tex}, and reference in text using \texttt{Table\textasciitilde\textbackslash ref\{tab:XX\_description\}}. Example can be seen at \texttt{01\_seizure\_count.csv} with \texttt{01\_seizure\_count.tex}
    }
    \label{tab:0_Tables_Header}
    \begin{tabular}{p{0.3\textwidth}p{0.6\textwidth}}
        \toprule
        \textbf{Step} & \textbf{Instructions} \\
        \midrule
        1. Add CSV & Place file like \texttt{01\_data.csv} in \texttt{caption\_and\_media/} \\
        2. Add Caption & Create \texttt{01\_data.tex} with table caption \\
        3. Compile & Run \texttt{./compile -m} to process tables \\
        4. Reference & Use \texttt{\textbackslash ref\{tab:01\_data\}} in manuscript \\
        \bottomrule
    \end{tabular}
\end{table}






%% ----------------------------------------
%% FIGURES
%% ----------------------------------------
\clearpage
\section*{Figures}
\label{figures}
\pdfbookmark[1]{Figures}{figures}
\vspace{1cm}

% ======================================================================
% File: ./01_manuscript/contents/figures/compiled/FINAL.tex
% ======================================================================
% Generated by compile_figure_tex_files()
% This file includes all figure files in order

% Figure 01
\begin{figure*}[h!]
    \pdfbookmark[2]{Figure 01}{.01}
    \centering
    \includegraphics[width=0.9\textwidth]{./01_manuscript/contents/figures/caption_and_media/jpg_for_compilation/01_example_figure.jpg}
    \caption{Example figure caption. This is a template showing how to include figures in your manuscript. Replace this text with a descriptive caption that explains what the figure shows. Include panel labels (A, B, C) if using multipanel figures. Explain abbreviations and symbols used in the figure. Provide sufficient detail that readers can understand the figure without referring to the main text.}
\label{fig:example_figure_01}
    \label{fig:01_example_figure}
\end{figure*}

% Figure 02
\begin{figure*}[htbp]
    \pdfbookmark[2]{Figure 02}{.02}
    \centering
    \includegraphics[width=0.9\textwidth]{./01_manuscript/contents/figures/caption_and_media/jpg_for_compilation/02_another_example.jpg}
    \caption{Another example figure. Use this template to add additional figures to your manuscript. Each figure should be placed in a separate .tex file in this directory. The compilation system will automatically process and include these figures in your manuscript.}
\label{fig:example_figure_02}
    \label{fig:02_another_example}
\end{figure*}




%% ----------------------------------------
%% END of DOCUMENT
%% ----------------------------------------
\end{document}

%%%% EOF