TeXLive

From MukeWiki

TeX Live 2024

Installation from CTAN

Tex Live 2024 will be installed on Linux (Fedora) in /opt directory (/opt/texlive/2024 instead of default /usr/local/texlive/2024). Installation only LaTeX with support for Czech/Slovak and Cyrillic language.

wget https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
tar -xzf install-tl-unx.tar.gz
cd install-tl-*/

# interactive
./install-tl               # same as '-no-gui' or '-gui text' option
./install-tl -gui          # same as '-gui tcl' option

# batch (without interaction, automated TeX Live installation using profile)
wget https://raw.githubusercontent.com/musinsky/config/master/TeXLive/texlive.profile
./install-tl --profile=texlive.profile
Select scheme
[x] basic scheme (plain and latex)
Select collections
[x] Essential programs and files
[x] LaTeX fundamental packages
[x] LaTeX recommended packages
[?] Recommended fonts   (optional)
Personally would not recommend install Czech/Slovak or Cyrillic language collection (many blast, obsolete and no longer needed packages). Needed language packages will be installed later manually (see below).

Summa summarum installing approximately 200 packages. Total size approximately 470MB, including optional doc tree (texmf-dist/doc dir) with size of 235MB and including optional source tree (texmf-dist/source dir) with size of 35MB.

Directories customization
TEXDIR /opt/texlive/2024 the main TeX directory
TEXMFLOCAL /opt/texlive/texmf-local directory for site-wide local files
TEXMFSYSVAR /opt/texlive/2024/texmf-var directory for variable and automatically generated data
TEXMFSYSCONFIG /opt/texlive/2024/texmf-config directory for local config
TEXMFVAR ~/.texlive2024/texmf-var personal directory for variable and automatically generated data
TEXMFCONFIG ~/.texlive2024/texmf-config personal directory for local config
TEXMFHOME ~/texmf directory for user-specific files

Add to profile file

export PATH=/opt/texlive/2024/bin/x86_64-linux:$PATH
# MAN and INFO path are added automatically (on most systems)
# export MANPATH=/opt/texlive/2024/texmf-dist/doc/man:$MANPATH
# export INFOPATH=/opt/texlive/2024/texmf-dist/doc/info:$INFOPATH

Configuration

TeX Live Manager (GUI interface)

$ tlmgr gui

TeX Live Manager (command line interface)

$ tlmgr option repository https://mirror.ctan.org/systems/texlive/tlnet     # CTAN (list of all packages)
$ tlmgr paper a4
# utilities
$ tlmgr install latexmk epstopdf pdfcrop pdfjam

# Slovak (Czech) language
$ tlmgr install babel-slovak hyphen-slovak ec                          # lm is installed by default

# Russian language
$ tlmgr install babel-russian hyphen-russian cyrillic t2 lh cm-super   # lh also install package ec

# JINR Dubna report (personal packages)
$ tlmgr install environ trimspaces comment pdftexcmds
$ tlmgr update --list
$ tlmgr update --all
$ tlmgr update --self
$ tlmgr info texlive-scripts-extra --list
$ tlmgr install collection-fontsrecommended --dry-run
$ tlmgr install collection-fontsextra --dry-run
$ tlmgr info revtex
$ tlmgr install revtex
$ tlmgr remove revtex
$ tlmgr search --global revtex
$ tlmgr search --global --file il2enc.def
$ tlmgr search --global --file ecrm1200   # find missing font (package)
$ tlmgr search --file amsmath.sty         # find only from installed packages
$ tlmgr update --self --all
$ mktexlsr            # Update the filename (ls-R) databases
$ updmap-sys          # Update the default font map files
$ fmtutil-sys --all   # Recreate all format files
CTAN mirrors
$ tlmgr update --repository=ftp://ftp.cvut.cz/tex-archive/systems/texlive/tlnet --all
$ tlmgr update --repository=http://ftp.cvut.cz/tex-archive/systems/texlive/tlnet --all
$ tlmgr update --repository=https://mirrors.nic.cz/tex-archive/systems/texlive/tlnet/ --all

User mode

