Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is any of you familiar with the classicthesis and arsclassica packages?

I am using them for my PhD thesis, they are great, but I encountered a minor problem.

classicthesis defines the \graffito{...} command which is used to add a small note on the external margin of the page. These notes are usually formatted in a smaller black italic Times font. Unfortunately, as you can see in the top part of the attached picture, if you use hyperref (or other packages) to color links (or other things like acronyms) and you have one of them spanning across two lines in where a \graffito(...) is defined, the whole note gets the color of the link.

enter image description here

I often use LaTeX to compose scientific papers, so I do not know very well how things work under the hood. I managed to isolate the following code in classicthesis sources that is responsible for \graffito{...}. I thought it was enough to add \color{black} somewhere in the forth line of the following code: the note actually becomes black, but an empty line is added (see the bottom part of the attached picture). Could you please tell me how to modify it to avoid it being colored by links? Could you please also explain me why?

% Graffiti as in GKP's book "Concrete Mathematics"
% thanks to Lorenzo Pantieri and Enrico Gregorio
\def\graffito@setup{%
   \slshape\footnotesize%  <=== I'm going to add \color{black} right here!
   \parindent=0pt \lineskip=0pt \lineskiplimit=0pt %
   \tolerance=2000 \hyphenpenalty=300 \exhyphenpenalty=300%
   \doublehyphendemerits=100000%
   \finalhyphendemerits=\doublehyphendemerits}
