Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!ames!orion.arc.nasa.gov!ogawa From: ogawa@orion.arc.nasa.gov (Arthur Ogawa) Newsgroups: comp.text.tex Subject: Re: captions for figures and tables in LaTeX Message-ID: <1991Mar31.055906.29244@news.arc.nasa.gov> Date: 31 Mar 91 05:59:06 GMT References: <635@hydra.bucknell.edu> Sender: usenet@news.arc.nasa.gov (USENET Administration) Organization: NASA Ames Research Center, Moffett Field, CA Lines: 66 Bcc: ogawa In article <635@hydra.bucknell.edu> zaccone@sol.bucknell.edu (zaccone - 1393) writes: |I'm helping a friend format her thesis using LaTeX. She's using the |report style. One of the grad school's requirements is that the |captions for tables appear above the table, and the the captions for |figures appear below. I prepared the something similar to the following for a similar, earlier query. The following .sty file provides for and defines different caption formatting depending on which float environment it's called within. %%%%%%%%%%%%%%%% cut here %%%%%%%%%%%%%%%% zaccone.sty %%%%%%%%%%%%%%%% % zaccone.sty---provide for independent formatting for float captions. % The following is a re-definition of the \@caption macro which lets % you format your figure captions differently from your table captions, etc. % Your .sty file must provide for a meaning for, e.g., \@makefigurecaption, etc. % If you do not, the default \@makecaption will be used. \long\def\@caption#1[#2]#3{\par\addcontentsline{\csname ext@#1\endcsname}{#1}{\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}\begingroup \@parboxrestore \normalsize \expandafter\let\expandafter\@tempa\csname @make#1caption\endcsname \ifx\@tempa\relax\let\@tempa\@makecaption\fi \@tempa{\csname fnum@#1\endcsname}{\ignorespaces #3}\par \endgroup} % % Here is the content of a .sty file containing definitions using the above % hook. % % The following is the same as the \@makecaption in book.sty: \long\def\@makefigurecaption#1#2{% \vskip 10pt \setbox\@tempboxa\hbox{#1. #2}% \ifdim \wd\@tempboxa >\hsize #1. #2\par \else \hbox to\hsize{\hfil\box\@tempboxa\hfil} % \fi } % % The following is slightly different from the \@makecaption in book.sty: \long\def\@maketablecaption#1#2{% \setbox\@tempboxa\hbox{#1. #2}% \ifdim \wd\@tempboxa >\hsize #1. #2\par \else \hbox to\hsize{\hfil\box\@tempboxa\hfil} % \fi \vskip 10pt } %%%%%%%%%%%%%%%% cut here %%%%%%%%%%%%%%%% zaccone.tex %%%%%%%%%%%%%%%% % zaccone.tex---illustrate how to use zaccone.sty \documentstyle{article} \documentstyle{zaccone} \begin{document} \begin{figure}[h] Content of figure \caption{Figure caption}% \end{figure} \begin{table}[h] \caption{Table caption}% Content of table \end{table} \end{document} Arthur Ogawa Internet: ogawa@orion.arc.nasa.gov Ph: 1/415/691-1126 TeX consultant AppleLink: ogawa FAX:1/415/962-1969