issue215:latex
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue215:latex [2025/03/29 14:54] – créée auntiee | issue215:latex [2025/03/31 10:43] (Version actuelle) – auntiee | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | Welcome back to Full Circle and to Latex. This time, I am going to explain a few ways to install new packages to Latex on Linux. My “development” machine runs Mint 22.1, which is a Ubuntu derivative. This information is to alert you to the possibility the locations of my files on my machine may not match the locations of the same files on your machine. | + | **Welcome back to Full Circle and to Latex. This time, I am going to explain a few ways to install new packages to Latex on Linux. My “development” machine runs Mint 22.1, which is a Ubuntu derivative. This information is to alert you to the possibility the locations of my files on my machine may not match the locations of the same files on your machine. |
In last month’s column, I reviewed the history of Tex and indicated why it was written using packages. In addition to the very limited computing resources available when it was developed, the package structure points out most people who write have specialized needs. They are primarily mathematicians or chemists or chefs or translators or whatever. Most people do not need or use all the tools available in Latex or word processors. Most use a set of the same features in almost every document. With Tex / Latex, it is easy to make a template that includes all of the required packages and then generate the same kind of document every time. For example, if you never use graphs in documents then do not fill up computer memory with software that generates graphs. | In last month’s column, I reviewed the history of Tex and indicated why it was written using packages. In addition to the very limited computing resources available when it was developed, the package structure points out most people who write have specialized needs. They are primarily mathematicians or chemists or chefs or translators or whatever. Most people do not need or use all the tools available in Latex or word processors. Most use a set of the same features in almost every document. With Tex / Latex, it is easy to make a template that includes all of the required packages and then generate the same kind of document every time. For example, if you never use graphs in documents then do not fill up computer memory with software that generates graphs. | ||
- | There are a few thousand packages described in the two volumes of The Latex Companion (ISBN 978-0-13-465894-0). There are many more packages available at ctan.org. You should be able to find at least one package that will help you get the result you want. First you need to know if a desired package is already installed. | + | There are a few thousand packages described in the two volumes of The Latex Companion (ISBN 978-0-13-465894-0). There are many more packages available at ctan.org. You should be able to find at least one package that will help you get the result you want. First you need to know if a desired package is already installed.** |
- | I use a tool to help me find files. The command is “locate”. If I remember correctly it is not part of recent standard Linux installations. If it does not exist on your system, it is a very small bit of code, easy to install from a terminal using apt or whatever method your operating system uses. It searches a database of file names so, before you use it the first time, type “sudo updatedb”. The locate database should be updated regularly. It is a good candidate for the root cron. Once the database is built or updated you can use locate to find the package you want to use. | + | Bienvenue dans le Full Circle et dans LaTeX. Cette fois, je vais vous expliquer comment installer de nouveaux paquets pour LaTeX sous Linux. Ma machine de « développement » utilise Mint 22.1, un dérivé d' |
+ | |||
+ | Dans la chronique du mois dernier, j'ai passé en revue l' | ||
+ | |||
+ | Plusieurs milliers de paquets sont décrits dans les deux volumes de The LaTeX Companion (ISBN 978-0-13-465894-0). De nombreux autres paquets sont disponibles sur ctan.org. Vous devriez trouver au moins un paquet qui vous permettra d' | ||
+ | |||
+ | |||
+ | **I use a tool to help me find files. The command is “locate”. If I remember correctly it is not part of recent standard Linux installations. If it does not exist on your system, it is a very small bit of code, easy to install from a terminal using apt or whatever method your operating system uses. It searches a database of file names so, before you use it the first time, type “sudo updatedb”. The locate database should be updated regularly. It is a good candidate for the root cron. Once the database is built or updated you can use locate to find the package you want to use. | ||
Another way to find out if the package you need has been installed is to search for it using tlmgr (TexLive manager). You need to know the name of the package so do a search at CTAN to find a package that fits your needs. On the command line, type tlmgr info package-name. It takes a few seconds and then generates several lines of information about the package. You could also use locate or find to do the same task. | Another way to find out if the package you need has been installed is to search for it using tlmgr (TexLive manager). You need to know the name of the package so do a search at CTAN to find a package that fits your needs. On the command line, type tlmgr info package-name. It takes a few seconds and then generates several lines of information about the package. You could also use locate or find to do the same task. | ||
- | If you have use of tlmgr, it will normally do the work necessary to install any extra package you need. It is similar to apt (or any standard system upgrading and installation program). An easy way to check if tlmgr is installed and/or usable is to run tlmgr update –list. It will go through the installed packages on your device and list all those which need to be updated. Since it checks your complete TexLive/ | + | If you have use of tlmgr, it will normally do the work necessary to install any extra package you need. It is similar to apt (or any standard system upgrading and installation program). An easy way to check if tlmgr is installed and/or usable is to run tlmgr update –list. It will go through the installed packages on your device and list all those which need to be updated. Since it checks your complete TexLive/ |
+ | |||
+ | J' | ||
+ | |||
+ | Une autre façon de savoir si le paquet dont vous avez besoin est installé, c'est de le rechercher avec tlmgr (gestionnaire TexLive). Vous devez connaître le nom du paquet, donc, effectuez une recherche sur CTAN pour trouver un paquet qui correspond à vos besoins. Sur la ligne de commande, saisissez « tlmgr info nom-paquet ». L' | ||
+ | |||
+ | Si vous utilisez tlmgr, il effectuera normalement l' | ||
- | Once you have done a couple of searches for Latex files you will see the general structure of the tex directory tree. If you record the location of the major file groups, you may decide you do not need to use locate. I use locate because it is easy for me. | + | **Once you have done a couple of searches for Latex files you will see the general structure of the tex directory tree. If you record the location of the major file groups, you may decide you do not need to use locate. I use locate because it is easy for me. |
On my Mint system, Latex packages tend to get installed in one of three places, either in / | On my Mint system, Latex packages tend to get installed in one of three places, either in / | ||
Ligne 19: | Ligne 33: | ||
If I use TexStudio (which I usually do), then I can see immediately if a new package is required. When I type \usepackage{ TexStudio shows me a list of all the packages available on my system. Obviously if I want to use a package not on the list I must install it before the compile will be error-free. Then I use tlmgr in a terminal to install it: | If I use TexStudio (which I usually do), then I can see immediately if a new package is required. When I type \usepackage{ TexStudio shows me a list of all the packages available on my system. Obviously if I want to use a package not on the list I must install it before the compile will be error-free. Then I use tlmgr in a terminal to install it: | ||
- | tlmgr install name-of-desired-package. | + | tlmgr install name-of-desired-package.** |
- | Sometimes the package on ctan.org is not structured in a way that tlmgr can use. This seems to happen most frequently with old packages. That is when the locate utility I mentioned becomes useful. Most packages add one (occasionally more than one) style file (.sty) to the tex directories. Some packages add a class file (.cls) instead. Here is the process I have used to install old packages that will not install with tlmgr: | + | Après avoir effectué quelques recherches de fichiers LaTeX, vous verrez la structure générale de l' |
+ | |||
+ | Sur mon système Mint, les paquets LaTeX sont généralement installés à l'un des trois emplacements suivants : / | ||
+ | |||
+ | Que se passe-t-il si vous utilisez la commande usepackage {nom du paquet souhaité} et que le paquet n'est pas installé ? | ||
+ | |||
+ | Si j' | ||
+ | |||
+ | tlmgr install nom-du-paquet-souhaité. | ||
+ | |||
+ | |||
+ | **Sometimes the package on ctan.org is not structured in a way that tlmgr can use. This seems to happen most frequently with old packages. That is when the locate utility I mentioned becomes useful. Most packages add one (occasionally more than one) style file (.sty) to the tex directories. Some packages add a class file (.cls) instead. Here is the process I have used to install old packages that will not install with tlmgr: | ||
• Download the package zip from ctan.org. | • Download the package zip from ctan.org. | ||
• Unpack the zip file and read all the documentation if it exists. This will tell me two things: 1) will the package do what I need and 2) is there anything special or complicated about the installation. | • Unpack the zip file and read all the documentation if it exists. This will tell me two things: 1) will the package do what I need and 2) is there anything special or complicated about the installation. | ||
Ligne 31: | Ligne 56: | ||
• I make a new directory in the part of the tree that has the other .sty /. cls directories. I name this new directory the name of the package. | • I make a new directory in the part of the tree that has the other .sty /. cls directories. I name this new directory the name of the package. | ||
• I copy the .sty / .cls file into the new directory. | • I copy the .sty / .cls file into the new directory. | ||
- | • I run texhash to rebuild the Tex directory database. | + | • I run texhash to rebuild the Tex directory database.** |
- | The instructions from WikiBooks (2022) for installing new packages involve these steps: | + | Il arrive que le paquet sur ctan.org ne soit pas structuré de manière à être utilisable par tlmgr. Cela semble se produire le plus souvent avec les anciens paquets. C'est alors que l' |
+ | • Téléchargez le fichier zip du paquet depuis ctan.org. | ||
+ | • Décompressez le fichier zip et lisez toute la documentation, | ||
+ | |||
+ | Il existe une page WikiBooks intitulée LaTeX_Installing_Extra_Packages, | ||
+ | |||
+ | Certains anciens paquets nécessitent les quatre premières étapes du processus listé dans WikiBooks et présenté ci-dessous. J' | ||
+ | ••J' | ||
+ | ••Je crée un nouveau répertoire dans la partie de l' | ||
+ | ••Je copie le fichier .sty/.cls dans le nouveau répertoire. | ||
+ | ••J' | ||
+ | |||
+ | |||
+ | **The instructions from WikiBooks (2022) for installing new packages involve these steps: | ||
• Extract the files. Run Latex on the supplied ins file. (See Comments below.) | • Extract the files. Run Latex on the supplied ins file. (See Comments below.) | ||
• Generate the documentation. Run Latex on the .dtx file. This will make a dvi file or a pdf if you have pdfLatex installed. (See Comments below.) | • Generate the documentation. Run Latex on the .dtx file. This will make a dvi file or a pdf if you have pdfLatex installed. (See Comments below.) | ||
Ligne 40: | Ligne 78: | ||
• If the installation involved fonts, you also need to update the font map. Fonts can be installed in the system-wide directory and/or in the local (personal) directory. There are two different ways to update the Latex font map. (The newfont.map file will be provided with the font package.) | • If the installation involved fonts, you also need to update the font map. Fonts can be installed in the system-wide directory and/or in the local (personal) directory. There are two different ways to update the Latex font map. (The newfont.map file will be provided with the font package.) | ||
- | System-wide: | + | System-wide: |
- | Local: I direct you to www.tug.org/ | + | Les instructions de WikiBooks (2022) pour l' |
+ | ••Extraire les fichiers. Exécuter LaTeX sur le fichier ins fourni. (Voir les commentaires ci-dessous.) | ||
+ | ••Générer la documentation. Exécuter LaTeX sur le fichier .dtx. Cela créera un fichier DVI ou un PDF si pdfLatex est installé. (Voir les commentaires ci-dessous.) | ||
+ | ••Installer les fichiers dans un répertoire local dans la partie ~/texmf de l' | ||
+ | ••Mettre à jour l' | ||
+ | ••Si l' | ||
+ | |||
+ | Sur tout le système : updmap-sys --force --enable Map=newfont.map | ||
+ | |||
+ | |||
+ | **Local: I direct you to www.tug.org/ | ||
Whether installed locally or system-wide, | Whether installed locally or system-wide, | ||
+ | |||
Comments on the Four / Five Step process above. | Comments on the Four / Five Step process above. | ||
Ligne 51: | Ligne 100: | ||
• texhash | • texhash | ||
- | If you use tlmgr update - -all the mktexslr command mentioned with fonts runs automatically once the update is finished. That is very convenient. I also run sudo texhash after the update just to be certain. | + | If you use tlmgr update - -all the mktexslr command mentioned with fonts runs automatically once the update is finished. That is very convenient. I also run sudo texhash after the update just to be certain.** |
- | This has been sufficient for almost all the packages I have installed while writing these columns. Unlike the Wikibooks 5 Steps, I have used this two step process for font packages with no problems. | + | En local : Je vous invite à consulter www.tug.org/ |
+ | |||
+ | Que les polices soient installées localement ou à l' | ||
+ | |||
+ | Commentaires sur le processus en quatre ou cinq étapes ci-dessus. | ||
+ | |||
+ | Les étapes de Wikibooks sont inutilement compliquées. Elles étaient peut-être nécessaires par le passé. Pour la plupart des paquets, l' | ||
+ | ••Dans un terminal, tlmgr install nom-du-paquet | ||
+ | ••texhash | ||
+ | |||
+ | Si vous utilisez tlmgr update --all, la commande mktexslr mentionnée pour les polices s' | ||
+ | |||
+ | |||
+ | **This has been sufficient for almost all the packages I have installed while writing these columns. Unlike the Wikibooks 5 Steps, I have used this two step process for font packages with no problems. | ||
If you wish to (or need to) use the manual process instead of using tlmgr, then save yourself time and energy and read the documentation for the package. Usually packages built in the last ten years are complete with PDF documentation, | If you wish to (or need to) use the manual process instead of using tlmgr, then save yourself time and energy and read the documentation for the package. Usually packages built in the last ten years are complete with PDF documentation, | ||
- | That is enough for this column. I hope you try to add a few new packages in the near future. Let me know if you have questions or comments. I will talk to you next time about more packages from ctan. | + | That is enough for this column. I hope you try to add a few new packages in the near future. Let me know if you have questions or comments. I will talk to you next time about more packages from ctan.** |
+ | |||
+ | Cela a été suffisant pour la quasi-totalité des paquets que j'ai installés lors de la rédaction de ces articles. Contrairement aux 5 étapes de Wikibooks, j'ai utilisé sans problème ce processus en deux étapes pour les paquets de polices. | ||
+ | |||
+ | Si vous souhaitez (ou devez) utiliser la procédure manuelle plutôt que tlmgr, gagnez du temps et de l' | ||
+ | |||
+ | Cela suffit pour cet article. J' | ||
issue215/latex.1743256474.txt.gz · Dernière modification : 2025/03/29 14:54 de auntiee