3

enter image description here

Hello,

I am a bit confused as to why my equation numbering all of a sudden became like this? Cannot find a solution for changing up the format or spot where this is coming from. I am using a template of a latex document, I've previously used, and this never happened beforehand.

Any guidance?

Thanks

4
  • 11
    Welcome to TeX.SE! Can you please show us a short compilable TeX code resulting in your screenshot? – Mensch Jun 11 '19 at 20:30
  • 2
    my guess is that it is a misformed \ifnum .. >0 test do you get an error message? (the pdf is not usually usable after an error) – David Carlisle Jun 11 '19 at 21:24
  • @DavidCarlisle , indeed I am getting that error message, but I'm not quite sure how do I fix this, as it has never occured before. This is how I have it set up right now: \begin{equation} L_{t,T}=L_{m,T}+D_v+D_{Stro}+D_{Stg.}+D_{S,p}+D_{BM}+D_B+K \end{equation} – Rihards Jun 12 '19 at 7:41
  • 2
    if you want help with an error message always show the full error from the log and don't bother showing the pdf, don't just show pdf without mentioning that you got an error. The pdf output is meaningless in that case. Also show a complete small document that shows the error, (which will be in your setup of the equation numbering, not in the code fragment you put in a comment. – David Carlisle Jun 12 '19 at 7:57
8

You give no information but luckily I have a crystal ball....

If you have a document such as

\documentclass{report}
%\documentclass{article}

\usepackage[T1]{fontenc}
\def\theequation{\ifnum\value{chapter}>0 \thechapter.\fi\arabic{equation}}
\begin{document}

\begin{equation}
  1=0
\end{equation}
\end{document}

It works, producing unprefixed equation numbers if there are no \chapter but prefixing the number with the chapter number if there are.

If you switch the % so that the document uses article class which has no chapters the terminal output is.

! Missing number, treated as zero.
<to be read again> 
                   \c@chapter 
l.8 \begin{equation}

? h
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

? 
! Missing = inserted for \ifnum.
<to be read again> 
                   \c@chapter 
l.8 \begin{equation}

? 
! Missing number, treated as zero.
<to be read again> 
                   \c@chapter 
l.8 \begin{equation}

? 
! Undefined control sequence.
\theequation ...num \value {chapter}>0\thechapter 
                                              .\fi \arabic {equation}
l.10 \end{equation}

? 

After (any) error you really need to fix the error it is not worth looking at the PDF except possibly as a debugging aid.

The PDF in this case looks rather like yours:

enter image description here

The fix here is to use a class that has chapters or not redefine \theequation.

Of course your actual code may not be using chapter it may be some other code, but the same issue will apply, \theequation has been redefined in a way that it does not work with the document class you are using.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.