3

I created a separate floating environment for my supplementary figures using \usepackage{newfloat} \DeclareFloatingEnvironment[name={Figure S}]{suppfigure}.

However, this prints in the figure caption "Figure S 1" with a space between S and the number. How can I remove this space only for this floating environment?

(I know about \renewcommand{\thefigure}{S\arabic{table}}, however this works globally and since I also have normal figure environments this is not possible.)

MWE:

\documentclass[a4paper]{scrbook}
\usepackage[utf8]{inputenc}

\usepackage{newfloat} \DeclareFloatingEnvironment[name={Figure S}]{suppfigure}

\begin{document}
\begin{suppfigure}
    \centering
    \caption{Test}
\end{suppfigure}

\end{document}

2 Answers 2

2

The suppfigure environment has its own counter.

\documentclass[a4paper]{scrbook}
\usepackage{newfloat}

\DeclareFloatingEnvironment[name={Figure}]{suppfigure}
\renewcommand{\thesuppfigure}{S\arabic{suppfigure}}

\begin{document}
\begin{suppfigure}
    \centering
    \caption{Test}
\end{suppfigure}

\end{document}
0

One approach would be to add some negative horizontal space at the end of the name-attribute, like so:

\documentclass[a4paper]{scrbook}
\usepackage[utf8]{inputenc}

\usepackage{newfloat} \DeclareFloatingEnvironment[name={Figure S\hspace{-.6ex}}]{suppfigure}

\begin{document}
\begin{suppfigure}
    \centering
    \caption{Test}
\end{suppfigure}

\end{document}

You can fine tune the space to your liking.

enter image description here

You must log in to answer this question.

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