Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!njin!princeton!phoenix.princeton.edu!bjr From: bjr@clarity.Princeton.EDU (Brian J. Reiser) Newsgroups: comp.text.tex Subject: Re: LaTeX figure \caption question Message-ID: Date: 3 Sep 90 16:09:17 GMT References: <8240@jarthur.Claremont.EDU> Sender: news@idunno.Princeton.EDU Distribution: comp Organization: Cognitive Science Lab. Princeton University. Lines: 37 In-reply-to: dhosek@sif.claremont.edu's message of 31 Aug 90 02:16:57 GMT In article <8240@jarthur.Claremont.EDU> dhosek@sif.claremont.edu (Hosek, Donald A.) writes: In article <7865@helios.TAMU.EDU>, jdm5548@diamond.tamu.edu (James Darrell McCauley) writes... ->In article , ->bjr@clarity.Princeton.EDU (Brian J. Reiser) writes: ->|> Is there any simple way to modify the formatting of latex figure ->|> captions? I have some longish captions (approx 3-4 sentences) that ->|> are associated with some graphs included in the document as figures. ->|> The default formatting for \caption is apparently the normal text ->|> size, and if the text is longer than one line, it is in a paragraph ->|> the same width as the text. I would like to have the captions printed ->|> slightly smaller, and in a width indented from the width of the text. OK, the correct way for changing the formatting of a caption: LaTeX defines \caption so that the actual printing of the caption text is handled by the \@makecaption macro. For example, article.sty defines \@makecaption to center the caption if it is one line or less and to typeset it as a paragraph otherwise with the definition: [original \@makecaption macro and hosek's revision deleted] Thanks to everybody for their suggestions on how to solve this problem. The solution I pulled together from everybody's suggestions is: \long\def\@makecaption#1#2{ \vskip 10pt \setbox\@tempboxa\hbox{\small #1: #2} \ifdim \wd\@tempboxa >0.8\hsize % IF longer than one line: \quote {\small #1: #2\par}\endquote % THEN set as quote paragraph \else % ELSE center. \hbox to\hsize{\hfil\box\@tempboxa\hfil} \fi} -- Brian Reiser Cognitive Science Laboratory Princeton University