User mode is relative new option (start from TeX Live 2013). Before using tlmgr in user mode, you have to set up the user tree with the init-usertree action. After the user tree is created, you can tell tlmgr to do the (supported) actions by adding the --usermode command line option.

$ tlmgr init-usertree   # create user tree in $TEXMFHOME
$ tlmgr --usermode gui
$ tlmgr --usermode search --global revtex
$ tlmgr --usermode install revtex
mktexlsr $HOME/texmf   # mktexlsr $(kpsewhich -var-value=TEXMFHOME)
updmap-user
fmtutil-user --all

Show configuration

The native TeX Live Manager tlmgr completely subsumes the texconfig program. From TeX Live 2020 texconfig is in the optional package texlive-scripts-extra (not installed by default).

$ tlmgr conf
========== kpathsea variables ==========
TEXMFMAIN=/opt/texlive/2024/texmf-dist
TEXMFDIST=/opt/texlive/2024/texmf-dist
TEXMFSYSCONFIG=/opt/texlive/2024/texmf-config
TEXMFSYSVAR=/opt/texlive/2024/texmf-var
TEXMFLOCAL=/opt/texlive/texmf-local
TEXMFCONFIG=/home/musinsky/.texlive2024/texmf-config
TEXMFVAR=/home/musinsky/.texlive2024/texmf-var
TEXMFHOME=/home/musinsky/texmf
$ kpsewhich -expand-path='$TEXMFLOCAL'   # try also '$TEXMF'
/opt/texlive/texmf-local
$ kpsewhich -expand-var='$TEXMFLOCAL'
/opt/texlive/texmf-local
$ kpsewhich -var-value=TEXMFLOCAL        # try also TEXMF
/opt/texlive/texmf-local

PSCyr

Collection of PSCyr fonts (version 0.4d-beta9, 2004-10-15), Alexander Lebedev (2000-2004) [1]. Tested on Linux (Fedora) with TeX Live (from 2008 to 2024).

install as admin (recommended)
to $TEXMFLOCAL (/opt/texlive/texmf-local)
or install as user
to $TEXMFHOME (/home/musinsky/texmf)
export DEST_DIR=$(kpsewhich -var-value=TEXMFLOCAL)
export DEST_DIR=$(kpsewhich -var-value=TEXMFHOME)
wget ftp://scon155.phys.msu.su/pub/russian/psfonts/0.4d-beta/PSCyr-0.4-beta9-tex.tar.gz   # frequent fail server
wget ftp://scon155.phys.msu.su/pub/russian/psfonts/0.4d-beta/PSCyr-0.4-beta9-type1.tar.gz # frequent fail server
wget https://raw.githubusercontent.com/musinsky/config/master/TeXLive/PSCyr/PSCyr-0.4-beta9-tex.tar.gz
wget https://raw.githubusercontent.com/musinsky/config/master/TeXLive/PSCyr/PSCyr-0.4-beta9-type1.tar.gz
tar -xzf PSCyr-0.4-beta9-type1.tar.gz
tar -xzf PSCyr-0.4-beta9-tex.tar.gz

mkdir -p $DEST_DIR/fonts/{afm,tfm,type1,vf}/public/pscyr
mkdir -p $DEST_DIR/fonts/{enc,map}/dvips/pscyr
mkdir -p $DEST_DIR/fonts/map/dvipdfm/pscyr
mkdir -p $DEST_DIR/tex/latex/pscyr
mkdir -p $DEST_DIR/doc/fonts/pscyr

