Post by Lars MadsenPost by GLI'm not fond of the caption package etc. to control the font.
caption.sty does not provide a way to choose to insert or not a
colon, then my opinion is that such a package should be avoided.
the documentation is the documented code, in other words, no interface
is provided.
Regards.
the caption package does provide this feature
if the caption package is used then a \caption{} in a figure env gives you
'Figure 1' not 'Figure 1:'
but with listings it never get that far because the caption is stopped
when the option is 'caption=' (or similar) and then never get passed on
Here is something that seem to be working (sorry on my way out the door,
so a full MWE will have to wait for later)
This require etoolbox (and I have not gotten to the 'list of' part yet),
combine with loading caption as well and caption= => Listing 1, not
'Listing 1:'
\def\***@MakeCaption#1{%
\***@ifdisplaystyle
\ifx #1t%
% \ifx\lst@@caption\@empty
% \expandafter\***@HRefStepCounter
% \else
% \expandafter\refstepcounter
% \fi
% this might not be completely correct
\iftoggle{capactive}{%
\expandafter\refstepcounter%
}{%
\expandafter\***@HRefStepCounter%
}%
{lstlisting}%
\ifx\***@label\@empty\else \label{\***@label}\fi
\let\***@arg\***@intname \***@ReplaceIn\***@arg\***@filenamerpl
\global\let\***@name\***@arg \global\let\lstname\***@name
\***@ifnolol\else
\ifx\lst@@caption\@empty
\ifx\***@caption\@empty
\ifx\***@intname\@empty
\else
\def\***@temp{ }%
\ifx\***@intname\***@temp
\else
\addcontentsline{lol}{lstlisting}\***@name
\fi
\fi
\fi
\else
\addcontentsline{lol}{lstlisting}%
{\protect\numberline{\thelstlisting}\lst@@caption}%
\fi
\fi
\fi
% \ifx\***@caption\@empty\else
\iftoggle{capactive}{%
\***@IfSubstring #1\***@captionpos
{\begingroup \let\@@vskip\vskip
\def\vskip{\afterassignment\***@vskip \@tempskipa}%
\def\***@vskip{\nobreak\@@vskip\@tempskipa\nobreak}%
\par\@parboxrestore\normalsize\normalfont % \noindent (AS)
\ifx #1t\allowbreak \fi
\ifx\***@title\@empty
\ifdefvoid\***@caption{%
\***@makecaption\***@lstlisting{}%
}{%
\***@makecaption\***@lstlisting{\ignorespaces\***@caption}%
}%
\else
\***@maketitle\***@title % (AS)
\fi
\ifx #1b\allowbreak \fi
\endgroup}{}%
% \fi
}{}%
\fi}
\newtoggle{capactive}
\***@Key{caption}\relax{\***@OptArg[{#1}]{#1}%
{\def\***@caption{##2}\def\lst@@caption{##1}}%
\toggletrue{capactive}%
\let\***@title\@empty}
\def\***@lstlisting{%
\lstlistingname%
%\ifx\lst@@caption\@empty
%\else
~\thelstlisting%
% \fi
}%
--
/daleif (remove RTFSIGNATURE from email address)
Memoir and mh bundle maintainer
LaTeX FAQ: http://www.tex.ac.uk/faq
LaTeX book: http://www.imf.au.dk/system/latex/bog/ (in Danish)
Remember to post minimal examples, see URL below
http://www.minimalbeispiel.de/mini-en.html