---
name: latex-writing-7852a873dc08
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]"
1. Ask about target venue/format
2. Create main.tex with appropriate template
3. Set up bibliography file
4. Add standard sections (abstract, intro, conclusion)
5. Compile initial PDF

### Add Equation
When user says: "Add the softmax equation"
1. Identify equation type (inline/display)
2. Generate LaTeX math code
3. Insert with appropriate label
4. Recompile PDF

### Add Figure
When user says: "Add a figure showing [description]"
1. Ask for figure path or create placeholder
2. Generate figure environment
3. Add caption and label
4. Update references
5. Recompile PDF

### Add Citation
When user says: "Cite this paper: [reference]"
1. Parse reference information
2. Create BibTeX entry
3. Insert \cite{} command
4. Run bibtex + latex

### Fix Compilation Errors
When user says: "The LaTeX isn't compiling"
1. Read error log from `latex_compile` response's `errors` field
2. Identify error location and type (line number, missing package, undefined command)
3. Apply fix to the LaTeX source
4. Recompile with `latex_compile` and verify `success: true`

## Common Templates

### IEEE Conference
```latex
\documentclass[conference]{IEEEtran}
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{graphicx}
\usepackage{textcomp}
```

### ACM Article
```latex
\documentclass[sigconf]{acmart}
\usepackage{booktabs}
```

### CVPR Conference
```latex
\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
```latex
\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
```latex
\begin{bmatrix}
a & b \\
c & d
\end{bmatrix}
```

### Algorithms
```latex
\begin{algorithm}
\caption{Algorithm Name}
\begin{algorithmic}
\STATE ...
\end{algorithmic}
\end{algorithm}
```

## Best Practices

1. **Modular Structure**: Use \input{} for sections
2. **Consistent Labels**: Use prefixes (fig:, tab:, eq:, sec:)
3. **Version Control**: Regular saves and snapshots
4. **Error-First**: Fix errors before adding content
5. **Preview Often**: Compile frequently to catch issues early


---
Source attribution: Prismer-AI
Original project: https://github.com/Prismer-AI/Prismer
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2026 Gabriel Moreira

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: Prismer-AI
Original project: https://github.com/Prismer-AI/Prismer
Attribution basis: Upstream repository explicitly recorded in package mirror path

Fields of work: Education & Research
Roles: Academic Writer, Researcher, Tutor / Instructor
Specialties: Specialty not specified
Tools: Latex_Compile, Send_Ui_Directive, Update_Latex
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: ee7f96afa2efebb64761bc3d36bdf6b8202b1c6ae3696386c8da4a4b9dadf48e
