1

I'm trying to create a twocolumn landscape document with four images per page (two per column, two columns per page). Except for the first figure, all are identical in form. The first figure is to contain text regarding the others. For some reason, the distinct nature of the initial figure is making the second figure of that first column (on the first page) appear at a different vertical position than the second figures in all the remaining columns (the out-of-place figure is lower on the page than the others). I've tried playing with the positioning behavior for the figures, and I've tried playing with how I declare the twocolumn landscape format, but nothing I've attempted fixes this undesirable quirk. For example, I've tried

\documentclass[landscape,twocolumn,letterpaper]{article}
\usepackage{geometry}

and

\documentclass[landscape,twocolumn,letterpaper]{article}
\usepackage[lmargin=0.50in,rmargin=0.50in]{geometry} % b/c I need smaller margins

and

\documentclass{article}
\usepackage[landscape,twocolumn,lmargin=0.50in,rmargin=0.50in]{geometry}

So, any fix ideas from the crowd?

\documentclass[landscape,twocolumn,letterpaper]{article}
\usepackage{geometry}
\usepackage{tikz}
\usepackage{lipsum}

% The basic figure I'm reusing
\DeclareRobustCommand{\myfig}[1]{
\begin{figure}[tb]
\centering
\textbf{Object \##1}\\
\vspace{10pt}
\begin{tikzpicture}[scale=0.6]
  \draw[help lines] (0,0) grid (8,7);
  \foreach \x in {0,...,7}
    \foreach \y in {0,...,6}
      \draw (\x+0.5, \y+0.5) node{0};
\end{tikzpicture}
\end{figure}
}

% ***************************** Main Matter *****************************

\begin{document}

\begin{figure}
\centering
\begin{minipage}[t]{4.0in}
\centering
\textbf{Title Line}\\
\lipsum[1]
\end{minipage}
\end{figure}

\myfig{1}
\myfig{2}
\myfig{3}

\clearpage

\myfig{4}
\myfig{5}
\myfig{6}
\myfig{7}

\end{document}

Page 1 Page 1

  • It seems that the figures are being arranged on the page as if they each get a \vfil beneath them. These expand until all the veritcal space is used up, which means that the size of the gap equals \textheight minus the sum of the figure heights, divided by two. – John Kormylo May 29 '15 at 3:45
  • I guess I'd been playing with the amount of text at the same time as playing with inserting some \vspace whitespace, so I never got an accurate idea of how just the amount of text affected things on its own. Now that I try that, I see that having just enough text to match the size of the other figures "fixes" the problem, via some sort of "gap size function." (thanks @JohnKormylo) So I guess I need to get better at troubleshooting. But still! I would expect the figures to go straight to top and bottom when that's what I ask for, rather than having variable size margins above/below/between them – avengerofpi May 29 '15 at 4:08
  • So I guess what I need to know is how to exactly copy/mimic the height of the other figures. I'll try to find that out tomorrow, or maybe someone will do that for me and post a link? – avengerofpi May 29 '15 at 4:15
2

I used flowfram to divide the page into 4 quadrants, and each figure winds up centered (vertically and horizontally) in each quadrant.

\documentclass[landscape,twocolumn,letterpaper]{article}
\usepackage{geometry}
\usepackage{tikz}
\usepackage{lipsum}
\usepackage{flowfram}

\newflowframe[1,2]{\dimexpr 0.5\textwidth - 0.5\columnsep}{\dimexpr 0.5\textheight - 0.5\columnsep}%
{0pt}{\dimexpr 0.5\textheight + 0.5\columnsep}[main]

\newflowframe[1,2]{\dimexpr 0.5\textwidth - 0.5\columnsep}{\dimexpr 0.5\textheight - 0.5\columnsep}%
{0pt}{0pt}[lowerleft]

\newflowframe[1,2]{\dimexpr 0.5\textwidth - 0.5\columnsep}{\dimexpr 0.5\textheight - 0.5\columnsep}%
{\dimexpr 0.5\textwidth + 0.5\columnsep}{\dimexpr 0.5\textheight + 0.5\columnsep}[upperright]

\newflowframe[1,2]{\dimexpr 0.5\textwidth - 0.5\columnsep}{\dimexpr 0.5\textheight - 0.5\columnsep}%
{\dimexpr 0.5\textwidth + 0.5\columnsep}{0pt}[lowerright]

% The basic figure I'm reusing
\DeclareRobustCommand{\myfig}[1]{
\begin{figure}[p]
\centering
\textbf{Object \##1}\\
\vspace{10pt}
\begin{tikzpicture}[scale=0.6]
  \draw[help lines] (0,0) grid (8,7);
  \foreach \x in {0,...,7}
    \foreach \y in {0,...,6}
      \draw (\x+0.5, \y+0.5) node{0};
\end{tikzpicture}
\end{figure}
}

% ***************************** Main Matter *****************************

\begin{document}

\centering
\begin{figure}[p]
\centering
\textbf{Title Line}\\
\lipsum[1]
\end{figure}

\myfig{1}
\myfig{2}
\myfig{3}

\myfig{4}
\myfig{5}
\myfig{6}
\myfig{7}

\end{document}
  • Thanks for the suggestion! Looks like the simpler of the two answers given and looks to work for me, so marking as solution. – avengerofpi May 30 '15 at 3:34
0

If you want absolute positioning, then my suggestion is to position the content using something like eso-pic. I've done that below:

enter image description here

\documentclass[landscape,letterpaper]{article}

\usepackage{eso-pic,adjustbox,tikz,lipsum}
\pagestyle{empty}% No header/footer

% The basic figure I'm reusing
\DeclareRobustCommand{\myfig}[1]{%
  \begin{tabular}{c}
    \textbf{Object \##1} \\[\normalbaselineskip]
    \begin{tikzpicture}[scale=0.6]
      \draw[help lines] (0,0) grid (8,7);
      \foreach \x in {0,...,7}
        \foreach \y in {0,...,6}
          \draw (\x+0.5, \y+0.5) node{0};
    \end{tikzpicture}
  \end{tabular}%
}

% ***************************** Main Matter *****************************

\begin{document}

\mbox{}% Just put something on the page
\AddToShipoutPictureFG*{% Place on _this_ page's ForeGround
  % Top left
  \put(\LenToUnit{\dimexpr.3333\paperwidth-2in},\LenToUnit{.6667\paperheight}){%
    \begin{minipage}{4in}
      \centering\textbf{Title line} \par\medskip
      \lipsum[1]
    \end{minipage}}%
  % Bottom left
  \put(\LenToUnit{.3333\paperwidth},\LenToUnit{.3333\paperheight}){%
    \adjustbox{center=0pt}{\myfig{1}}}
  % Top right
  \put(\LenToUnit{.6667\paperwidth},\LenToUnit{.6667\paperheight}){%
    \adjustbox{center=0pt}{\myfig{2}}}
  % Bottom right
  \put(\LenToUnit{.6667\paperwidth},\LenToUnit{.3333\paperheight}){%
    \adjustbox{center=0pt}{\myfig{3}}}
}

\clearpage

\mbox{}% Just put something on the page
\AddToShipoutPictureFG*{% Place on _this_ page's ForeGround
  % Top left
  \put(\LenToUnit{.3333\paperwidth},\LenToUnit{.6667\paperheight}){%
    \adjustbox{center=0pt}{\myfig{4}}}
  % Bottom left
  \put(\LenToUnit{.3333\paperwidth},\LenToUnit{.3333\paperheight}){%
    \adjustbox{center=0pt}{\myfig{5}}}
  % Top right
  \put(\LenToUnit{.6667\paperwidth},\LenToUnit{.6667\paperheight}){%
    \adjustbox{center=0pt}{\myfig{6}}}
  % Bottom right
  \put(\LenToUnit{.6667\paperwidth},\LenToUnit{.3333\paperheight}){%
    \adjustbox{center=0pt}{\myfig{7}}}
}

\end{document}

minipages and tabulars are vertically centered (unless you specify something else). The horizontal centering of content comes adjustbox's center=0pt option (you can also use a regular \makebox[0pt]), plus some fixed-width adjustment due to the known width of your text box.

  • Thanks for the suggestion and the info. It's not quite working on my machine---"Package keval Error: center undefined", resulting in the TikZ figures being right justified rather than centered in their columns---but I'll have to wait till later this weekend to figure that out. Maybe I'm missing a package. Anyways, if I had 15 reputation I'd totally upvote you. As is, all I can offer is this heartwarming :-) – avengerofpi May 30 '15 at 3:39
  • @avengerofpi: The center key-value is offered by adjustbox. Make sure you have an up-to-date version of the package. If not, you can download it from CTAN. – Werner May 30 '15 at 4:50
  • Thanks. Updating my packages fixed it. I was about four years out of date :s – avengerofpi Jun 2 '15 at 3:10

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.