User:Loh.tar/TeX

From ArchWiki

Category:TeX

Note: This page is a proposal to the community to become an official part of the Arch Wiki. It's the summary of my efforts to find a better fitting solution for my needs as TeXLive which was verbose shared at the Arch forum. All this public noise was triggered by a suggestion at the discussion page of the TeXLive Wiki Page
Note: This is the first draft. I have made all reasonable efforts to follow the Arch Wiki style. But in contrast to the a typical Arch Wiki page where rarely a recommendation can bee seen, the wording is as neutral as possible and the reader is treated as a well educated system admin, may this text differ, but on purpose.

From Wikipedia:

TeX ... is a typesetting system which was designed and written by Donald Knuth[1] and first released in 1978. ... it has been noted as one of the most sophisticated digital typographical systems.

This page does not intend to explain TeX in detail nor claims to be complete. It just like to give some help to those who are interested in "TeX-Stuff" and are looking for how to install a TeX distribution on their Arch-Box. It will be assumed that the the reader of this page isn't a TeX expert but has some knowledge about TeX from other sources.

The TeX Situation

As probably known, TeX source files *.tex will be compiled, usually into a *pdf file, by a program like pdflatex. To do this very complex task there are many other programs and resource files, like fonts, involved. Alle these needed programs and files are bundled into a distribution, just like a Linux distribution, and can be very enormous. And just like a Linux distribution has a TeX distribution also packages and package manager, similar to Perl or Python]. And there we have the root of some trouble when it comes to decide how to install the TeX distribution on our Arch, or any other Linux box.

Because the TeX distribution is so very enormous and complex, no Linux package maintainer can provide each small TeX package as, in our case, Arch package. So what they do is, they bundle many of them into more or less big chunks. And this has the consequence, that you quickly need to install much more stuff than you really need, just because some little 100KB TeX package is in some 200MB Linux package.

This is well known for years, or better decades. One solution is, of cause, not to use the packages provided by the Linux distribution but direct use the TeX distribution. In case of TeXLive isn't as hard as it sound, because there is no compile of the TeX programs needed, thanks to precompiled offered packages.

And there are other, newer, TeX distributions or tools available which handle needed resource files on the fly at compile time. Compile time of your .tex source of course.

Available TeX Distributions on Arch

TeXLive

The probably most famous and mature TeX distribution is TeXLive and exist since 1996. In this article was actually already said everything in the previous section. When you install TeXLive by pacman you will quickly have 2GB or more on your hard drive. But you will nothing miss related to TeX.

Alternatively you may install direct from tug.org what some experienced TeX users prefer because you can hold different release version of TeX in parallel on your system.

  • pro
    • De facto standard. It's like the mother of TeX
    • Stable and complete!
  • cons
    • Typical install size 2GB and more
    • To keep the installation small (~100-200MB) requires some effort, but then..
      • Resides nicely separated in /usr/local/texlive/year with no side effects on the rest of the installation
      • Easy installation and fail-safe upgrade

MikTeX

MikTeX is a much newer TeX distribution and originally developed on and for Windows. But since ~2017 is also Linux in general supported, but not Arch in particular. So it is only available in AUR miktexAUR. Compiling take some time and endet up in a ~700MB folder. But the package itself take only ~26MB and ~70MB installed. It seems the PKGBUILD could be improved.

MikTeX comes with a collection of tools similar to TeXLive. Engines like miktex-pdflatex, miktex-xelatex, miktex-lualatex and more. Furthermore is a GUI management tool miktex-console available and some cli tools like mpm and initexmf

Once installed it downloads on the fly needed packages without hassle. So you can write letters and more with a total size of ~300MB installed TeX stuff, which is located at ~/.miktex/ and/or /opt/miktex.

  • pro
    • Sofar known equal powerful as TeXLive
    • Automatic download of missing resources at document compile time
    • Cached resources are stored in TeX standard texmfs tree in ~/.miktex
    • Typical install size only ~100-200MB
    • Manually setup possible
  • cons
    • Reasonable fast internet connection required at first document compile time, at least when not setup manually
    • On Arch only available in AUR, PKGBUILD not mature
    • Setup not straight forward
    • At PKGBUILD compile time there are a lot of warnings printed. So, the source may not in best condition

Tectonic

Tectonic is a modernized, complete, self-contained TeX/LaTeX engine, powered by XeTeX and TeXLive. Tectonic is beta software but has been demonstrated to work well in a variety of real-world situations.[1] What sound a little cryptic, turns out to be an incredible lightweight, easy to install and use, alternative TeX system.

It consist of only one executable with no setup hassle. It's already available in community tectonic. Tectonic fetches, just like MikTeX, on the fly, all needed resources to compile some document and caches them in ~/.cache/Tectonic. All in all may that take 100MB disc-space.

While it is modern, and uses only XeTeX with its utf8 support, it has even that drawback. There is no alternative to XeTeX! Should you need for any reason some other TeX-Variant, you are stuck.

  • pro
    • Only one executable
    • No setup fumbling, ready to use
    • Automatic download of missing resources at document compile time
    • Coded in Rust, so probably no code insecurities
    • Typical install size only ~100-200MB
    • Compiled documents are small
    • No clutter is left on the disk from document compile, like logs or aux files
  • cons
    • Reasonable fast internet connect required at first document compile time
    • Only XeTeX supported
    • Cached resources are stored in cryptic checksum files in ~/.tectonic
    • Fetched resources comes w/o documentation
    • Documents with local packages and styles don't compile out of the box (one has to put the packages into the local folder)
    • Significant adjustments to old documents may be required
    • No configuration possible, e.g. resource cache directory

ConTeXt

And there is an other powerful TeX system ConTeXt. Ready to go, without the need for some Arch package. You are encouraged to improve this section of this Wiki with more details about ConTeXt.