11

I'm trying to learn how to use Latex so I've got a little bit of problems in understanding what is the mistake that I've made.

In this case I'm compiling a Table containing multiple datas about currents, voltages and resistences of a circuit and the programme gives back a houndred mistakes about Missing $ or Extra {, then there is a fatal mistake at lines 1, but by putting everything under the % comment sign I've discovered that the problems still lies in the way I've encoded the lines of the table...

Error in main.tex (line 29): Missing $ inserted. $ l.29 {\Large R_ B}& {\Large 2.2 M\Omega}& {\Large 2.237 M\Omega}& {\Large 2.2... I've inserted a begin-math/end-math symbol since I think you left one out. Proceed, with fingers crossed.

LaTeX Font Info: External font `cmex10' loaded for size (Font)
<17.28> on input line 29. ! Extra }, or forgotten $. l.29 {\Large R_B} & {\Large 2.2 M\Omega}& {\Large 2.237 M\Omega}& {\Large 2.2...

I've deleted a group-closing symbol because it seems to be spurious, as in $x}$'. But perhaps the } is legitimate and you forgot something else, as in\hbox{$x}'. In such cases the way to recover is to insert both the forgotten and the deleted material, e.g., by typing `I$}'.

Error in main.tex (line 29): Missing } inserted. } l.29 {\Large R_B}& {\Large 2.2 M\Omega}& {\Large 2.237 M\Omega}& {\Large 2.2...

I've put in what seems to be necessary to fix the current column of the current alignment. Try to go on, since this might almost work.

! Extra }, or forgotten $. }

Error in main.tex: ==> Fatal error occurred, no output PDF file produced!*

These are the Errors.

Here you can find the code that I've written. The troubled linesare the ones are the ones presenting numeric Result...they should all contain the same mistake because I've copy/paste them since I've to create 6 Tables, all with the same Layout.

\documentclass[12pt,a4paper]{report}
\usepackage[italian]{babel}
\title{Relazione - Circuiti con BJT e Punti di Bias}
\author{Mengops}
\date{Laboratory of April, 14th 2014}

\begin{document}
\begin{tabular}{cccc}
\hline
\multicolumn{4}{c}{\Large Tabella Circuito 1}\\
\hline
{\Large }& {\Large Teorico}& {\Large Reale}& {\Large Spice}\\
\hline
{\Large R_{B}}& {\Large 2.2 M\Omega}& {\Large 2.237 M\Omega}& {\Large 2.2 M\Omega}\\
\hline
{\Large R_{C}}& {\Large 5.6 k\Omega}& {\Large 5.555 k\Omega}& {\Large 56 k\Omega}\\
\hline
{\Large I_{B}}& {\Large 5 \mu A}& {\Large k\Omega}& {\Large 5.15622 \mu A}\\
\hline
{\Large I_{C}}& {\Large 1 \mu A}& {\Large  k\Omega}& {\Large 1.082 \mu A}\\
\hline
{\Large V_{RC}}& {\Large V}& {\Large 7.079 V}& {\Large 6.0594 V}\\
\hline
{\Large V_{RB}}& {\Large 11.3 V}& {\Large 11.388 V}& 11.344 V}\\
\hline
{\Large V_{BE}}& {\Large 0.7 V}& {\Large 0.615 V}& {\Large 0.656 V}\\
\hline
{\Large V_{CE}}& {\Large V}& {\Large 4.896 V}& {\Large 5.94 V}\\
\hline
\end{tabular}

\end{document}
3
  • 1
    Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – jub0bs
    May 5, 2014 at 7:12
  • 1
    off-topic but more beautiful: \usepackage{siunitx} and then & \Large \SI{2.2}{\mega\ohm} %
    – LaRiFaRi
    May 5, 2014 at 7:25
  • 1
    Welcome to TeX.SX! Could you please provide a fully compilable example? It would help solvers a lot!
    – Malipivo
    May 5, 2014 at 7:31

2 Answers 2

14

Things like \Large R_B (as seen in your error message) are only possible in math mode. Write instead

\Large $R_B$

and {\Large R_C} needs no {...} Write it as \Large $R_C$ and so on. Everything inside a tabular cell is local. And if your whole tabular should be written with the \Large setting use:

{\Large
\begin{tabular}{...}
...
\end{tabular}\par}

If you have only math expressions in your tabular use

\usepackage{array}
...
\begin{tabular}{>{$}c<{$} ... }
...
\end{tabular}

or use the environment array instead of tabular. I both cases you can insert normal text with \text{...} (amsmath), \textrm{...}, and/or \mbox{...}. The first one is the best choice.

2
  • Thanks so much it totally solved the problem. May I ask one more question about it? Is there any way to avoid writing "$-$" each time?
    – Mengops
    May 5, 2014 at 21:23
  • see my edited answer
    – user2478
    May 6, 2014 at 6:19
4

You probably want to use siunitx for the unit of measure symbols; it will also give a more uniform appearance to the data.

\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[italian]{babel}
\usepackage{siunitx,array,textgreek,booktabs}
\sisetup{text-micro=\textmu}

\title{Relazione --- Circuiti con BJT e Punti di Bias}
\author{Mengops}
\date{Laboratory of April, 14th 2014}

\begin{document}
\maketitle

\centering\Large
\begin{tabular}{>{$}l<{$}rrr}
\toprule
\multicolumn{4}{c}{Tabella Circuito 1}\\
\midrule
& Teorico& Reale& Spice\\
\midrule
R_\mathrm{B}&\SI{2.2}{\mega\ohm}&\SI{2.237}{\mega\ohm}&\SI{2.2}{\mega\ohm}\\
R_\mathrm{C}&\SI{5.6}{\kilo\ohm}&\SI{5.555}{\kilo\ohm}&\SI{56}{\kilo\ohm}\\
I_\mathrm{B}&\SI{5}{\micro\ampere}&\SI{}{\kilo\ohm}&\SI{5.15622}{\micro\ampere}\\
I_\mathrm{C}&\SI{1}{\micro\ampere}&\SI{}{\kilo\ohm}&\SI{1.082}{\micro\ampere}\\
V_\mathrm{RC}&\SI{}{\volt}&\SI{7.079}{\volt}&\SI{6.0594}{\volt}\\
V_\mathrm{RB}&\SI{11.3}{\volt}&\SI{11.388}{\volt}&\SI{11.344}{\volt}\\
V_\mathrm{BE}&\SI{0.7}{\volt}&\SI{0.615}{\volt}&\SI{0.656}{\volt}\\
V_\mathrm{CE}&\SI{}{\volt}&\SI{4.896}{\volt}&\SI{5.94}{\volt}\\
\bottomrule
\end{tabular}

\end{document}

Notice how the subscripts in the first column should be upright, as they denote abbreviations and not variables.

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .