Skip to content

Commit

Permalink
More on migration.
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier committed Nov 10, 2024
1 parent eaa51bc commit ad60482
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 8 deletions.
46 changes: 39 additions & 7 deletions docs/guides/migrating-pdftex-luatex.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,46 @@
# Migrating from pdfTeX to LuaTeX

**Draft**
**Draft**

Documents shuld be encoded in UTF-8.
> *Improve this page! Feel free to draft a pull request [on GitHib](https://github.com/latex3/babel/tree/docs/docs)*.
Now the recommended engine is `luatex`, here are some hints on how to
migrate a LaTeX document from `pdftex` to `luatex`.

## Input encoding

Documents should be encoded in UTF-8. The package `luainputenc` can
help if you are in a hurry, but its use is discouraged. Many editors
provide options to set the document encoding.

## Fonts

The package `fontenc` must be removed (as well as `inputenc`). With
this single change, languages in the Latin script should work if the
font is the default one. If you are using a package to set the font,
you may need to replace it by `fontspec` calls. There is no rule – some
of these packages are compatible and some are not.
font is the default one. A minimal example in `pdftex` is:
```tex
\documentclass[french]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\begin{document}
Plus ça change, plus c'est la même chose!
\end{document}
```
which in `luatex` becomes:
```tex
\documentclass[french]{article}
\usepackage{babel}
\begin{document}
Plus ça change, plus c'est la même chose!
\end{document}
```

If you are using a package to set the font, you may need to replace it
by `fontspec` calls. There is no rule – some of these packages are
compatible and some are not. You can find an example comparing `pdftex`
and `luatex` [here](https://tex.stackexchange.com/a/730422/5735).

With languages in non-Latin encodings, you should assign them a font.
A typical modification would be from:
Expand All @@ -31,16 +61,18 @@ to:
...
\end{document}
```
Remember some classes and packages, particularly `beamer`, set the
default family to `sf` instead of `rm`.

## RTL scripts

Migration is a little more involved. See
[Hebrew](https://latex3.github.io/babel/guides/locale-hebrew.html) and
[Arabic](https://latex3.github.io/babel/guides/locale-arabic.html)
[Arabic](https://latex3.github.io/babel/guides/locale-arabic.html).

## Other languages

There is a list of locales
[here](https://latex3.github.io/babel/guides/index-locale.html). You can
find many minimal documents for `luatex`.
find many minimal documents for `luatex`.

2 changes: 2 additions & 0 deletions docs/guides/migrating-xetex-luatex.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

**Draft**

> *Improve this page! Feel free to draft a pull request [on GitHub](https://github.com/latex3/babel/tree/docs/docs)*.
In many languages and scripts, particularly Latin, Greek and Cyrillic,
a document written for `xetex` should work with `luatex` without
changes.
Expand Down
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ case, it's advisable to install TeXLive.)
When to use the old good language files and when `\babelprovide` or `provide=*`.
* [Useful links to tex.strackexchange](guides/useful-links-to-tex.stackexchange.html)
Examples for many languages: Chinese, Arabic, Sanskrit, etc.
* [Migrating from XeTeX to
LuaTeX](https://latex3.github.io/babel/guides/migrating-xetex-luatex.html).
* [Migrating from pdfTeX to
LuaTeX](https://latex3.github.io/babel/guides/migrating-pdftex-luatex.html).

---------------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/news/whats-new-in-babel-24.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ See the following section for an example.
## Spacing in French

Firstly, remember `ini` files are not necessarily a replacement for
`ldf' files. For a complete localization for French, prefer default the
`ldf` files. For a complete localization for French, prefer default the
style by Daniel Flipo. The `ini` locale is mainly intended for French
as a secondary language (although it can also be used as the primary
language, if you like).
Expand Down

0 comments on commit ad60482

Please sign in to comment.