%\DeclareRobustCommand{\graffito}[1]{\marginpar%
% [\graffito@setup\raggedleft\hspace{0pt}{#1}]%
% {\graffito@setup\raggedright\hspace{0pt}{#1}}}
\let\oldmarginpar\marginpar
\renewcommand{\marginpar}[1]{\oldmarginpar%
 [\graffito@setup\raggedleft\hspace{0pt}{#1}]%
 {\graffito@setup\raggedright\hspace{0pt}{#1}}}

I hope the following minimal working example will help you. Thanks in advance!

\documentclass[paper=a4,fontsize=11pt,BCOR=5mm,twoside,open=right,titlepage,
    headinclude,footinclude,captions=tableheading,numbers=noenddot,fleqn,
    cleardoublepage=empty]{scrreprt}

\usepackage[pdftex]{hyperref}
\usepackage[smaller,printonlyused,withpage]{acronym}
\usepackage[dvipsnames,svgnames,x11names,table,fixpdftex,hyperref]{xcolor}
\usepackage[eulerchapternumbers,eulermath,beramono,pdfspacing,linedheaders]{classicthesis}
\usepackage{arsclassica}

\renewcommand{\bflabel}[1]{{#1}\hfill}
\renewcommand*{\acsfont}[1]{\textsmaller{\textsf{\textsc{\textbf{\color{webgreen}{#1}}}}}}
\renewcommand*{\acffont}[1]{\textsf{\textsc{\color{webgreen}{#1}}}}

\areaset[current]{336pt}{750pt}
\setlength{\marginparwidth}{7em}
\setlength{\marginparsep}{2em}

\pdfcompresslevel=9
\pdfadjustspacing=1
\hypersetup{
    colorlinks=true, linktocpage=true, pdfstartpage=3, pdfstartview=FitV,%
    breaklinks=true, pdfpagemode=UseNone, pageanchor=true, pdfpagemode=UseOutlines,%
    plainpages=false, bookmarksnumbered, bookmarksopen=true, bookmarksopenlevel=1,%
    hypertexnames=true, pdfhighlight=/O,%nesting=true,%frenchlinks,%
    urlcolor=webbrown, linkcolor=RoyalBlue, citecolor=webgreen, %pagecolor=RoyalBlue,%
    pdftitle={The Title},%
    pdfauthor={\textcopyright\ Stefano},%
    pdfsubject={},%
    pdfkeywords={},%
    pdfcreator={pdfLaTeX},%
    pdfproducer={LaTeX with hyperref and classicthesis}%
}

\begin{document}
\cleardoublepage
\acresetall
\chapter{A Chapter} % (fold)
\label{cha:a_chapter}
An application field\graffito{Technical domains} that is often cited 
in this regard is that of \acp{WS} and \ac{SOA} in general.

\begin{acronym}[SOA]
\acro{SOA}{Service\--Oriented Architecture}
\acro{WS}{Web Service}
\end{acronym}
% chapter a_chapter (end)
\end{document}
share|improve this question
    
You should file a bug report to André Miede about it. For the moment, loading etoolbox and doing \makeatletter\patchcmd{\graffito@setup}{\slshape}{\leavevmode\normalcolor\itsha‌​pe}{}{}\makeatother will solve the problem. (I don't know why \slshape sneaked in instead of \itshape.) –  egreg Jan 9 '13 at 13:38
    
I know that \itsha‌​pe and \slshape have different spacing... Maybe they did it on purpose! If get a solution, I'll forward it to André! –  Stefano Bragaglia Jan 9 '13 at 13:57
    
I just sent a message to André to let him know about the problem and the solution. I also pointed him to this page to let you guys that helped me out to get the credit that you deserve. Thanks everybody! –  Stefano Bragaglia Jan 9 '13 at 14:17

1 Answer 1

up vote 4 down vote accepted

Add \leavevmode before the \color command.

(See a footnote about this in the grfguide documentation of colour support in LaTeX. (Sorry, its not my fault:-)

There is a different type of problem that will occur for all drivers. Due to certain technical difficulties\footnote{At least two causes: 1) The presence of a \texttt{\char`\\special} \m{whatsit} prevents \texttt{\char`\\addvspace} ‘seeing’ space on the current vertical list, so causing it to incorrectly add extra vertical space. 2) A \m{whatsit} as the first item in a \texttt{\char`\\vtop} moves the reference point of the box.}%


\documentclass[paper=a4,fontsize=11pt,BCOR=5mm,twoside,open=right,titlepage,
    headinclude,footinclude,captions=tableheading,numbers=noenddot,fleqn,
    cleardoublepage=empty]{scrreprt}

\usepackage[pdftex]{hyperref}
\usepackage[smaller,printonlyused,withpage]{acronym}
\usepackage[dvipsnames,svgnames,x11names,table,fixpdftex,hyperref]{xcolor}
\usepackage[eulerchapternumbers,eulermath,beramono,pdfspacing,linedheaders]{classicthesis}
\usepackage{arsclassica}

\renewcommand{\bflabel}[1]{{#1}\hfill}
\renewcommand*{\acsfont}[1]{\textsmaller{\textsf{\textsc{\textbf{\color{webgreen}{#1}}}}}}
\renewcommand*{\acffont}[1]{\textsf{\textsc{\color{webgreen}{#1}}}}

\areaset[current]{336pt}{750pt}
\setlength{\marginparwidth}{7em}
\setlength{\marginparsep}{2em}

\pdfcompresslevel=9
\pdfadjustspacing=1
\hypersetup{
    colorlinks=true, linktocpage=true, pdfstartpage=3, pdfstartview=FitV,%
    breaklinks=true, pdfpagemode=UseNone, pageanchor=true, pdfpagemode=UseOutlines,%
    plainpages=false, bookmarksnumbered, bookmarksopen=true, bookmarksopenlevel=1,%
    hypertexnames=true, pdfhighlight=/O,%nesting=true,%frenchlinks,%
    urlcolor=webbrown, linkcolor=RoyalBlue, citecolor=webgreen, %pagecolor=RoyalBlue,%
    pdftitle={The Title},%
    pdfauthor={\textcopyright\ Stefano},%
    pdfsubject={},%
    pdfkeywords={},%
    pdfcreator={pdfLaTeX},%
    pdfproducer={LaTeX with hyperref and classicthesis}%
}

\makeatletter


\def\graffito@setup{%
   \slshape\footnotesize%  <=== I'm going to add \color{black} right here!
\leavevmode\color{black}%
   \parindent=0pt \lineskip=0pt \lineskiplimit=0pt %
   \tolerance=2000 \hyphenpenalty=300 \exhyphenpenalty=300%
   \doublehyphendemerits=100000%
   \finalhyphendemerits=\doublehyphendemerits}

\makeatother

\begin{document}
share|improve this answer
1  
Thanks! It works like a charm! Also thanks for explaining me how to use \makeatletter and \makeatother! It was on the TODO list! –  Stefano Bragaglia Jan 9 '13 at 14:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.