Add logos beyond the title (tikzposter)
Here's one way to do it. I redefined \maketitle to name the title node and then used this named node to place two additional nodes with the logos. All you have to do is to use your images and options in \insertlogoi
, \insertlogoii
:
\insertlogoi[<options>]{<logo1 file>}
\insertlogoii[<options>]{<logo2 file>}
and you can control the separation between the logos and the title box using \LogoSep
(default value=0pt
).
A complete example:
\documentclass{tikzposter}
\title{The Title}
\author{The Author}
\institute{The Institute}
\makeatletter
\newcommand\insertlogoi[2][]{\def\@insertlogoi{\includegraphics[#1]{#2}}}
\newcommand\insertlogoii[2][]{\def\@insertlogoii{\includegraphics[#1]{#2}}}
\newlength\LogoSep
\setlength\LogoSep{0pt}
\insertlogoi[width=5cm]{example-image-a}
\insertlogoii[width=5cm]{example-image-b}
\renewcommand\maketitle[1][]{ % #1 keys
\normalsize
\setkeys{title}{#1}
% Title dummy to get title height
\node[transparent,inner sep=\TP@titleinnersep, line width=\TP@titlelinewidth, anchor=north, minimum width=\TP@visibletextwidth-2\TP@titleinnersep]
(TP@title) at ($(0, 0.5\textheight-\TP@titletotopverticalspace)$) {\parbox{\TP@titlewidth-2\TP@titleinnersep}{\TP@maketitle}};
\draw let \p1 = ($([email protected])-([email protected])$) in node {
\setlength{\TP@titleheight}{\y1}
\setlength{\titleheight}{\y1}
\global\TP@titleheight=\TP@titleheight
\global\titleheight=\titleheight
};
% Compute title position
\setlength{\titleposleft}{-0.5\titlewidth}
\setlength{\titleposright}{\titleposleft+\titlewidth}
\setlength{\titlepostop}{0.5\textheight-\TP@titletotopverticalspace}
\setlength{\titleposbottom}{\titlepostop-\titleheight}
% Title style (background)
\TP@titlestyle
% Title node
\node[inner sep=\TP@titleinnersep, line width=\TP@titlelinewidth, anchor=north, minimum width=\TP@visibletextwidth-2\TP@titleinnersep]
at (0,0.5\textheight-\TP@titletotopverticalspace)
(title)
{\parbox{\TP@titlewidth-2\TP@titleinnersep}{\TP@maketitle}};
\node[inner sep=0pt,anchor=west]
at ([xshift=-\LogoSep]title.west)
{\@insertlogoi};
\node[inner sep=0pt,anchor=east]
at ([xshift=\LogoSep]title.east)
{\@insertlogoii};
% Settings for blocks
\normalsize
\setlength{\TP@blocktop}{\titleposbottom-\TP@titletoblockverticalspace}
}
\makeatother
\begin{document}
\maketitle
\end{document}
The result:
To add three or more logos, one can define similar commands and \node
s to the ones I defined for the case of two logos. Alittle variation for four logos:
\documentclass{tikzposter}
\usetikzlibrary{positioning}
\title{The Title}
\author{The Author}
\institute{The Institute}
\makeatletter
\newcommand\insertlogoi[2][]{\def\@insertlogoi{\includegraphics[#1]{#2}}}
\newcommand\insertlogoii[2][]{\def\@insertlogoii{\includegraphics[#1]{#2}}}
\newcommand\insertlogoiii[2][]{\def\@insertlogoiii{\includegraphics[#1]{#2}}}
\newcommand\insertlogoiv[2][]{\def\@insertlogoiv{\includegraphics[#1]{#2}}}
\newlength\LogoHSep
\newlength\LogoVSep
\setlength\LogoHSep{60pt}
\setlength\LogoVSep{1cm}
\insertlogoi[width=5cm]{example-image-a}
\insertlogoii[width=5cm]{example-image-b}
\insertlogoiii[width=5cm]{example-image-c}
\insertlogoiv[width=5cm]{example-image}
\renewcommand\maketitle[1][]{ % #1 keys
\normalsize
\setkeys{title}{#1}
% Title dummy to get title height
\node[transparent,inner sep=\TP@titleinnersep, line width=\TP@titlelinewidth, anchor=north, minimum width=\TP@visibletextwidth-2\TP@titleinnersep]
(TP@title) at ($(0, 0.5\textheight-\TP@titletotopverticalspace)$) {\parbox{\TP@titlewidth-2\TP@titleinnersep}{\TP@maketitle}};
\draw let \p1 = ($([email protected])-([email protected])$) in node {
\setlength{\TP@titleheight}{\y1}
\setlength{\titleheight}{\y1}
\global\TP@titleheight=\TP@titleheight
\global\titleheight=\titleheight
};
% Compute title position
\setlength{\titleposleft}{-0.5\titlewidth}
\setlength{\titleposright}{\titleposleft+\titlewidth}
\setlength{\titlepostop}{0.5\textheight-\TP@titletotopverticalspace}
\setlength{\titleposbottom}{\titlepostop-\titleheight}
% Title style (background)
\TP@titlestyle
% Title node
\node[inner sep=\TP@titleinnersep, line width=\TP@titlelinewidth, anchor=north, minimum width=\TP@visibletextwidth-2\TP@titleinnersep]
at (0,0.5\textheight-\TP@titletotopverticalspace)
(title)
{\parbox{\TP@titlewidth-2\TP@titleinnersep}{\TP@maketitle}};
\node[inner sep=0pt,anchor=west]
at ([shift={(-\LogoHSep,\LogoVSep)}]title.west)
(logo1)
{\@insertlogoi};
\node[inner sep=0pt,anchor=west,right=of logo1]
(logo2)
{\@insertlogoii};
\node[inner sep=0pt,anchor=east]
at ([shift={(\LogoHSep,\LogoVSep)}]title.east)
(logo4)
{\@insertlogoiv};
\node[inner sep=0pt,left=of logo4]
(logo4)
{\@insertlogoiii};
% Settings for blocks
\normalsize
\setlength{\TP@blocktop}{\titleposbottom-\TP@titletoblockverticalspace}
}
\makeatother
\begin{document}
\maketitle
\end{document}
A somewhat dirty, but very flexible way to insert logos using a "low-level" tikz command referencing the name of the title node:
\node[OPTIONS] at ([email protected]) {\includegraphics[width=10cm]{mylogo.png}};
Here you can provide additional options to the node command so as to move your logo wherever you need. Also, you can change west
in ([email protected])
to other positions. An example document:
\documentclass{tikzposter}
\title{Title}
\author{Author}
\institute{Institute}
\begin{document}
\maketitle
\node[anchor=west] at ([email protected]) {\includegraphics[width=10cm]{mylogo1.png}};
\node[anchor=west,yshift=-2cm] at ([email protected]) {\includegraphics[width=10cm]{mylogo2.png}};
\node[anchor=east,yshift=-1cm] at ([email protected]) {\includegraphics[width=10cm]{mylogo3.png}};
\block{Block}{Content}
\end{document}
(embarrassing to say that I'm one of the authors of tikzposter and was now googling myself for how to insert a logo without having to redefine any macro. As a result I came up with this solution.)