0

I got a LaTeX file from someone, I'm not sure how its structured exactly but maybe there is an easy way to solve my problem without having to change too much in the template:

Problem: When there's a long title in my LaTeX file, it completely ruins the header Bad Header

I want it to look something like this in the case where that title is too long: Good Header Notice: not only do I not want a line-break, also there should be only a certain width allowed and there needs to be some way to show that the title is not complete like my "..." at the end in this example.
How to do this?

\documentclass[10pt, a4paper, notitlepage, twoside, twocolumn, openany]{book}

%...

\newcommand{\Issue}{ISSUE 02/2019}
\newcommand{\Title}{Teeeeest, Teeesst, TESSSSSSSSSSSSSSSSSSSST: Teeeeeeeeeeeeeest teeeeeeeeest Teeeeeeeeeeeeeeeeest and Teeeeeeeeeeest test test teeeeeeeeeeeeeest Tesssst}
\newcommand{\Author}{Prof. Dr.Test Teeeest,T T.}
\newcommand{\StartPageNumber}{93}

% HEADER
\usepackage{fancyhdr}
\setlength{\headheight}{15.2pt}
\pagestyle{fancy}
\fancypagestyle{plain}{}
\fancyhf{}
\fancyhf[HRO]{\vectoralight \thepage}
\fancyhf[HLE]{\vectoralight \thepage}
\fancyhf[HRE,HLO]{\vectoralight \Issue}
\fancyhf[HCE,HCO]{\vectoralight \emph{\Author}, \Title}
\renewcommand{\headrulewidth}{0pt}

EDIT From an answer mentioned in the comments I got quite far adding this:

\usepackage[fit]{truncate}

And then using it like this:

\fancyhf[HCE,HCO]{\truncate{.75\headwidth}{\vectoralight \emph{\Author}, \Title}}

But it's using the headwith of the whole header - ignoring my page number and issue on the top left and right. Is there an easy way to take the widths of my other \fancyhf tags into account?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.