[Tugindia] how to flushleft figure caption

Radhakrishnan CV cvr at river-valley.org
Thu Apr 3 19:03:24 CEST 2003


>>>>> "Ragu" == Ragu  <ragu at ttiindia.com> writes:

    Ragu> Check the following macros for your purpose to keep the
    Ragu> single line caption center to your figure and multiline
    Ragu> caption to flushleft.

Ragu, what the previous poster wanted was a simple solution to flush
left his figure captions. A simple modification of \@makecpation
command will do the job. For that we need not intimidate him with a
terse and horrendous code that you've provided. The following simple
line of code will do the job:

\makeatletter

 \def\@makecaption#1#2{\flushleft\textbf{#1.}\space#2}

\makeatother

    Ragu> But for some publishers, they need to have the last line
    Ragu> center to the figure and the rest of the lines fluesh
    Ragu> left. Please check which format your publishe likes ...

Even for this, so much of hacking is not necessary. See the following
simple code:

\long\def\@makecaption#1#2{%
         \leftskip   =0pt plus  0.5fil%
         \rightskip  =0pt plus  -0.5fil%
         \parfillskip=0pt plus    1fil%
        {\bfseries#1.}~#2}


    Ragu> ################## --begin --S.Ragu

    Ragu> \def\HD#1#2{\vrule height #1pt depth #2pt width 0pt\relax}

[...]

While helping others (I always appreciate your attitudes) with code
snippets, it could be of great help if you provide them with useful
and friendly code so that people would not at least get frightened. If
not, TeX will only remain in the software house alone and will seldom
find a place in the daily lives of normal mortals like me and many
others in this list.


Best regards.

Radhakrishnan


More information about the Tugindia mailing list