## Using umlauts with listing package in LaTeX

Umlauts (and other special characters) sometimes do not work out of the box when applying the listing package.

Here is a code snippet for mapping umlauts to their “raw” encodings:

I found this snippet alongside many more for other languages in a stackoverflow post.

## Setting up Sumatra PDF for TeXlipse with SyncTeX in Windows

1. Install TeXlipse from the following update site: http://texlipse.sourceforge.net/
2. After a restart, open Windows > Preferences > Texlipse/Viewer Settings and promote Sumatra to the top of the list.
3. Choose Edit. The appearing dialog is also depicted below.
4. Select the location of your SumatraPDF.exe as Viewer command
5. As Viewer arguments insert the following:
-reuse-instance %file -forward-search %texfile %line
6. Close the dialog and re-open your document in the preview using Ctrl + 4.

Setting up Sumatra PDF as PDF viewer for TeXlipse

Whenever you run the preview command, Sumatra PDF will jump to the appropriate position in the compiled PDF file and highlight it for a short moment.

## Fixing missing font maps in MiKTeX

If you need to install MiKTeX packages without using the MiKTeX Package Manager (mpm.exe), you may run into problems with missing font maps that are not properly registered in the index. A typical error message looks as follows:

A simple solution – that worked out for me at least – is to run updmap.exe one or several times.

## References

Solved thanks to

this post

.

## Excluding TeX command parameters from Aspell check

The spellchecker aspell allows to exclude certain TeX commands from spellchecking. This article shortly summarizes the configuration parameters that control this behavior. The following options can either be used on the command-line, as environmental variable ASPELL_CONF, or inside a (personal/global) configuration file.

The switch for creating a rule is called add-tex-command and it accepts the command name as first parameter and a string of [opOP] as second, which configures which paramters to ignore (o,p) and which ones to check (O,P).

The following switch tells aspell not to skip the first mandatory parameter, to skip second mandatory parameter, to skip first optional parameter, and not to skip second optional paramter

## Removing a rule

To remove a filter rule, use the following command:

Two special switches enable and disable the checking of TeX comments:

## An example

• aspell check –add-tex-command=”myCommand op” dummy.tex
passes.
• aspell check –add-tex-command=”myCommand Op” dummy.tex
marks KittyX as error.
• aspell check –add-tex-command=”myCommand oP” dummy.tex
marks DogX and DearX as error.
• aspell check –add-tex-command=”myCommand OP” dummy.tex
marks DogX, DearX, and KittyX as errors.

## Best practices

Here are some lines from my ~/.aspell.conf:

The first command serves as marker for passages that are (for example) in German:

## Reference

• [1] Filtering in Aspell
• [2] Source for the example

## Set categorical axis labels

The data file needs to be tab-separated. The first column is treated as x-value.

## Use percentage as axis label

If the y-values are given in a range of, say, 0.0 to 1.0, the following command displays them as 0% to 100% on the y-axis.

## References

• [1] Plotting experimental data with pgfplots by Josef Wright (TUGboat, Volume 31 (2010), No. 1)
• [2] Official pgfplots gallery

## No SyncTex information available in Texstudio

SyncTex is a mechanism that allows to jump between source LaTeX file and output PDF file. Texstudio was complaining about missing SyncTex support. The reason was that SyncTex needs to be enabled via a command line switch in Options -> Configure Texstudio… -> Commands/PdfLaTeX:From

To

## Tell LaTex how to handle unknown graphics file extensions

Ipe is a very nice drawing tool which also interacts with LaTeX in a way that, e.g., you can use the math environment, use LaTeX packages, etc. In order to distinguish PDF files produced with Ipe from other PDF files, I use the file extension ipe.pdf which confuses pdflatex when used inside the includegraphics command:

yields

We may tell pdflatex how to handle this unknown graphics extension with the following command:

Here is the meaning of the parameters:

1. .ipe.pdf is the extension which is unknown to the compiler. Each included file with such an extension will be handled by this rule. Removing this extension yields the “basename” of the file.
2. pdf is the format as which pdflatex shall treat the file
3. .ipe.pdf is the extension to append to the “basename” after potential conversion commands. This should be the name of the file as it can be found on the disk.
4. <empty> conversion command. In our case, the file is already a valid PDF document and no action is necessary. But in case pdflatex could not handle this file type, we may specify a conversion command here, e.g., jpeg2ps #1 which would take a JPEG file and convert it to Postscript. In this case we would need to specify ps as third argument (or leave it out because LaTeX will guess the correct extension) since the file produced by the converter will have a ps extension.

• [1] ipe project at Sourceforge.net

## Drawing finite state automata with Tikz

Tikz offers a library for drawing finite state automata (FSA) for embedding in LaTeX. As I mostly use simple FSAs and for making the corresponding Tikz code more expressive, I created two new commands:

• newState
Each state has an internal name which may be referred to when drawing edges and a visible label. In contrast toother graph drawing tools such as GraphViz we need to provide positioning information for each node (above of/below of/right of/left of). Each state may bear additional properties such as whether it is an accepting state or  an initial state.
• newTransition
A transition connects a source state with a target state, given that some condition is fulfilled guard. An edge may be drawn as a straight line (default) or as an arc (bend left/bend right). For loops you need to use loop above/loop below etc.

## Example FSA

Finite State Automaton drawn with Tikz

The following example code defines an FSA which accepts words conforming to the regular expression b(an)+e:

## GraphViz as an Alternative

Another candidate for drawing graphs is GraphViz, which I indeed tested first. GraphViz has some important drawbacks:

• The subscript tag <SUB> and some others do not work for GraphViz before the version of October 14, 2011, and even then, only for PNG and SVG rendering.[1]
• The font used for rendering by GraphViz is not synchronized with the font in the final LaTeX document which may be annoying.