Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I can't seem to figure out the minute details needed to use enumerate inside a tabular environment. If I just sort of brute force the code I can get something similar to what I'm trying to achieve, but I'd much prefer somehow being able to use enumerate (or something similar) so I can be consistent. My "for the time being" code looks like:

\begin{tabular}{|p{8cm}p{8cm}|}
\hline
\multicolumn{2}{|c|}{Testing Modifications (highlight or circle)} \\
\hline
1. Time Limit Waved             & 2. On-Task Focusing Prompts \\
3. Exam/Sep Location            & 4. Waive Spelling Reqs \\
5. Questions Read Aloud     & 6. Revise Test Format \\
7. Answers Any Way              & 8. Revise Test Directions \\
9. Calc/Abacus Permitted  & 10. Breaks \\
\multicolumn{2}{|l|}{11. Other: \underline{\hspace{10cm}}} \\
\hline
\end{tabular}

Which gives me the output of: enter image description here

Which isn't awful, but is still a little off (most notably the fact that the numbers are being left justified due to the tabular environment. I think there were some topics on here about how to have a specific column be able to allow enumerate, but so far I haven't seen anything about enumerate spanning two columns. Any help is appreciated!

share|improve this question
    
It may be my personal opinion, but formatting like this requires lot to eye movement, which only makes it difficult to read, especially it you try to read sequentially. It would be simpler to read if the table was formatted similar to one in Fran's answer. –  mythealias Sep 15 '12 at 15:05
add comment

2 Answers

up vote 7 down vote accepted

One way to do it would be to use a custom counter. Below I have adapted the solution from a very similar question Making the table enumerated, which yields:

enter image description here

