Latex: flushleft environment within tabular cells

  • Context: LaTeX 
  • Thread starter Thread starter lavster
  • Start date Start date
  • Tags Tags
    Latex
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 6K views
lavster
Messages
213
Reaction score
0
Can anyone tell me what is wrong with what I've written here - its coming up with lots of errors (inlcuded below). I have the \usepackage{multirow} at the beginning. Thanks

[tex] \begin{table}[h]<br /> \caption{Investigation of interleaf leakage using ion chamber}<br /> \begin{center}<br /> \begin{tabular}{c c c c}<br /> <br /> \hline\hline<br /> MLC open/closed & Position from Original (mm) & Reading (per 200MU) & $\mbox{~~}$ Average $\mbox{~~}$ \\ [0.5ex]<br /> \hline\hline<br /> open & 0 & 4.27, 4.26 & $\mbox{~~}$ 4.265 \\ <br /> closed & 0 & 0.49 & <br /> \begin{flushleft}<br /> $$\mbox{~~}$$\ldelim \} {3} {7mm} \multirow{3}{*}{0.0493} <br /> \end{flushleft} <br /> \\<br /> <br /> closed & 1 & 0.50 & \\ <br /> closed & 2 & 0.49 & \\ [1ex]<br /> \hline<br /> \end{tabular}<br /> \label{rubbish}<br /> \end{center}<br /> \caption{Uncertainty of the Measurement}<br /> \begin{center}<br /> \begin{tabular}{c c}<br /> <br /> \hline\hline<br /> Source of uncertainty & Uncertainty \\ [0.5ex]<br /> \hline\hline<br /> standard deviation & see equation \ref{SD} \\ <br /> scale reading & $\pm$0.01mm \\ <br /> response of electrometer & $\pm$0.5\% \\ <br /> reproducibility of unit & $\pm$1\% \\ <br /> <br /> \hline<br /> & \\<br /> where, & \\<br /> \multicolumn{2}{c}{<br /> \begin{equation}<br /> \mbox{~~~~~~~~~~~~~~~~~~~~~~~~~~~}StandardDeviation = \sqrt{\frac{\sum^{n}_{i=0}(x_i-\bar{x})}{n-1}},\mbox{~~~~~~~~~~~~~~~~~~~~~~~~~~~}<br /> \label{SD}<br /> \end{equation}<br /> } \\<br /> & \\<br /> \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.} \\<br /> \end{tabular}<br /> \label{uncert}<br /> \end{center}<br /> \end{table}<br /> <br /> [\tex]<br /> <br /> <br /> ! LaTeX Error: Something's wrong--perhaps a missing \item.<br /> <br /> See the LaTeX manual or LaTeX Companion for explanation.<br /> Type H <return> for immediate help.<br /> ... <br /> <br /> l.649 \begin{flushleft}<br /> <br /> Try typing <return> to proceed.<br /> If that doesn't work, type X <return> to quit.<br /> <br /> <br /> ! LaTeX Error: Something's wrong--perhaps a missing \item.<br /> <br /> See the LaTeX manual or LaTeX Companion for explanation.<br /> Type H <return> for immediate help.<br /> ... <br /> <br /> l.649 \begin{flushleft}<br /> <br /> Try typing <return> to proceed.<br /> If that doesn't work, type X <return> to quit.<br /> <br /> <br /> ! LaTeX Error: Something's wrong--perhaps a missing \item.<br /> <br /> See the LaTeX manual or LaTeX Companion for explanation.<br /> Type H <return> for immediate help.<br /> ... <br /> <br /> l.649 \begin{flushleft}<br /> <br /> Try typing <return> to proceed.<br /> If that doesn't work, type X <return> to quit.<br /> <br /> <br /> ! LaTeX Error: Something's wrong--perhaps a missing \item.<br /> <br /> See the LaTeX manual or LaTeX Companion for explanation.<br /> Type H <return> for immediate help.<br /> ... <br /> <br /> l.651 \end{flushleft}<br /> <br /> Try typing <return> to proceed.<br /> If that doesn't work, type X <return> to quit.<br /> <br /> <br /> ! LaTeX Error: Something's wrong--perhaps a missing \item.<br /> <br /> See the LaTeX manual or LaTeX Companion for explanation.<br /> Type H <return> for immediate help.<br /> ... <br /> <br /> l.651 \end{flushleft}<br /> <br /> Try typing <return> to proceed.<br /> If that doesn't work, type X <return> to quit.<br /> <br /> <br /> ! LaTeX Error: Something's wrong--perhaps a missing \item.<br /> <br /> See the LaTeX manual or LaTeX Companion for explanation.<br /> Type H <return> for immediate help.<br /> ... <br /> <br /> l.651 \end{flushleft}<br /> <br /> Try typing <return> to proceed.<br /> If that doesn't work, type X <return> to quit.<br /> <br /> ! Missing $ inserted.<br /> <inserted text> <br /> $<br /> l.680 }<br /> \\<br /> I've inserted a begin-math/end-math symbol since I think<br /> you left one out. Proceed, with fingers crossed.<br /> <br /> ! You can't use `\eqno' in math mode.<br /> \endmathdisplay@a ...\df@tag \@empty \else \veqno <br /> \alt@tag \df@tag \fi \ifx ...<br /> l.680 }<br /> \\<br /> Sorry, but I'm not programmed to handle this case;<br /> I'll just pretend that you didn't ask for it.<br /> If you're in the wrong mode, you might be able to<br /> return to the right one by typing `I}' or `I$' or `I\par'.<br /> <br /> ! Missing $ inserted.<br /> <inserted text> <br /> $<br /> l.680 }<br /> \\<br /> I've inserted something that you may have forgotten.<br /> (See the <inserted text> above.)<br /> With luck, this will get me unwedged. But if you<br /> really didn't forget anything, try typing `2' now; then<br /> my insertion and my current dilemma will both disappear.[/tex]
 
on Phys.org
also how to I insert my text properly?!
 
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 \http://latex-community.org/know-how/latex/55-latex-general/424-latex-reference-manual#g_t_005craggedright 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 http://latex-community.org/know-how/latex/55-latex-general/424-latex-reference-manual#g_t_005chspace 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