6

everyone.

I would like to achieve a figure caption like this:

Figure1: Text.

I've read a lot of answers about caption format and I know how to change the text "Figure" but I still don't know how to remove the space between "Figure" and "1".

If anybody knows the answer I'll appreciate your help. Thank you!

1
  • Welcome to TeX.SX! If you have read a lot of answers you have seen most likely answers that are compilable. You're not providing something helpful to start yet :-( Please add a compilable document with \documentclass, the relevant packages and a working \begin{document}...\end{document} where a figure occurs
    – user31729
    Aug 2, 2016 at 20:08

1 Answer 1

7

Perhaps this, redefining \fnum@figure to remove the \nobreakspace from its middle:

\documentclass{article}
\renewcommand\figurename{Figure}
\makeatletter
\def\fnum@figure{\figurename\thefigure}
\makeatother
\begin{document}
\begin{figure}[ht]
\centering
\rule{1in}{1in}
\caption{This is a caption}
\end{figure}
\end{document}

enter image description here

If you wanted to do it in only 1 location (not across the document), you could invoke \let\nobreakspace\relax inside the figure environment, prior to the \caption.

2
  • Steven, that worked just fine. Thank you very much.
    – Marina__
    Aug 2, 2016 at 20:24
  • Thank you very Much for the answer.
    – Ed Herrera
    Mar 14, 2022 at 19:50

You must log in to answer this question.

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