TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need the first sentence of my captions to appear on its own line in a \large, bold font. I also need to same document to easily produce standard captions (all same font, no line breaks). I have implemented a class file that uses an option to directly modify \@caption and add the necessary formatting; however, my code isn't quite working. This example correctly places the first sentence of the caption on its own line in the correct font, but the text is not left-aligned.



    \StrBefore{#1}{.}[\firstcaption] %
    \StrBehind{#1}{.}[\secondcaption] %



\caption{A Simple table. It has a caption with multiple sentences. It has a caption with multiple sentences. It has a caption with multiple sentences.}
\begin{tabular}{ l c r }
  1 & 2 & 3 \\
  4 & 5 & 6 \\
  7 & 8 & 9 \\

share|improve this question
removing the spaces before the comments in \StrBefore{#1}{.}[\firstcaption] % and \StrBehind{#1}{.}[\secondcaption] % should fix the problem. – Guido Aug 3 '12 at 22:28
@Guido you could turn you comment into an answer (maybe showing the corrected code and an image of the result?) – Gonzalo Medina Aug 4 '12 at 18:33
up vote 1 down vote accepted

The indentation is given by the two spaces before the comments in

\StrBefore{#1}{.}[\firstcaption] % 


\StrBehind{#1}{.}[\secondcaption] % 

Removing them fixes the problem. Also you can add a condition to ensure there is period . in the caption.

      \textbf{\large #1}}%

share|improve this answer
Removing the spaces does the trick. The additional condition to check for a period is also a great suggestion. – honeytoast Aug 6 '12 at 14:37

Your Answer


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.