Compile and manage LaTeX academic papers with Chinese/English support using XeLaTeX, bibliography management, and VS Code LaTeX Workshop integration
A skill for building and managing LaTeX academic papers, particularly for machine learning and computer vision research, with full Chinese and English language support.
This skill helps you compile LaTeX academic papers using XeLaTeX (for multilingual support) or PDFLaTeX (English-only), manage bibliographies with BibTeX, and work with standard academic paper structures including IEEE conference formats and technical reports.
The skill expects this directory layout:
```
project/
├── src/ # LaTeX source files
│ ├── paper.tex # Main document
│ ├── refs.bib # Bibliography database
│ └── *.tex # Other LaTeX files
├── out/ # Compiled outputs (auto-created)
└── pic/ # Figures (pdf/png/eps)
```
For draft builds without bibliography updates:
```bash
xelatex -output-directory=out -synctex=1 -interaction=nonstopmode -file-line-error src/paper.tex
pdflatex -output-directory=out -synctex=1 -interaction=nonstopmode -file-line-error src/paper.tex
```
For complete builds with properly resolved citations:
```bash
xelatex -output-directory=out src/paper.tex && \
bibtex out/paper && \
xelatex -output-directory=out src/paper.tex && \
xelatex -output-directory=out src/paper.tex
latexmk -xelatex -output-directory=out src/paper.tex
```
```bash
latexmk -c -output-directory=out
```
Before compiling, verify the environment:
**Use XeLaTeX when:**
**Use PDFLaTeX when:**
For a new document or after adding citations:
```bash
xelatex -output-directory=out -synctex=1 -interaction=nonstopmode src/paper.tex
bibtex out/paper
xelatex -output-directory=out -synctex=1 -interaction=nonstopmode src/paper.tex
xelatex -output-directory=out -synctex=1 -interaction=nonstopmode src/paper.tex
```
Or use the automated approach:
```bash
latexmk -xelatex -output-directory=out src/paper.tex
```
For quick draft iterations:
```bash
xelatex -output-directory=out -synctex=1 -interaction=nonstopmode src/paper.tex
```
When citations or cross-references are added/changed, run the full build again.
If compilation fails:
1. **Check the log file**: `out/paper.log` contains detailed error messages
2. **Common issues**:
- Missing packages: Install with `tlmgr install <package-name>`
- Image not found: Verify paths in `pic/` directory (use `../pic/` from `src/`)
- Bibliography errors: Ensure `refs.bib` syntax is valid (check for unmatched braces)
- Chinese font issues: XeLaTeX requires system fonts; check with `fc-list :lang=zh`
3. **Clean build and retry**:
```bash
latexmk -c -output-directory=out
latexmk -xelatex -output-directory=out src/paper.tex
```
If using VS Code with LaTeX Workshop:
```latex
\documentclass[conference]{IEEEtran}
\usepackage{ctex} % Chinese support
\usepackage{amsmath,amssymb,amsthm}
\usepackage{graphicx}
\usepackage{algorithm,algpseudocode}
\begin{document}
\title{Your Paper Title}
\author{...}
\maketitle
% Content here
\bibliographystyle{IEEEtran}
\bibliography{refs}
\end{document}
```
```latex
\documentclass{article}
\usepackage{xeCJK} % Chinese support
\usepackage{geometry}
\usepackage{listings} % Code blocks
\usepackage{graphicx}
\geometry{a4paper,margin=2.5cm}
\begin{document}
% Content here
\end{document}
```
- `-synctex=1`: Enables source-PDF synchronization
- `-interaction=nonstopmode`: Continues on errors (useful for CI)
- `-file-line-error`: Shows errors with file/line format
**Scenario 1: Compile a conference paper with Chinese abstract**
```bash
latexmk -xelatex -output-directory=out src/paper.tex
open out/paper.pdf # macOS
xdg-open out/paper.pdf # Linux
```
**Scenario 2: Quick draft iteration**
```bash
xelatex -output-directory=out -synctex=1 -interaction=nonstopmode src/paper.tex
```
**Scenario 3: Clean and rebuild from scratch**
```bash
latexmk -C -output-directory=out
latexmk -xelatex -output-directory=out src/paper.tex
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/latex-academic-paper-builder/raw