TeX Live: Difference between revisions
(→Arch-packaged TeX Live: Underline a bit more the importance and exemplify just what essential LaTeX packages mean. pdflatex, for instance, will not work without this package.) |
|||
(247 intermediate revisions by 41 users not shown) | |||
Line 1: | Line 1: | ||
[[Category:TeX]] | [[Category:TeX]] | ||
[[ | [[de:TeX]] | ||
[[ja:TeX Live]] | [[ja:TeX Live]] | ||
[[zh-hans:TeX Live]] | [[zh-hans:TeX Live]] | ||
{{Related articles start}} | {{Related articles start}} | ||
{{Related|TeX Live FAQ}} | {{Related|TeX Live/FAQ}} | ||
{{Related|TeX Live | {{Related|TeX Live/CJK}} | ||
{{Related| | {{Related|Tectonic}} | ||
{{Related articles end}} | {{Related articles end}} | ||
According to [[Wikipedia:TeX Live|Wikipedia]]: | |||
TeX Live is | :'''TeX Live''' is a free software distribution for the [[Wikipedia:TeX|TeX]] typesetting system that includes major TeX-related programs, macro packages, and fonts. | ||
TeX Live includes: | |||
* many TeX engines, such as: | |||
* | ** [[Wikipedia:pdfTeX|pdfTeX]] | ||
* | **[[Wikipedia:XeTeX|XeTeX]] | ||
**[[Wikipedia:LuaTeX|LuaTeX]] | |||
* basic macro packages (called ''formats'' in TeX parlance), such as: | |||
** [[Wikipedia:LaTeX|LaTeX]] | |||
** [[Wikipedia:ConTeXt|ConTeXt]] | |||
* many user-produced packages | |||
== Arch-packaged TeX Live vs native TeX Live == | |||
There are multiple ways to install TeX Live. While a snapshot of TeX Live should be available from the Arch Linux package repositories (as described below), that snapshot is in most cases updated only once a year. In contrast, TeX Live itself is a rolling release distribution, based on the model of the user having to upgrade once a year, but with individual package upgrades available on a sub-daily basis. | |||
The advantages of having a native and up-to-date TeX Live installation include having access to the latest features and bug fixes and to the relevant documentation. While it ''is'' possible to upgrade or install an individual package without having native TeX Live (see {{ic|TEXMFLOCAL}} and {{ic|TEXMFHOME}}), this requires extra care - it is necessary to ensure that the versions of all relevant packages are mutually compatible. | |||
See the [https:// | In contrast to native TeX Live, the packages in the Arch repositories tend not to include documentation, which is problematic as the documentation from CTAN is usually only available for the latest version of a TeX package. | ||
{{Note|Multiple installations of TeX Live can peacefully coexist on a single system.}} | |||
=== Native TeX Live === | |||
==== Installation ==== | |||
See the [https://tug.org/texlive/quickinstall.html quickinstall] documentation, and, if necessary, the [https://tug.org/texlive/doc/texlive-en/texlive-en.html full] documentation. The process boils down to: | |||
# downloading the netinstall [https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz archive] | |||
# unpacking the archive and changing to the newly created directory | |||
# running the install script, {{ic|perl ./install-tl}}, which starts an interactive installation procedure within a text interface | |||
## setting the wanted installation path or paths | |||
## optionally, choosing a subset of the package ''collections'' provided by TeX Live | |||
## optionally, choosing the Letter paper size as the default, as opposed to A4 | |||
## waiting for everything to download | |||
# As the install script will notify you at the end of the process, it's necessary to add the TeX Live installation to the system executable and documentation paths: {{ic|PATH}}, {{ic|MANPATH}}, {{ic|INFOPATH}}. The install script prints the exact additions that are required before exiting. | |||
==== Updating ==== | |||
See the [https://tug.org/texlive/doc/tlmgr.html tlmgr] documentation, {{ic|tlmgr update --all}} upgrades all packages from the collections chosen during the installation. It will also install any packages that are newly added to an installed TeX Live collection. | |||
Once a year, when there's a new TeX Live release, {{ic|tlmgr update --all}} will fail and it will be necessary to install TeX Live anew. | |||
=== Arch-packaged TeX Live === | |||
* The {{Grp|texlive}} group contains most TeX Live packages, categorised based on upstream collections (see [https://tex.stackexchange.com/questions/356831/tex-live-package-collection-organisation]). | |||
** {{Pkg|texlive-basic}}, the core installation, based on the ''medium'' upstream install scheme. The package includes [[pacman hook]]s to automate ''mktexlsr'', ''fmtutil'' and ''updmap''. | |||
** {{Pkg|texlive-latex}} contains essential LaTeX packages. (For instance, if you intend to use {{ic|pdflatex}}, then you need this package). | |||
** {{Pkg|texlive-latexrecommended}} and {{Pkg|texlive-latexextra}} contain many useful LaTeX packages, such as {{ic|polyglossia}}, {{ic|amsmath}} and {{ic|graphicx}}. | |||
** {{Pkg|texlive-fontsrecommended}} contains essential fonts (including the default Latin Modern) | |||
** {{Pkg|texlive-fontsextra}} contains additional fonts, which can be viewed on the [https://www.tug.org/FontCatalogue/ LaTeX Font Catalogue]. | |||
** {{Pkg|texlive-xetex}} and {{Pkg|texlive-luatex}} contain packages for XeTeX and LuaTeX respectively. | |||
** {{Pkg|texlive-bibtexextra}} contains the [https://ctan.org/pkg/biblatex BibLaTeX] package and additional BibTeX styles and bibliography databases. | |||
** {{Pkg|texlive-mathscience}} contains essential packages for mathematics, natural sciences and computer science. | |||
* The {{Grp|texlive-lang}} group contains packages providing character sets and features for languages with non-Latin characters. | |||
* {{Pkg|biber}} provides an alternative bibliography processing backend for BibLaTeX. | |||
Note that some tools in {{Pkg|texlive-binextra}} have optional dependencies which are not automatically installed. For example, ''latexindent'' depends on {{Pkg|perl-yaml-tiny}} and {{Pkg|perl-file-homedir}}. | |||
{{Tip|If you are missing specific ''.sty'' files, you can run {{ic|pacman -F}} to find the Arch package that provides them: | |||
{{hc|$ pacman -F soul.sty| | |||
extra/texlive-plaingeneric 2023.66594-19 (texlive) | |||
usr/share/texmf-dist/tex/generic/soul/soul.sty | |||
}} | |||
}} | |||
Whenever there is a need to install a TeX package available on [https://www.ctan.org/ CTAN], run the following to determine whether it is included in an Arch ''texlive-'' package: | |||
$ tlmgr info ctan_package_name | grep collection | |||
This will potentially list the name of a TeX Live collection which corresponds to an Arch ''texlive-'' package (also check the {{Grp|texlive}} group to confirm whether such package exists). For instance, an output of {{ic|collection: collection-plaingeneric}} means that TeX package is included in {{Pkg|texlive-plaingeneric}}. | |||
Alternatively, {{ic|tlmgr}} can be used to manually install a single TeX package (see below). | |||
{{Note|Some tools and utilities included in TeX Live rely on {{Pkg|ghostscript}}, {{Pkg|perl}}, {{Pkg|python}}, or {{Pkg|ruby}}. See the optional dependencies of each package for details.}} | |||
==== tllocalmgr ==== | |||
{{Warning|1=It has been suggested that tllocalmgr will no longer work. See [https://bbs.archlinux.org/viewtopic.php?id=286197].}} | |||
The ''tllocalmgr'' utility, provided by {{AUR|tllocalmgr}}, lets you install (and update) packages from CTAN as [[pacman]] packages. See [https://github.com/hv15/tllocalmgr/blob/master/tllocalmgr#L835 its usage] ({{ic|-h}}) for details. | |||
==== tlmgr ==== | |||
With {{Pkg|texlive-basic}} the ''tlmgr'' utility should work out of the box. If you still have issues or you're using the old package {{ic|texlive-core}} then you should follow the following procedure in order to make ''tlmgr'' work. | |||
{{Note| | |||
* While {{Pkg|texlive-basic}} provides the [https://www.tug.org/texlive/tlmgr.html tlmgr] script in ''TEXMFDIST'', it is broken ({{Bug|74404}}). You can fix it as described below. | |||
* The {{man|1|texconfig}} command is mostly broken because it partially depends on ''tlmgr'' ({{Bug|59094}}). The interactive mode of {{ic|texconfig}} requires {{Pkg|dialog}}. | |||
}} | |||
{{Accuracy|The "fix" should be incorporated into the {{Pkg|texlive-core}}{{Broken package link|replaced by {{Pkg|texlive-basic}}}} package. Editing files in ''TEXMFDIST'' will not survive package upgrades.}} | |||
The ''tlmgr'' utility is the standard way of installing and updating packages from CTAN. It requires minor fixes as follows: | |||
First, edit {{ic|''TEXMFDIST''/scripts/texlive/tlmgr.pl}} and replace {{ic|1=$Master = "$Master/../..";}} with {{ic|1=$Master = "${Master}/../../..";}}. The path prefix ''TEXMFDIST'' is not a predefined environment variable, it is defined below in this article. Replace it with the correct value. | |||
This can also be done from the command line with {{ic|sudo sed -i 's/\$Master {{=}} "\$Master\/..\/..";/\$Master {{=}} "\$Master\/..\/..\/..";/' "$TEXMFDIST/scripts/texlive/tlmgr.pl"}} | |||
Create an alias for the perl script (which you can add in your shell init file). | |||
alias tlmgr='''TEXMFDIST''/scripts/texlive/tlmgr.pl --usermode' | |||
Now you can initialize it in user mode (which will use {{ic|~/texmf}} as install prefix): | |||
$ tlmgr init-usertree | |||
Set your preferred [https://www.ctan.org/mirrors mirror]. You need to append {{ic|/systems/texlive/tlnet}} to the path of the mirror. For example: | |||
<nowiki>$ tlmgr option repository http://mirrors.rit.edu/CTAN/systems/texlive/tlnet</nowiki> | |||
Now you can install CTAN packages as usual: | |||
$ tlmgr install ''package_name'' | |||
==== Package documentation ==== | |||
The packages in the official repositories do not contain the documentation or source files of font/macro packages. | |||
For offline access with {{ic|texdoc}}, [[install]] the whole TeX Live documentation and source files with {{Pkg|texlive-doc}}. | |||
You can also access the documentation online at: | |||
* https://tug.org/texlive/Contents/live/doc.html | |||
* https://ctan.org/ – the central place for all kinds of material around TeX | |||
* https://texdoc.org/ ({{ic|<nowiki>http://texdoc.org/pkg/</nowiki>''packagename''}} directly yields the relevant PDF) | |||
== Usage == | == Usage == | ||
See the following resources: | |||
* [[Wikibooks:LaTeX]] | |||
* [https://tobi.oetiker.ch/lshort/lshort.pdf The Not So Short Introduction to LaTeX 2ε] | |||
* [https://www.andy-roberts.net/writing/latex Getting to Grips with LaTeX – Andrew Roberts] | |||
* [https://www.texfaq.org/ The TeX FAQ] | |||
Some use a [[List of applications/Documents#TeX editors|TeX editor]] for creating documents. | |||
=== High-level wrappers for compiling documents === | |||
It almost always makes more sense to use a higher-level tool like {{man|1|latexmk}}, or perhaps {{man|1|arara}}, instead of calling things like {{man|1|pdflatex}} directly, mostly because lower-level tools need to be run multiple times in general for completely compiling a single document. | |||
=== texmf trees and Kpathsea === | |||
texmf trees (''texmf'' stands for TeX and [[Wikipedia:Metafont|Metafont]]) should follow the [https://tug.org/tds/ TeX Directory Structure], or files may not be found.[https://www.tug.org/texlive/doc/texlive-en/texlive-en.html#x1-110002.3] | |||
TeX Live uses the [https://tug.org/texinfohtml/kpathsea.html Kpathsea] library to lookup paths by filename across multiple texmf trees and the current working directory. | |||
Kpathsea searches the following variables in the reverse order (later trees override earlier ones). | |||
{| class="wikitable" | |||
! Variables !! Arch default <sup>1)</sup> !! Used by [https://www.tug.org/texlive/doc/texlive-en/texlive-en.html#x1-110002.3] | |||
|- | |||
| {{ic|TEXMFDIST}} || {{ic|/usr/share/texmf-dist}} || files of the original distribution | |||
|- | |||
| {{ic|TEXMFLOCAL}} || {{ic|/usr/local/share/texmf:/usr/share/texmf}} || administrators for system-wide installation of additional or updated macros, fonts, etc. | |||
|- | |||
| {{ic|TEXMFSYSVAR}} || {{ic|/var/lib/texmf}} || updmap and fmtutil (user mode) to store (cached) runtime data | |||
|- | |||
| {{ic|TEXMFSYSCONFIG}} || {{ic|/etc/texmf}} || updmap and fmtutil (user mode) to store modified configuration data | |||
|- | |||
| {{ic|TEXMFHOME}} || {{ic|~/texmf}} || users for their own individual installations of additional or updated macros, fonts, etc. | |||
|- | |||
| {{ic|TEXMFVAR}} || {{ic|~/.texlive/texmf-var}} || updmap and fmtutil (sys mode) to store (cached) runtime data | |||
|- | |||
| {{ic|TEXMFCONFIG}} || {{ic|~/.texlive/texmf-config}} || updmap and fmtutil (sys mode) to store modified configuration data | |||
|- | |||
| {{ic|TEXMFCACHE}} || {{ic|$TEXMFSYSVAR;$TEXMFVAR}} || ConTeXt MkIV and LuaLaTeX to store (cached) runtime data | |||
|} | |||
{{Note|The default values are defined in {{ic|/etc/texmf/web2c/texmf.cnf}}[https://github.com/archlinux/svntogit-packages/blob/packages/texlive-core/trunk/texmf.cnf]; they can be overridden with [[environment variables]].}} | |||
Kpathsea provides the {{man|1|kpsewhich}} command to lookup paths. When run with the {{ic|--var-brace-value{{=}}''VARIABLE''}} argument it can also print the values of variables. | |||
Kpathsea uses filename databases ({{ic|ls-R}}) to speed up searches in system-wide texmf trees (configured with the {{ic|TEXMFDBS}} variable). This means that when system-wide file trees are changed, {{man|1|mktexlsr}} or {{ic|texhash}} (a symlink) need to be run as [[root user|root]]. Fortunately the {{Pkg|texlive-core}}{{Broken package link|replaced by {{Pkg|texlive-basic}}}} automates this with a [[pacman hook]] targeting all default system-wide texmf trees but {{ic|/usr/local/share/texmf}}.[https://github.com/archlinux/svntogit-packages/blob/packages/texlive-core/trunk/mktexlsr.hook] So as long as you install system-wide packages via [[pacman]] you should not need to run ''mktexlsr'' or ''texhash'' at all. | |||
{{Tip|For setting up a local repository you can create the {{ic|~/texmf/tex/{format}/}} directory structure ({{ic|{format} }} is usually {{ic|latex}}), where custom classes are located in the root of the {{ic|./{format} }} folder and other local files get placed in a folder with the same name (e.g. {{ic|mycustompackage.sty}} goes to {{ic|./{formats}/mycustompackage/mycustompackage.sty}}), then run {{ic|texhash}} to update the user database.}} | |||
== Tips and tricks == | |||
=== Changing default paper size === | |||
{{Accuracy|It is possible by directly editing the config files.[https://tug.org/pipermail/tex-live/2009-April/020692.html]}} | |||
It is currently impossible to set the default page size using the texlive tools, because they do not work with the standard Arch package. | |||
Usually, you would run {{ic|texconfig}} or {{ic|tlmgr}}, which are also capable of changing other useful settings. | |||
You can edit the configuration files as follows. | |||
* | * To set the paper size for the ''pdftex'' family of commands (''pdftex'', ''pdflatex'', etc) edit {{ic|/etc/texmf/tex/generic/tex-ini-files/pdftexconfig.tex}} file. | ||
which can also be discovered by running {{ic|kpsewhich pdftexconfig.tex}}. Change the two lines that specify the {{ic|pdfpageheight}} and {{ic|pdfpagewidth}}. For example, to use letter size, change | |||
\pdfpageheight = 297 true mm | |||
\pdfpagewidth = 210 true mm | |||
to | |||
\pdfpageheight = 11 true in | |||
\pdfpagewidth = 8.5 true in | |||
Unfortunately, this will not have any effect until the binary ''.fmt'' files are rebuilt. You can do this with {{ic|fmtutil-sys}}. Re-installing {{Pkg|texlive-bin}} with [[pacman]] will also do this for you. | |||
* For ''dvips'', you can use the {{ic|-t}} option to specify the paper size: {{ic|dvips -t letter foo.dvi}}. To change the default, edit {{ic|/etc/texmf/dvips/config/config.ps}} file. | |||
which can also be discovered with {{ic|kpsewhich config.ps}}. The end of this file has sections that list all the paper sizes that ''dvips'' knows about. The first listed paper size will be the default. Just move the one that you want to be the default to the top of the list. The behavior of ''dvips'' will be affected as soon as the file file is changed. | |||
=== Making fonts available to Fontconfig === | |||
By default, the fonts that come with the various TeX Live packages are not automatically available to [[Fontconfig]]. If you want to use them with, say XeTeX or [[LibreOffice]], the easiest approach is to make symlink the font directory to a subdirectory in your [[Font configuration#Font paths|user's font path]]. Run the following for an OpenType font: | |||
By default, the fonts that come with the various TeX Live packages are not automatically available to Fontconfig. If you want to use them with, say XeTeX or [[LibreOffice]], the easiest approach is to make | |||
$ ln -s /usr/share/texmf-dist/fonts/opentype/public/''some_fonts_you_want'' ~/''font_path''/OTF/ | |||
To make them available to fontconfig, run: | |||
$ fc-cache ~/''font_path'' | |||
$ mkfontscale ~/''font_path''/OTF | |||
$ mkfontdir ~/''font_path''/OTF | |||
Similar steps follow for TrueType fonts and Type 1 fonts. In the lines above, substitute {{ic|opentype}} with {{ic|truetype}} or {{ic|type1}} and substitute {{ic|OTF}} with {{ic|TTF}} or {{ic|Type1}}. | |||
{{ | Alternatively, {{Pkg|texlive-core}}{{Broken package link|replaced by {{Pkg|texlive-basic}}}} contains the file {{ic|/usr/share/fontconfig/conf.avail/09-texlive-fonts.conf}} that contains a list of the font directories used by TeX Live. You can use this file with: | ||
{{ | {{bc|# ln -s /usr/share/fontconfig/conf.avail/09-texlive-fonts.conf /etc/fonts/conf.d/09-texlive-fonts.conf}} | ||
And then update fontconfig: | |||
{{bc|$ fc-cache && mkfontscale && mkfontdir}} | |||
{{bc| | |||
{{Note| | |||
* This may cause conflicts with XeTeX/XeLaTeX if the same fonts are (separately) available to both TeX and Fontconfig, i.e. if multiple copies of the same font are available on the search path. | |||
* Type 1 fonts will not be available in LibreOffice 5.3 and later. | |||
}} | |||
=== | === Updating babelbib language definitions === | ||
{{Style|You should not change {{ic|/usr/share/texmf-dist/}}.}} | |||
If you have the very specific problem of [https://www.ctan.org/pkg/babelbib babelbib] not having the latest language definitions that you need, and you do not want to recompile everything, you can get them manually from https://www.tug.org/texlive/devsrc/Master/texmf-dist/tex/latex/babelbib/ and put them in {{ic|/usr/share/texmf-dist/tex/latex/babelbib/}}. For example: | |||
If you have the very specific problem of babelbib not having the latest language definitions that you need, and you do not want to recompile everything, you can get them manually from https://www.tug.org/texlive/devsrc/Master/texmf-dist/tex/latex/babelbib/ and put them in {{ic|/usr/share/texmf-dist/tex/latex/babelbib/}}. For example: | |||
{{bc| | {{bc|<nowiki> | ||
$ cd /usr/share/texmf-dist/tex/latex/babelbib/ | |||
# wget https://www.tug.org/texlive/devsrc/Master/texmf-dist/tex/latex/babelbib/romanian.bdf | # wget https://www.tug.org/texlive/devsrc/Master/texmf-dist/tex/latex/babelbib/romanian.bdf | ||
# wget [...all-other-language-files...] | # wget [...all-other-language-files...] | ||
# wget https://www.tug.org/texlive/devsrc/Master/texmf-dist/tex/latex/babelbib/babelbib.sty | # wget https://www.tug.org/texlive/devsrc/Master/texmf-dist/tex/latex/babelbib/babelbib.sty | ||
}} | </nowiki>}} | ||
Afterwards, you need to run {{ic|texhash}} to update the TeX database: | Afterwards, you need to run {{ic|texhash}} to update the TeX database: | ||
# texhash | # texhash | ||
== Alternatives == | |||
Alternatives to TeX Live include MikTex and [[Tectonic]], they come with a minimal install, downloading the necessary packages on the go. | |||
== See also == | |||
* [https://tug.org/texlive/doc.html TeX Live documentation] | |||
* Question and answer sites | |||
** [https://tex.stackexchange.com/ TeX - LaTeX Stack Exchange] | |||
** [https://topanswers.xyz/tex TopTeX (TeX site on TopAnswers)] | |||
* [http://detexify.kirelabs.org/ Detexify LaTeX handwritten symbol recognition] |
Latest revision as of 14:13, 29 March 2024
According to Wikipedia:
- TeX Live is a free software distribution for the TeX typesetting system that includes major TeX-related programs, macro packages, and fonts.
TeX Live includes:
- many TeX engines, such as:
- basic macro packages (called formats in TeX parlance), such as:
- many user-produced packages
Arch-packaged TeX Live vs native TeX Live
There are multiple ways to install TeX Live. While a snapshot of TeX Live should be available from the Arch Linux package repositories (as described below), that snapshot is in most cases updated only once a year. In contrast, TeX Live itself is a rolling release distribution, based on the model of the user having to upgrade once a year, but with individual package upgrades available on a sub-daily basis.
The advantages of having a native and up-to-date TeX Live installation include having access to the latest features and bug fixes and to the relevant documentation. While it is possible to upgrade or install an individual package without having native TeX Live (see TEXMFLOCAL
and TEXMFHOME
), this requires extra care - it is necessary to ensure that the versions of all relevant packages are mutually compatible.
In contrast to native TeX Live, the packages in the Arch repositories tend not to include documentation, which is problematic as the documentation from CTAN is usually only available for the latest version of a TeX package.
Native TeX Live
Installation
See the quickinstall documentation, and, if necessary, the full documentation. The process boils down to:
- downloading the netinstall archive
- unpacking the archive and changing to the newly created directory
- running the install script,
perl ./install-tl
, which starts an interactive installation procedure within a text interface- setting the wanted installation path or paths
- optionally, choosing a subset of the package collections provided by TeX Live
- optionally, choosing the Letter paper size as the default, as opposed to A4
- waiting for everything to download
- As the install script will notify you at the end of the process, it's necessary to add the TeX Live installation to the system executable and documentation paths:
PATH
,MANPATH
,INFOPATH
. The install script prints the exact additions that are required before exiting.
Updating
See the tlmgr documentation, tlmgr update --all
upgrades all packages from the collections chosen during the installation. It will also install any packages that are newly added to an installed TeX Live collection.
Once a year, when there's a new TeX Live release, tlmgr update --all
will fail and it will be necessary to install TeX Live anew.
Arch-packaged TeX Live
- The texlive group contains most TeX Live packages, categorised based on upstream collections (see [1]).
- texlive-basic, the core installation, based on the medium upstream install scheme. The package includes pacman hooks to automate mktexlsr, fmtutil and updmap.
- texlive-latex contains essential LaTeX packages. (For instance, if you intend to use
pdflatex
, then you need this package). - texlive-latexrecommended and texlive-latexextra contain many useful LaTeX packages, such as
polyglossia
,amsmath
andgraphicx
. - texlive-fontsrecommended contains essential fonts (including the default Latin Modern)
- texlive-fontsextra contains additional fonts, which can be viewed on the LaTeX Font Catalogue.
- texlive-xetex and texlive-luatex contain packages for XeTeX and LuaTeX respectively.
- texlive-bibtexextra contains the BibLaTeX package and additional BibTeX styles and bibliography databases.
- texlive-mathscience contains essential packages for mathematics, natural sciences and computer science.
- The texlive-lang group contains packages providing character sets and features for languages with non-Latin characters.
- biber provides an alternative bibliography processing backend for BibLaTeX.
Note that some tools in texlive-binextra have optional dependencies which are not automatically installed. For example, latexindent depends on perl-yaml-tiny and perl-file-homedir.
pacman -F
to find the Arch package that provides them:
$ pacman -F soul.sty
extra/texlive-plaingeneric 2023.66594-19 (texlive) usr/share/texmf-dist/tex/generic/soul/soul.sty
Whenever there is a need to install a TeX package available on CTAN, run the following to determine whether it is included in an Arch texlive- package:
$ tlmgr info ctan_package_name | grep collection
This will potentially list the name of a TeX Live collection which corresponds to an Arch texlive- package (also check the texlive group to confirm whether such package exists). For instance, an output of collection: collection-plaingeneric
means that TeX package is included in texlive-plaingeneric.
Alternatively, tlmgr
can be used to manually install a single TeX package (see below).
tllocalmgr
The tllocalmgr utility, provided by tllocalmgrAUR, lets you install (and update) packages from CTAN as pacman packages. See its usage (-h
) for details.
tlmgr
With texlive-basic the tlmgr utility should work out of the box. If you still have issues or you're using the old package texlive-core
then you should follow the following procedure in order to make tlmgr work.
- While texlive-basic provides the tlmgr script in TEXMFDIST, it is broken (FS#74404). You can fix it as described below.
- The texconfig(1) command is mostly broken because it partially depends on tlmgr (FS#59094). The interactive mode of
texconfig
requires dialog.
The tlmgr utility is the standard way of installing and updating packages from CTAN. It requires minor fixes as follows:
First, edit TEXMFDIST/scripts/texlive/tlmgr.pl
and replace $Master = "$Master/../..";
with $Master = "${Master}/../../..";
. The path prefix TEXMFDIST is not a predefined environment variable, it is defined below in this article. Replace it with the correct value.
This can also be done from the command line with sudo sed -i 's/\$Master = "\$Master\/..\/..";/\$Master = "\$Master\/..\/..\/..";/' "$TEXMFDIST/scripts/texlive/tlmgr.pl"
Create an alias for the perl script (which you can add in your shell init file).
alias tlmgr='TEXMFDIST/scripts/texlive/tlmgr.pl --usermode'
Now you can initialize it in user mode (which will use ~/texmf
as install prefix):
$ tlmgr init-usertree
Set your preferred mirror. You need to append /systems/texlive/tlnet
to the path of the mirror. For example:
$ tlmgr option repository http://mirrors.rit.edu/CTAN/systems/texlive/tlnet
Now you can install CTAN packages as usual:
$ tlmgr install package_name
Package documentation
The packages in the official repositories do not contain the documentation or source files of font/macro packages.
For offline access with texdoc
, install the whole TeX Live documentation and source files with texlive-doc.
You can also access the documentation online at:
- https://tug.org/texlive/Contents/live/doc.html
- https://ctan.org/ – the central place for all kinds of material around TeX
- https://texdoc.org/ (
http://texdoc.org/pkg/packagename
directly yields the relevant PDF)
Usage
See the following resources:
- Wikibooks:LaTeX
- The Not So Short Introduction to LaTeX 2ε
- Getting to Grips with LaTeX – Andrew Roberts
- The TeX FAQ
Some use a TeX editor for creating documents.
High-level wrappers for compiling documents
It almost always makes more sense to use a higher-level tool like latexmk(1), or perhaps arara(1), instead of calling things like pdflatex(1) directly, mostly because lower-level tools need to be run multiple times in general for completely compiling a single document.
texmf trees and Kpathsea
texmf trees (texmf stands for TeX and Metafont) should follow the TeX Directory Structure, or files may not be found.[3]
TeX Live uses the Kpathsea library to lookup paths by filename across multiple texmf trees and the current working directory.
Kpathsea searches the following variables in the reverse order (later trees override earlier ones).
Variables | Arch default 1) | Used by [4] |
---|---|---|
TEXMFDIST |
/usr/share/texmf-dist |
files of the original distribution |
TEXMFLOCAL |
/usr/local/share/texmf:/usr/share/texmf |
administrators for system-wide installation of additional or updated macros, fonts, etc. |
TEXMFSYSVAR |
/var/lib/texmf |
updmap and fmtutil (user mode) to store (cached) runtime data |
TEXMFSYSCONFIG |
/etc/texmf |
updmap and fmtutil (user mode) to store modified configuration data |
TEXMFHOME |
~/texmf |
users for their own individual installations of additional or updated macros, fonts, etc. |
TEXMFVAR |
~/.texlive/texmf-var |
updmap and fmtutil (sys mode) to store (cached) runtime data |
TEXMFCONFIG |
~/.texlive/texmf-config |
updmap and fmtutil (sys mode) to store modified configuration data |
TEXMFCACHE |
$TEXMFSYSVAR;$TEXMFVAR |
ConTeXt MkIV and LuaLaTeX to store (cached) runtime data |
/etc/texmf/web2c/texmf.cnf
[5]; they can be overridden with environment variables.Kpathsea provides the kpsewhich(1) command to lookup paths. When run with the --var-brace-value=VARIABLE
argument it can also print the values of variables.
Kpathsea uses filename databases (ls-R
) to speed up searches in system-wide texmf trees (configured with the TEXMFDBS
variable). This means that when system-wide file trees are changed, mktexlsr(1) or texhash
(a symlink) need to be run as root. Fortunately the texlive-core[broken link: replaced by texlive-basic] automates this with a pacman hook targeting all default system-wide texmf trees but /usr/local/share/texmf
.[6] So as long as you install system-wide packages via pacman you should not need to run mktexlsr or texhash at all.
~/texmf/tex/{format}/
directory structure ({format}
is usually latex
), where custom classes are located in the root of the ./{format}
folder and other local files get placed in a folder with the same name (e.g. mycustompackage.sty
goes to ./{formats}/mycustompackage/mycustompackage.sty
), then run texhash
to update the user database.Tips and tricks
Changing default paper size
It is currently impossible to set the default page size using the texlive tools, because they do not work with the standard Arch package.
Usually, you would run texconfig
or tlmgr
, which are also capable of changing other useful settings.
You can edit the configuration files as follows.
- To set the paper size for the pdftex family of commands (pdftex, pdflatex, etc) edit
/etc/texmf/tex/generic/tex-ini-files/pdftexconfig.tex
file.
which can also be discovered by running kpsewhich pdftexconfig.tex
. Change the two lines that specify the pdfpageheight
and pdfpagewidth
. For example, to use letter size, change
\pdfpageheight = 297 true mm \pdfpagewidth = 210 true mm
to
\pdfpageheight = 11 true in \pdfpagewidth = 8.5 true in
Unfortunately, this will not have any effect until the binary .fmt files are rebuilt. You can do this with fmtutil-sys
. Re-installing texlive-bin with pacman will also do this for you.
- For dvips, you can use the
-t
option to specify the paper size:dvips -t letter foo.dvi
. To change the default, edit/etc/texmf/dvips/config/config.ps
file.
which can also be discovered with kpsewhich config.ps
. The end of this file has sections that list all the paper sizes that dvips knows about. The first listed paper size will be the default. Just move the one that you want to be the default to the top of the list. The behavior of dvips will be affected as soon as the file file is changed.
Making fonts available to Fontconfig
By default, the fonts that come with the various TeX Live packages are not automatically available to Fontconfig. If you want to use them with, say XeTeX or LibreOffice, the easiest approach is to make symlink the font directory to a subdirectory in your user's font path. Run the following for an OpenType font:
$ ln -s /usr/share/texmf-dist/fonts/opentype/public/some_fonts_you_want ~/font_path/OTF/
To make them available to fontconfig, run:
$ fc-cache ~/font_path $ mkfontscale ~/font_path/OTF $ mkfontdir ~/font_path/OTF
Similar steps follow for TrueType fonts and Type 1 fonts. In the lines above, substitute opentype
with truetype
or type1
and substitute OTF
with TTF
or Type1
.
Alternatively, texlive-core[broken link: replaced by texlive-basic] contains the file /usr/share/fontconfig/conf.avail/09-texlive-fonts.conf
that contains a list of the font directories used by TeX Live. You can use this file with:
# ln -s /usr/share/fontconfig/conf.avail/09-texlive-fonts.conf /etc/fonts/conf.d/09-texlive-fonts.conf
And then update fontconfig:
$ fc-cache && mkfontscale && mkfontdir
- This may cause conflicts with XeTeX/XeLaTeX if the same fonts are (separately) available to both TeX and Fontconfig, i.e. if multiple copies of the same font are available on the search path.
- Type 1 fonts will not be available in LibreOffice 5.3 and later.
Updating babelbib language definitions
If you have the very specific problem of babelbib not having the latest language definitions that you need, and you do not want to recompile everything, you can get them manually from https://www.tug.org/texlive/devsrc/Master/texmf-dist/tex/latex/babelbib/ and put them in /usr/share/texmf-dist/tex/latex/babelbib/
. For example:
$ cd /usr/share/texmf-dist/tex/latex/babelbib/ # wget https://www.tug.org/texlive/devsrc/Master/texmf-dist/tex/latex/babelbib/romanian.bdf # wget [...all-other-language-files...] # wget https://www.tug.org/texlive/devsrc/Master/texmf-dist/tex/latex/babelbib/babelbib.sty
Afterwards, you need to run texhash
to update the TeX database:
# texhash
Alternatives
Alternatives to TeX Live include MikTex and Tectonic, they come with a minimal install, downloading the necessary packages on the go.