Outils pour utilisateurs

Outils du site


issue220:latex

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
issue220:latex [2025/09/02 07:58] d52frissue220:latex [2025/09/02 08:28] (Version actuelle) d52fr
Ligne 4: Ligne 4:
  
 The next group of packages are for index support. There are many packages that deal with indexes (indices). Part 2 of The Latex Companion (ISBN 978-0-201-36300-5) has a thirty-page chapter called Generating Indexes as well as more than two columns of entries for the word “index” in its own index. This is obviously an important topic in document preparation. Its importance suggests Latex is most often used for documents that require an index: academic papers and non-fiction books.** The next group of packages are for index support. There are many packages that deal with indexes (indices). Part 2 of The Latex Companion (ISBN 978-0-201-36300-5) has a thirty-page chapter called Generating Indexes as well as more than two columns of entries for the word “index” in its own index. This is obviously an important topic in document preparation. Its importance suggests Latex is most often used for documents that require an index: academic papers and non-fiction books.**
 +
 +Un autre mois s'est écoulé et une nouvelle chronique est prévue pour le FCM. Cette fois, je vais aborder les sujets LaTeX sur ctan.org, en commençant par « I ». Ce groupe comprend seize sujets. Cinq d'entre eux concernent les langues ou la documentation associée : islandais, indien (Inde), gaélique irlandais et italien. Quatre sujets traitent spécifiquement des index. Par ordre alphabétique, après l'islandais, le premier sujet est « IDE : environnements de développement intégrés ». Vingt-trois paquets sont répertoriés dans l'IDE, dont quelques-uns sont destinés aux systèmes d'exploitation DOS et OS/2 ; je ne les utiliserai donc pas. J'ignorerai également tous les paquets IDE conçus pour Windows ou Mac. Ces deux conditions éliminent la quasi-totalité des paquets IDE.
 +
 +Le paquet kile pourrait intéresser certains. Il est conçu pour fonctionner avec l'environnement de bureau KDE 4. J'ai trouvé très peu d'informations à son sujet. Kile est disponible sur SourceForge et doit être compilé avec les versions appropriées des bibliothèques KDE, QT, Cmake et le compilateur C++. Il existe un deuxième IDE pour l'environnement KDE, KtexShell. Le CTAN le signale comme obsolète.
 +
 +Le groupe de paquets suivant concerne la prise en charge des index. De nombreux paquets traitent des index. La deuxième partie de The LaTeX Companion (ISBN 978-0-201-36300-5) comporte un chapitre de trente pages intitulé « Génération d'index », ainsi que plus de deux colonnes d'entrées pour le mot « index » dans son propre index. Il s'agit évidemment d'un sujet important dans la préparation de documents. Son importance suggère que LaTeX est le plus souvent utilisé pour les documents nécessitant un index : articles universitaires et ouvrages non-fictionnels.
 +
  
 **One day I hope to write a cookbook using Latex. For now I use Latex to put together teaching materials. One week’s worth of lessons does not need an index. However a semester of weekly lessons should have a table of contents and an index. So I learned how to use one of the available index tools. **One day I hope to write a cookbook using Latex. For now I use Latex to put together teaching materials. One week’s worth of lessons does not need an index. However a semester of weekly lessons should have a table of contents and an index. So I learned how to use one of the available index tools.
