Category: The LaTeX Archives

Custom Shortcuts in Kile
24 January 2013

If you use Kile as LaTeX editor and if you find yourself typing the same code all over again – like a specific table environment, or a slide environment in beamer or whatever, why not create your own user tag and assign a custom shortcut? You can even decide where the cursor should be placed and what should happen in case text is selected while pressing your shortcut.

It’s very easy and very fantastic: User defined Tags.

Weiterlesen
Bibtex going openout_any = p
19 September 2012

Working with multibib, Bibtex started failing me after a recent reinstallation of texlive on xubuntu. On
bibtex <project-path>/src.aux
I got:

 bibtex: Not writing to &amp;amp;lt;project-path&amp;amp;gt;/src.blg (openout_any = p).

I couldn't open file name `&amp;amp;lt;project-path&amp;amp;gt;/src.blg' 

To get rid of the error, open texmf.cnf, which resides in /usr/share/texlive/texmf/web2c through
sudo gedit /usr/share/texlive/texmf/web2c/texmf.cnf
Then find the entry

openout_any = p

p is the paranoid setting. I changed it to r and it now works again (chapeau to dmj).

[update 31 Jan 2013] If sudo is not an option and thus texmf.cnf can’t be changed, see Sini’s helpful comment below. [/update]

 

If you want to learn about multiple bibliographies using multibib, there is a very good tutorial by peisistratos. Unfortunately it is in German, but I’m sure there are English ones out there, too.

Weiterlesen
Strikethrough in LaTeX
17 June 2010

Today I found a second way to achieve a strikethrough in LaTeX (what is done by »line-through« in css: strike out text). If you want to put a line across text, your choices are »ulem« and »cancel«:

Strikethough in LaTeX using »ulem«

\usepackage{ulem} in the preamble gives you two ways to strike out text (and a couple more for underlining):

  1. \sout{text to be striked out} for a horizontal line through text to be striked out (exactly like »line through«).
  2. \xout{text to be crossed out} for many short diagonal lines crossing out the letters of the text to be crossed out

The problem that ulem affects some bibliography styles where otherwise italicised text is then underlined can be remedied through the »normalem«-option in the preamble: \usepackage[normalem]{ulem} (Thanks Fredrik!).

Ulem is part of MiKTeX and TeX Live but also available at ctan.

Strikethrough in LaTeX using »cancel«

\usepackage{cancel} in the preamble gives you four different modes of striking through

  1. \cancel{text to cancel} draws a diagonal line (slash) through its argument
  2. \bcancel{text to cancel} uses the negative slope (a backslash)
  3. \xcancel{text to cancel} draws an X (actually \cancel plus \bcancel)
  4. \cancelto{〈value〉}{〈expression〉} draws a diagonal arrow through the 〈expression〉pointing to the 〈value〉 (math-mode only)

You can get cancel at ctan.

Results

LaTeX strikethrough examples (ulem + cancel)

Click on the image for pdf or download the source file – which looks like this:


\documentclass[a4paper,11pt]{article}

\usepackage[utf8]{inputenc}

\usepackage{setspace}

\usepackage{ulem}

\usepackage{cancel}

\begin{document}

\sffamily

\doublespace

\textbf{Ulem:}

\verb+\sout{striked out text}+ renders \sout{striked out text}

\verb+\xout{crossed out text}+ renders \xout{crossed out text}

\textbf{Cancel:}

\verb+\cancel{canceled text}+ renders \cancel{canceled text}

\verb+\bcancel{b-canceled text}+ renders \bcancel{b-canceled text}

\verb+\xcancel{x-canceled text}+ renders \xcancel{x-canceled text}

\verb+\cancelto{<value>}{<expression>}+ renders $\cancelto{value}{expression} $

Cancelto also works with more complicated expressions:

\verb+\cancelto{\frac{num2}{den2}}{\frac{num1}{den1}}+ renders $\cancelto{\frac{num2}{den2}}{\frac{num1}{den1}} $

\end{document}

Weiterlesen
Fonts in LaTeX
1 September 2009

In short: To avoid the standard pixel bitmap fonts and go for smooth, scalable post script ones, use one of the following:

\usepackage{palatino}
\usepackage{times}
\usepackage{bookman}
\usepackage{newcent}

