Ceci est une ancienne révision du document !
Tex was developed in the mid 1970s by Donald Knuth and published in 1978. “TeX was designed with two main goals in mind: to allow anybody to produce high-quality books with minimal effort, and to provide a system that would give exactly the same results on all computers, at any point in time” (Wikipedia: Tex). That meant the document and the typesetting instructions had to be written using only the standard 128 characters available in ASCII. Remember the first IBM-PC was not available until 1981. It came with 16KB of RAM, which was expandable to 256KB. For storage, the original IBM PC could house either one or two 320KB floppy disk drives. There were no PCs in 1978, so the first installations of Tex ran on PDP-10 machines, a mainframe computer popular in commercial settings and universities. Remember Tex was designed for typesetting, and remember that, until IBM made CGA graphics cards available in 1981, computer monitors displayed only ASCII characters: text, numbers and a few special characters. Printers were also restricted in the same way until the development of Postscript (mid 1980s) and PDF (1992).
This brief history lesson is to point out the need for packages when using Tex. With very limited RAM available and the necessity for using only ASCII, Knuth had to develop a typesetting system that would be efficient and run consistently on mainframes from as many different manufacturers as possible. These limits (processing power and printing power) necessitated the use of packages, small independent sets of instructions that could be loaded only when required. The hardware limitations made Tex and LaTex modular. Because this early design decision was forced upon Knuth by the hardware specifications available at the time, Tex is now remarkably flexible and relatively easy to expand. Need a new capability? Write a new package. For example, the American Mathematical Society has written several packages that are very useful when mathematical formulas are included in printed documents.. This set of packages can be identified by “ams” at the beginning of the package name.
Latex was developed more-or-less in parallel to Tex. Latex is designed to be a user-friendly layer on top of Tex. It is a set of macros for the markup functions of Tex, and leaves the layout functions to Tex. It was developed in the 1980s, the current version was released in 1994 and revised in 2020. Latex consists of a basic set of packages that all users of Latex can assume will be availabe, and minimal documentation. The Latex archive (https://www.ctan.org/pkg/latex) contains more details. CTAN is an enormous storehouse of packages (sets of Tex macros) which can be downloaded and added to your Latex / Tex files, and then made available for use with your documents. What kind of document are you trying to write? Are you doing research in the physical sciences? There are 93 packages which include the word physics in their description at CTAN. There are 58 which use chemistry, but only 14 for astronomy. What about the life sciences? Packages using biology in their description are 23 in number, but only 1 for biochemistry. There are 750(!) for math, 62 labeled for geometry. You might want to narrow your search for an appropriate package, for example the term “integration” has 21 packages, probably some of these are in the total of 750 for mathematics. Turning to non-scientific packages, there is 1 which says it supports the work of pastors and priests, 28 for business, 1 for accounting, 2 for banking - including one that is specific for documents from the Czech National Bank.
If your document requires citations, there are packages for several different citation styles so the references in your document can conform to whatever style your school or publication requires. There are 5 packages for the MLA style, 17 for the Chicago style, and 53 for the APA style. Some of these packages will be obsolete as citation styles change from time to time. (Perhaps we should develop a package for FCM? <tongue firmly planted in cheek>). If you find a package you would like to use at CTAN, what then? First, of course, you need to download it and unpack it. Then follow the installation instructions if there are any. Some packages have no installation instructions. Apparently the user is supposed to know how to install them. How the user, particularly inexperienced users, are to obtain this knowledge is not clear. Installing new Tex / LaTex packages can be a frustrating experience as you will learn in the rest of this article.
Some packages have good, clear, concise installation instructions. For example the installation instructions for the apa7 package say: 1. Create directory “config” next to the file apa7.ins 2. Run latex apa7.ins 3. Move/copy apa7.cls to the directory of your latex install or the directory containing your latex project. As we will find out, these instructions are appropriate for installing apa7. They are not all you need to know in order to install and use APA citation styles in your documents. I selected APA because it is a very common citation style used at colleges, universities and in professional journals. I selected apa7 because it is tied to the most recent revision of the APA style standard. Whether you use APA (or any citation style), I hope you will learn from what I did. When you want to expand what you can do with LaTex by installing new packages, keep my experience in mind.
Having downloaded the apa7.zip package and then unzipping it there are these files: apa7.dtx, apa7.ins, apa7.pdf, README.txt. The README file has the installation instructions shown above. APA7.PDF contains documentation for this version of the APA style sheet – nothing to help with installation of the package. So I will follow the instructions. 1. In the apa7 folder in my default download folder, I made a folder called “config”. 2. I opened a terminal window and ran latex apa7.ins. This generated twelve txt files in the config folder: twelve files starting with apa7 and then a word denoting language: apa7american.txt, apa7british.txt, etc. It also added two files to the main apa7 folder: apa7.cls and apa7.log. 3. Then I am supposed to copy apa7.cls to the directory of my latex install or my project. I chose the project folder. 4. Once I had apa7.cls in the project file, I started a new Tex project (apa7test.tex) and added the apa7 package to the preamble. Then I compiled apa7test.tex using TexStudio. 5. Compiling apa7test.tex with apa7.cls in the same folder generated an error. The apa7.sty file could not be found. I moved the apa7.cls file to the installation folder (using sudo) and compiled it again. a. I did a search for *.cls files and discovered in my distribution *.cls files are stored in /usr/share/texlive/texmf-dist/tex/latex. Each cls file is stored in a separate folder. I have to make a folder apa7 in /usr/share/texlive/texmf-dist/tex/latex (/usr/share/texlive/texmf-dist/tex/latex/apa7) and then moved apa7.cls into that folder (using sudo). 6. Same error: cannot find apa7.sty.
What I learned is not obvious and not mentioned in the apa7 documentation. APA7 is simply an update to the original APA style sheet which is available by installing apacite. It is not a complete package, the original apacite package needs to be installed first. This oversight in the documentation is common with Tex packages; this kind of oversight is very frustrating for inexperienced users. After I downloaded and unzipped apacite, I then gave the command text apacite.ins. (This instruction is often used as a precursor to installing Tex / LaTex packages.) There are now 24 files in the apacite folder instead of the 4 I started with. These files need homes; they have to be moved to appropriate folders in the tex hierarchy of folders. Each user will have to find where the files with a particular extension are stored in their distribution. Most or all will be in the same part of the directory tree. Search for the extension to find the location. Then move the appropriate file into the location. Then repeat. In my download/apacite folder, there are eight extensions which need to be relocated. Where they will go depends upon your distribution.
I know this article has not had much “hands-on” material for you to follow. Next month, I will return to my usual hands-on, step-by-step stuff with an expansion of Erik’s work about images in documents. Some of you have probably watched some or many of the instructional videos about LaTex available online. Many of them are specific about what packages need to be included in order to do particular tasks. Erik used three packages in the articles he wrote: graphicx, subcaption and lipsum. Packages can be used to extend LaTex, to give it capabilities the standard install does not have, to update its features, to do specific tasks. When I look at images next time, I will need to use the graphicx package. As always if you have comments, or questions, or have a specific topic you want me to deal with, please send an email. I will respond to the best of my ability.