Graphics, Figures & Tables ⇒ Change name of figures, delete spacing
Change name of figures, delete spacing
Heyho!
I'd be very happy if someone of you could help me with two little problems:
I need to change the naming of figures from "Figure x" to "Figure Sx".
What I have done so far is to use \renewcommand:
\renewcommand{\figurename}{Figure~S}
This gives "Figure S x". How can I get rid of the spacing?
Moreover, when I reference the figure, I write
Figure~S\ref{fig:"LABEL"}
The result there also gives an unwanted spacing "Figure S x".
Thank you already very much in advance!
Cheers.
I'd be very happy if someone of you could help me with two little problems:
I need to change the naming of figures from "Figure x" to "Figure Sx".
What I have done so far is to use \renewcommand:
\renewcommand{\figurename}{Figure~S}
This gives "Figure S x". How can I get rid of the spacing?
Moreover, when I reference the figure, I write
Figure~S\ref{fig:"LABEL"}
The result there also gives an unwanted spacing "Figure S x".
Thank you already very much in advance!
Cheers.
NEW: TikZ book now 40% off at Amazon.com for a short time.

Change name of figures, delete spacing
Without a
minimal working example one could only try to guess.
Changing the
Using the
hyperref or
cleveref package you can add the type of the cross-reference.

Changing the
\thefigure
command may help. The type of customization depends, for example, on whether your class supports chapters or not.Using the


Change name of figures, delete spacing
Minimum working example:
Code: Select all
\documentclass[journal=jacsat,manuscript=article,demo]{achemso}
\title
{Title}
\begin{document}
\renewcommand{\figurename}{Figure~S}
\renewcommand{\theequation}{S\arabic{equation}}
\begin{figure}
\centering
\includegraphics{FigureS1.png}
\caption{Figure caption}
\label{fig:potential1}
\end{figure}
\end{document}
Last edited by Angelika on Sun Oct 02, 2022 12:10 pm, edited 3 times in total.
Change name of figures, delete spacing
Please use the forum editor's code tags to mark the code and allow testing.
Changing
Changing
\theequation
shows you the way, you just have to adjust it for \thefigure
.Change name of figures, delete spacing
Thanks for the advice! Unfortunately it gives me twice the number now, the first without spacing, the second with spacing.
- Stefan Kottwitz
- Site Admin
- Posts: 10344
- Joined: Mon Mar 10, 2008 9:44 pm
Change name of figures, delete spacing
Then don't use both
remove
Stefan

\renewcommand{\figurename}{Figure~S}
or just use \renewcommand{\figurename}{Figure}
if you need "figure" caoitalized.Stefan
LaTeX.org admin
Change name of figures, delete spacing
Code: Select all
\documentclass[journal=jacsat,manuscript=article,demo]{achemso}
\renewcommand{\thefigure}{S\arabic{figure}}
\renewcommand{\theequation}{S\arabic{equation}}
\title {Title}
\begin{document}
\begin{figure}
\centering
\includegraphics{FigureS1.png}
\caption{Figure caption}
\label{fig:potential1}
\end{figure}
See Figure~\ref{fig:potential1}.
\end{document}
This would also work using

Code: Select all
\documentclass[journal=jacsat,manuscript=article,demo]{achemso}
\renewcommand{\thefigure}{S\arabic{figure}}
\renewcommand{\theequation}{S\arabic{equation}}
\usepackage{hyperref}
\title {Title}
\begin{document}
\begin{figure}
\centering
\includegraphics{FigureS1.png}
\caption{Figure caption}
\label{fig:potential1}
\end{figure}
See \autoref{fig:potential1}.
\end{document}
S
to every figure number looks strange and useless. But if you like so …My main topics are KOMA-Script and other questions related to my packages. If I reply to any other topic or if you've not yet added a minimal working example, please do not expect any further response. And please don't forget to tag examples as code.
Change name of figures, delete spacing

