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.

Look out for the \par below (on the row starting with "MSA" and notice it does not achieve the desired new paragraph. How to achieve the desired effect? Thanks.

\documentclass{article}
\usepackage{booktabs}


\begin{document}

\begin{figure*}

\small{
\begin{center}
\begin{tabular}{@{} l c c @{}}
\toprule
Characteristic & \multicolumn{2}{c}{Result}\\
 \cmidrule{2-3}
 & Seaweed isolate & Coral isolate \\
 \midrule
Cell shape & Rod & Rod\\
Gram stain & $-$ & $-$\\
Oxidase & $+$ & $-$\\
Catalase & $+$ & $-$\\
Anaerobic & Growth (weak) & No growth\\
Motility & $+$ & $-$ or ? \\
Indole production & $+$ & $-$ or ? \\
Hugh \& Leifsons & ? & ? \\
MSA \par\medskip Growth \par Mannitol utilisation & Growth & No growth\\
%Growth in absence of salt & & \\ (Didn't get time to do this one.)
Colony pigmentation & White & White \\
Colony texture & Smooth, creamy & Waxy, pellet-like \\
Colony edges & Entire & Entire \\
Colony shape & Round & Round \\
Colony elevation & Flat & Buldge\\
Medium modifications & Cracked patterns & Clear halo, pits, liquification\\
\bottomrule
\end{tabular}
\end{center}
}

\end{figure*} 


\end{document}

Edit: A number of you have helpfully pointed out my motivation isn't clear. "MSA" has two indented sub-entries underneath it. If I was doing it in Word, it would look like this:

enter image description here

With this in mind you may wish to revise your answers. Thanks! :)

Edit2: Sorry, I removed \medskip immediately following /par. It is no longer needed. The aim is to be able to start new paragraphs inside a table cell.

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

The tabular environment redefines \par to be \@empty:

\let\par\@empty

To obtain the "original" meaning of \par you could use a \multicolumn with a p{}-type column. However, in this case you don't really need to introduce new paragraphs in the cell; you can do something like the following:

\documentclass{article}
\usepackage{booktabs}

\begin{document}

\begin{table*}
  \small
  \centering
  \begin{tabular}{@{} l c c @{}}
    \toprule
    Characteristic & \multicolumn{2}{c}{Result}\\
    \cmidrule{2-3}
    & Seaweed isolate & Coral isolate \\
    \midrule
    Cell shape & Rod & Rod\\
    Gram stain & $-$ & $-$\\
    Oxidase & $+$ & $-$\\
    Catalase & $+$ & $-$\\
    Anaerobic & Growth (weak) & No growth\\
    Motility & $+$ & $-$ or ? \\
    Indole production & $+$ & $-$ or ? \\
    Hugh \& Leifsons & ? & ? \\
    MSA \\
    \hspace*{0.5cm}Growth & $+$ & $-$ \\
    \hspace*{0.5cm}Mannitol utilisation & $+$ & ? \\
    %Growth in absence of salt & & \\ (Didn't get time to do this one.)
    Colony pigmentation & White & White \\
    Colony texture & Smooth, creamy & Waxy, pellet-like \\
    Colony edges & Entire & Entire \\
    Colony shape & Round & Round \\
    Colony elevation & Flat & Buldge\\
    Medium modifications & Cracked patterns & Clear halo, pits, liquification\\
    \bottomrule
  \end{tabular}
\end{table*} 

\end{document}

Note that I used \centering instead of the center environment to avoid extra vertical space and that \small doesn't require the use of braces (it's a switch with no arguments). I also used table* instead of figure*.

share|improve this answer
    
Can you please explain what multicolumn is doing in your solution? I'm trying to understand why it's needed... Thanks. (PS. \par\medskip is needed in table cells to conserve horizontal space because I often insert tables in a two-column document, where the table is confined to the width of half the page. Secondly, not here, but it's often needed because I have a lot of content in some table cells which when broken down into logical paragraphs helps with readability.) –  ptrcao May 21 '11 at 2:17
    
@ptrcao: the second argument of \multicolumn overrides the original format declaration for the column, so using (as in my code) \multicolumn{1}{p{2.8cm}}{...} means that now the column behaves as a \parbox and now you can use \par. However, taking into account the new information in your EDIT, I'll propose another simpler alternative in my answer. –  Gonzalo Medina May 21 '11 at 2:36
    
Is there a way to do this without imposing a fixed width 2.8cm? I want my table columns to be dynamic and adaptable, not fixed. Thanks. :) –  ptrcao May 21 '11 at 2:38
    
@ptrcao: see the update to my answer. –  Gonzalo Medina May 21 '11 at 2:42
    
One last thing; the reason why I used figure was because of the advice given at andrewjpage.com/index.php?/archives/…. Suppose I still wanted the table to span 2 columns without having to end multicols environment and then restart after the table. Any idea how this might be done? –  ptrcao May 21 '11 at 5:40
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.