Stockholm Jan. 2022.

KTH regulations: This is a personal web page created by Lars Jonsson. More information. You can contact me at ljonsson AT kth DOT se.


Lars remarks on Printing, LaTeX, ...

... as well as links, macros and suggestions around and about producing, printing and presenting your results in LaTeX. First, links to others: A first introduction to latex can be found here Introduction to Using TEX (Overleaf). The 3300 most used latex symbols and how to access them are available from CTAN.
What this page does provide is:


An example

Here is a simple example that answers some basic questions about the use of macros and headers in LaTeX:
The file test.tex contain examples of references, macros, how to make sections as well as a time-mark at the bottom of each page. The time-mark macro(s) are in the file now_macro.tex and some basic 'replacement' macros are in the file macro_dyn.tex.
To handle reference to papers, books etc. I have attached a bibliography file: stein.bib.


Basics: To make a LaTeX document --- under Linux

Store the files from the section An example above in a separate directory,

Typeset the file test.tex, from above e.g.

pdflatex test 
bibtex test, e.g
bibtex test

Typeset twice again (to get the bibliography correct) e.g.

pdflatex test
pdflatex test

If all worked out well, you now have the result in an pdf file. I provide mine here test.pdf.

For more details on pdflatex see eg. prepare pdf-files form LaTeX. Rather than using items like psfrag, I prefer to use Pgf/Tiks which provide a well featured graphics (latex-like) enviroment for latex. I really like the matlab2tikz macro. Data arrive into latex-like files and it is easy to add and correct text, colors etc. Please also see Colorbrewer in the help of selecting good colors

For use with ArXiv I recommend to use the style file habbrv.bst which provides eprint and can be used to include internal links.


Guidelines



Remarks on slides in LaTeX

I use the beamer class: an introduction.


Back-of-the-Book Indexing

Indexing a LaTeX document with help of the program MakeIndex with syntax
MakeIndex filename
is straight forward on a superficial level. The program solves the technical part of indexing i.e. how to associate the position (page) with a desired word or concept in the text is there solved. The keyword to use in the LaTeX document is
\index{favorite word}
It is also neccessary to include
\documentclass{book}
\usepackage{makeidx}
in the preamble as well as
\printindex
where you want to print the index.
I also recommend the additional package \usepackage{index} which have a number of nice shortcuts like not having to retype the word upon indexing.

However to produce a good index, that is how an index is organization and structured and typographically presented is less that trivial. One document that discuss the idea of organizing (book indexing and/or back-of-book indexing) a text (or texts) is TAO-maps. Which discuss the model Topics Association Occurrence Maps, it clears some of the idea structure of how a text can be indexed.
Models which answers or suggest

is still largely left to the individual. I am still searching for a good description on how such an organization should look like. A webpage with an introduction to back-of-the book index theory would be desired.

From my point of view, a simple index which only lists one level of topics is the easiest to construct. On the other hand, one might get several very similar words scattered through the index: e.g. surface current density, volume current density, current density, will all be split into several places e.g. under the letters c,s and v. An alternative might be to list all three as subtopics to of e.g. current density. Such a subtopic listing often has troubles with associations. E.g. imagine that we choose current and density as two separate topics, should then a current density subtopic (of density, and of current) have mutual associations between density and current (see also...)?

Ideally an index is to be a concentration of the information in a text. This ideal requires an iterative procedure to extract an appropriate set of pointers to the text, almost like constructing a miniature abstract for each paragraph.


Printing


Bugs, errors and some fixes in LaTeX and related software

\qed-in the middle of the page error:

The command \qed, as implemented by amstex has a minor bug. If the file ends with \qed, the type-setting does not move the box all the way to the right-hand side of the page, but stops somewhere in the middle. This problem might be fixed by inserting one or two carriage return after the command \qed.

The pdflatex error:

" Unicode char \u8: not set up for use with LaTeX." is sometimes caused by that an editing program has added a 'BOM' at the start of the file. It consist of the hexadecimal characters: "ef bb bf" at the start of the file. To check if the file has these non-pdflatex characters at the start one can use vim:
:%!xxd
to see a hex-representation of the file. To stop the viewing:
:%!xxd -r
and to remove the bom:
:set nobomb