Category: TeX

classicthesis with figures using full width

When using calssicthesis most of the defaults look good and are there for a typographical, aesthetical or arbitrary reason. Some people immediately want turn on dottedtoc for instance.

I had a very different concern. The package uses a rather wide margin, in order to place nice marginpars thruout the text. Thats fine by me, it also allows for a nice small text layout without resorting to multiple columns. I did not like this for the typesetting of figures, especially large figures spanning a whole page or the top half thereof. So, I ventured out to change this. After some searching I came across the neat changepage package, which most of all allows for save determination of even and odd pages. With this, it was fairly straightforward to implement. I chose to provide a widefigure environment to typeset full-width figures with [p] or [t].

% wider floats by use of changepage. 
% see changepage documentation for details on the underlying quirks
\usepackage[strict]{changepage}  
% calculate size of margin to use
\newlength\totalmargin
\setlength\totalmargin\marginparwidth
\addtolength\totalmargin\marginparsep
% layout using the full margin as well
\newenvironment{layoutfullwidth}{%
\checkoddpage%
\ifoddpage%
\begin{adjustwidth}{0pt}{-\totalmargin}
\else%
\begin{adjustwidth}{-\totalmargin}{0pt}
\fi%
% advance textwidth for use in float,
% e.g. includegraphics[width=\textwidth]
\advance\textwidth\totalmargin
}{%
\end{adjustwidth}
}
% new, wider figure to use where wanted.
% note that the caption will be layouted wide as well.
\newenvironment{widefigure}[1][!tpb]{%
\begin{figure}[#1] 
\begin{layoutfullwidth}
}{
\end{layoutfullwidth}
\end{figure}

This is a straightforeward way of doing it, changing the typesetting of all floats in general requires some really ugly plain TeX hacking. I got it to work out of playful ambition but decided against using it in order to keep the code clean and understandable.

by axel
2010-02-01. 19:52:10. 286 words, 8604 views. Categories: programming, science, TeX , Leave a comment »Send a trackback »

Deutscher bibtex Stil mit konsistener Autorennennung

Nachdem mir die Eigenheit vom gerplain.bst nicht gefiel, die Reihenfolge der Vornamen und Namen in einem Literarturverweis umzudrehen, etwa so:

  [5] Fred, H., Z. Spät und H. Müller: Hobeln für Fortgeschrittene, 1. Auflage, Spanverlag, 2009

Habe ich mich nach Alternativen umgesehen. Da ich nicht gleich auf die volle DIN1505 Variante wechseln wollte, habe ich in einer Runde Mitternächlichem Syntaxraten den Stil zu einem für mich akzeptabeln Kompromiss angepasst. Es ware mit der Änderung von nur zwei Zeilen in format.names getan:

257c256
<         { s nameptr "{ll}{, jj}{, ff}{~vv}" format.name$ 't :=
---
>         { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
259c258
<             { "; " * t smallcaps * }
---
>             { ", " * t smallcaps * }

Hier die geänderte Datei: gerplain2.bst (Name, V.; Name, V. und Name, V.)

Somit habe ich jetzt Verweise der etwas kanonischeren Form

  [5] Fred, H.; Spät, Z. und Müller, H.: Hobeln für Fortgeschrittene, 1. Auflage, Spanverlag, 2009

Alternativ kann man auch grundsätlich mit den Initalen beginnen, hier ist nur eine Zeile zu ersetzen.

277c276
<         { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ smallcaps }
---
>         { s nameptr "{ll}{, jj}{, ff}{~vv}" format.name$ smallcaps }

Hier die fertige Datei: gerplain3.bst (V. Name, V. Name und V. Name)

Diese Variante liesst sich etwas angenehmer, begünstigt aber weniger das vertikale Scannen der Nachnahmen:

  [5] H. Fred, Z. Spät und H. Müller: Hobeln für Fortgeschrittene, 1. Auflage, Spanverlag, 2009

Ist natürlich alles Geschmacksache, aber ich hoffe erstmal das ich sobald nicht wieder eine bst Datei lesen muß.

von axel
20.05.09. 03:39:21. 250 Wörter, 3558 Ansichten. Kategorien: programming, science, TeX , 1 Kommentar »Send a trackback »

refbase

After years of collecting papers in more or less orderly folder hirarchies if finnally accepeted the fact that single hirarchies are not the reasonable way to collect literature, is searched for alternatives. After reviewing a number of projects I choose to give refbase a try.

So, not without some complications, I set up my very own refbase installation.

It basically unties the usage of bibtex with web storage of the PDF files and a Database backend. While the latter could be more advanced, the possibilty to use and store plain SQL Queries makes up for a lot. I may not resist to contribute to the code, though.

As for now, I'll give it a try as it is, and see how it feels.

Cheers

Axel

by axel
2009-05-10. 23:22:19. 125 words, 2270 views. Categories: science, TeX , Leave a comment »Send a trackback »

Beamer Presentation with Colored Sections and Side-TOC

When recently creating a presentation with the LaTeX beamer package, I had the idea to re-use the 4-section-4-color approach I used in a presentation on visual saliency (PDF, German). So I did some TeX hacking in order to get colored headers and shadows on the frame titles, looking like this:

Somebody asked me about it, so here is how it's done.

I like the Berkeley theme best, with gray colors, so the preamble starts:

\usetheme[right]{Berkeley}
\usecolortheme{seagull}

The colors were derived from the 4 primary color channels of the visual system, red, green, blue and yellow.

\xdefinecolor{headerb}{rgb}{0.20 0.20 0.40} %  51  51 102 a dark blue
\xdefinecolor{headerg}{rgb}{0.21 0.37 0.00} %  53  94   0 a dark green
\xdefinecolor{headery}{rgb}{0.97 0.78 0.09} % 248 198  22 a soft yellow
\xdefinecolor{headerr}{rgb}{0.77 0.18 0.18} % 194  46  46 a soft red

So, in order to head with a certain color and image, I created a frame command:

% frame command
\newcommand{\myframeimage}{}
\newcommand{\setframeimage}[1]{\renewcommand{\myframeimage}{#1}}
\newenvironment{myframe}[1]{%
\begin{frame}%
\frametitle{%
\begin{picture}(270,20)(0,0)
\put(0,0){\ifthenelse{\equal{\myframeimage}{}}{}{\includegraphics[height=15pt]{\myframeimage}}}
\put(20.8,0){\color{black} #1}%
\put(20,0.8){\color{white} #1}%
\end{picture}}
}{%
\end{frame}%
}

So, before I start a colored section I do the following:

\setbeamercolor{frametitle}{bg=headerg}
\setframeimage{figures/icon-ear.png}

And, of course, use the above frame command for each colored frame.

\begin{myframe}{\qout{Musikerzeugung durch Hören} [Jehan 2005]}
\includegraphics[width=\textwidth]{figures/ton-musik-trans-jehan.pdf}
\end{myframe}

You can take a look at the final product: Musikwahrnehmung & Erzeugung (PDF, German)

by axel
2008-08-03. 19:20:00. 232 words, 9488 views. Categories: programming, science, TeX , Leave a comment »Send a trackback »