Showing posts with label LaTeX. Show all posts
Showing posts with label LaTeX. Show all posts

September 1, 2012

Abstract Language

Today a friend asked me how to create a German and a separated English abstract in LaTeX. Sure, you would say: Just write one abstract in German and the other one in English, where is the problem? Well that was not the problem. The problem was that LaTeX did always print "Zusammenfassung" (which is the German word for "Abstract") for both, the German and English version when using the abstract command:
\begin{abstract}
Long story short, it's very easy to use another language for all your commands - in case the requested language is installed.
\begin{abstract} Das ist meine Kurz- oder Zusammenfassung auf Deutsch... \end{abstract} \begin{otherlanguage}{english} \begin{abstract} This is my abstract written in English... \end{abstract} \end{otherlanguage}
Last make sure you defined you languages correctly in your main document as shown below
\usepackage[english,ngerman]{babel}
You see, only one additional command is necessary to accomplish this task.

December 16, 2011

LaTeX Custom Bibliography Sorting

I'm currently writing a specialized paper to gain a bachelor's degree in Computer Science. The most painful part of writing was to sort the references which are stored in a bibliography using LaTeX.

I don't know whether I made a mistake or the sort styles just don't support ordering by the author's first name. Nevertheless here is a solution if you step into problems when sorting your references doesn't work like you'd expect :-)

First turn off sorting in your main .tex file
\bibliographystyle{unsrt}

When applying this, LaTeX will sort your references by its usage. So the reference used first, will be listed first. You turn this into an advantage. Now within your document, before you use any references in your paper, use this line for hidden text to apply your custom sorting.
\phantom
{
\cite{FirstRef}
\cite{SecondRef}
\cite{ThirdRef}
...
}

The only disadvantage you have to be aware of is that from now on you have to take care which references are really used in your paper to not reference anything unused.

Anyway this solution works good for me - if you know any better solution to this problem, please don't hesitate to write a comment :)