LaTeX: Difference between revisions

No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
These days, I always use [https://tug.org/xetex/ XeTeX] (as opposed to e.g. pdflatex), 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), though I might use LuaTeX instead. Code can generally run through both and result in similar output. XeTeX is significantly slower than pdflatex, and cannot use the full capabilities of the microtype package (as of 2023-09, anyway). Nonetheless, it's a far better way to deal with [[Unicode]] and modern fonts. LuaTeX seems another valid option, and might perhaps be more actively developed. It's currently about as slow as XeTeX.
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==
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>.