Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Latex multicolumn problem

  1. Jun 2, 2012 #1
    Can anyone tell me what is wrong with what ive written here - its coming up with lots of errors (inlcuded below). I have the \usepackage{multirow} at the beginning. Thanks

    [tex]
    \begin{table}[h]
    \caption{Investigation of interleaf leakage using ion chamber}
    \begin{center}
    \begin{tabular}{c c c c}

    \hline\hline
    MLC open/closed & Position from Original (mm) & Reading (per 200MU) & $\mbox{~~}$ Average $\mbox{~~}$ \\ [0.5ex]
    \hline\hline
    open & 0 & 4.27, 4.26 & $\mbox{~~}$ 4.265 \\
    closed & 0 & 0.49 &
    \begin{flushleft}
    $$\mbox{~~}$$\ldelim \} {3} {7mm} \multirow{3}{*}{0.0493}
    \end{flushleft}
    \\

    closed & 1 & 0.50 & \\
    closed & 2 & 0.49 & \\ [1ex]
    \hline
    \end{tabular}
    \label{rubbish}
    \end{center}
    \caption{Uncertainty of the Measurement}
    \begin{center}
    \begin{tabular}{c c}

    \hline\hline
    Source of uncertainty & Uncertainty \\ [0.5ex]
    \hline\hline
    standard deviation & see equation \ref{SD} \\
    scale reading & $\pm$0.01mm \\
    response of electrometer & $\pm$0.5\% \\
    reproducibility of unit & $\pm$1\% \\

    \hline
    & \\
    where, & \\
    \multicolumn{2}{c}{
    \begin{equation}
    \mbox{~~~~~~~~~~~~~~~~~~~~~~~~~~~}StandardDeviation = \sqrt{\frac{\sum^{n}_{i=0}(x_i-\bar{x})}{n-1}},\mbox{~~~~~~~~~~~~~~~~~~~~~~~~~~~}
    \label{SD}
    \end{equation}
    } \\
    & \\
    \multicolumn{2}{c}{where $\bar{x}$ is the average value, $x_i$ is the i-th reading and $n$ is the total number of readings.} \\
    \end{tabular}
    \label{uncert}
    \end{center}
    \end{table}

    [\tex]


    ! LaTeX Error: Something's wrong--perhaps a missing \item.

    See the LaTeX manual or LaTeX Companion for explanation.
    Type H <return> for immediate help.
    ...

    l.649 \begin{flushleft}

    Try typing <return> to proceed.
    If that doesn't work, type X <return> to quit.


    ! LaTeX Error: Something's wrong--perhaps a missing \item.

    See the LaTeX manual or LaTeX Companion for explanation.
    Type H <return> for immediate help.
    ...

    l.649 \begin{flushleft}

    Try typing <return> to proceed.
    If that doesn't work, type X <return> to quit.


    ! LaTeX Error: Something's wrong--perhaps a missing \item.

    See the LaTeX manual or LaTeX Companion for explanation.
    Type H <return> for immediate help.
    ...

    l.649 \begin{flushleft}

    Try typing <return> to proceed.
    If that doesn't work, type X <return> to quit.


    ! LaTeX Error: Something's wrong--perhaps a missing \item.

    See the LaTeX manual or LaTeX Companion for explanation.
    Type H <return> for immediate help.
    ...

    l.651 \end{flushleft}

    Try typing <return> to proceed.
    If that doesn't work, type X <return> to quit.


    ! LaTeX Error: Something's wrong--perhaps a missing \item.

    See the LaTeX manual or LaTeX Companion for explanation.
    Type H <return> for immediate help.
    ...

    l.651 \end{flushleft}

    Try typing <return> to proceed.
    If that doesn't work, type X <return> to quit.


    ! LaTeX Error: Something's wrong--perhaps a missing \item.

    See the LaTeX manual or LaTeX Companion for explanation.
    Type H <return> for immediate help.
    ...

    l.651 \end{flushleft}

    Try typing <return> to proceed.
    If that doesn't work, type X <return> to quit.

    ! Missing $ inserted.
    <inserted text>
    $
    l.680 }
    \\
    I've inserted a begin-math/end-math symbol since I think
    you left one out. Proceed, with fingers crossed.

    ! You can't use `\eqno' in math mode.
    \endmathdisplay@a ...\df@tag \@empty \else \veqno
    \alt@tag \df@tag \fi \ifx ...
    l.680 }
    \\
    Sorry, but I'm not programmed to handle this case;
    I'll just pretend that you didn't ask for it.
    If you're in the wrong mode, you might be able to
    return to the right one by typing `I}' or `I$' or `I\par'.

    ! Missing $ inserted.
    <inserted text>
    $
    l.680 }
    \\
    I've inserted something that you may have forgotten.
    (See the <inserted text> above.)
    With luck, this will get me unwedged. But if you
    really didn't forget anything, try typing `2' now; then
    my insertion and my current dilemma will both disappear.
     
  2. jcsd
  3. Jun 2, 2012 #2
    also how to I insert my text properly?!
     
  4. Jun 24, 2012 #3
    For properly inserting code, use the "Code" button in the post editor.

    Regarding the problem: you cannot use a flushleft environment within tabular cells. It's implemented as a list environment, that's why you got the error "Missing \item" because a list consists of items. You could use \raggedright instead.

    Also, you cannot use an equation environment within a normal tabular cell. It would work in a paragraph cell, made with the p column specifier, or within \parbox or a minipage environment.

    Further tipps:

    • Use more table placement options, such as [!htbp] instead of just [h], to allow more flexible placement. You can find an explanation of these options on LaTeX-Community.org in the post Order of appearance of tables and figures
    • I would not use a center environment within in a table environment, this adds additional vertical space. Instead, I would use \centering. See center vs. \centering for an explanation.
    • \mbox{~~~~~~~~~~~~~~~~~~~~~~~~~~~} and similar are strange fixes - you could use \hspace but better would be a proper automatic alignment.
    • Several labels in a table environment could be a problem - perhaps use the subcaption or the subfig package.
    • I strongly recommend to use the booktabs package for nice table design.

    Stefan
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Latex multicolumn problem
  1. LaTeX problem (Replies: 8)

  2. Problems with LaTeX (Replies: 4)

Loading...