I'm currently trying to write my thesis in LaTeX and while everything else seems to be working fine, I can't seem to figure out how I could remove the leading space in the numbering of figure captions and equation references in text. I'm not that good at using LaTeX so please go easy on me if I got wrong ideas how something works. Anyways I guess LaTeX reserves space for numbering like "11.1" and that's why if my figures only go up to single numbers I get " 1.1" instead of "1.1"?

Whenever I add a figure in my text, like for example

\caption{\small Esimerkki tutkitusta...}

I get the kind of extra space like in my picture (note: "Kuva 4.1" = "Figure 4.1"). Within text it doesn't really matter, as I can simply do

Some text here\ref{myfig}

without a leading space before \ref command and I get the desired look for it. I guess they are all probably defined with same command but I haven't been able to find how I could change it. I tried reading documentations like the captions-package as well as searching for similar problems pretty much everywhere but with no luck.

Also with equations I'm supposed to use referencing like "In equation (2.1) this and that..." but I end up with "In equation ( 2.1) blablabla" like the bottom example of my picture ("Yhtälöä ( 2.2) ...")

V_\alpha(\mathbf{r}) &= [1+\exp(\frac{r-R_\alpha-d}{\sigma})]^{-1}, \\
In equation (\ref{eq:soft}) bla bla bla

Extra space in front of figure and equation numbering

I know I'm supposed to add a minimal working example of my code, but considering how I'm using a rather large thesis template and I'm not really sure which commands actually affect the space in the numberings I really don't have a clue what kind of example I should really add here. I'll gladly post a minimal example if someone could at least point me to right direction.

Edit: I found the commands responsible for the numberings in my code

\renewcommand \thetable{\ifnum \c@chapter>\z@ \chapfigname.\fi \@arabic\c@table}
\renewcommand \theequation{\ifnum\c@chapter>\z@\chapfigname.\fi\@arabic\c@equation}

I didn't really do anything other than comment out the lines to test how it looks without them and uncomment them again, and like magically my code seems to work now exactly as I wanted it to... :D

  • 1
    Off topic: to refer an equation, you can use \eqref{} and parenthesis will be automatically inserted.
    – Sigur
    Commented Feb 26, 2018 at 21:52
  • As for the Minimal Working Example, this is what I would do: First, make a copy of your stuff!! Second, remove all text and leave only what produces the problem (in this case, a figure with a caption). Then I would remove some code that I think that have nothing to do with the problem and compile. If the problem persists, I was correct, otherwise I may have found the part of the code that is causing me trouble. Repeat this last part until a MWE appears. Commented Feb 26, 2018 at 21:53
  • 2
    We need more info on your preamble to discover why there is a blank space. This is not the default output.
    – Sigur
    Commented Feb 26, 2018 at 21:53
  • 1
    You have added the space (latex does not add it) in some code that you have not shown. You need to show at least the definition of \thefigure Commented Feb 26, 2018 at 22:07

1 Answer 1


You haven't shown any relevant code but it appears that you have a definition such as






\caption{a figure\label{zz}}



which produces

enter image description here

Fixing the definition not to have a space at the start of the figure counter, so changing the definition to



enter image description here

  • Well thanks to you I found the commands that modified the numbering. I have no clue why it's fixed now even though I didn't really modify anything but all the same, it works! Cheers! :)
    – vivas
    Commented Feb 27, 2018 at 8:53

You must log in to answer this question.

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