Outils pour utilisateurs

Outils du site


issue210:latex

Ceci est une ancienne révision du document !


This issue will continue our examination of the topics in CTAN. This time, we will explore a few of the packages indexed in the “C” area. (Remember ctan.org is the repository for packages designed for Tex/Latex.) There are more than 50 topic names starting with “c”. Nine of them offer support for specific languages (Catalan, Chinese, Cherokee, Croatian and others). I chose two packages out of more than 50 in the calculation topic, and three packages out of 27 from the calendar topic. All should be available to any user of a standard installation of Latex.

The basicarith package has 14 pages of documentation. The abstract says “the basicarith package provides means for typesetting arithmetic problems, of whatever operations, in a clean and open fashion, suitable for educational texts rather than scholarly works.” This package would have been useful when I was teaching mathematics.

Note: this package does not solve problems for you, it does not convert Latex to a calculator. It typesets problems with answers as they could appear in a text.

Note: the typesetting is done to textbook standards commonly used in North America and parts of Europe. Your location may require different notation. The joy of open source software is you can read and edit the package to suit your requirements. Then submit your version to ctan.org for inclusion.

Above is the code used to produce the figure shown left.

Of course there are other tools and options in this package. Please read the documentation and experiment before you need to use basicarith in your work.

The next package is calculator. The 87-page documentation covers both calculator and calculus packages. The first 30 pages describe various capabilities of calculator and calculus. The remaining pages show the macro code which will be useful to developers. Calculator “allows us to use Latex as a calculator with which we can perform many of the common scientific calculations…apart from add, multiply or divide, we can calculate powers, square roots, logarithms, trigonometric and hyperbolic functions” (from the abstract to the documentation). This package not only typesets equations, it also solves them within the limits of Tex arithmetic. There are worked examples throughout the documentation. Calculations can be chained together so the result of one can be used in the calculation of the next.

As you can see from the image below, Tex math seems to be limited to five decimal places of accuracy. What is not apparent from the image, but which is visible in the code (top right), is the package amsmath needs to be used with calculator.

Calculations can be done with integer and real numbers (including exponents), natural logs (base e is the default, although other bases can be used), plus regular, inverse and hyperbolic trigonometric functions in both radians and degrees. Some simple matrix and vector math can also be done.

The calculus package includes features that typeset and solve: linear, quadratic, cubic polynomial functions, trigonometric functions, vector-valued functions, in Cartesian and polar coordinates and others.

I could use up several columns exploring some of the many possibilities of calculator and calculus. If you have a need for typesetting simple and complex equations in Latex, I strongly recommend you read the documentation carefully and experiment. There are many opportunities for good results and for mistakes.

Now I will move on to some packages in the calendar topic.

The chronology package makes timelines. This is easy to do with pen and ruler, not so easy with a word processor or spreadsheet. The chronology package makes the task very simple. It has a limited set of instructions in the four-page documentation. I chose to use the simplest set of commands to make a timeline of the development of one line of CPU chips. The code is below, refer to the figure for the result. As always, I encourage you to read the documentation to learn about several other possibilities.

\documentclass[letterpaper,12pt]{article} \usepackage{chronology} \begin{document} \begin{chronology}[5]{1970}{1995}{\textwidth}

\event{1974}{8080}
\event{1978}{8086}
\event{1979}{8088}
\event{1981}{IBM PC}
\event{1984}{286}
\event{1986}{386}
\event{1989}{486}
\event{1993}{586}

\end{chronology} \end{document}

The last package in this instalment is termcal. According to the documentation, termcal “is intended to print a term calendar for use in planning a class.” After reading the documentation, I suggest the last part of this sentence should read “for use in planning a semester.” This is not a tool to help teachers do lesson plans but a tool to help students plan their work for a semester.

Instructions start with \calendar{start date}{number of weeks}. For my example, I will use Oct 9, and 10 weeks. (Dates have to be written in mm/dd/yy order. Only digit years are accepted.) The size of the boxes is set with the \calboxdepth and \calboxwidth instructions. (This is similar to setting the size of cells in a table.) These are followed by \calday which indicates which days are to be printed, and \skipday which shows which days do not need to be printed since they have no events.

Text can be added to dates using the \caltext{date}{text} instruction. Events can also be entered using the \caltexton{day number}.The day number is indicated in the top-right corner of each date. Note the syntax used to get the example results: back-slash, space, two back-slashes (to indicate new line), required text. This syntax is not in the documentation. The documentation is not clear, and not helpful at several points. Perhaps this is to be expected since the documentation was last revised in 1996. I suspect the differences between what the documentation says should work and what actually works are probably due to the age of the package and that Latex has had a major upgrade since 1996.

That is all for this column. There are many more topics starting with “C”. I may decide to tackle a few more of them next time, or I may move to the “D” topics. Read the next issue and find out. As always, if you have a task or topic you want me to discuss please send me or the editor a note and I will do my best.

issue210/latex.1729963576.txt.gz · Dernière modification : 2024/10/26 19:26 de auntiee