0

I am trying to recreate the following header created in Word using LaTeX

desired output

I have attempted to do so by using the fancyhdr package and creating a table as follows

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{} % sets both header and footer to nothing
\renewcommand{\headrulewidth}{0pt}
\fancyhead[L]{ 
\begin{tabular}{l l}
\multirow{3}{*}{\includegraphics[scale=1]{template/header_left}} & {\huge Big text} \\
& Small text \\
\multicolumn{2}{l}{\includegraphics[scale=1]{template/horizontal}}
\end{tabular}}

However, the result looks like this:

Latex output

these are the two images used to construct the header:

Image 1: horizontak

Image 2:

left

1
  • Welcome to TeX.SE!
    – Mensch
    Nov 1, 2021 at 13:32

3 Answers 3

0

The makecell package often comes handy for these kinds of constructs.

\documentclass{article}
\usepackage{lipsum}
\usepackage{makecell}
\usepackage{graphicx}
\usepackage{fancyhdr}
\setlength{\headheight}{64pt}
\pagestyle{fancy}
\fancyhf{} % sets both header and footer to nothing
\renewcommand{\headrulewidth}{0pt}
\fancyhead[L]{ 
  \mbox{\makecell[cl]{\includegraphics[scale=1]{header_left}}}
  \makecell[cl]{{\huge Big text} \\[2pt] ~Small text} \\[-9pt]
  {\includegraphics[width=\headwidth]{horizontal}}}

\begin{document}
\lipsum
\end{document}

enter image description here

0

This uses \saveboxes and \parboxes to construct the header. Note that fancyhdr is sensitive about \headheight.

\documentclass[a4paper,11pt]{article}
\usepackage{xcolor}
\usepackage{graphicx}
% create header
\sbox1{\parbox[b]{0.5\textwidth}{{\huge Big text}\par Small texty \hrule height0pt}}% move baseline to bottom
\newsavebox{\myheader}
\savebox{\myheader}{\parbox[b]{\textwidth}{\includegraphics[height={\dimexpr \ht1+\dp1+2pt}]{example-image}%
  \hspace{2pt}\raisebox{2pt}{\box1}% add 2pt gap to left and bottom
  \color{red}\hrule height2pt}}
% use header
\usepackage[headheight=\ht\myheader]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{} % sets both header and footer to nothing
\renewcommand{\headrulewidth}{0pt}
\fancyhead[L]{\usebox\myheader}

\begin{document}
The content of my thesis goes here
\end{document}

Note that every line (box) has a top, bottom and baseline. LaTeX tries to space the baselines \baselineskip apart, but if two lines run together it instead adds \lineskip between the bottom of one and the top of the next. Tabular is even more complicated. However, \hrule does not obey these rules.

0

This is a version that is using colored rules instead of your graphics files.

\documentclass{article}

\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage[scaled]{helvet}
\usepackage[T1]{fontenc}
\renewcommand\familydefault{\sfdefault}

\usepackage[dvipsnames]{color}

\makeatletter
\let\old@rule\@rule
\def\@rule[#1]#2#3{\textcolor{rulecolor}{\old@rule[#1]{#2}{#3}}}
\makeatother

\definecolor{rulecolor}{named}{BrickRed}
\setlength{\headheight}{32pt}

\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[L]{ 
\rule{2em}{4em}\hspace{2pt}\rule{1em}{4em}\hspace{2pt}\rule{0.25em}{4em} \hspace{3pt}
\raisebox{5mm}[4mm][2mm]{
\begin{tabular}{l}
\huge Big Text \\
\textcolor[rgb]{0.8,0.8,0.8}{Small text}
\end{tabular}
}\vspace{-0.8em}
\rule{1.2\textwidth}{1em} \hspace{3pt}
}

\begin{document}

\noindent \lipsum

\end{document}

It will look like this. All lengths can be tailored.

With rules

Your Answer

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

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