3 ms·
LaTeX is old. It was designed long before PDFs existed. Long before Unicode existed. You can get a good PDF out of LaTeX but it requires some work. You’d think
by dietrichepp 4y ago
LaTeX is old. It was designed long before PDFs existed. Long before Unicode existed. You can get a good PDF out of LaTeX but it requires some work.
You’d think that the “semantic” nature of LaTeX makes it easy, but there’s an expansive set of macros between the source document and the PDF.
Just one example—LaTeX does things like replace “---” with “—” or replace “fi” with “fi”. How does LaTeX do it? At some point, somebody wrote some code which recognizes those patterns in the source file and emits the appropriate glyph. But these replacements are not equivalent—the “---” em dash needs to be a Unicode character with its own glyph, and “fi” needs to be two characters that share one glyph. Not important for DVI files, but important for PDF files where you want to copy the text out.
You can get this to work in LaTeX but it won’t work correctly by default, depending on how you are getting a PDF file. You end up with a preamble in all your LaTeX files to make them work nicely. You also probably want to use xelatex or lualatex instead of pdflatex (I don’t keep up with this stuff—get up to date recommendations elsewhere).