| 1 |
latex-uni8: Universal inputenc, fontenc and babel for pdflatex + lualatex |
| 2 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 3 |
uni8.sty is a LaTeX style file which makes it easy to use input encoding |
| 4 |
(UTF-8 by default, can be changed), fontspec.sty (optional), font |
| 5 |
encoding (T1 if fontspec.sty is not used), babel (English language by |
| 6 |
default), hyphenation, underline (with soul.sty), default text and math |
| 7 |
fonts (Computer Modern or Times) and paper sizes correctly with both |
| 8 |
pdflatex and lualatex. |
| 9 |
|
| 10 |
How to use: |
| 11 |
|
| 12 |
\documentclass{article} |
| 13 |
\usepackage{uni8} |
| 14 |
... |
| 15 |
\begin{document} |
| 16 |
... |
| 17 |
\end{document} |
| 18 |
|
| 19 |
See the project page https://github.com/pts/latex-uni8 for example files |
| 20 |
and the latest updates. |
| 21 |
|
| 22 |
The name uni8 is an abbreviation of: universal UTF-8 and 8-bit input |
| 23 |
encoding. It indicates that uni8.sty can set up UTF-8 (utf8) and legacy |
| 24 |
8-bit input encodings (e.g. latin1, latin2) correctly in many environments |
| 25 |
(pdflatex or lualatex, with or without fontspec.sty, T1 or Unicode font |
| 26 |
encoding). |
| 27 |
|
| 28 |
Limitations: |
| 29 |
|
| 30 |
* \showhyphens doesn't display accented characters correctly in the console |
| 31 |
log. With pdflatex on an UTF-8 console all non-ASCII characters are wrong. |
| 32 |
With lualatex on an UTF-8 console with T1 font encoding some non-ASCII |
| 33 |
characters (e.g. ő and ű) are wrong: the ones which are at a different |
| 34 |
location in Unicode and T1 encoding. |
| 35 |
|
| 36 |
uni8.sty takes care of the following: |
| 37 |
|
| 38 |
* It sets up font families (text: main, sans and mono; also math): Computer |
| 39 |
Modern (implemented using Latin Modern) by default, and it's possible to |
| 40 |
select Times + Helvetica + Courier (implemented using TeX Gyre and mathptmx) |
| 41 |
instead. |
| 42 |
* It sets up input encoding (UTF-8 is the default, it does |
| 43 |
\usepackage[utf8]{inputenc} or a variation of that). |
| 44 |
* It sets the page size based on \documentclass[a4paper]{article} etc. |
| 45 |
* \usepackage[english]{babel} (this includes setting up hyphenation). |
| 46 |
If you want a different language, then do someting like |
| 47 |
\PassOptionsToPackage{hungarian}{babel} before \usepackage{uni8}. |
| 48 |
* \usepackage{soul} (or a variation of it, if available). |
| 49 |
* It makes the \ul command (as defined in soul.sty) should just work with |
| 50 |
footnotes and automatic hyphenation as well. |
| 51 |
* It makes \hyphenation{...} exceptions work properly, even with accented |
| 52 |
characters specified the usual way (encoded with the input encoding, UTF-8 |
| 53 |
by default). (For lualatex, it also makes \patterns{...} work similarly.) |
| 54 |
* It makes sure that magyar.ldf (if \PassOptionsToPackage{hungarian}{babel} |
| 55 |
is used) doesn't print useless warnings about inputenc.sty or t1enc.sty. |
| 56 |
* It sets up font encoding (like T1 encoding with \usepackage{t1enc} if |
| 57 |
needed). |
| 58 |
|
| 59 |
Usage recommendations and best practices: |
| 60 |
|
| 61 |
* Use \usepackage{uni8} with pdflatex it possible. |
| 62 |
* If you need lualatex, probaby you want to use Unicode fonts, thus use |
| 63 |
\usepackage[fontspec]{uni8}. Configure fonts with \fontspec{...} and |
| 64 |
\setmainfont{...} as usual. The default for for uni8 is cm (Latin Modern). |
| 65 |
* \usepackage{uni8} also works with lualatex without fontspec.sty |
| 66 |
(tested on TeX Live 2019), but for simplicity and increased backwards |
| 67 |
compatibility (especially for magyar.ldf), use pdflatex instead of |
| 68 |
lualatex-without-fontspec.sty if possible. The most fragile part of how |
| 69 |
uni8.sty uses lualatex without fontspec.sty is setting up hyphenation |
| 70 |
patterns with the T1 encoding. |
| 71 |
|
| 72 |
Features: |
| 73 |
|
| 74 |
* The default font (\usepackage[font=cm]) families are Computer Modern |
| 75 |
(implemented using Latin Modern) by default. |
| 76 |
* Use \usepackage[font=times] to use Times, Helvetica and Courier font |
| 77 |
families (implemented using TeX Gyre and mathptmx). |
| 78 |
* Use \usepackage[font=old-times] to use Times, Helvetica and Courier as |
| 79 |
text and math default fonts (rather than Latin Modern, which is based on |
| 80 |
Computer Modern). This uses the new old URW-based text fonts with |
| 81 |
times.sty. |
| 82 |
* Use \usepackage[inputenc=latin2] to use ISO-8859-2 input encoding. Most |
| 83 |
users shouldn't need this nowaday, the UTF-8 default is better. |
| 84 |
* Use \usepackage[inputenc=latin1] to use ISO-8859-1 input encoding. Most |
| 85 |
users shouldn't need this nowaday, the UTF-8 default is better. |
| 86 |
* uni8.sty is compatible with hyperref.sty, color.sty and xcolor.sty in both |
| 87 |
pdflatex and lualatex. |
| 88 |
* uni8.sty works with pdflatex, lualatex and latex (with .dvi |
| 89 |
output). |
| 90 |
|
| 91 |
How to install LaTeX on Debian Buster, with TeX Live 2019: |
| 92 |
|
| 93 |
* To get the pdflatex command, run: |
| 94 |
sudo apt-get install texlive-latex-base |
| 95 |
* To get the lualatex command (and the minimal defaults for uni8.sty), run: |
| 96 |
sudo apt-get install texlive-latex-base texlive-luatex |
| 97 |
* To make [fontspec] (eqivalent to \usepackage{fontspec}) work, run: |
| 98 |
sudo apt-get install texlive-latex-base texlive-luatex texlive-latex-recommended |
| 99 |
* To make [font=times] work without [fontspec], run: |
| 100 |
sudo apt-get install texlive-latex-base texlive-latex-recommended tex-gyre |
| 101 |
* To make [font=times] work with [fontspec], run: |
| 102 |
sudo apt-get install texlive-latex-base texlive-luatex fonts-texgyre texlive-latex-recommended |
| 103 |
* To make \usepackage{soul} (automatically done by uni8.sty) work, run: |
| 104 |
sudo apt-get install texlive-latex-base texlive-latex-extra |
| 105 |
* To make \usepackage{lmodern} (automatically done by uni8.sty) work, run: |
| 106 |
sudo apt-get install texlive-latex-base |
| 107 |
* To make \PassOptionsToPackage{english,american,british}{babel} (and the |
| 108 |
corresponding hyphenation) work, run: |
| 109 |
sudo apt-get install texlive-latex-base |
| 110 |
* To make \PassOptionsToPackage{german}{babel} work, run: |
| 111 |
sudo apt-get install texlive-latex-base texlive-lang-german |
| 112 |
* To make \PassOptionsToPackage{spanish}{babel} work, run: |
| 113 |
sudo apt-get install texlive-latex-base texlive-lang-spanish |
| 114 |
* To make \PassOptionsToPackage{french}{babel} work, run: |
| 115 |
sudo apt-get install texlive-latex-base texlive-lang-french |
| 116 |
* To make \PassOptionsToPackage{italian}{babel} work, run: |
| 117 |
sudo apt-get install texlive-latex-base texlive-lang-italian |
| 118 |
* To make \PassOptionsToPackage{hungarian}{babel} (and the corresponding |
| 119 |
hyphenation) work, run: |
| 120 |
sudo apt-get install texlive-latex-base texlive-lang-european |
| 121 |
|
| 122 |
__END__ |