| name | latex2markdown |
| description | Extracts content from LaTeX files to fill in paper.md. Use this skill when the user wants to import content from existing LaTeX papers into the CoPaper structure. |
LaTeX to Markdown Conversion Skill
This skill extracts content from LaTeX academic papers and fills it into the CoPaper markdown structure.
When to Use This Skill
- User requests to convert LaTeX to paper.md (e.g., "convert LaTeX to paper.md", "import my LaTeX paper")
- User wants to extract content from existing LaTeX files to fill paper.md
- User needs to migrate LaTeX content to the CoPaper structure
Paper Structure Reference
The paper follows CoPaper structure. Key rules for this skill:
- Level 1-5 (
# to #####): Structural headings only — do NOT modify these in paper.md.
- Level 6 (
######): Content paragraphs. Title = topic sentence (≤50 chars). Body = supporting text (≤500 chars).
- Metadata: HTML comments
<!-- description: ... --> guide what each section should contain.
Input Files
| File | Required | When to Read | Purpose |
|---|
paper.md | Required | Step 1 (start) | Target framework file whose existing structure guides the conversion |
writingrules.md | Required | Step 1 (start) | Full structure and content constraints for mapping LaTeX content into CoPaper markdown |
| User-provided LaTeX files | Required | Step 1 (start) | Source material to extract and map into paper.md |
fig/ | Conditional | During special-element handling | Destination for user-provided figure assets referenced from the LaTeX source |
Unlike drafting skills, this conversion skill SHOULD read writingrules.md because it must preserve the full markdown framework during import.
Instructions
Core Principle
Do not modify the structure of paper.md. Only fill in content under each section based on the description guidance.
You can leave empty sections if there is no corresponding content in the LaTeX files.
Do not use the comments in Latex
Step-by-Step Process
- Read paper.md: Understand the existing structure and
description fields
- Read LaTeX files: Extract relevant content (title, sections, paragraphs, figures, tables)
- Match content to structure: Map LaTeX content to corresponding sections in paper.md based on semantic meaning, not just section names
- Write topic sentences: Extract key points as Level 6 headers (≤ 50 characters)
- Write supporting sentences: Add detailed content as paragraph body (≤ 500 characters)
- Handle special elements: Process figures, tables, algorithms, equations appropriately
Content Extraction Rules
From LaTeX to paper.md
| LaTeX Element | paper.md Mapping |
|---|
\title{} | Level 1 header # |
\section{} | Match to corresponding section based on content meaning |
\subsection{} | Match to corresponding subsection in paper.md |
| Paragraphs | Extract as Level 6 header + supporting sentences |
\begin{figure} | Reference in text, add image to fig/ folder |
\begin{table} | Convert to markdown table or describe in text |
\begin{algorithm} | Describe algorithm in supporting sentences |
\begin{lstlisting} | Describe code logic in supporting sentences |
$...$, $$...$$ | Preserve as inline/block math formulas |
\cite{}, \bibitem{} | Preserve as [Author et al., Year] format |
Paragraph Conversion
For each paragraph in LaTeX:
- Identify the topic: What is the main point of this paragraph?
- Write topic sentence: Summarize in ≤ 50 characters as Level 6 header
- Extract supporting content: Keep essential evidence, data, reasoning (≤ 500 characters)
- Match to paper.md section: Find the appropriate section based on
description guidance
- Split if needed: If content exceeds 500 chars, split into multiple paragraphs with different topic sentences
Special Elements Handling
Figures:
- Extract figure content description as supporting sentences
- Note figure reference in text (e.g., "如图X所示...")
- If user provides image files, copy to
fig/ folder
Tables:
- Convert small tables to markdown format
- For large tables, summarize key findings in supporting sentences
- Preserve table captions as descriptions
Algorithms:
- Describe algorithm purpose and key steps in supporting sentences
- Note complexity if mentioned (e.g., "时间复杂度为O(n log n)")
Equations:
- Preserve math formulas as
$...$ or $$...$$
- Explain equation meaning in supporting sentences if needed
Examples
Example 1: Paragraph Conversion
LaTeX Input:
\section{Introduction}
Our system achieves 92\% detection rate for APT attacks,
compared to 78\% for the state-of-the-art method HOLMES.
The improvement comes from modeling temporal correlations
between attack stages, which traditional methods ignore.
paper.md Output:
**Example 2: Section Matching**
**LaTeX Input:**
```latex
\section{Related Work}
Traditional intrusion detection systems can be categorized
into signature-based and anomaly-based approaches.
Signature-based methods [1] detect known attacks but fail
on zero-day threats. Anomaly-based methods [2] can detect
novel attacks but suffer from high false positive rates.
paper.md Output:
## 业界当前解决方案
<!-- description: 概述当前业界主流的解决方案和方法 -->
### 第一类解决方案
<!-- description: 概述第一类方法的思路和局限 -->
###### Signature-based IDS detects known attacks only
Signature-based methods detect known attacks but fail on zero-day threats. They match attack patterns against predefined rules [1].
Important Notes
- Preserve Math: Keep LaTeX math formulas as
$...$ or $$...$$
- Preserve Citations: Keep citation references as
[Author, Year]
- Respect Limits: Topic sentence ≤ 50 chars, supporting sentences ≤ 500 chars
- Follow Description: Write content that matches each section's
description guidance
- No Structure Changes: Never modify Level 1-5 headers in paper.md
- Semantic Matching: Match LaTeX content to paper.md sections by meaning, not just names
- Leave Empty: If no matching content exists, leave the section empty rather than forcing content