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

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.

Reference

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:

miktex-makepk: PK font md-chr8y could not be created.

!pdfTeX error: pdflatex (file md-chr8y): Font md-chr8y at 600 not found
==> Fatal error occurred, no output PDF file produced!

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

      .

MiKTeX manualII. Reference

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.

Adding a rule

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

add-tex-command myCommand PpoO
--add-tex-command="myCommand PpoO"

Removing a rule

To remove a filter rule, use the following command:

rem-tex-command myCommand
--rem-tex-command="myCommand"

Check TeX comments

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

tex-check-comments
dont-tex-check-comments
--tex-check-comments
--dont-tex-check-comments

An example

\documentclass{article} 
%\url{http://tex.stackexchange.com/a/314/86}

\makeatletter
\def\myCommand{\@ifnextchar[{\@with}{\@without}}
\def\@with[#1]#2{Hello #1, have you met #2?}
\def\@without#1{Goodbye #1.}
\makeatother

\begin{document}
\myCommand[KittyX]{the DogX}
\myCommand{my DearX}
\end{document}
  • 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:

add-tex-command aspellNoCheck p
add-tex-command citep op
add-tex-command citet op
add-tex-command nomenclature opP # don't check the sort key and the abbreviation
add-tex-command url p

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

\newcommand{\aspellNoCheck}[1]{#1}

Reference

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

Set categorical axis labels

\begin{axis}
[
xticklabels={master, g8, lehrer, promovieren, sport, sitzenbleiben},
xtick={1,...,6},
x tick label style={rotate=90,anchor=east}
]
    ...
\end{axis}

Read data from file

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

\pgfplotstableread{data.csv}\datatable
\begin{axis}
    \addplot table[y = myColumn] from \datatable;
    \addlegendentry{Results from myColumn};
\end{axis}

 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.

\begin{axis}
[
yticklabel={\pgfmathparse{\tick*100}\pgfmathprintnumber{\pgfmathresult}\%},
]
    ...
\end{axis}

Do not connect data points with lines (scatter plot)

\begin{axis}
[
only marks
]
    ...
\end{axis}

References

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

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

pdflatex -interaction=nonstopmode %.tex

To

pdflatex -interaction=nonstopmode -synctex=1 %.tex

 

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:

includegraphics{cyk.ipe.pdf}

yields

! LaTeX Error: Unknown graphics extension: .ipe.pdf.

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

\DeclareGraphicsRule{.ipe.pdf}{pdf}{.ipe.pdf}{}

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.

Links

  • [1] ipe project at Sourceforge.net

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

Finite State Automaton drawn with Tikz

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

documentclass{scrartcl}

usepackage{tikz}
usetikzlibrary{arrows,automata}

% newState{}{}{}{}
%
% #1: internal name,
% #2: (visible) label,
% #3: node properties (e.g. accepting, initial)
% #4: relative position (e.g. right of=/left of=/above of=/below of=)

newcommand{newState}[4]{node[state,#3](#1)[#4]{#2};}

% newTransition{}{}{}{}
% #1: source state (internal name),
% #2: target state (internal name)
% #3: guard/edge label
% #4: edge direction (loop below/above, bend right/left)
newcommand{newTransition}[4]{path[->] (#1) edge [#4] node {#3} (#2); } 

begin{document}
  begin{figure}
  begin{tikzpicture}[
    % Default arrow tip
    ->,>=stealth',shorten >=1pt,auto,
    % Default node distance
    node distance=2cm,
    % Edge stroke thickness: semithick, thick, thin
    semithick
    ]

    newState{S}{$S$}{initial}{}
    newState{q1}{$q_1$}{right of=S}{}
    newState{q2}{$q_2$}{below of=q1}{}
    newState{q3}{$q_3$}{right of=q1}{accepting} 

    newTransition{S}{q1}{b}{}
    newTransition{q1}{q2}{a}{bend left}
    newTransition{q2}{q1}{n}{bend left}
    newTransition{q1}{q3}{e}{}
  end{tikzpicture}
  caption{Finite State Automaton, accepting the pattern emph{b(an)+e}}
  end{figure}
end{document}

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.

Links

  • [1] Martin Thoma’s site with another nice example
  • [2] texamples.net