[comp.text.tex] FIGURE and BIBLIOGRAPHY questions

rigoutso@ROBROY.NYU.EDU (Isidore Rigoutsos) (11/13/90)

Hello everyone.
I subscribed to comp.text.tex a few days ago and I hope the following few
questions have not already been beaten to death. 
Please, accept my apologies if this is the (zillion+1)-st time you see them
repeated.

All of my questions refer to the LATEX environment.  
Here is what I would like to know: 

1) Is there any way to make the word "Figure" of the figure caption line be
   *boldface*? 

2) Is there any way to replace the word "Figure" of the figure caption line
with something like "Fig." or any given string for that matter?

3) How can one get rid of the `:' (or replace it by `.') in the line
		"Figure  XX : <caption text>"?

4) I would like to be able to draw a horizontal line of length \textwidth 
   immediatelly after the caption line of a figure. Is that possible? How can
   it be done? If this is not possible, could I instead put a box around the 
   figure body?

5) Is there any way to replace the word "References" at the beginning of the 
   bibliography section by a given string?


You can e-mail or post your answers. Thank you very much in advance,

Isidore Rigoutsos


------------------------------------------------------------------------------
Isidore Rigoutsos 			  |Internet: rigoutso@cs.nyu.edu
Computer Science Department 		  |   or rigoutso@robust.nyu.edu
Courant Institute of Mathematical Sciences|BITNET:rigoutso%robust@NYUCIMSA
New York University			  |UUCP: ...!cmcl2!robust!rigoutso 
251 Mercer Street			  |FAX: (212) 995 4122
New York, NY 10012    			  |Voice: (212) 998 3471
------------------------------------------------------------------------------

young@emx.utexas.edu (Young U. Ryu) (11/13/90)

rigoutso@ROBROY.NYU.EDU (Isidore  Rigoutsos) asked the following
questions.

> 1) Is there any way to make the word "Figure" of the figure caption line be
>    *boldface*? 

%%% If you want both Figure (and Table) and following number
%%% in boldface
\catcode`@=11
\long\def\@makecaption#1#2{
 \vskip 10pt 
 \setbox\@tempboxa\hbox{{\bf #1}: #2}
 \ifdim \wd\@tempboxa >\hsize {\bf #1}: #2\par \else \hbox
to\hsize{\hfil\box\@tempboxa\hfil} 
 \fi}
\catcode`@=12

%%% or alternatively
\catcode`@=11
\def\fnum@figure{\bf Figure \thefigure}
\def\fnum@table{\bf Table \thetable}
\catcode`@=12

%%% If you want only Figure (and Table) in boldface
\catcode`@=11
\def\fnum@figure{{\bf Figure} \thefigure}
\def\fnum@table{{\bf Table} \thetable}
\catcode`@=12

> 2) Is there any way to replace the word "Figure" of the figure caption line
>    with something like "Fig." or any given string for that matter?

\catcode`@=11
\def\fnum@figure{Fig. \thefigure}
%\def\fnum@table{Table \thetable} % You may change Table to anything you want
\catcode`@=12

> 3) How can one get rid of the `:' (or replace it by `.') in the line
>		"Figure  XX : <caption text>"?

\catcode`@=11
\long\def\@makecaption#1#2{
 \vskip 10pt 
 \setbox\@tempboxa\hbox{#1. #2}      % was : instead of .
 \ifdim \wd\@tempboxa >\hsize #1. #2\par \else \hbox  % was : instead of .
to\hsize{\hfil\box\@tempboxa\hfil} 
 \fi}
\catcode`@=12

> 4) I would like to be able to draw a horizontal line of length \textwidth 
>    immediatelly after the caption line of a figure. Is that possible? How can
>    it be done? If this is not possible, could I instead put a box around the 
>    figure body?

Note: Somebody posted the \boxfigure macro, long time ago.
      Sorry, I don't remember who. He/she should get the credit
      for this macro and the \boxtable macro, absolutely.
      I modified the \boxfigure macro just a little bit.

%--------Start Here---------------------------------------------

% \boxfigure{pos}{wid}{text}:  A figure with a box around it
%
% pos     the usual figure placement arg: eg. htbp
% wid     the width of the figure, in some units: eg. 5in
% text    the contents of the figure, including
%         picture/caption/label/etc
%
\newlength{\boxwidth}
\newcommand{\boxfigure}[3]{
     \begin{figure}[#1]
          \setlength{\boxwidth}{#2}
          \addtolength{\boxwidth}{.1in}

          \centering
          \framebox[\boxwidth]{
               \begin{minipage}{#2}
               \vspace*{10 pt}
               #3
               \vspace*{5 pt}
               \end{minipage}
          }
     \end{figure}  
}

% \boxtable{pos}{wid}{text}:  A table with a box around it
%
% pos     the usual table placement arg: eg. htbp
% wid     the width of the table, in some units: eg. 5in
% text    the contents of the table, including
%         tabular/caption/label/etc
%
\newcommand{\boxtable}[3]{
     \begin{table}[#1]
          \setlength{\boxwidth}{#2}
          \addtolength{\boxwidth}{.1in}

          \centering
          \framebox[\boxwidth]{
               \begin{minipage}{#2}
               \vspace*{10 pt}
               #3
               \vspace*{5 pt}
               \end{minipage}
          }
     \end{table}  
}

% use \fullboxwidth for arg 2 of boxfigure & boxtable to get box of
% size \textwidth
\newlength{\fullboxwidth}
\setlength{\fullboxwidth}{\textwidth}
\addtolength{\fullboxwidth}{-0.1in}

%---------End Here----------------------------------------------

For example:
\boxfigure{htb}{\fulltextwidth}{
    \centering
    \begin{picture}
    LaTeX Picture Statements
    \end{picture}
    \caption{Blah Blah}\label{Foo}
}

> 5) Is there any way to replace the word "References" at the beginning of the 
>    bibliography section by a given string?

\def\thebibliography#1#2{\section*{#1\@mkboth
 {\uppercase{#1}}{\uppercase{#1}}}\list
 {[\arabic{enumi}]}{\settowidth\labelwidth{[#2]}\leftmargin\labelwidth
 \advance\leftmargin\labelsep
 \usecounter{enumi}}
 \def\newblock{\hskip .11em plus .33em minus .07em}
 \sloppy\clubpenalty4000\widowpenalty4000
 \sfcode`\.=1000\relax}
\let\endthebibliography=\endlist

For example

\begin{thebibliography}{My References}{99}

\bibitem ....

\end{thebibliography}

%%%%%%%%%%%%%%%%%%%%%%%%

Final Notes: If you include these macros in a XXX.sty file,
             you may not need \catcode`@=11 and \catcode`@=12.
             There may exist bugs ... :-)


Young
The Univ. of Texas at Austin