现代LaTeX
Modern Latex

原始链接: https://github.com/mrkline/modern-latex

LaTeX 虽然古老,但仍是一款强大的排版工具,然而过时的教程却令人望而却步。本书旨在提供一个现代且实用的入门指南。本书推荐使用 LuaLaTeX,这是一个支持 Unicode 的版本,可以通过 Linux 上的包管理器(例如 `texlive-base`)轻松安装。配套的 `latexmk` 脚本简化了书籍的构建过程,它可以处理交叉引用所需的多次编译。对于数字显示,在线版本提供了改进,例如均匀的页边距和居中的页码。鼓励用户自定义字体,特别是如果他们缺少原版字体(Garamond Premier、Neue Haas Grotesk 等),可以通过修改 `fontspec` 命令来实现。可以使用 `latexmk -lualatex -latexoption=-halt-on-error modern-latex.tex` 构建本书,或者手动多次调用 `lualatex` 来构建。欢迎通过 pull request 或直接联系作者的方式贡献和反馈。

Hacker News 最新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 现代 LaTeX (github.com/mrkline) 10 分,来自 signa11,41 分钟前 | 隐藏 | 过去 | 收藏 | 讨论 加入我们,参加 6 月 16-17 日在旧金山举办的 AI 初创公司学校! 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系我们 搜索:

原文

LaTeX is a tool for creating beautiful writing, or a torture device that drives users to the brink of madness every time they see bad spacing for the rest of their lives. One of the two. Despite origins that can be traced back four decades, it remains one of the best typesetting programs around. Many of its guides, however, haven't aged as well. This short book will get you started with LaTeX without bogging you down in arcana that lost its relevance back in the 90s.

An up-to-date version should be available at https://assets.bitbashing.io/modern-latex.pdf

  1. Install LuaLaTeX, a modern, Unicode-aware version of LaTeX. On Linux, this is usually as simple as installing your distro's TeX Live package, e.g., texlive-base or texlive-core. The same package should also provide the latexmk script. (See below)

  2. Check out the online branch of the source repository, which is optimized for digital display instead of a printed book. Changes include even margins, centered page numbers, a lack of blank pages between chapters, and so on.

  3. Change the fonts as-needed.

    The official version of this book is typeset with Garamond Premier, Neue Haas Grotesk, URW Futura, Drive Mono, Noto, and (of course) Latin Modern. In the likely case that you don't have all of these typefaces, change the fontspec commands (e.g., setmainfont, etc.) appropriately, then modify or remove the colophon at the back of the book.

  4. Build the book using

    latexmk -lualatex -latexoption=-halt-on-error modern-latex.tex
    

    Note that latexmk will run LuaLaTeX multiple times, since TeX generates cross references in one pass, then links them in a second.

    If you can't use latexmk for some reason, you can manually invoke

    lualatex -halt-on-error -shell-escape modern-latex.tex
    

    until it no longer warns, "Label(s) may have changed. Rerun to get cross-references right."

...is welcome! Please issue pull requests on this book's Github page, or contact the author via matt <at> bitbashing.io

Enjoy!

联系我们 contact @ memedata.com