Ceci est une ancienne révision du document !
This time I will take a look at some of the packages in the “M” topic at ctan.org. I would really like to know if these walk-throughs of selected packages is of interest to anyone. I wonder if a project-oriented column would be of more use. Now I am at M I am more than half way through the alphabet. I know there are not as many packages featured in M – Z as there was in the A – L topics. I have been wondering what would be useful after the next ten or so columns are published. Let me know, send me a note, send something to the editor. This column is to help you learn about some of the capabilities of the immensely complex typesetting software called Latex.
By the way I hope this column is more useful than most of the videos about Latex available on Youtube. Most of them are quite basic. Some are poorly formatted and difficult for me to understand. Many show how to use one of the commercial Web-based front ends for Latex. As a personal aside I do not understand why people pay for a front end to software that is free for all to use. It would be possible to make a set of videos from these columns to help people learn about various Latex packages. I think short videos about specific packages and their uses would be better than most of what is available about Latex on the Internet. Let me know if that is of interest since it would be additional work.
Opening up the M topic there are about forty-eight different sets of packages. As usual I will ignore the packages for languages other than English. Under M there is: Macedonian, Maltese, Manju, Marathi and Mongolian. Marathi is a language of western India. Manju is an alternate spelling for Manchu, an almost-extinct language of northeast China; it has only a few thousand speakers. Manchu is written vertically, a major challenge to typesetting. The functionality of the Manju package has be transferred to the montex package which is used for Mongolian as well as Manchu. Mongolian is also written in vertical columns.
As you can imagine the M topic area includes packages to do with mathematics and with macros. There is a small collection of packages in the magazine topic. There are three packages to help with formatting minutes of meetings, a few packages which will convert units of one kind into units of another kind. (Useful in Canada where we deal with both Imperial units and metric units.) There is one package which formats PDF files so they can be used with a smart phone. This one is probably not necessary any more, phones have easy access to apps that read PDF files. There are packages to deal with the typesetting needs of molecular biology and Materials Science. There is a multimedia topic (six packages) and two topics for music (many packages).
In the maths topic there are many packages. One package I have used often is amsmath: the American Mathematical Society package, useful to typeset many math symbols and structures. (There is a corresponding amsfonts package which should be used with it.) The amsmath package has its own chapter in The Latex Companion, see volume 2, chapter 11. I can demonstrate a few of the capabilities of amsmath. If you regularly use math in your Latex - PDF documents I strongly suggest you review the documentation for amsmath plus the chapter in The Latex Companion.
Equations can be very complicated. Latex can satisfy almost all needs for mathematical expressions without resorting to generating the expression in other software and importing a graphic. Multi-line equations, special alignments, adjustments to vertical and horizontal spacing, text in equations, matrix math, commutative diagrams, arrows of many kinds, limits, integrals and many others I cannot pretend to understand. The amsmath package has broad application any time an equation is needed, not only math but physics, chemistry, biology, economics, etc. I wish I had this set of tools when I was teaching college math and chemistry.
Shown right is the code for the sample page.
In addition to the many packages related to amsmath and others related to specific math applications there is a package called calculator which can generate solutions to math calculations in a document. There is an 87-page document describing how to use calculator. I have included a short example of the code for you to try. The calculator package simulates a scientific calculator and can solve many problems with both integers and real numbers. It has lists of built-in constants (like pi and e). It calculates the values of regular, hyperbolic and inverse trigonometric functions in radians and degrees, handles matrices, vectors and scalars and more. I have not shown in the sample but calculations can be chained together so the result of one is the starting point of the next.
\usepackage{calculator} \begin{document}
A demonstration file for the calculator package. (The dollar signs are necessary to indicate a math operation in Latex.)
\MULTIPLY{8}{7}{\sol} $8\times7=\sol$
\POWER{2.256}{7}{\sol} $2.256^7=\sol$
At the end of the M topics are the two topics related to typesetting music. If you are even remotely familiar with how music appears on a printed page you can imagine the challenges faced by a developer trying to build a package to print music scores. You might be familiar with the common five-line staff used for orchestral music. There are other ways to display music for specific instruments or specific kinds of music. Bagpipes, Byzantine music, guitars, Gregorian chant, jazz chords, recorders, shape note singing, fingering diagrams for various instruments all have separate packages. I am not a musician so I include an example from the lengthy documentation for the MusixTex package to show the flexibility of this system of macros.
This is a complicated example. Obviously there are many commands to be learned to use this system well. As a non-musician I can understand a little of the code. In MusixTex pitches from the A below six ledger lines below the bass clef to E above six ledger lines above the treble clef can be represented by letters of the alphabet. Learning MusixTex is probably somewhat less complicated than learning a programming language. I suspect if you want to generate music for the piano you would need to learn a subset of the MusixTex command set. There is a “cheat sheet” on p. 156 of the manual which contains the code for the pitches, notes and accidentals (without and with dots) plus clefs, rests and a variety of miscellaneous symbols. There is a subset of MusixTex for generating tablature for guitars. Lyrics can be added and positioned so syllables will be placed correctly in relation to notes. There are thirty-eight extensions which can be used with MusixTex, all can be loaded using the \input command in the preamble to the document. The MusixTex package could easily be called the MusixTex system. If you produce music in PDF files or printed music I strongly recommend you take a look at MusixTex. That is all from me this time. I hope you are enjoying pleasant weather where you are. In the Northern Hemisphere autumn has started. Cold wet autumn weather usually encourages us to work inside. Perhaps this is the time when you will experiment with Latex. If you have questions please ask. I will do what I can to help.
