技术写作与文档2021jarbus.net
如何不写 LaTeX 也能写出 LaTeX
How to write LaTeX without writing LaTeX
导读
这篇文章介绍如何用 Markdown、Pandoc 等工具间接生成 LaTeX 文档,从而不必手写 LaTeX 语法,适合需要排版论文或技术文档、又不想被格式折腾的写作者。评论区讨论了各种替代方案的取舍:Markdown 的便利与局限、直接学 LaTeX 的成本,以及 LyX 这类折中工具。
可以直接用的写作要点
- 01
先用 Markdown 完成初稿;等你感到语法限制、开始跟工具较劲时,再升级到 LaTeX,不要在前期纠结格式。
- 02
需要多格式输出(HTML、EPUB、PDF)时用 Pandoc;只输出 LaTeX 且要符合学术模板时,考虑 markdown 宏包,它能生成符合预期的 biblatex 引用。
- 03
把 Markdown 当作起点,不算放弃 LaTeX:可以先用 Pandoc 生成 LaTeX 源文件,再手动调整复杂排版,兼顾低摩擦写作与精细控制。
- 04
写作工具的选择应以降低写作摩擦为标准:格式越少介入越好,把注意力留给内容本身。
HN 评论精选
只用 LaTeX 输出时,markdown 宏包比 Pandoc 更贴合学术模板的引用习惯。
如果你的输出只是 LaTeX,推荐 markdown 宏包(用 Lua 解析并转换 Markdown)。Pandoc 的优势在于能同时输出 EPUB、HTML、LaTeX/PDF 等多种格式;但在只输出 LaTeX、尤其是学术写作场景下,markdown 宏包会把内容转成你预期的 LaTeX。例如引用会转成 biblatex 调用,而 Pandoc 会自己生成全部引用和参考文献,绕过你和导师习惯的样式与行为。
dindresto查看英文原文
If your only target from Markdown is LaTeX, I recommend the LaTeX markdown package which uses lua to parse and convert the input markdown: https://github.com/Witiko/markdown Pandoc shines when targetting multiple backends, like EPUB, HTML and LaTeX/PDF. But the LaTeX markdown package has one advantage when only targetting LaTeX, especially in academic settings: it translates everything to the LaTeX you'd expected. For example, citations are translated into biblatex calls, while pandoc generates all of the citations and the bibliography by itself, bypassing the style and behavior you and your professors might expect.
需求简单时,直接学基础 LaTeX 比搭工具链更省事。
花 20 分钟学一下 LaTeX 就够了。只要你的排版需求不比 Markdown 能做的更复杂,这点时间足够。
togaen查看英文原文
Just spend 20 minutes learning LaTeX. If you’re already not doing anything more complicated than what you can do with markdown, that’s all the longer it will take.
Markdown 起草、Pandoc 转 LaTeX 再精修,是兼顾效率与控制力的实用流程。
我同时喜欢 Pandoc 和 LaTeX。大量文本准备工作只用标准 Markdown 就能完成,那就用 Markdown。但 Markdown 有局限:当你开始跟它较劲时,就该考虑下一步了。LaTeX 本身出乎意料地好写,尤其写简单文档时。用 Markdown 起步来搭建 LaTeX 文档也是好选择:Markdown 写起来阻力略小,我起草或复制素材时会用它;如果需要更复杂的格式,就用 Pandoc 生成第一版 LaTeX 源码,再进去添加元素或调整复杂段落。
dredmorbius查看英文原文
I'm a fan of both Pandoc and LaTeX. There's a pretty incredible amount of text preparation which can be done only in bog-standard Markdown, and if that's the case, go for it. Markdown has its limitations, and if you find yourself starting to fight it ... consider that it's probably time to take the next step. LaTeX itself is surprisingly easy to write, again most especially if you're writing simple documents. And using Markdown to bootstrap creating a LaTeX document is also a good option. I find Markdown slightly lower-friction to write, and will use it when either composing or copying works initially. If they do require more complex formatting, I'll generate the first iteration of the LaTeX source with Pandoc, then dive into that and add additional elements or tweak complex sections as needed.
LyX 提供图形界面的折中方案,但牺牲了一定的排版精确控制。
另一个常被忽略的替代品是 LyX:它是以 LaTeX 为内核的所见即所得编辑器。不过和其他所见即所得或混合系统一样,它在精确的格式控制上有所欠缺……
srvmshr查看英文原文
Another alternative often missed is LyX. It is a WYSWYM editor with LaTeX in the core. As with other WYSWYM or hybrid systems, it lacks the precise formatting
同类还值得读
编写更好文档的框架
A Framework for Writing Better Documentation
这是 Divio 的文档写作框架,把技术文档按「读者的目标」分成四类:教程(学习导向)、操作指南(问题导向)、参考(信息导向)、解释(理解导向)。
技术写作与文档2021 · 637 分 · 76 评4 条写作要点编辑精选写好一份设计文档
Writing a good design document
这篇 HN 帖子标题为《Writing a good design document》,主题是如何写好一份设计文档;对写作者来说,它值得作为技术写作和结构化说明文的参照。
技术写作与文档2025 · 581 分 · 147 评3 条写作要点编辑精选技术写作课程
Technical Writing Courses
这是 Google 官方免费技术写作课程(两门),讲受众定义、主动语态、短句、文档结构等基础方法。
技术写作与文档2020 · 571 分 · 73 评4 条写作要点编辑精选写出更好的错误信息
Write better error messages
这篇帖子讨论如何写出更好的错误信息,评论补充了开发者场景下的具体做法和真实反面案例。
技术写作与文档2022 · 566 分 · 253 评4 条写作要点编辑精选写一本技术书的经济账
The Economics of Writing a Technical Book
一位技术书作者拆解写书的真实经济账:版税收入往往远低于投入的时间成本。
技术写作与文档2018 · 519 分 · 149 评4 条写作要点编辑精选