2

I am trying to change the number in the caption of the figure. It should be the following number of the equation. So instead of "Gleichung 0.1" i want "Gleichung 0.2" in the caption (see picture). I don't mind typing those numbers manually, since it's only for 4 following figures that have to follow on the equation number. Plus i don't have any other equations afterwards, in that chapter (if it helps). But i have a lot of figures following, which numbers should not be changed! I have tried a couple of instructions i've found like: \usepackage{chngcntr} or something similar, but i couldn't figure it out yet. That's why i come to you with this MWE.

If i could keep the figure command and type in the numbering manually without changing the numbers of the following figures, you would help me already;)

EDIT: The actual document and numbering is shown in the last picture.

captionproblem

MWE:

\documentclass{scrreprt}
\usepackage{amsmath, amssymb}

\begin{document}

\begin{equation} 
\label{eq:periodischefunktion}
f(t)=f(t+T),
\end{equation}

\begin{figure}[ht]
\renewcommand*\figurename{Gleichung}
\[
\left|
\begin{array}{*{3}{c}}
c_{F_x\vec{x}} & c_{F_y\vec{x}} & c_{F_z\vec{x}}\\
c_{F_x\vec{y}} & c_{F_y\vec{y}} & c_{F_z\vec{y}}\\
c_{F_x\vec{z}} & c_{F_y\vec{z}} & c_{F_z\vec{z}}\\
\end{array}\right|_{stat} = 
\left|
\begin{array}{*{3}{c}}
410,6 & - & -\\
- & 318,7 & -\\
- & - & -\\
\end{array}
\right|
\frac{\mbox{N}}{\mbox{mm}}
\]
\caption{Steifigkeitsmatrix bei Auskragung $A=0$~mm}
\label{eq:steifmatrix0}
\end{figure}

\end{document}

enter image description here

  • 1
    \stepcounter{figure} just after \begin{figure} should do the job. – barbara beeton Dec 8 '14 at 17:41
  • @barbarabeeton i think it's a little bit more complicated. at least i don't know how to get the number to 4.3 (see picture after edit). \stepcounter{figure} brings just 4.16. And what's even worse is that the following captions are affected by this command. – goodstuff Dec 8 '14 at 18:12
  • 1
    @goodstuff: As suggested by @barbarabeeton, adding \stepcounter{figure} just after \begin{figure}` yields the desired output. – Werner Dec 8 '14 at 18:17
  • Don't do this. PLease, don't do this. Work in a consitent way. You will regret it at some point. – Johannes_B Dec 8 '14 at 18:21
  • 1
    As i said, this does only work for the MWE... is there a way to count down that number for the figure 4.15->4.3 WITHOUT affecting figures later in that document! – goodstuff Dec 8 '14 at 18:22
5

This can go wrong if the figure floats after LaTeX has typeset other numbered equations, but here it is anyway:

\documentclass{scrreprt}
\usepackage{amsmath, amssymb,siunitx}

\begin{document}

\begin{equation} 
\label{eq:periodischefunktion}
f(t)=f(t+T),
\end{equation}

\begin{figure}[ht]
\renewcommand*\figurename{Gleichung}
\makeatletter
\let\c@figure\c@equation
\makeatother
\[
\begin{vmatrix}
c_{F_x\vec{x}} & c_{F_y\vec{x}} & c_{F_z\vec{x}}\\
c_{F_x\vec{y}} & c_{F_y\vec{y}} & c_{F_z\vec{y}}\\
c_{F_x\vec{z}} & c_{F_y\vec{z}} & c_{F_z\vec{z}}\\
\end{vmatrix}_{\mathrm{stat}} = 
\begin{vmatrix}
410,6 & - & -\\
- & 318,7 & -\\
- & - & -\\
\end{vmatrix}
\si[per-mode=fraction]{\newton\per\milli\meter}
\]
\caption{Steifigkeitsmatrix bei Auskragung $A=\SI{0}{\milli\meter}$}
\label{eq:steifmatrix0}
\end{figure}

\begin{figure}[ht]
Normal
\caption{Normal figure}
\end{figure}

Some reference to \ref{eq:steifmatrix0}.

\end{document}

The trick is to make (locally) the caption in the figure environment use equation.

enter image description here

  • awesome, just what i needed. and since there are no further equations afterwards and my numbering is influenced by chapters, it works perfectly. thank you – goodstuff Dec 8 '14 at 18:35

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.