Notes:

  • I have used a \newcolumntype from the array package to define a P column type to simplify the use of the tabular environments in adding the labels:

    \newcolumntype{P}[1]{>{\AddLabel}p{#1}<{}}
    

    When a column of type P{} is used, the \AddLabel macro is invoked first, which increments the counter and automatically adds the counters value as a label before using the regular p{} column type.

  • \makebox is used to ensure that the labels are aligned to the right within a space equal to the width that would be required to typeset 99 (assuming that your max will be two digits.

  • When using the \multicolumn, you need to manually include \AddLabel to generate the label as needed.
  • At the start of any subsequent tables that use the P column type as defined here, one needs to reset the counter via \setcounter{Label}{0}. Otherwise a table following the one in this example would start the numbering from 12.

    If you are using this table numerous times in your document, the I would suggest either defining a custom environment, or perhaps redefining the \begin{tabular} environment to automatically reset this counter. See How can I center all tables in a document? for help with this if desired.

Code:

\documentclass{article}
\usepackage{array}%            \newcolumntype
\usepackage{calc}%             \widthof

\newcounter{Label}
\newcommand*{\AddLabel}{%
    \stepcounter{Label}%
    \makebox[\widthof{99}][r]{\arabic{Label}}.~%
}%

\newcolumntype{P}[1]{>{\AddLabel}p{#1}<{}}

\begin{document}
\setcounter{Label}{0}% Start at beginning (Really only needed for subsequent uses)
\begin{tabular}{|P{5cm}P{5cm}|}
\hline
\multicolumn{2}{|l|}{Testing Modifications (highlight or circle)} \\
\hline
Time Limit Waved         & On-Task Focusing Prompts \\
Exam/Sep Location        & Waive Spelling Reqs \\
Questions Read Aloud     & Revise Test Format \\
Answers Any Way          & Revise Test Directions \\
Calc/Abacus Permitted    & Breaks \\
\multicolumn{2}{|c|}{\AddLabel Other: \underline{\hspace{10cm}}} \\
\hline
\end{tabular}
\end{document}
share|improve this answer
    
@aklingensmith: Please note the fix to the second \multicolumn in the updated solution. As far as your color issue that is unrelated to this question and should be in a separate question so that others are more likely to be able to find it if they run into a similar issue. –  Peter Grill Sep 14 '12 at 17:56
    
Thanks for the updated answer! And I'll edit my comment to remove the question. It seemed rather small, but you bring up a good point about others running into the same error. Thanks! –  aklingensmith Sep 14 '12 at 18:00
add comment

Maybe you do not need a complicated tabular environment for this.

Edit: As requested in the aklingensmith's comment, the title and font background could be set easily with \fcolorbox and color or xcolor packages. Other good option is the mdframed package because their versatility (Note that with this package is not needed call to color packages directly), but also is possible do a fancy box without it.

MWE

\documentclass{article}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{fancybox}
\mdfdefinestyle{MyFrame}{%
    linecolor=black!50,
    outerlinewidth=0.1em,
    skipabove=.5\baselineskip,
    skipbelow=.5\baselineskip,
    roundcorner=1em,
    leftmargin=.045\textwidth,
    rightmargin=.1\textwidth,
    innertopmargin=1ex,
    innerbottommargin=.5\baselineskip,
    innerrightmargin=1em,
    innerleftmargin=1em,
    backgroundcolor=yellow!05!white,
    frametitlerule=true,
    frametitlerulecolor=black!40!yellow!90,
    frametitlebackgroundcolor=black!85,
    frametitlerulewidth=0.2em}


\usepackage{multicol}
\begin{document}

\fbox{
\begin{minipage}{0.8\textwidth}
Testing Modifications (highlight or circle) \hrule
\begin{enumerate}
  \setlength{\itemsep}{0pt}
  \setlength{\parskip}{0pt}
\begin{multicols}{2}
    \item Time Limit Waved
    \item Exam/Sep Location
    \item Questions Read Aloud
    \item Answers Any Way
    \item Calc/Abacus Permitted
    \item On-Task Focusing Prompts
    \item Waive Spelling Reqs
    \item Revise Test Format 
    \item Revise Test Directions 
    \item Breaks 
\end{multicols}
    \item Other: \dotfill 
\end{enumerate}
\smallskip
\end{minipage}
}   

\smallskip

{\color{blue} \Ovalbox{
\begin{minipage}{0.8\textwidth}
\centering\fcolorbox{blue!90}{blue!40!black!50}{\color{white}\bfseries ~~ Testing Modifications (highlight or circle) ~~ } \color{red!40!black}
\begin{enumerate}
  \setlength{\itemsep}{0pt}
  \setlength{\parskip}{0pt}
\begin{multicols}{2}
    \item Time Limit Waved
    \item Exam/Sep Location
    \item Questions Read Aloud
    \item Answers Any Way
    \item Calc/Abacus Permitted
    \item On-Task Focusing Prompts
    \item Waive Spelling Reqs
    \item Revise Test Format 
    \item Revise Test Directions 
    \item Breaks 
\end{multicols}
    \item Other: \dotfill 
\end{enumerate}
\smallskip
\end{minipage}
}   
}






\mdfsetup{frametitlealignment=\center}

\begin{mdframed}[style=MyFrame, frametitle={\color{white}Testing Modifications (highlight or circle)}]


\begin{enumerate}
  \setlength{\itemsep}{0pt}
  \setlength{\parskip}{0pt}
\begin{multicols}{2}
    \item Time Limit Waved
    \item Exam/Sep Location
    \item Questions Read Aloud
    \item Answers Any Way
    \item Calc/Abacus Permitted
    \item On-Task Focusing Prompts
    \item Waive Spelling Reqs
    \item Revise Test Format 
    \item Revise Test Directions 
    \item Breaks 
\end{multicols}
    \item Other: \dotfill 
\end{enumerate}
\smallskip

\end{mdframed}


\end{document}
share|improve this answer
    
While this certainly does a great job at getting close to what I'm looking for, I'm a little unsure how I would go about making the title ("Testing Modifications...") white font on a black background. That being said, I'd never seen the command \dotfill, which is awesome. Thanks for that! –  aklingensmith Sep 20 '12 at 5:55
    
@aklingensmith, the background color is not problem. See the edited answer. –  Fran Sep 20 '12 at 15:32
    
These are definitely great! I'll have to toy around with them: I've just began using mdframed and I've never tried minipage. Thanks! –  aklingensmith Sep 25 '12 at 2:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.