5

I want to build a poster with tikzposter using a custom title that contains a tikzpicture.

Here's a simplified example:

\documentclass{tikzposter}

\settitle{
    Test

    \begin{tikzpicture}
        \fill (0,0) rectangle (1,1);
        % \node at (0,0) () {Test};
    \end{tikzpicture}

    Test
}

\usepackage{lipsum}

\begin{document}

\maketitle

\block{Lorem Ipsum}{
    \lipsum
}

\end{document}

This is how this renders for me: screenshot

However, when I comment in the line \node at (0,0) () {Test};, for some reason, the tikzpicture is pulled to the right:

screenshot

Where is this horizontal distance coming from, and how can I prevent this from happening?

fefrei
  • 1,339
  • 1
    I think that the problem stems from the fact that you are nesting tikzpictures and you may be able to avoid it by using boxes. –  Jul 24 '18 at 11:54

1 Answers1

7

The problem is that you are, perhaps unknowingly, nesting tikzpictures, which one should not do. You can avoid it by using boxes.

\documentclass{tikzposter}
\newsavebox\whatever
\savebox\whatever{\begin{tikzpicture}
        \fill (0,0) rectangle (1,1);
         \node at (0,0) () {Test};
\end{tikzpicture}
}

\settitle{
    Test

\usebox\whatever

    Test
}

\usepackage{lipsum}

\begin{document}

\maketitle

\block{Lorem Ipsum}{
    \lipsum
}

\end{document}
  • 1
    Indeed, it looks like I was accidentally inheriting a minimum width which caused this shift. Thanks! – fefrei Jul 24 '18 at 12:02