Outils pour utilisateurs

Outils du site


issue220:latex

Latex CTAN I – J Topics Another month has gone by and another column is due for FCM. This time I will look at Latex topics at ctan.org starting with “I”. There are sixteen topics in this group. Five of them have to do with languages or supporting documentation for languages Icelandic, Indic (India), Irish-Gaelic and Italian. There are four topics which deal specifically with indexes (indices). In alphabetical order after Icelandic, the first topic is IDE: Integrated Development Environments. There are twenty-three packages listed in IDE, a few of them are for the DOS and OS/2 operating systems so I will not work with them. I will also ignore all the IDE packages that are designed for Windows or the Mac. These two conditions eliminate almost all of the IDE packages. The kile package may be of interest to some. It is designed to work with the KDE 4 desktop environment. I could find very little information about it. Kile is available from sourceforge and must be compiled with the appropriate versions of the KDE libraries, QT, Cmake and C++ compiler. There is a second IDE for the KDE environment called KtexShell. CTAN marks it as obsolete. 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. 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. The basics of building an index with Latex are clearly explained in Part 2 of The Latex Companion. If you are interested I suggest you follow the steps on pp. 345 – 346. include the following command in the preamble: \usepackage{makeidx} include the following command in the preamble \makeindex put the \printindex command where you want the index to appear (usually at the end of a document. 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. 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. 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 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.) 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. Assuming you have done that Search and Replace, you then need to install the edited file as a new package. Use the new name in the usepackage instruction in the preamble to your document. Alternatively you can rename invoice.sty to something else, then rename the edited file to invoice.sty. Let me know if my suggestion for changing VAT to something else is useful. For more complex questions or customization about invoice, please read the well written sixteen-page documentation. 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 \documentclass{options}{scrjrnl}. 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. 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.

issue220/latex.txt · Dernière modification : 2025/08/24 17:09 de philou511