1

I have a document that looks like this

enter image description here

The horizontal line is just a \hrule, but the two vertical lines are made with a textblock. Is there an easier way to place them?

Using a table environment is not an option, since the vertical space between items goes bananas.

\documentclass{article}
\usepackage{multicol,tabularx}
\usepackage[top=0.5in,bottom=0.8in,left=0.8in,right=0.8in,landscape]{geometry}

\usepackage[absolute]{textpos}
\setlength{\TPHorizModule}{1cm}
\setlength{\TPVertModule}{\TPHorizModule}
\textblockorigin{10mm}{10mm}

\begin{document}
\begin{textblock}{3}(6.3,0.75)%%%Places a vertical line
\rule{0.1mm}{18cm}
\end{textblock}

\begin{textblock}{3}(15,0.75)%%%Places a vertical line
\rule{0.1mm}{18cm}
\end{textblock}

\begin{tabularx}{\textwidth}{X}
\centering{FUS} 
\end{tabularx}
\hrule

\begin{multicols}{2}
\begin{minipage}{0.44\textwidth}
\vspace{15cm}   
RO
\end{minipage}

\begin{minipage}{0.44\textwidth}
DAH
\end{minipage}
\end{multicols}
\end{document}
6
  • Easier... easier how? Why is what you have "difficult"? What else do you want to do with the output?
    – Werner
    Aug 5 '15 at 3:29
  • @Werner I have to tell LaTeX where and how long I want that line. It has to be adjusted every time the \hrule moves, or the columns width changes. Tinkering like that is what I'd expect on a WYSIWYG, not on LaTeX.
    – Kurzd
    Aug 5 '15 at 3:35
  • @Kurzd you could create your own environment, and automatize all those lengths based on the characteristics of the content, using savebox. Or you could try more elaborated table environments. Check this link en.wikibooks.org/wiki/LaTeX/…
    – phollox
    Aug 5 '15 at 4:01
  • Or not use a table at all, but rather something like multicol. @Werner I'm pretty sure OP is talking about the apparent 'hackiness' of the doc. I'm not really sure how much we can infer (since the given solution 'works' but is suboptimal for varying definitions of 'optimal'). OP, what is your goal for this document, what have you tried to work towards that goal, and what is the hang-up with that approach? (Related: tex.stackexchange.com/a/258199/17423 because I'm cheating a little. OP's document is a maths reference sheet.) Aug 5 '15 at 4:21
  • 1
    I'm trying to make one of these. There's four of those, all of them with different layouts and glaring mistakes.
    – Kurzd
    Aug 5 '15 at 21:33
4

This gives a similar output. Is it 'easier'?

The height of the vertical rules is calculated automatically using \pagegoal (total vertical space available within margins) and \pagetotal (amount of vertical space already used on current page).

\documentclass{article}

\usepackage{calc}
\usepackage[top=1.3cm,bottom=2cm,left=2cm,right=2cm,landscape]{geometry}

\begin{document}

\centering
FUS
\hrule{}

\newlength\minipageheight
\setlength\minipageheight{\pagegoal-\pagetotal-1mm}

\begin{minipage}[t][\minipageheight][t]{0.33\textwidth}
\vfill
RO
\end{minipage}%
\vrule{}
\begin{minipage}[t][\minipageheight][t]{0.33\textwidth}
\smallskip
\centering
DAH
\end{minipage}%
\vrule{}
\begin{minipage}[t][\minipageheight][t]{0.33\textwidth}
\smallskip
\centering
JOOR
\end{minipage}

\end{document}

enter image description here

2
  • Your suggestion made all the columns jump to a second page, leaving that FUS alone. I changed \minipageheight's definition to 16 cm, and they're all now on the same page.
    – Kurzd
    Aug 5 '15 at 22:30
  • 1
    I think this is because of rounding errors from the calculation of \minipageheight. 0.99\minipageheight fits on one page for me, but 1.01\minipageheight does not. I have updated the solution, and made \minipageheight shorter by 1mm.
    – onewhaleid
    Aug 6 '15 at 22:21

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.