Files
nexus/wiki/concepts/LaTeX-Flattening.md
2026-04-23 00:02:55 +08:00

27 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "LaTeX Flattening"
type: concept
tags: []
sources: [arxiv-paper-reader]
last_updated: 2026-04-17
---
## Concept Definition
**LaTeX 扁平化LaTeX Flattening** 是指将多文件 LaTeX 论文项目(含 `\include{}``\input{}`、子文件等)自动合成为单一连续文本的技术过程,使 AI 模型能够完整理解论文结构而无需处理文件引用和相对路径。
## How It Works
arXiv 论文通常包含多个 `.tex` 文件(主文件引用 `sections/` 目录下的子文件)。扁平化过程:
1. 下载 arXiv LaTeX 源码压缩包(`.tar.gz`
2. 解析主文件,找到所有 `\include{}` / `\input{}` 引用
3. 按引用顺序将子文件内容拼接注入主文件
4. 清理 `\bibliography{}`、图片引用等外部依赖标记
5. 输出单一完整文本流
## Use Cases
- [[arXiv-Paper-Reader]] 的核心处理步骤——将 arXiv LaTeX 源码转换为 AI 可读的纯净文本
- 任何需要将 LaTeX 文档喂入 LLM 的场景
## Related Concepts
- [[arXiv-API]]LaTeX 源码的下载来源
- [[本地缓存]]:扁平化结果可缓存避免重复处理