LaTeX: Difference between revisions
No edit summary |
|||
| (7 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
These days, I always use [https:// | These days, I always use [https://www.luatex.org/ LuaTeX] (as opposed to e.g. pdflatex or XeTeX), usually in conjunction with the [https://ctan.org/pkg/memoir?lang=en Memoir class] and [https://www.ctan.org/pkg/polyglossia polyglossia package] (as opposed to e.g. babel). Code can generally run through both and result in similar output. LuaTeX is significantly slower than XeTeX, which is itself slower than pdflatex. Nonetheless, it produces the best output with [[Unicode]] and modern fonts. | ||
Note that Amazon's createspace package cannot be used with XeTeX, at least as of 2023-08. | Note that Amazon's createspace package cannot be used with XeTeX, at least as of 2023-08. | ||
| Line 9: | Line 9: | ||
** It is only partially supported outside of pdflatex; LuaTex supports it better than XeTeX as of 2023-10 (see the table in the documentation, page 6). | ** It is only partially supported outside of pdflatex; LuaTex supports it better than XeTeX as of 2023-10 (see the table in the documentation, page 6). | ||
* Use the [https://ctan.org/pkg/realscripts realscripts] package for most documents. It improves sub- and superscripts when using OpenType fonts with appropriate features (normally the glyphs are simply drawn at a smaller size). It doesn't work well in certain environments or in certain cases, in which case use a '*' suffix to revert to the previous definitions. It's best to use this from the beginning of a document so that you check each placement. | * Use the [https://ctan.org/pkg/realscripts realscripts] package for most documents. It improves sub- and superscripts when using OpenType fonts with appropriate features (normally the glyphs are simply drawn at a smaller size). It doesn't work well in certain environments or in certain cases, in which case use a '*' suffix to revert to the previous definitions. It's best to use this from the beginning of a document so that you check each placement. | ||
** As of late 2023, it does not work well with [https://ctan.org/pkg/siunitx?lang=en siunitx] in my experience. | ** As of late 2023, it does not work well with [https://ctan.org/pkg/siunitx?lang=en siunitx] in my experience. You'll want to define <tt>text-subscript-command</tt> and <tt>text-superscript-command</tt> to be commands which use <tt>\textsuperscript*</tt> etc., though this does seem to work. | ||
* 72.27 points equals 1 inch equals 25.4 millimeter | * 72.27 points equals 1 inch equals 25.4 millimeter | ||
* Invoke with <tt>-halt-on-error</tt> for better life quality | |||
** You probably want <tt>-shell-escape</tt> as well. I've never found a situation where it's bad. | |||
===LuaLaTeX/XeTeX notes=== | |||
* LuaLaTeX needs the Harfbuzz renderer to handle complex languages, and it's superior in any case. | |||
** I think this is the default as of 2020 ("LuaHBTex") | |||
==Punctuation== | ==Punctuation== | ||
===Quotation Marks=== | ===Quotation Marks=== | ||
* Use <tt>``</tt> for the left mark, and two apostrophes for the right. | * Use <tt>``</tt> for the left mark, and two apostrophes for the right. | ||
* If you're nesting single quotes within double quotes (e.g. for a quote within a quote), you might run into e.g. < | * If you're nesting single quotes within double quotes (e.g. for a quote within a quote), you might run into problems when the interior quote ends or begins with the exterior one, e.g. <nowiki>'''</nowiki> (which is rendered as a double right quote followed by a single right quote). To properly nest, use e.g. <nowiki>'\thinspace''</nowiki>. | ||
* If you want an actual old-skool quotation mark (for emulating old terminals, perhaps), try <tt>\textquotedbl</tt>. | * If you want an actual old-skool quotation mark (for emulating old terminals, perhaps), try <tt>\textquotedbl</tt>. | ||
** For an old-skool apostrophe, <tt>\textquotesingle</tt>. | ** For an old-skool apostrophe, <tt>\textquotesingle</tt>. | ||
| Line 39: | Line 46: | ||
===Backslashes=== | ===Backslashes=== | ||
Use <tt>\textbackslash{}</tt> to render a backslash in text. | Use <tt>\textbackslash{}</tt> to render a backslash in text. | ||
==Lists== | ==Lists== | ||
Enclose bulleted lists within a <tt>\begin{itemize}</tt> and <tt>\end{itemize}</tt> block. Each element is preceded by <tt>\item</tt>. | Enclose bulleted lists within a <tt>\begin{itemize}</tt> and <tt>\end{itemize}</tt> block. Each element is preceded by <tt>\item</tt>. | ||