Ligne 14: Ligne 21:
  
 On p. 342 the authors give the following advice “You should, therefore, plan an index and develop it along with the main text.” Adding entries for an index after a document has been typed is tedious and will teach you the strengths and weaknesses of Search and Replace. Every term (word, phrase) which will appear in the index has to be coded in the text using \index{the term} before the term.** On p. 342 the authors give the following advice “You should, therefore, plan an index and develop it along with the main text.” Adding entries for an index after a document has been typed is tedious and will teach you the strengths and weaknesses of Search and Replace. Every term (word, phrase) which will appear in the index has to be coded in the text using \index{the term} before the term.**
 +
 +J'espère un jour écrire un livre de recettes avec LaTeX. Pour l'instant, j'utilise LaTeX pour créer du matériel pédagogique. Une semaine de cours n'a pas besoin d'index. En revanche, un semestre de cours hebdomadaires devrait comporter une table des matières et un index. J'ai donc appris à utiliser l'un des outils d'indexation disponibles.
 +
 +Les bases de la création d'un index avec LaTeX sont clairement expliquées dans la partie 2 du LaTeX Companion. Si cela vous intéresse, je vous suggère de suivre les étapes des pages 345 et 346.
 +
 +« Inclure la commande suivante dans le préambule : \usepackage{makeidx}
 +Inclure la commande suivante dans le préambule : \makeindex
 +Insérer la commande \printindex à l'endroit où vous souhaitez que l'index apparaisse (généralement à la fin du document).»
 +
 +P. 342, les auteurs donnent le conseil suivant : « Il est donc conseillé de planifier un index et de le développer en même temps que le texte principal. » Ajouter des entrées à un index après la saisie d'un document est fastidieux et vous permettra de comprendre les avantages et les inconvénients de la fonction Rechercher/Remplacer. Chaque terme (mot, expression) qui apparaît dans l'index doit être codé dans le texte en utilisant \index{le terme} avant le terme.
 +
  
 **To explain using the file from last issue, if I wish there to be an index entry for the word “Whitefoot” pointing to p. 5, then I need to write \index{Whitefoot} somewhere on p. 5. If I want a Whitefoot entry in the index pointing to a different page, then I need to add \index{Whitefoot} on the appropriate page. As I said, Search and Replace becomes very useful if you wish to build an index after a document has been completed. It may also be the smart way to build an index. Search and Replace will find all appearances of an entry, human beings will miss one or more if searching by eye. **To explain using the file from last issue, if I wish there to be an index entry for the word “Whitefoot” pointing to p. 5, then I need to write \index{Whitefoot} somewhere on p. 5. If I want a Whitefoot entry in the index pointing to a different page, then I need to add \index{Whitefoot} on the appropriate page. As I said, Search and Replace becomes very useful if you wish to build an index after a document has been completed. It may also be the smart way to build an index. Search and Replace will find all appearances of an entry, human beings will miss one or more if searching by eye.
  
 Some word processors have a feature called a concordance used with their indexing tools. The concordance is a list of words which should appear in the index. The word processor searches for every occurrence of each word and codes it so it appears in the index. CTAN has a package called addindex which seems to do the same. However it is an old package and was designed to run on a Sun Sparc workstation. It may not perform on our machines. There are some specialized tools on CTAN which can build, for example, an index of citations, or an index of chemical substances, but I have not found anything similar to the word processor concordance feature for Latex. It is possible there is such a package among the 170 hits at ctan using the term index. Perhaps one of you knows the name of such a package.** Some word processors have a feature called a concordance used with their indexing tools. The concordance is a list of words which should appear in the index. The word processor searches for every occurrence of each word and codes it so it appears in the index. CTAN has a package called addindex which seems to do the same. However it is an old package and was designed to run on a Sun Sparc workstation. It may not perform on our machines. There are some specialized tools on CTAN which can build, for example, an index of citations, or an index of chemical substances, but I have not found anything similar to the word processor concordance feature for Latex. It is possible there is such a package among the 170 hits at ctan using the term index. Perhaps one of you knows the name of such a package.**
 +
 +Pour l'expliquer en utilisant le fichier du dernier numéro, si je souhaite qu'une entrée d'index pour le mot « Whitefoot » pointe vers la page 5, je dois écrire \index{Whitefoot} quelque part à la page 5. Si je souhaite qu'une entrée Whitefoot pointe vers une autre page, je dois ajouter \index{Whitefoot} sur la page correspondante. Comme je l'ai dit, la fonction Rechercher/Remplacer est très utile pour créer un index après la création d'un document. C'est peut-être aussi une méthode intelligente. La fonction Rechercher/Remplacer permet de retrouver toutes les occurrences d'une entrée ; une recherche visuelle en manquera une ou plusieurs.
 +
 +Certains traitements de texte intègrent une fonction appelée concordance. Cette concordance est une liste de mots qui doivent apparaître dans l'index. Le traitement de texte recherche chaque occurrence de chaque mot et la code pour qu'elle apparaisse dans l'index. CTAN propose un paquet appelé addindex qui semble faire la même chose. Cependant, il s'agit d'un paquet ancien, conçu pour fonctionner sur une station de travail Sun Sparc. Il se peut que cela ne fonctionne pas sur nos machines. CTAN propose des outils spécialisés permettant de créer, par exemple, un index de citations ou un index de substances chimiques, mais, dans LaTeX, je n'ai rien trouvé de similaire à la fonction de concordance de traitement de texte. Il est possible qu'un tel paquet existe parmi les 170 résultats de CTAN utilisant le terme index. Peut-être l'un d'entre vous connaît-il le nom de ce paquet.
 +
  
 **Moving to another topic, the Invoice area has thirteen packages listed. Two are specialized for use in Belgium, one for Venezuela, one for France, and one for the U.S. (Doing this search I learned there are different standard invoice forms in different countries.) The package invoice is in English. The introduction says “the package may be used for generating invoices. The package can deal with invisible expense items and deductions, output may be presented in any of 10 different languages.” It is part of the standard install of TexLive so I am able to use it without installing anything. **Moving to another topic, the Invoice area has thirteen packages listed. Two are specialized for use in Belgium, one for Venezuela, one for France, and one for the U.S. (Doing this search I learned there are different standard invoice forms in different countries.) The package invoice is in English. The introduction says “the package may be used for generating invoices. The package can deal with invisible expense items and deductions, output may be presented in any of 10 different languages.” It is part of the standard install of TexLive so I am able to use it without installing anything.
  
 The documentation says further “the invoice package is basically a tailor-made solution for a consultant who charges fees and claims all sorts of expenses, sometimes working on different assignments for the same client.” It requires the use of the calc and fp packages. (These two packages are installed by default in TexLive.) The invoice package works in its own Latex environment. It does not include any tools for letterhead, addresses, phone numbers, etc. Those items have to be set up in a Latex document letter class. Page 3 of the documentation shows the logical structure of the invoice environment. ** The documentation says further “the invoice package is basically a tailor-made solution for a consultant who charges fees and claims all sorts of expenses, sometimes working on different assignments for the same client.” It requires the use of the calc and fp packages. (These two packages are installed by default in TexLive.) The invoice package works in its own Latex environment. It does not include any tools for letterhead, addresses, phone numbers, etc. Those items have to be set up in a Latex document letter class. Page 3 of the documentation shows the logical structure of the invoice environment. **
 +
 +Passons à un autre sujet : la section Factures répertorie treize paquets. Deux sont spécialement conçus pour la Belgique, un pour le Venezuela, un pour la France et un pour les États-Unis. (En effectuant cette recherche, j'ai découvert qu'il existe différents formulaires de facture standard selon les pays.) Le paquet « invoice » est en anglais. L'introduction indique : « Ce paquet permet de générer des factures. Il peut gérer les dépenses et déductions invisibles, et les résultats peuvent être présentés dans 10 langues différentes.» Il fait partie de l'installation standard de TeXLive, ce qui me permet de l'utiliser sans rien installer.
 +
 +La documentation précise également : « Le paquet invoice est une solution sur mesure pour un consultant qui facture des honoraires et déclare toutes sortes de frais, travaillant parfois sur différentes missions pour le même client.» Il nécessite l'utilisation des paquets calc et fp. (Ces deux paquets sont installés par défaut dans TeXLive.) Le paquet invoice fonctionne dans son propre environnement LaTeX. Il n'inclut aucun outil pour les en-têtes, les adresses, les numéros de téléphone, etc. Ces éléments doivent être configurés dans une classe de document LaTeX « letter ». La page 3 de la documentation montre la structure logique de l'environnement de facturation.
 +
  
 **The invoice environment requires two options: the base currency of the invoice and the tax rate (a number without the percent sign). For example: begin{invoice}{CA\string$}{13}. (If your currency does not use a dollar sign, you can dispense with the \string.) If VAT is included in the price then enter a 0 or there is no VAT, when you start the environment use: \begin{invoice}{CA\string$}{0}. That will remove the VAT entries from the invoice. **The invoice environment requires two options: the base currency of the invoice and the tax rate (a number without the percent sign). For example: begin{invoice}{CA\string$}{13}. (If your currency does not use a dollar sign, you can dispense with the \string.) If VAT is included in the price then enter a 0 or there is no VAT, when you start the environment use: \begin{invoice}{CA\string$}{0}. That will remove the VAT entries from the invoice.
  
 An invoice will contain one or more projects. Each project will have either fees or expenses or both. If both, then fees must come before expenses. Expenses can be billed in either the base currency (called the local currency in the documentation), or a foreign currency, or both. A foreign currency can either be converted before being entered into the invoice or the invoice can calculate the equivalent base currency based on a conversion rate provided by the user. (See accompanying screenshot.)** An invoice will contain one or more projects. Each project will have either fees or expenses or both. If both, then fees must come before expenses. Expenses can be billed in either the base currency (called the local currency in the documentation), or a foreign currency, or both. A foreign currency can either be converted before being entered into the invoice or the invoice can calculate the equivalent base currency based on a conversion rate provided by the user. (See accompanying screenshot.)**
 +
 +L'environnement de facturation requiert deux options : la devise de base de la facture et le taux de taxe (un nombre sans le signe de pourcentage). Par exemple : begin{invoice}{CA\string$}{13}. (Si votre devise n'utilise pas le signe dollar, vous pouvez vous passer de la \string.) Si la TVA est incluse dans le prix, saisissez 0 ; sinon, s'il n'y a pas de TVA, utilisez : \begin{invoice}{CA\string$}{0} au démarrage de l'environnement. Cela supprimera les entrées de TVA de la facture.
 +
 +Une facture contient un ou plusieurs projets. Chaque projet comporte soit des frais, soit des dépenses, soit les deux. Dans ce cas, les frais doivent précéder les dépenses. Les dépenses peuvent être facturées dans la devise de base (appelée devise locale dans la documentation), soit dans une devise étrangère, soit les deux. Une devise étrangère peut être convertie avant d'être saisie dans la facture, soit la facture peut calculer la devise de base équivalente en fonction du taux de conversion fourni par l'utilisateur. (Voir la capture d'écran page 34)
 +
  
 **I think in Europe VAT is the standard term for sales tax. In North America it can have several acronyms. If you want to use some other term, I suggest you save a copy of invoice.sty with another name. Then use a text editor and Search and Replace. I suggest you use a two- or three-letter acronym to replace VAT (perhaps Tax). Using more than three letters might generate errors so be prepared to redo the Search and Replace if replacing VAT with “Sales Tax” causes problems. **I think in Europe VAT is the standard term for sales tax. In North America it can have several acronyms. If you want to use some other term, I suggest you save a copy of invoice.sty with another name. Then use a text editor and Search and Replace. I suggest you use a two- or three-letter acronym to replace VAT (perhaps Tax). Using more than three letters might generate errors so be prepared to redo the Search and Replace if replacing VAT with “Sales Tax” causes problems.
Ligne 32: Ligne 65:
  
 For more complex questions or customization about invoice, please read the well written sixteen-page documentation. ** For more complex questions or customization about invoice, please read the well written sixteen-page documentation. **
 +
 +Je pense qu'en Europe, TVA est le terme standard pour la taxe de vente. En Amérique du Nord, elle peut avoir plusieurs acronymes. Si vous souhaitez utiliser un autre terme, je vous suggère d'enregistrer une copie de invoice.sty sous un autre nom. Ensuite, utilisez un éditeur de texte et la fonction Rechercher/Remplacer. Je vous conseille d'utiliser un acronyme de deux ou trois lettres pour remplacer VAT (par exemple Tax). L'utilisation de plus de trois lettres peut générer des erreurs ; préparez-vous donc à refaire le recherche/remplacer si le remplacement de VAT par « Sales Tax » pose problème.
 +
 +Si vous avez effectué ce rechercher/remplacer, vous devez installer le fichier modifié comme un nouveau paquet. Utilisez le nouveau nom dans l'instruction usepackage du préambule de votre document. Vous pouvez également renommer invoice.sty, puis renommer le fichier modifié en invoice.sty. N'hésitez pas à me faire savoir si ma suggestion de remplacer VAT par un autre nom vous est utile.
 +
 +Pour des questions plus complexes ou pour personnaliser votre facture, veuillez consulter la documentation de seize pages.
 +
  
 **To fill out this issue’s column, I looked at the short list of “J” topics. There are only seven of them. Two have to do with typesetting in Japanese, and four of the remaining five topics deal with specific professional journals. One topic is called “journal personal”, it contains one package “scrjrnl”. It is a document class, not a package to use in an existing document. The initial command is  **To fill out this issue’s column, I looked at the short list of “J” topics. There are only seven of them. Two have to do with typesetting in Japanese, and four of the remaining five topics deal with specific professional journals. One topic is called “journal personal”, it contains one package “scrjrnl”. It is a document class, not a package to use in an existing document. The initial command is 
Ligne 38: Ligne 78:
  
 The documentation is six pages long, half of it shows the commands in the cls file. The other three pages offered very little information that was useful to me. After considerable experimentation, and considerable searching, I found the Github of the author. It has four tex files with accompanying PDF files in four different languages. I copied the commands from the author’s English tex file into a sample file on my machine. The resulting tex file would compile so I have a sample PDF. However the tex file also generated several “undefined control sequence” errors. This error indicates Latex cannot find what it needs to complete the compilation.** The documentation is six pages long, half of it shows the commands in the cls file. The other three pages offered very little information that was useful to me. After considerable experimentation, and considerable searching, I found the Github of the author. It has four tex files with accompanying PDF files in four different languages. I copied the commands from the author’s English tex file into a sample file on my machine. The resulting tex file would compile so I have a sample PDF. However the tex file also generated several “undefined control sequence” errors. This error indicates Latex cannot find what it needs to complete the compilation.**
 +
 +Pour compléter la chronique de ce numéro, j'ai consulté la liste restreinte des sujets en « J ». Il n'y en a que sept. Deux concernent la composition en japonais, et quatre des cinq sujets restants concernent des revues professionnelles spécifiques. L'un d'eux, intitulé « revue personnelle », contient le paquet « scrjrnl ». Il s'agit d'une classe de document, et non d'un paquet à utiliser dans un document existant. La commande initiale est
 +
 +\documentclass{options}{scrjrnl}.
 +
 +La documentation fait six pages, dont la moitié présente les commandes du fichier cls. Les trois autres pages offrent très peu d'informations utiles. Après de nombreuses expérimentations et recherches, j'ai trouvé le Github de l'auteur. Il contient quatre fichiers .tex accompagnés de fichiers PDF en quatre langues différentes. J'ai copié les commandes du fichier .tex anglais de l'auteur dans un fichier d'exemple sur ma machine. Le fichier .tex résultant a été compilé, ce qui m'a permis d'obtenir un exemple PDF. Cependant, le fichier .tex a également généré plusieurs erreurs de « undefined control sequence » (séquence de contrôle indéfinie). Cette erreur indique que LaTeX ne trouve pas ce dont il a besoin pour terminer la compilation.
 +
  
 **I got frustrated trying to learn how to use the scrjrnl package. The Linux Companion was of no assistance and I could not find anything online (other than the author’s Github) which was related to scrjrnl. I may need to learn a lot more about the KOMA-script family of packages before I tackle scrjrnl again. During all this work I did discover another package which might be of use for making a journal or diary or other document with periodic entries. That is a topic for another column. Hope you are enjoying pleasant weather wherever you are.** **I got frustrated trying to learn how to use the scrjrnl package. The Linux Companion was of no assistance and I could not find anything online (other than the author’s Github) which was related to scrjrnl. I may need to learn a lot more about the KOMA-script family of packages before I tackle scrjrnl again. During all this work I did discover another package which might be of use for making a journal or diary or other document with periodic entries. That is a topic for another column. Hope you are enjoying pleasant weather wherever you are.**
 +
 +J'ai été frustré d'essayer d'apprendre à utiliser le paquet scrjrnl. Le LaTeX Companion ne m'a été d'aucune aide et je n'ai rien trouvé en ligne (à part le GitHub de l'auteur) concernant scrjrnl. Il me faudra peut-être en apprendre davantage sur la famille de paquets KOMA-script avant de m'attaquer à nouveau à scrjrnl. Au cours de ce travail, j'ai découvert un autre paquet qui pourrait être utile pour créer un journal, un agenda ou tout autre document avec des entrées périodiques. Ce sera le sujet d'une autre chronique. J'espère que vous profitez du beau temps où que vous soyez.
  
issue220/latex.txt · Dernière modification : 2025/09/02 08:28 de d52fr