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.

I am writing a document which needs to have tables and figures.

Normally for formatting the caption of figures/tables I use

\renewcommand{\@makecaption}

But it affects both tables and figures captions.

Is there any way to define different formatting for captions, e.g. bold captions for tables and italic captions for figures? I'd like to do this without using packages.

share|improve this question

migrated from stackoverflow.com Oct 6 '11 at 12:04

This question came from our site for professional and enthusiast programmers.

3  
Why is using a package not an option for you? –  Paŭlo Ebermann Oct 6 '11 at 11:58
    
@Paŭlo Ebermann, there is no reason not using packages, i just want to find out if there is any private command or direct method for that! thanks anyway! –  amrzar Oct 6 '11 at 12:15

1 Answer 1

up vote 6 down vote accepted

Using the caption package is more friendly, as it allows for setting captions for figures and tables differently out of the box.

If you really don't want to use packages (I can't see why), then

\newcommand{\@maketablecaption}{...}
\newcommand{\@makefigurecaption}{...}
\toks@=\expandafter{\table}
\edef\table{\let\noexpand\@makecaption\noexpand\@maketablecaption\the\toks@}
\toks@=\expandafter{\figure}
\edef\figure{\let\noexpand\@makecaption\noexpand\@makefigurecaption\the\toks@}

where \@maketablecaption and \@makefigurecaption are defined as it suits you.

share|improve this answer
    
this is exactly what i was looking for! Thanks –  amrzar Oct 6 '11 at 12:52

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.