0

I would like to use tikz to draw a background in a baposter document. The idea is to typeset a document that can be printed at different sizes, such as A0 and A4 (at least).

It is not clear to me what coordinates tikz is using. I prepared the following example:

\documentclass[a0paper,portrait]{baposter}
\usepackage{tikz}

\begin{document}

\background{
  \begin{tikzpicture}[remember picture,overlay]%
  \draw[black,line width=20pt] (current page.south east) rectangle (current page.north west);
  \draw[thick,green,line width=1mm] (0,0) rectangle (0,1) ;
  \draw[thick,blue,line width=1mm] (1,0) rectangle (1,3) ;
  \draw[thick,red,line width=1mm] (3,0) rectangle (3,30) ;
  \draw[thick,yellow, line width=2mm] (current page.south west) rectangle (0.5, 0.5);
  \end{tikzpicture}
}

\begin{poster}{
    background=user,
    eyecatcher=false,
    boxColorOne=white
}
{} % eye catcher
{
    \bfseries\sffamily TITLE
}
{
    AUTHOR
}
{} % logo

\headerbox{intro}{name=problem,column=0,row=0,headershape=smallrounded,
                    headerborder=none,textborder=none}{
content
}


\end{poster}
\end{document}

whose output is:

output

I have three questions:

  • how does tikz fix the origin (0,0)? In this case the point (0,0) is not in the lower left corner. Do I need to figure out how to use the shift command option or is there an easier way?
  • how can I get the range of x and y values for the selected paper size (in this cases a0paper)?
  • can I use normalized coordinates, i.e. [0,1], for the two axes?

Is there anyone who can help me?

1 Answer 1

1

TiKZ doesn't fix origin. origin is only valid inside a tikzpicture. Once the picture is finished, it's placed as a regular char where it should go.

You can shift coordinates from a certain origin ([shift={(2cm,3cm)}]current page.center), or use relative coordinates from previous point with ++.

The paper size is fixed into \papaerwidth and \paperheight. You can use this values to determine proportional positions.

some examples in following code:

\documentclass[a0paper,portrait]{baposter}
\usepackage{tikz}
\usepackage{lmodern}

\begin{document}

\background{
  \begin{tikzpicture}[remember picture,overlay]%
  \draw[black,line width=20pt] (current page.south east) rectangle (current page.north west);
  \draw[thick,green,line width=1mm] ([shift={(1cm,1cm)}]current page.south west) rectangle ++(.2*\paperwidth,.3*\paperheight) ;
  \draw[thick,blue,line width=1mm, shift=(current page.center)] (-2,-2) rectangle (2,2);
  \draw[thick,red,line width=1mm] (3,0) rectangle (5,20) ;
  \draw[thick,yellow, line width=2mm] (current page.south west) rectangle (0.5, 0.5);
  \end{tikzpicture}
}

\begin{poster}{
    background=user,
    eyecatcher=false,
    boxColorOne=white
}
{} % eye catcher
{
    \bfseries\sffamily TITLE
}
{
    AUTHOR
}
{} % logo

\headerbox{intro}{name=problem,column=0,row=0,headershape=smallrounded,
                    headerborder=none,textborder=none}{
content
}


\end{poster}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .