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.

After creating my headline here How to arrange / align / place pictures and text, to form a given headline? I guessed, I would just place it into the header with \ihead and \thispagestyle{scrheadings} - but NO.

Problem is, the following text is placed uppon my header. And when I try to use markright I get eighter compile errors or no header at all.

I read some infos about using \protect, but it did not help eighter. I am guessing, that my constuct itself is simply not that easy to migrate into a header. I hope I can solve this on my own, but maybe someone else seeks a challange too :)

Here is the code, the images to it are available through the link before:

\documentclass[
    pdftex,
    a4paper,
    11pt,
    DIV15,
    BCOR20mm,
    parskip,
    numbers=noenddot]{scrbook}
    \usepackage{graphics} 
    \usepackage[pdftex]{graphicx}
    \usepackage{scrpage2}
    \usepackage{setspace} 
\begin{document}
\thispagestyle{scrheadings}
        \noindent
       \ihead{
        \textsf{
        \begin{singlespace}
             \raisebox{-0.5\height}{\rlap{\includegraphics[scale=0.5]{left_demo.png}}}
            \hfill
            %\includegraphics[height=60px]{center_demo.png}
            %\hfill
            \raisebox{-0.15\height}{\llap{
            \scriptsize %
            \begin{tabular}[c]{@{}r@{}}
                  somedemo txt abcdefghij,\\
                  texttextte txt texttexttextetscter\\
                  \\
                  demodemode demodemode
            \end{tabular}}}
            \raisebox{-0.525\height}{\includegraphics[height=45px]{right_demo.png}}
        \end{singlespace}}}
        \huge{text}
\end{document}

I do really appreciate any help on this, thanks!

Edit:

Here is what's wrong:

enter image description here

the text in the red circle should not be that high (used ihead here)

share|improve this question
    
your MWE runs without error, where were you planning to use marks? –  David Carlisle Oct 5 '12 at 9:48
    
sorry, I don't understand ... I tried using \markright instead of \ihead, but this gives me error \KV@def has extra } - using \ihead works fine - just the \huge{text} is placed too high –  Jook Oct 5 '12 at 10:26
    
I don't understand what you are trying to do actually (\markright typically just takes simple text such as a section title the complicate layout would normally be part of the page head design but that it uses the text from \markright where appropriate. That said if you want to stick the whole lot in a mark it appears to work to remove \noindent (which looks to be there in error ) and replace \ihead by \markright{\unexpanded{{ and add an extra } after \end{singlespace}}} –  David Carlisle Oct 5 '12 at 10:55
    
after \end{singlespace}? actually I would like to have the whole singlespace section to be IN the header. The \huge{text} is what I want to have beneath my header. –  Jook Oct 5 '12 at 11:07
    
yes that's what the above comment would do, although as I say using a \mark isn't really the way to do it it (I'd say the basic latex way of setting up page headers but I think the script classes have their own mechanisms so perhaps some who has used those before might answer) –  David Carlisle Oct 5 '12 at 11:32

1 Answer 1

up vote 2 down vote accepted

The problem is that your images take more vertical spacing than the default vertical space reserved for the header. When you process your code you will get a warning like this:

Overfull \vbox (57.3689pt too high) has occurred while \output is active

(the actual value for the overfull box will depend on the actual images). The value for \headheight has to be increased accordingly to prevent the warning and you can do this using headlines= or headheight= (this probably implies a change in the page layout).

Here's a little example. From the comments it's clear that the intent is to change the page style for the titlepage; one possibility to achieve this is to define a new page style and to use the geometry package to temporarily change the headheight value without modifications to the page layout made as class options through DIV and BCORR (adjust the length according to your needs); since the contents of the footer for this style was not specified I used some dummy options in the definition of the new page style:

\documentclass[pdftex,a4paper,11pt,DIV15,BCOR20mm,parskip,numbers=noenddot]{scrbook}
\usepackage{graphicx}
\usepackage{scrpage2}
\usepackage{geometry}
\usepackage{setspace} 
\usepackage{lipsum} 

\defpagestyle{mystyle}{%
\ihead{\sffamily%
  \raisebox{-0.5\height}{\rlap{\includegraphics[scale=0.5]{cat}}}\hfill
            %\includegraphics[height=60px]{center_demo.png}
            %\hfill
 \raisebox{-0.15\height}{\llap{%
    \scriptsize %
    \begin{tabular}[c]{@{}r@{}}
    somedemo txt abcdefghij,\\
    texttextte txt texttexttextetscter\\
    \\
    demodemode demodemode
    \end{tabular}}}
  \raisebox{-0.525\height}{\includegraphics[height=45px]{cat}}
 }
}{\ifoot{inside}\cfoot{center}\ofoot{outside}}

\begin{document}

\begin{titlepage}
\pagestyle{scrheadings}
\thispagestyle{mystyle}
\newgeometry{headheight=45pt}
{\huge text} 
\lipsum[1-3]
\end{titlepage}

\clearpage
\restoregeometry

\lipsum[1-4]

\end{document}

enter image description here

Not relevant to the problem mentioned, but the font size switches (\Huge, \huge, \LARGE, etc.) are declarations that do not have arguments, so instead of \huge{text}, you should use {\huge text} (to keep the change local and possibly using \par inside the group if required).

share|improve this answer
    
yeah! this is it - but would you be so kind to extend your demo to adjust the healines just for a single page (e.g. titlepage) and how to avoid getting pagenumbering on this page, when using ihead - which is a strange behaviour anyways. –  Jook Oct 5 '12 at 13:37
    
@Jook I have a lecture starting in 8 minutes, so I won't be able to give the modified example for several hours. As soon as I can I will do it. –  Gonzalo Medina Oct 5 '12 at 13:52
    
thank you very much! I got rid of the pagenumbering by using \ofoot{} but this was accompanied by my bottom text beeing displayed too far down. And besides, I would like to use a footer on the titlepage - just without pagenumbering. –  Jook Oct 5 '12 at 14:19
    
@Jook I updated my answer with the announced code. –  Gonzalo Medina Oct 5 '12 at 18:31
    
Thank you! This solved my particular problem. However, in order to understand your code better, I started to read about geometry and pagestyles and stuff und must conclude - Latex has a quite some huge steps in it's learing curve, which one has to conquer. –  Jook Oct 8 '12 at 8:41

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.