or, for standard post script fonts

\usepackage{pslatex} or
\usepackage{ae,aecompl}

Be warned: the latter killed my Umlaute.

The more interesting stuff on fonts in LaTeX can be found here.

Weiterlesen
Position:Absolute in LaTeX
19 September 2008

In css there is the handy absolute positioning. Today I found out how to do it in LaTeX:

In the preamble

\usepackage{textpos}

In the document

\begin{textblock}{2}[0,0](8,1.5)
    Lorem ipsum dolor sit amet
\end{textblock}

The arguments are as follows:

\begin{textpos}
{<width>}
[
<left handle>,<top handle>]
(<leftmargin>,<topmargin>)

Width: width of the box. Height is determined automatically.

Handle: Where the box is being grabbed. Default is [0,0], which means left/top corner; [0.5,0.5] would be the center of the box and [1,1] the right bottom corner.

Margin: Where the box will be positioned on the page.

For more detailed instructions (on the units of measurement for instance), refer to Norman Gray’s textpos doc. The textpos bundle can be found at tug.

Weiterlesen
Section Footnote in LaTeX
5 May 2008

I left biting marks in the table on this one. I don’t know if it’s a general issue or just my document. Anyway:

I wanted to have footnotes from inside sections, subsections, and subsubsections. They work similar to footnotes in tables, you need to address them similar to this:

\section{Some Section in my Document\footnotemark}

\footnotetext{My boring footnotetext.}

Only, when I did it like this, it worked on some occasions, but not on others (reason for me biting the wood).

I finally found out that it did not work on all occasions where I did it exactly like in above example, but always rendered

TeX capacity exceeded, sorry [input stack size=5000]

However, it did work on all the occasions where I specified the (optional) short title for section/subsection/&c:

\section[Section in Document]{Some Section in my Document\footnotemark}

\footnotetext{My boring footnotetext.}

The optional shorter title appears — as far as I know — in the table of contents and in left-/rightmark. Also, Kile uses it to display the document structure, too. So if you have rather long titles (like I do) it is a good idea specifying a short one anyway. If not, I guess you can just as well repeat the full title in the optional argument if you need a footnote.

When using the starred variant (\section*{My merry section}), don’t provide a short title.

Weiterlesen
Continuous Footnote Numbering in LaTeX
15 November 2007

By default LaTeX starts the footnote counter at zero for each chapter when you use the class {book} or {scrbook}. If you want to avoid that and have a continuous enumeration, here is how it works:

Create a folder <remreset> in your local package repository. Save the file remreset.sty into this folder.

Open your preamble and add

\usepackage{remreset}
\@removefromreset{footnote}{chapter}

Should you get an error message like this

You can’t use ‘\spacefactor’ in vertical mode. \@

or like this

Command \@ already defined.

embrace the stuff with \makeatletter and \makeatother:

\usepackage{remreset}
\makeatletter
\@removefromreset{footnote}{chapter}
\makeatother

Voilà.

Weiterlesen
ΛαΤεΧ in Greek
12 November 2007

There are various possibilities to include Greek text in your LaTeX document. The three ones I found are these:

  1. $\Gamma\rho\varepsilon\varepsilon\kappa$ gets you Γρεεκ allright, but it looks clumsy and lacks all the accents etc.
  2. betababel. It does not work with my customised control sequences, and I am too lazy to change them and learn them all anew.
  3. polutonikogreek. Neat, slim, worked straight away.

Nos. 2 & 3 use ngerman, so make sure they don’t start a fight with german.

 

update

I had a slight problem with polutonikogreek and titletoc. Whenever I used something like

\greek{p’olemos}

which referred to this entry in the preamble:

