| name | latex-writing |
| description | Create, edit, and compile LaTeX documents for academic papers using latex_compile, update_latex, and send_ui_directive tools. Use when the user mentions LaTeX, .tex files, academic writing, typesetting, or needs to compile documents with equations, theses, or journal submissions. |
LaTeX Writing Skill
Description
Create, edit, and compile LaTeX documents for academic papers, theses, and reports.
Tools Used
latex_compile - Compile LaTeX to PDF (auto-switches to LaTeX editor)
update_latex - Update LaTeX editor content without compiling
send_ui_directive - Send raw UI directives for advanced control
Usage Patterns
Create New Paper
When user says: "Create a new paper about [topic]"
- Ask about target venue/format
- Create main.tex with appropriate template
- Set up bibliography file
- Add standard sections (abstract, intro, conclusion)
- Compile initial PDF
Add Equation
When user says: "Add the softmax equation"
- Identify equation type (inline/display)
- Generate LaTeX math code
- Insert with appropriate label
- Recompile PDF
Add Figure
When user says: "Add a figure showing [description]"
- Ask for figure path or create placeholder
- Generate figure environment
- Add caption and label
- Update references
- Recompile PDF
Add Citation
When user says: "Cite this paper: [reference]"
- Parse reference information
- Create BibTeX entry
- Insert \cite{} command
- Run bibtex + latex
Fix Compilation Errors
When user says: "The LaTeX isn't compiling"
- Read error log from
latex_compile response's errors field
- Identify error location and type (line number, missing package, undefined command)
- Apply fix to the LaTeX source
- Recompile with
latex_compile and verify success: true
Common Templates
IEEE Conference
\documentclass[conference]{IEEEtran}
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{graphicx}
\usepackage{textcomp}
ACM Article
\documentclass[sigconf]{acmart}
\usepackage{booktabs}
CVPR Conference
\documentclass[10pt,twocolumn,letterpaper]{article}
\usepackage[pagenumbers]{cvpr}
\usepackage{times}
\usepackage{epsfig}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{booktabs}
\usepackage[breaklinks=true,bookmarks=false]{hyperref}
\title{Paper Title}
\author{Author Name\\Institution\\{\tt\small email@example.com}}
\begin{document}
\maketitle
\begin{abstract}
Abstract text here.
\end{abstract}
\section{Introduction}
...
\section{Related Work}
...
\section{Method}
...
\section{Experiments}
...
\section{Conclusion}
...
{\small
\bibliographystyle{ieee_fullname}
\bibliography{references}
}
\end{document}
Thesis
\documentclass[12pt,a4paper]{report}
\usepackage{geometry}
\geometry{margin=1in}
Math Snippets
Equations
- Inline:
$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$
- Display:
\[ E = mc^2 \]
- Numbered:
\begin{equation}...\end{equation}
Matrices
\begin{bmatrix}
a & b \\
c & d
\end{bmatrix}
Algorithms
\begin{algorithm}
\caption{Algorithm Name}
\begin{algorithmic}
\STATE ...
\end{algorithmic}
\end{algorithm}
Best Practices
- Modular Structure: Use \input{} for sections
- Consistent Labels: Use prefixes (fig:, tab:, eq:, sec:)
- Version Control: Regular saves and snapshots
- Error-First: Fix errors before adding content
- Preview Often: Compile frequently to catch issues early