mv PSCyr/fonts/afm/public/pscyr/*   $DEST_DIR/fonts/afm/public/pscyr
mv PSCyr/fonts/tfm/public/pscyr/*   $DEST_DIR/fonts/tfm/public/pscyr
mv PSCyr/fonts/type1/public/pscyr/* $DEST_DIR/fonts/type1/public/pscyr
mv PSCyr/fonts/vf/public/pscyr/*    $DEST_DIR/fonts/vf/public/pscyr
mv PSCyr/dvips/pscyr/*.enc       $DEST_DIR/fonts/enc/dvips/pscyr
mv PSCyr/dvips/pscyr/*.map       $DEST_DIR/fonts/map/dvips/pscyr
mv PSCyr/dvipdfm/base/*.map      $DEST_DIR/fonts/map/dvipdfm/pscyr
mv PSCyr/tex/latex/pscyr/*    $DEST_DIR/tex/latex/pscyr

# documentation
mv PSCyr/ChangeLog        $DEST_DIR/doc/fonts/pscyr
mv PSCyr/LICENSE          $DEST_DIR/doc/fonts/pscyr
mv PSCyr/manifest.txt     $DEST_DIR/doc/fonts/pscyr
mv PSCyr/doc/PROBLEMS     $DEST_DIR/doc/fonts/pscyr
mv PSCyr/doc/fonts-ex.tex $DEST_DIR/doc/fonts/pscyr
iconv -f KOI8-R -t UTF8 < PSCyr/doc/README.koi > $DEST_DIR/doc/fonts/pscyr/README.utf8
mktexlsr
updmap-sys --enable Map=pscyr.map
mktexlsr $DEST_DIR
updmap-user --enable Map=pscyr.map
NOTE from TeX Live 2017 updmap script must explicitly specifying either so-called system mode (updmap-sys) or user mode (updmap-user)
NOTE file map pscyr2.map used only with (obsolete) dvipdfm, no more need to enable

testing

mkdir test
cp $DEST_DIR/doc/fonts/pscyr/fonts-ex.tex test/
cd test
latex fonts-ex.tex
dvips fonts-ex.dvi
pdflatex fonts-ex.tex
pdffonts fonts-ex.pdf
$ kpsewhich psfonts.map   # for dvips
          /opt/texlive/2024/texmf-var/fonts/map/dvips/updmap/psfonts.map     # fonts installed as admin
/home/musinsky/.texlive2024/texmf-var/fonts/map/dvips/updmap/psfonts.map     # fonts installed as user
$ kpsewhich pdftex.map    # for pdftex
          /opt/texlive/2024/texmf-var/fonts/map/pdftex/updmap/pdftex.map     # fonts installed as admin
/home/musinsky/.texlive2024/texmf-var/fonts/map/pdftex/updmap/pdftex.map     # fonts installed as user

$ grep faqr6a $(kpsewhich psfonts.map)
faqr6a AntiquaPSCyr-Regular " T2AEncoding ReEncodeFont " <t2a.enc <antiq6.pfb
$ grep faqr6a $(kpsewhich pdftex.map)
faqr6a AntiquaPSCyr-Regular " T2AEncoding ReEncodeFont " <t2a.enc <antiq6.pfb
$ grep PSCyr $(kpsewhich pdftex.map) | wc -l
107

LaTeX

UTF-8

The LaTeX support of utf8 is fairly specific: it includes only a limited range of unicode input characters. It only defines those symbols that are known to be available with the current font encoding. Extended UTF-8 (ucs) input encoding support for LaTeX use the utf8x option to define more character combinations, but is not officially supported and is unmaintained ?!

\usepackage[utf8]{inputenc}   % or utf8x if really needed

With XeTeX and LuaTeX (best way to deal with unicode) the inputenc package is no longer needed. Both engines support UTF-8 directly.

NOTE LaTeX2e News Issue 28 (2018-04): UTF-8 is the new default input encoding. This means that with new documents one can assume UTF-8 input and it is no longer required to always specify \usepackage[utf8]{inputenc}. But if this line is present it will not hurt either.

Fonts

Bitmap (raster) fonts consist of a matrix of dots or pixels representing the image of each glyph in each face and size, are faster and easier to use in computer code, but non-scalable. Bitmap fonts look best at their native pixel size. At non-native sizes, many text rendering systems perform resampling, more advanced systems perform anti-aliasing.

Vector (outline) fonts use Bezier curves, drawing instructions and mathematical formulae to describe each glyph, which make the character outlines scalable to any size, are more complicated to render on screen than bitmap fonts. Vector fonts store instructions in the form of lines and curves of how to draw the image rather than storing the image itself. Most fonts seen and used on computers are Vector (outline) fonts. Examples are PostScript Type 1 and Type 3 fonts, TrueType and OpenType.

Type1 (.pfb, .pfa, .afm) fonts were developed by Adobe, which uses PostScript file format to encode font information. The glyphs are outline fonts described with cubic Bezier curves.
TrueType (.ttf) is a font system originally developed by Apple. It was intended to replace Type1 fonts, unlike them, glyphs are described with quadratic Bezier curves.
OpenType (.otf) is a smartfont system designed by Adobe and Microsoft. OpenType fonts contain outlines in either the TrueType or Type1 format together with a wide range of metadata.

Metafont (stroke fonts) use a series of specified lines and additional information to define the profile, or size and shape of the line in a specific face, which together describe the appearance of the glyph. Metafont font is primarily made up of strokes with finite-width pens, along with filled regions, describes the pen paths. Like Type1, TrueType or OpenType fonts, it is a vector font description system. Fonts are described in terms of curves and lines (source of font .mf) with associated font metric (.tfm), but generating the bitmap fonts (.pk), that can be embedded into e.g. PostScript. Metafont was devised by Donald Knuth as counterpart to his TeX typesetting system. Today, the role of Metafont is diminishing. Many people choose to use Type1 fonts almost entirely. In fact, with PostScript alternatives to the Computer Modern Math fonts now available, it's possible to use TeX without using MetaFont fonts at all.

MetaPost uses a language based on that of Metafont to produce precise technical, advanced illustrations. Its output is vector (scalable) PostScript or SVG, rather than the bitmaps Metafont creates.

The advance of publishing technology (PostScript, PDF, laser printers) has reduced the need for bitmap fonts. The preferred formats are now vector (outline) fonts such as Type1, TrueType, or OpenType, which can be rendered efficiently at arbitrary resolution and using sophisticated anti-aliasing techniques by printer firmware or on-screen document viewers. In LaTeX are available Type1 fonts, modern TeX compilers (such XeTeX and LuaTeX) allow documents to use OpenType or TrueType fonts.

LaTeX fonts

Computer Modern (CM) is the family of typefaces used by default by the typesetting program TeX. The base fonts are distributed as Metafont source (generating the bitmap fonts). Best is to use vector (outline) fonts, several projects have ported the CM fonts into such formats. PostScript Type1 versions of Computer Modern are available in the AMS fonts distribution (transformed by BlueSky and donated to the American Mathematical Society under Open Font License). It is found in most standard TeX distributions.

Latin Modern (LM) implementation is now standard in the TeX community and was made through a Metafont/MetaPost derivative called MetaType1. It was derived from the AMS/BlueSky Type1 fonts, which were converted back into outline-based MetaType1 programs, from which then the extended Type1 and OpenType Latin Modern fonts were developed. On screen display of the Latin Modern fonts can result in a less even display of kerning and character heights than is the case with the AMS/BlueSky fonts (involved roundtrip conversion process). Latin Modern Math fonts is available as Type 1 and as OpenType format (XeTeX or LuaTeX).

LaTeX Font encoding

The default LaTeX font encoding is OT1, the encoding of the original CM (Computer Modern) TeX text fonts. It contains only 128 characters, many from ASCII. The AMS fonts are Type1 versions of Computer Modern. Output looks perfect, but has some limitations for non-English (hyphenation, search in PDF, some Latin letters, not to mention about Greek or Cyrillic).

EC (Extended Cork, Extended CM, European CM) fonts in T1 encoding contains 256 characters for most of the west and east European languages based on Latin script. Fonts are available in Type1 format, as part of the CM-Super bundle.

LH font set contains letters necessary to typeset documents in languages using Cyrillic script. Because of the large number of Cyrillic glyphs, they are arranged into four font encodings: T2A, T2B, T2C, and X2. Fonts, in the standard T2* and X2 encodings, are available in Type1 format, in the CM-Super family of fonts.

CM, EC or LH fonts are bitmaps fonts. It is best to use vector Type1 fonts exclusively to produce documents that display well. Modern TeX installations will be setup (will be trying) so that this happens automatically. Default Computer Modern font does not support T1 or T2. Collection of Type1 fonts with T1 encoding support (most widely used today) is Latin Modern (lm). Maybe also to use CM-Super (cm-super) family of fonts. Booth fonts family have Latin support, but Cyrillic letters contain only CM-Super, not Latin Modern.

English

For only English you do not need a specific font encoding (is uses default OT1) and LaTeX automatically uses AMS (Type1 Computer Modern) fonts.

AMS (default) Latin Modern (in special cases [2])
\documentclass{article}



\begin{document}
Test $\sim$ m$^{square}$ in \LaTeX
\end{document}
\documentclass{article}

\usepackage{lmodern}

\begin{document}
Test $\sim$ m$^{square}$ in \LaTeX
\end{document}

Slovak

Pre slovencinu, cestinu, resp. neanglicke jazyky sa pouziva Multilingual support (babel) for Plain TeX or LaTeX. Balik pre podporu slovenciny Babel Slovak (babel-slovak) sa postara (okrem ineho) o slovenske popisy v dokumente, t.j. nie "Chapter, Figure" ale "Kapitola, Obrazok" atd. Zastaraly balik CSLaTeX (posledna verzia z 2012-10) sa uz dalej neodporuca pouzivat.

Pouzivanim EC (CM fonty v T1 kodovani) fontov sa situaciu v LaTeX zlepsila. Tieto fonty sa nacitavaju implicitne (ako bitmap) pri pouzivani babel s T1 kodovanim. Typograficka kvalita pre ceske a slovenske dokumenty vsak nie je uspokojiva a preto ich pouzivanie nie je odporucane. Neskor bola vytvorena cela skupina Type1 fontov CM-Super, ktora pokryva cele mnoziny EC, LH a inych fontov. Ani CM-Super vsak nedosahuje takych kvalit ako AMS (Type1 Computer Modern), napriek tomu su dobre pouzitelne, zrovnatelne. Bez pouzitia \usepackage{cmap} v PDF dokumente s EC bitmap fonts (a T1 kodovanim) nefunguje vyhladavanie ani kopirovanie.

Nedostupnost Latin (T1 kodovanie) fontov v kvalite podobnej implicitnych Computer Modern fontov vo vektorovom formate Type1 (ktore davaju vyborny vysledok, ale nemaju podporu T1 kodovania) priviedla k vytvoreniu fontov Latin Modern (LM), ktore vyriesili rozne problemy (vid nizsie) a vytvaraju vynikajuci PDF vystup s plnou podporou vsetkych znakov latinskej abecedy. Dosahuju dokonca lepsie vysledky ako Type1 verzia CSfonts (specialne vytvorene CSTeX zdruzenim). Na vyvoji LM fontov sa podiela aj CSTUG a v sucasnosti je to najlepsia volba pre sadzbu ceskych a slovenskych textov do vektoroveho (PDF) formatu. ConTeXt dokonca pouziva Latin Modern ako default fonts, namiesto Computer Modern pre vsetky (latin) jazyky.

Pri pouzivani T1 kodovania s inymi (nie Latin Modern alebo CM-Super) skupinami fontov, napr. \usepackage{times} , nastavaju specificke problemy s niektorymi pismenami (v slovencine napr. pre ď, ť, ľ je diakriticke znamienko umiestnene za medzerou, kerning problem) a vyhladavanim, kopirovanim priamo v PDF subore. Riesenim moze byt pouzitie ineho kodovania \usepackage[IL2]{fontenc} , ktore bolo vytvorene v ramci CSLaTeX projektu spolu s CSfonts. Kodovanie IL2, ktore vnutorne koduje do ISO 8859-2 (alias Latin-2), je vyladene pre podporu cestiny, slovenciny. Latin Modern ako aj CM-Super fonty s T1 kodovanim funguju bezproblematicky (vyhladavanie, kopirovanie priamo v PDF dokumentoch).

Pre slovencinu, cestinu, resp. v pripade pouzitia T1 kodovania, musi byt vzdy nainstalovany balik ec (bitmapove EC fonty) a to aj v pripade, ze budeme pouzivat vektorove fonty (Latin Modern alebo CM-Super).

LaTeX (TeX Live 2024) v pripade T1 kodovania automaticky pouzije CM-Super fonty, ak by nahodou neboli nainstalovane, tak pouzije bitmapove EC fonty. Pre pouzitie Latin Modern je potrebne explicitne pouzit tento balik \usepackage{lmodern} . Predpoklada sa skora zamena pouzitia lm ako implicitnych fontov namiesto cm-super. POZOR V pripade ak sa explicitne nepouzije \usepackage[T1]{fontenc} , tak sa nepouzije T1 kodovanie (napriek pouzitiu babel so slovencinou alebo cestinou), ale OT1. Dosledkom toho sa vygeneruje dokument s AMS fontami (original Type1 Computer Modern), a teda vzniknu vyssie spomenute problemy (kerning, vyhladavanie).

Latin Modern (recommended) CM-Super (default)
\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english,slovak]{babel}

\usepackage{lmodern}

\begin{document}
Skúška $\sim$ m$^{\check{s}tvorcov\acute{y}}$ v \LaTeX{}u
\end{document}
\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english,slovak]{babel}



\begin{document}
Skúška $\sim$ m$^{\check{s}tvorcov\acute{y}}$ v \LaTeX{}u
\end{document}
summarum

Pri pouzivani slovenciny (cestiny) v LaTeX pracujeme s T1 kodovanim, implicitne sa pouziju vektorove cm-super fonts (ak nie su nainstalovane, tak sa pouziju bitmap ec fonts). Najlepsi vysledok vsak dosiahneme pouzitim lm fonts. Pomocou balikov babel-slovak a hyphen-slovak sa postarame a spravne popisy a delenie slov v dokumente.

math mode

Slovenske (ceske) pismenka sa v math mode nemaju pouzivat, preto logicky ani nie su v matematickej italike. V pripade nutnosti pouzivat akcent v math mode ($k\hat{o}\check{n}$ = kôň).

uvodzovky

Priamo pisanim v UTF-8 kodovani, slovenske „dvojite“ uvodzovky („ U+201E, “ U+201C) alebo pomocou makra \uv (obsiahnuteho v babel-slovak), slovenske \uv{dvojite} uvodzovky

\def\uv#1{\clqq#1\crqq}
vlna

Vygenerovanie nezalomitelnych medzier ( ~ ) pomocou programu vlna

$ vlna -l latex.tex

Existuje aj automaticke doplnovanie behom prekladu dokumentu \usepackage{encxvlna} , vyzaduju vsak manualne konfigurovanie encTeX, co sposobuje problemy obzvlast s prenositelnostou takeho LaTeX dokumentu.

Russian

Пакет cyrillic поддерживает кириллицу в LaTeX, он включает набор кириллических кодировок для inputenc. Для кодирования шрифтов в формате T2(A) и решения разных проблем поддержки набора кириллицы (BibTeX или русский текст в математической моде) используется пакет t2. Семейство кириллических (растровых) шрифтов, согласующихся с базовыми шрифтами Computer Modern, с поддержкой T2A кодирования, доступно в составе пакета lh.

Векторные (Type1) шрифты для LaTeX доступны в семействе CM-Super или PSCyr. К сожалению, кириллица не была включена в состав Latin Modern шрифтов (существуют шрифты Cyrillic modern, но похоже они уже больше не поддерживаются, последняя версия из 2014-12). cm-super наиболее популярные векторные шрифты, кроме того они включены состав любого дистрибутива LaTeX. Из за лицензионных проблем пакет с шрифтами PSCyr, наоборот, отсутствует в дистрибутивах LaTeX, кроме того он больше не поддерживается и не развивается.

CM-Super (default) PSCyr (only if installed)
\documentclass{article}

\usepackage{mathtext}       % must be before fontenc

\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc} % must be after fontenc
\usepackage[english,russian]{babel}



\begin{document}
Проба $\sim$ m$^{квадратный}$ на \LaTeX{}е
\end{document}
\documentclass{article}

\usepackage{mathtext}       % must be before fontenc

\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc} % must be after fontenc
\usepackage[english,russian]{babel}

\usepackage{pscyr}

\begin{document}
Проба $\sim$ m$^{квадратный}$ на \LaTeX{}е
\end{document}