Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In my preamble I defined a custom float to use it for my equations like this

\newfloat{formula}{ht}{frm}
\floatname{formula}{Formel}

then I use it like this

\begin{formula}
\begin{equation}
\begin{array}{rcl}
D(x,y,\sigma) & = & (G(x,y,k\sigma) - G(x,y,\sigma)) * I(x,y) \\
              & = & L(x,y,k\sigma) - L(x,y,\sigma)
\end{array}
\end{equation}
\caption[\glsentrydesc{DOG}]{\glsentrydesc{DOG} $D$ zweier benachbarter Bilder mit Weichzeichnungsfaktor $k$}
\end{formula}

which displays like that

custom float with long caption

The caption is pretty long and there is a line break in it. How can I achive that "faktor k" appears right under "Difference" instead of "Formel 2" ?

I'm asking because regular captions for a figure show up differently. I want the above example to show up like that

long caption in figure block

Here is a minimal document:

\documentclass{scrartcl}

\usepackage{amsmath}
\usepackage{float}
\usepackage{glossaries}

\newfloat{formula}{ht}{frm}
\floatname{formula}{Formel}

\newacronym{DOG}{DoG}{Difference of Gaussian}

\begin{document}

\begin{formula}
\begin{equation}
\begin{array}{rcl}
D(x,y,\sigma) & = & (G(x,y,k\sigma) - G(x,y,\sigma)) * I(x,y) \\
             & = & L(x,y,k\sigma) - L(x,y,\sigma)
\end{array}
\end{equation}
\caption[\glsentrydesc{DOG}]{\glsentrydesc{DOG} $D$ zweier benachbarter Bilder mit Weichzeichnungsfaktor $k$}
\end{formula}

\end{document}
share|improve this question
    
When using a KOMA-Script document class I would personally drop usage of the float package and use \DeclareNewTOC (offered by KOMA-Script) instead. –  Axel Sommerfeldt Sep 21 '12 at 5:51
add comment

1 Answer

up vote 4 down vote accepted

Using the floatrow package to define the new float produces the desire formatting for the caption:

\documentclass{scrartcl} 
\usepackage{amsmath} 
\usepackage{floatrow} 

\newfloat{formula}{ht}{frm} 
\floatname{formula}{Formel} 

\begin{document} 

\begin{formula} 
\begin{equation} 
a=b
\end{equation} 
\caption{$D$ zweier benachbarter Bilder mit Weichzeichnungsfaktor $k$ and some more text} 
\end{formula} 

\end{document}

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.