! Missing Number, Treated as Zero. C@) L.149 Item{
This mistake appears when you have written something within a count, dimension or skip entry which isn't a number. If you lot practice this, you will generate the fault message below:
main.tex, line 5
l<to be read again> t 50.8 \vspace{this should be a number} A number should take been hither; I inserted `0'. (If you can't effigy out why I needed to see a number, look up `weird error' in the index to The TeXbook.)
Common Causes
Forgetting to include a number where a number is required:
The most bones way this error tin can exist generated is if you have forgotten to include a number in a command where a number is required. An example of this is shown beneath.
We want to insert some vertical space between here \vspace {this should be a number} and here.
Here the \vspace{...} control expects a number as its statement, telling information technology how much vertical space to leave betwixt the text. Every bit in that location is no number present, an error appears. The right way to write this
We want to insert some vertical space betwixt here \vspace {6em} and hither.
There are many commands like \vspace{...} which require numbers equally their argument. The most common of these are
- Spacing commands such every bit:
-
\vspace{...} -
\vspace*{...} -
\hspace{...} -
\hspace*{...}
-
- Scaling commands, such as
\includegraphics[scale = 0.7]{image}. This will calibration your image to exist0.7times its actual size. The other options available hither which require numbers are:-
width -
height -
page -
resolution -
trim -
angle.
-
- The
\linebreak[number]command, where the argument states how many lines you lot want to be skipped. - Counters commands such:
-
\addtocounter{mycounter}{number} -
\setcounter{mycounter}{number}
-
- Length setting commands such as
\setlenght{\lengthname}{number}. This volition change the value of a particular length such every bit\textwidthto the valuenumber(e.g.\setlength{\textwidth}{1in}). - Table option commands such as
\multicolumn{number}{c}{Table entry}.
Having a linebreak \\ followed by square brackets:
If a linebreak command \\ is ever followed by square brackets [...] , it will be taken equally an optional argument, and thus a number will exist expected inside the square brackets. This is even true if at that place is whitespace and newlines betwixt the \\ and [...] commands. This problem oft appears in tables, as shown beneath:
\begin {tabular}{c|c} [x] & 2\\ [10]^2 & 4 \end {tabular}
This volition generate an error, every bit on the third line, nosotros have a linebreak followed by squared brackets. FiftyaTeTen expects a number inside the foursquare brackets, just instead finds x . The correct way to write the above table is to include the square brackets inside curly braces {...} equally shown beneath:
\begin {tabular}{c|c} [x] & 2\\ {[x]}^2 & 4 \end {tabular}
Using the subfigure bundle:
The subfigure package is long outdated, and will generate a 'Missing number' fault when there is no error nowadays. An example of this is shown below:
% In your preamble \usepackage {subfigure} % In the trunk of your certificate \brainstorm {figure} \centering \begin {subfigure}[b]{0.three\textwidth } \includegraphics [scale=0.2] {image} \caption {A dupe} \label {fig:gull} \terminate {subfigure} % \cease {figure}
This will generate an error, as the subfigure package does not recognise \textwidth equally a number, when information technology is in fact a number (equivalent to the constant width of the full text block on a page). The mode to resolve this is to use the more updated subcaption parcel, which has replaced subfigure . Writing the same code equally in a higher place with \usepackage{subcaption} in the preamble instead of \usepackage{subfigure} volition give the desired result without whatever error.
warrenanstivoung53.blogspot.com
Source: https://www.overleaf.com/learn/latex/Errors/Missing_number%2C_treated_as_zero
0 Response to "! Missing Number, Treated as Zero. C@) L.149 Item{"
Post a Comment