\newcommand*{\greek}[1]%
   {\selectlanguage{polutonikogreek}{#1}%
   \selectlanguage{german}}

the .toc-file looked like this at the corresponding place:

[…]
\contentsline {section}{\numberline {1.1}KAPITEL-1.1}{14}
\contentsline {subsection}{\numberline {1.1.1}UNTERKAPITEL-1.1.1}{14}
\select@language {polutonikogreek}
\select@language {german}
\select@language {polutonikogreek}
\select@language {german}
\contentsline {subsection}{\numberline {1.1.2}UNTERKAPITEL-1.1.2}{20} […]

Wherever \select@language appeared in the toc, the styling of my toc entries of the subsection level was being messed up. I style subsection entries in the toc in a way that they all get written in a single line. It looks like this:

\titlecontents*{subsection}[3.5em]
   {\vspace{-0.5mm}\itshape\footnotesize}{}%
   {}{\dots\normalfont\footnotesize%
   \thecontentspage.\enspace}%
   [\itshape][\vspace{1mm}]

There are two solutions.

  1. Ignore the problem, compile your document, open the .toc-file, delete all \select@language entries and compile again (but only once).
  2. Use the following specifications in your preamble:
    \usepackage{ucs}
    \usepackage[utf8x]{inputenc}
    \usepackage[polutonikogreek,german]{babel}
    \newcommand{\gdir}%
       {\foreignlanguage{polutonikogreek}}

    and then put the greek text directly into your document like this:

    \gdir{Πόλεμος}
Weiterlesen
Custom Counter in LaTeX
1 November 2007

How it does work:

Here is what we do: We define the counter

\newcounter{MyCounter}

then we add

\renewcommand\theMyCounter{\roman{MyCounter}}

after it, and it works. Thanks to Axel for his help on this.

 

How it does not work:

When you define a new counter like this

\newcounter{MyCounter}

And later use it like this

\refstepcounter{MyCounter}\label{example}
\roman{MyCounter}. Beispiel eins

And then reference it like this:

And now I reference an example \ref{example}. \end{document}

Then LaTeX still interprets it as something like

\newcommand\theMyCounter{\arabic{MyCounter}}

So it results in an arabic number. This is not what we want. We want to reference the counter in lower roman (or upper roman or alph or what have you), too.

Weiterlesen
Timestamp your LaTeX Documents
1 November 2007

While working on a somewhat larger scale document I always end up with numerous prints, .dvis, .pdfs and so on and so forth. Once, I lost all my original .tex documents and thus had to copy everything from a pdf and reformat it. In a case like that, it sure is handy to know exactly with which version you are dealing and which one is the latest. So for my thesis I wanted to add a little automatic timestamp to each print. Sure enough I found timestamp.sty. Just go to your local package repository, create a folder called <timestamp> and save timestamp.sty into it. With

\usepackage{timestamp}

in the preambel and

\timestamp

anywhere in your document, you can then add the – you’re guessing it – timestamp. The output will look like this:

2007-03-23 14:34

Now, I never liked this date format, so if you, too, prefer DD-MM-YYYY, open timestamp.sty and scroll to the very bottom. Replace

\newcommand{\timestamp}{\the\year-%
\ifnum\month<10 0\fi\the\month-%
\ifnum\day<10 0\fi\the\day\ \xxivtime}

(the last three lines above \endinput) with

\newcommand{\timestamp}{\ifnum\day<10 0\fi\the\day.\,%
\ifnum\month<10 0\fi\the\month.\,%
\the\year\ — \xxivtime\,h}

\timestamp then produces

23. 03. 2007 – 14:34 h

However, the version I use looks like this:

\newcommand{\timestamp}{compiled on \ifnum\day<10 0\fi\the\day.\,%
\ifnum\month<10 0\fi\the\month.\,%
\the\year\ at \xxivtime\,h}

So the output reads

compiled on 23. 03. 2007 at 14:34 h
Weiterlesen
Wir verwenden Cookies: Datenschutzerklärung. This website uses cookies. Privacy Policy.

My Portfolios

Industrial & Academic Portfolio

With more than a decade of experience, I  strengthen the visual identity of my clients through industrial, academic, and corporate photography. 

I also headed communications departments in both the corporate and the academic world and this background enables me to get you the visuals you need – every time!

Product Portfolio

What I enjoy about product photography is that through spending time with an object that otherwise gets overlooked as a mere utility, beauty can be found in unexpected places.

Making the extraordinary within the ordinary visible for others always is a very exciting process.

Portrait Portfolio

In the words of Arnold Newman, Portrait photography is 10% inspiration and 90% moving furniture.

It never seizes to amaze me how, by moving some furniture around and thus creating a carefully designed context for the subject, photography can condense the many facets of a personality into a still image.