LaTeX Latex: flushleft environment within tabular cells

  • Thread starter Thread starter lavster
  • Start date Start date
  • Tags Tags
    Latex
AI Thread Summary
The discussion centers on troubleshooting LaTeX errors in a table format. Key issues identified include the improper use of the flushleft environment within tabular cells, which leads to "missing \item" errors, and the incorrect placement of an equation environment inside a table cell. Suggestions for resolution include using the \raggedright command instead of flushleft, and employing a paragraph cell with the p column specifier or using a minipage for equations. Additionally, it is advised to avoid the center environment within a table, opting for \centering instead, and to use more flexible table placement options like [!htbp]. The use of \mbox for spacing is discouraged in favor of proper alignment methods. The recommendation to utilize the booktabs package for improved table aesthetics is also highlighted.
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

<br /> \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 &amp; Position from Original (mm) &amp; Reading (per 200MU) &amp; $\mbox{~~}$ Average $\mbox{~~}$ \\ [0.5ex]<br /> \hline\hline<br /> open &amp; 0 &amp; 4.27, 4.26 &amp; $\mbox{~~}$ 4.265 \\ <br /> closed &amp; 0 &amp; 0.49 &amp; <br /> \begin{flushleft}<br /> $$\mbox{~~}$$\ldelim \} {3} {7mm} \multirow{3}{*}{0.0493} <br /> \end{flushleft} <br /> \\<br /> <br /> closed &amp; 1 &amp; 0.50 &amp; \\ <br /> closed &amp; 2 &amp; 0.49 &amp; \\ [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 &amp; Uncertainty \\ [0.5ex]<br /> \hline\hline<br /> standard deviation &amp; see equation \ref{SD} \\ <br /> scale reading &amp; $\pm$0.01mm \\ <br /> response of electrometer &amp; $\pm$0.5\% \\ <br /> reproducibility of unit &amp; $\pm$1\% \\ <br /> <br /> \hline<br /> &amp; \\<br /> where, &amp; \\<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 /> &amp; \\<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&#039;s wrong--perhaps a missing \item.<br /> <br /> See the LaTeX manual or LaTeX Companion for explanation.<br /> Type H &lt;return&gt; for immediate help.<br /> ... <br /> <br /> l.649 \begin{flushleft}<br /> <br /> Try typing &lt;return&gt; to proceed.<br /> If that doesn&#039;t work, type X &lt;return&gt; to quit.<br /> <br /> <br /> ! LaTeX Error: Something&#039;s wrong--perhaps a missing \item.<br /> <br /> See the LaTeX manual or LaTeX Companion for explanation.<br /> Type H &lt;return&gt; for immediate help.<br /> ... <br /> <br /> l.649 \begin{flushleft}<br /> <br /> Try typing &lt;return&gt; to proceed.<br /> If that doesn&#039;t work, type X &lt;return&gt; to quit.<br /> <br /> <br /> ! LaTeX Error: Something&#039;s wrong--perhaps a missing \item.<br /> <br /> See the LaTeX manual or LaTeX Companion for explanation.<br /> Type H &lt;return&gt; for immediate help.<br /> ... <br /> <br /> l.649 \begin{flushleft}<br /> <br /> Try typing &lt;return&gt; to proceed.<br /> If that doesn&#039;t work, type X &lt;return&gt; to quit.<br /> <br /> <br /> ! LaTeX Error: Something&#039;s wrong--perhaps a missing \item.<br /> <br /> See the LaTeX manual or LaTeX Companion for explanation.<br /> Type H &lt;return&gt; for immediate help.<br /> ... <br /> <br /> l.651 \end{flushleft}<br /> <br /> Try typing &lt;return&gt; to proceed.<br /> If that doesn&#039;t work, type X &lt;return&gt; to quit.<br /> <br /> <br /> ! LaTeX Error: Something&#039;s wrong--perhaps a missing \item.<br /> <br /> See the LaTeX manual or LaTeX Companion for explanation.<br /> Type H &lt;return&gt; for immediate help.<br /> ... <br /> <br /> l.651 \end{flushleft}<br /> <br /> Try typing &lt;return&gt; to proceed.<br /> If that doesn&#039;t work, type X &lt;return&gt; to quit.<br /> <br /> <br /> ! LaTeX Error: Something&#039;s wrong--perhaps a missing \item.<br /> <br /> See the LaTeX manual or LaTeX Companion for explanation.<br /> Type H &lt;return&gt; for immediate help.<br /> ... <br /> <br /> l.651 \end{flushleft}<br /> <br /> Try typing &lt;return&gt; to proceed.<br /> If that doesn&#039;t work, type X &lt;return&gt; to quit.<br /> <br /> ! Missing $ inserted.<br /> &lt;inserted text&gt; <br /> $<br /> l.680 }<br /> \\<br /> I&#039;ve inserted a begin-math/end-math symbol since I think<br /> you left one out. Proceed, with fingers crossed.<br /> <br /> ! You can&#039;t use `\eqno&#039; 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&#039;m not programmed to handle this case;<br /> I&#039;ll just pretend that you didn&#039;t ask for it.<br /> If you&#039;re in the wrong mode, you might be able to<br /> return to the right one by typing `I}&#039; or `I$&#039; or `I\par&#039;.<br /> <br /> ! Missing $ inserted.<br /> &lt;inserted text&gt; <br /> $<br /> l.680 }<br /> \\<br /> I&#039;ve inserted something that you may have forgotten.<br /> (See the &lt;inserted text&gt; above.)<br /> With luck, this will get me unwedged. But if you<br /> really didn&#039;t forget anything, try typing `2&#039; now; then<br /> my insertion and my current dilemma will both disappear.
 
Physics news 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
 
Back
Top