Ceci est une ancienne révision du document !
Another issue of Full Circle and another exploration of the many tools and options available in Latex. This time I will explore a few of the possibilities listed in the G topics. The G topic includes the following languages: Georgian, German, Greek. I remind you I will not select any of the languages since I wrote a column about a few techniques for using other languages recently (FCM #213), and because I plan to write more extensively about using multiple languages in the future. The G topic contains mostly packages that have to do with graphics which I chose not to examine in this article.
The first group of packages in the G topic is a group entitled “Games”. I think it might have better been called “Diversions” since many of these packages are not what I think of as games. There are packages to make chess puzzles, bridge games, Scrabble, Chinese chess, Othello (Reversi), RPG, Weiqi (Go); and also packages to make ASCII art, Mandelbrot sets, I-Ching, mazes, sudoku, tangrams, and the days which are Friday the 13th. This is only a short list of what is available.
If you are interested in standard chess, there are packages for annotation of games, for drawing the board, a package of fonts supporting chess diagrams, one for correspondence with chess game notation, and more. Chessboard is a package that is part of the default installation of TexLive. It is maintained by Ulrike Fischer, one of the two main authors of The Latex Companion (ISBN 978-0-13-465894-0) which I have recommended several times. The package was last updated in 2024 November. Fischer says “you will now have full control about size, content and look of the board.”It requires the following packages: chessfss (fonts), pgfcore, pgfbaseshapes and pst-node which are also part of the default TexLive install. I also needed to load the skak package in order for chessboard to generate a board with the newgame command. (Perhaps my version of chessboard is not up to date.) One of the graphics with this article shows an initial chessboard. Fischer wrote clear and comprehensive documentation full of sample code and illustrations.
\documentclass[letterpaper,11pt]{article}
\usepackage{chessboard,skak}
\usepackage{chessfss,pgfcore,pgfbaseshapes,pst-node}
\setchessboard{showmover=false}
\begin{document}
\newgame
\chessboard[padding=4pt,pgfborder]
A pastime many people enjoy is solving mazes; which the next package calls labyrinths. This package was uploaded to CTAN in 2014 and works well on my system. The documentation is only eight pages long, but contains enough information to guide the user into experimenting with the code. As always, I strongly encourage you to read the documentation, perhaps even print it out while you work with this package. The sample graphic in this column was generated from one of the samples in the documentation.
\documentclass[letterpaper,11pt]{article}
\usepackage{labyrinth}
\begin{document}
\begin{labyrinth}{6}{5}
\h +++++
\v -----+ \h ++++-
\v ++-+++ \h -----
\v +-++++ \h -+----
\v +-++-+ \h ----+
\v +++--+ \h +-+++
\end{labyrinth}
From the geometry topic, I selected the geometry package. It is often used in Latex as it allows the user to define almost all the parameters of a document page. The latest update available at ctan.org is version 5.9 (2020 January). Page geometry can be changed in the middle of a document. If you have used Latex for at least one project, you know that each document requires the documentclass instruction. In the examples I have used for these articles, I have almost always set the document to letter-paper which defines a page as 8.5 X 11 inches, almost the same size as A4 paper. However, most books and periodicals are not published as 8.5 X 11 pages. They may be printed on “letter paper:” but are usually trimmed to something smaller. The geometry package allows the user to define the area for text, to centre the text on the page, set margins, set the sizes of the header and footer areas, and other choices. If the document type is “book”, then pages are printed two sided, so inner and outer margins are needed. Inner margins are usually wider than outer margins to allow for the area used in binding.
Geometry options are normally set at the beginning of a document. However it may be necessary to change the page geometry part way through. The newgeometry command can be used for this purpose, for example to insert a landscape page into an otherwise portrait-oriented document. The restoregeometry page returns the document to the original settings. If a set of options is going to be used regularly then the geometry can be saved and then loadgeometry used to load those options into the current location.
The 42-page documentation is written clearly and contains more than enough code to assist the user in the use of this package. There are many possible options available. Different options can be true / false, or have one, two or three possible values. The code needed to generate this image is below.
\documentclass[letterpaper,11pt]{article}
\usepackage[layoutwidth=6in,layoutheight=8in,textwidth=4in,textheight=6in]{geometry}
\usepackage{lipsum}
\begin{document}
The dimensions used in the geometry package will print the text to allow for space for binding. The book will be printed so it can be trimmed to the size required for publishing. \lipsum[1-3]
\end{document}
As I am sure most of you know, Latex generates PDF files. Very recently (2025 March), a package has been uploaded to ctan.org which allows the user to include complete or partial PDF files in Latex (PDF) documents. No need to retype or even copy and paste. If what you need is already in a PDF file, one or more pages of that file can be included in the current document using the pdfpages package. I saved my FCM#213 column as a PDF and used it as an example with the following code.
\usepackage[final]{pdfpages}
\begin{document}
\includepdf[page=1]{../published/fcm213babel/fcm213}
I imported just one page but you can include page ranges as well. The option [final] in the usepackage command means the text will be imported. Other options include draft (there will be a box with the file name on the designated page but no text), demo (only the required number of blank pages are inserted) and two others. There are many options available for the includepdf command. These include various layout options and various ways to include one or more pages from one or more PDF files in the current file.
Note 1: This package seems to be pointed at pdfTex users. Even so it performed well in my Latex environment.
Note 2: If you want to incorporate other than one complete page, you will need to either retype or use copy and paste.
The caret symbol ^ is used in mathematics and sciences in various ways. When the formula is read it is called “hat”. Two developers, Matthew W. Scroggs and Adam K. Townsend, developed a little package that puts real hats on characters. (Latex is not always serious. Developers do have senses of humour.) They developed a list of eighteen designs for hats. When the package is used like so:
\hat{a} = \hat{b}
a random hat is chosen from the list. The user can also choose which of the eighteen hats to use as shown in this second code snippet.
\hat[crown]{c} = \hat[birthday]{b}
It is easy to make one style of hat the default in the initial loading of the package.
\usepackage[cowboy]{realhats}
The documentation is one page plus one paragraph so read it and have fun with your work. When I use the \hat command, my editor (TeXstudio) automatically adds dollar signs around the”hat” instruction. This happens because “hat” is a math symbol in the same way as add, subtract, etc. So the instruction \hat is changed to $\hat{a}$. Nevertheless, this instruction still generates the letter with a real hat, not a caret. Is it possible to have both math carets (^) and real hats in the same document? I leave that to my readers to figure out.