Skill v1.0.0
currentAutomated scan100/100name: latex-output description: Use when user requests LaTeX format output or has provided school/journal LaTeX templates version: 1.0.0 type: worker license: N/A category: writing requirements: [cpu] metadata: {}
LaTeX output
Emit the paper as LaTeX, with support for a university or journal template supplied by the user.
When to use
- The user explicitly asks for LaTeX output
- The user supplied a LaTeX template
- The target journal or university requires LaTeX
Template directory
The user can drop template files into latex-templates/:
latex-templates/├── README.md # usage notes├── template.cls # template class file├── template.sty # template style file└── main-template.tex # example main file
Checklist
- [ ] Check
latex-templates/for a user template - [ ] Ask the user whether to use it
- [ ] Parse the template structure (sectioning commands, formatting requirements)
- [ ] Create the
.texchapter files against the template - [ ] Create
main.tex - [ ] Create
references.bib - [ ] Verify that it compiles
Parsing the template
Sectioning commands
Common sectioning commands:
\chapter{...} % chapter\section{...} % section\subsection{...} % subsection\subsubsection{...} % sub-subsection
Special environments
\begin{abstract}...\end{abstract} % abstract\begin{keywords}...\end{keywords} % keywords\begin{figure}...\end{figure} % figure\begin{table}...\end{table} % table\begin{equation}...\end{equation} % equation
Output structure
With a template
paper-project/├── latex-templates/ # original template (leave untouched)├── chapters/ # chapter content (.tex)│ ├── 00-abstract.tex│ ├── 01-introduction.tex│ ├── 02-literature.tex│ └── ...├── figures/ # figure files├── main.tex # main file├── references.bib # bibliography└── plan/ # project plan
main.tex skeleton
\documentclass{template} % or the user's template class% Load the user's template styles\usepackage{template}% Basic setup\title{Paper title}\author{Author}\date{\today}\begin{document}\maketitle% Abstract\input{chapters/00-abstract}% Table of contents\tableofcontents% Body chapters\input{chapters/01-introduction}\input{chapters/02-literature}\input{chapters/03-methods}\input{chapters/04-results}\input{chapters/05-discussion}\input{chapters/06-conclusion}% Bibliography\bibliographystyle{gbt7714-numerical} % or another style\bibliography{references}\end{document}
Chapter file format
Example .tex chapter
% chapters/01-introduction.tex% Introduction\chapter{Introduction}\section{Background}As [technology] advances, the field of [domain] faces the challenge of [problem].This paper addresses [problem] and proposes [method].\section{Objectives and significance}This study aims to ...\subsection{Theoretical significance}...\subsection{Practical significance}...\section{Scope and methods}The scope of this work covers:\begin{enumerate}\item Part one ...\item Part two ...\item Part three ...\end{enumerate}\section{Structure of the paper}The paper is organized into X chapters:Chapter 1 is the introduction, which presents ...Chapter 2 reviews the literature on ......
Bibliography (BibTeX)
references.bib format
@article{author2023title,author = {Zhang, San and Li, Si},title = {Paper title},journal = {Journal name},year = {2023},volume = {10},number = {2},pages = {100-110},}@book{author2022book,author = {Wang, Wu},title = {Book title},publisher = {Publisher},year = {2022},address = {Place of publication},}@inproceedings{author2021conf,author = {Zhao, Liu},title = {Conference paper title},booktitle = {Conference name},year = {2021},pages = {50-55},}
For Chinese-language entries, keep the original CJK author names and titles in the .bib file and compile with XeLaTeX plus a GB/T 7714 bibliography style.
Adapting to common templates
Tsinghua University (ThuThesis)
\documentclass[degree=master]{thuthesis}
Special commands:
\thusetup{...}— set thesis metadata\makecover— generate the cover\frontmatter— front matter\mainmatter— main matter\backmatter— back matter
University of Chinese Academy of Sciences (ucasthesis)
\documentclass{ucasthesis}
Journal templates
Journal formats vary; parse whatever template the user provides.
Compilation
Record the compile commands in plan/notes.md:
## LaTeX compilation### Recommended toolchains- TeXLive (cross-platform)- MacTeX (macOS)- MiKTeX (Windows)### Commands
xelatex main.tex bibtex main xelatex main.tex xelatex main.tex
### One-shot
latexmk -xelatex main.tex
Converting from Markdown
Markdown to LaTeX
If the user already has Markdown content, convert it:
- Heading:
# Title→\chapter{Title} - Bold:
**text**→\textbf{text} - Quote:
> quote→\begin{quote}quote\end{quote} - Code: `
code→\texttt{code}` - List:
- item→\begin{itemize}\item item\end{itemize}
Watch out for
- LaTeX special characters must be escaped:
# $ % & _ { } ~ ^ - CJK text requires XeLaTeX
- Use relative paths for figures
Error handling
No template found
"No LaTeX template detected. Choose one:1. Supply the template files (drop them intolatex-templates/)2. Use the defaultarticleclass3. Use thectexartclass (Chinese)4. Stay with Markdown"
Incomplete template
"A template was detected, but [filename] is missing.Please complete the template, or fall back to the defaults."