Page Layoutmultiple column layout with different-sized columns

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
ulula
Posts: 5
Joined: Fri Mar 19, 2010 6:18 pm

multiple column layout with different-sized columns

Post by ulula »

I am trying to get the following layout in a document, it is a test document that has boxes to check off on, with step numbers, and then there is a description of the step:

step Verify Description
1. [ ] Lorem lipsum dolor
2. [ ] Push button 1
...

I tried with tabbing, but on steps that had lots of text, the text ran off hte page. I tried modifying hanging indent and indent settings, but that got confusing as well, any suggestions for how to get this kind of layout?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

multiple column layout with different-sized columns

Post by gmedina »

Hi,

perhaps a tabular environment could be useful. Take a look at the following simple example (please note that the rows are numbered automatically):

Code: Select all

\documentclass{book}
\usepackage{array}
\usepackage{lipsum}% just to generate some text

\newcounter{mycont}

\begin{document}

\noindent\begin{tabular}{>{\stepcounter{mycont}\themycont.}l%
      @{\hspace*{5pt}[\quad ]\hspace*{5pt}}p{.8\textwidth}}
  \multicolumn{1}{l}{\bfseries Step} & \bfseries Verify Description\\
  & Description for the first step.\\
  & Description for the second step.\\
  & \lipsum[1]\\
\end{tabular}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

multiple column layout with different-sized columns

Post by frabjous »

I'd probably do something like this:

Code: Select all

\documentclass{article}
\usepackage{enumitem,hyperref}
\begin{document}
\begin{Form}
\noindent step Verify Description%
\newlength{\steplen}
\settowidth{\steplen}{step}
\newlength{\verifylen}
\settowidth{\verifylen}{~Verify~}
\newlength{\boxlen}
\settowidth{\boxlen}{\CheckBox{}}
\newlength{\labellen}
\setlength{\labellen}{\steplen}
\addtolength{\labellen}{\verifylen}
\settowidth{\verifylen}{Verify}
\newlength{\bufferlen}
\setlength{\bufferlen}{\verifylen}
\addtolength{\bufferlen}{-1\boxlen}
\begin{enumerate}[label={\arabic*.\hspace{0.5\bufferlen}\CheckBox{}\hspace{0.5\bufferlen}},leftmargin=\labellen]
\item Lorem lipsum dolor
\item Push button 1
\item Wait for big explosion
\end{enumerate}
\end{Form}
\end{document}
That'll generate actual live checkboxes that can be checked and unchecked inside your PDF viewer.

If you're going to print these and and check the boxes with pen or pencil, I'd go with the simpler:

Code: Select all

\documentclass{article}
\usepackage{enumitem,bbding}
\begin{document}
\noindent step Verify Description%
\newlength{\steplen}
\settowidth{\steplen}{step}
\newlength{\verifylen}
\settowidth{\verifylen}{~Verify~}
\newlength{\boxlen}
\settowidth{\boxlen}{\Square}
\newlength{\labellen}
\setlength{\labellen}{\steplen}
\addtolength{\labellen}{\verifylen}
\settowidth{\verifylen}{Verify}
\newlength{\bufferlen}
\setlength{\bufferlen}{\verifylen}
\addtolength{\bufferlen}{-1\boxlen}
\begin{enumerate}[label={\arabic*.\hspace{0.5\bufferlen}\Square\hspace{0.5\bufferlen}},leftmargin=\labellen]
\item Lorem lipsum dolor
\item Push button 1
\item Wait for big explosion
\end{enumerate}
\end{document}
On second thought, that's not really very simple. Feel free to ignore this crazy idea.
ulula
Posts: 5
Joined: Fri Mar 19, 2010 6:18 pm

Re: multiple column layout with different-sized columns

Post by ulula »

Thanks for the replies. The tabular option seems like a cleaner option, especially since I am generating the LaTeX code from a script. Only one concern however with the tabular option: if I encounter a table that has to go in the Description column, can I nest it?
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

multiple column layout with different-sized columns

Post by gmedina »

Of course. You can nest tabular environments.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
ulula
Posts: 5
Joined: Fri Mar 19, 2010 6:18 pm

multiple column layout with different-sized columns

Post by ulula »

That seems to be working fine now. I am nesting a tabulary environment within a cell under a tabular environment which is controlling the layout of the entire document. The layout of the document is fixed, I can determine that ahead of time. And the nested tables will be controlled with the tabulary environment.

What I am worried most about now is making these tables fit, since small tables will work fine, what about long ones? I can shrink the text, I guess, but other than that, I see no way out. I wish I could rotate the table, but since I am generating the LaTeX code from elsewhere, there is no way of determining ahead of time if I should rotate it or not, unless I throw some code to determine if the table will be too long.

Here is an example, using just a \textwidth. If the first column (Displayed Data) gets too long, the columns themselves will start to jam together. Now I see why they say LaTeX helps you structure your content and present it more concisely!

Code: Select all

\chapter{Equipment Operating Procedures} 

Here is a sample 7-column table that could expand quite a bit:


\begin{tabulary}{\textwidth}{L L L L L L L L}
\toprule
\textbf{Displayed Data} & \textbf{Color} & \textbf{Size} & \textbf{Display Type} & \textbf{Display Label} & \textbf{Line Number} & \textbf{Data Just.} \\
\midrule
Displayed RPM Label & Cyan & Large & Display Only & RPM $<value>$ & Line Number 1-1 & R \\
\bottomrule
\end{tabulary}
Post Reply