%%% %%% label,cite の値をその場に印字するモードを付加する LaTeX ファイル %%% LaTeX source to print arguments of \label,\ref and \cite %%% commands at the same point. %%% %%% by 降旗 大介 %%% FURIHATA Daisuke %%% %%% 1999/01/23 %%% %%% usage: LaTeX source の中でこのファイルを \input し、 %%% その後、\labelcheckprint コマンド(引数なし) %%% を LaTeX 文書の始まりに書き込むとこの機能が有効になる。 %%% 上のコマンドをコメントアウトすれば機能は働かない。 %%% %%% tips: 出力は TeX の標準的な出力に準拠するため、TeX 文書中でエラー %%% となるような文字列をラベルに用いるとやはりエラーとなる。 %%% 例えば、_(アンダースコア) や ^(キャラット) を含む文字列は %%% $ が足りないというエラーとともにラベルに使えないことが示 %%% されるだろう。 %%% %%% usage: Write "\input{THIS-FILE}" in your LaTeX source. %%% ( THIS-FILE is the name of this tex file. ) %%% Next, write "\labelcheckprint" in the begining of text. %%% When you don't want to use this function, please comment %%% out the above command "\labelcheckprint". %%% %%% tips: Strings that include characters causing errors in text %%% mode in TeX should not used in \label, \ref, \cite %%% commands because printout of labels are done in TeX %%% normal text mode. %%% For instance, you will find that you cannot use strings %%% that include underscore "_" or caret "^" for those %%% commands with the TeX error "Missing $ inserted". %%% $Header: /staff2/paoon/tex/MACROS/labelchk.tex,v 1.5 1999/01/23 09:04:24 paoon Exp $ %%% $Log: labelchk.tex,v $ %%% Revision 1.5 1999/01/23 09:04:24 paoon %%% *** empty log message *** %%% %%%Revision 1.4 1998/04/20 13:22:59 paoon %%%*** empty log message *** %%% %%%Revision 1.3 1998/04/20 10:49:45 paoon %%%I fixed some bugs in \label. %%% %%%Revision 1.2 1998/03/24 18:51:46 paoon %%%*** empty log message *** %%% %%%Revision 1.1 1998/03/24 17:29:28 paoon %%%Initial revision %%% %%% \def\gOGoGOlabelup#1{\raisebox{3.0ex}{\makebox[0mm][l]{\ \fbox{\bf\scriptsize\bf #1}}}} \def\gOGoGOlabel#1{\makebox[0mm][l]{\makebox[2em]{}\fbox{\bf\scriptsize\bf #1}}} \def\gOGoGOref#1{\raisebox{2.0ex}{\makebox[0mm][l]{$\triangleright\;$\bf\scriptsize\bf #1}}} \def\gOGoGOcite#1{\raisebox{2.0ex}{\makebox[0mm][l]{$\Rightarrow$\bf\scriptsize\bf #1}}} \makeatletter %%% for @-mark \newif\if@labelcheckprint\@labelcheckprintfalse \def\labelcheckprint{\global\@labelcheckprinttrue} \def\@citex[#1]#2{% \if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi% \def\@citea{}% \@cite{% \@for\@citeb:=#2\do {% \@citea\def\@citea{,\penalty\@m\ }% \@ifundefined{b@\@citeb}{% {\bf ?}% \@warning{Citation `\@citeb' on page \thepage \space undefined}% }% \hbox{\csname b@\@citeb\endcsname}% }% \if@labelcheckprint\gOGoGOcite{#2}\fi% }% {#1}% } \def\ref#1{% \@ifundefined{r@#1}{% {\bf ??}% \@warning{Reference `#1' on page \thepage \space undefined}% }% {% \edef\@tempa{\@nameuse{r@#1}}% \expandafter% \@car\@tempa% \@nil\null% }% \if@labelcheckprint% \gOGoGOref{#1}% \fi% } \def\pageref#1{% \@ifundefined{r@#1}{% {\bf ??}% \@warning{Reference `#1' on page \thepage \space undefined}% }% {% \edef\@tempa{\@nameuse{r@#1}} \expandafter% \@cdr\@tempa\@nil\null% }% \if@labelcheckprint% \gOGoGOref{#1}% \fi% } \def\label#1{% \if@labelcheckprint% \ifmmode % for equation environment \def\endequation{% \eqno \gOGoGOlabel{#1}\@eqnnum $$\global\@ignoretrue% }% % for eqnarray environment \def\@@eqncr{\let\@tempa\relax \ifcase\@eqcnt \def\@tempa{& & &}\or \def\@tempa{& &} \else \def\@tempa{&}\fi \@tempa \if@eqnsw\gOGoGOlabel{#1}\@eqnnum\stepcounter{equation}\fi \global\@eqnswtrue\global\@eqcnt\z@\cr} \else \gOGoGOlabelup{#1} \fi \fi% % % the following lines are original definition for \label. % \@bsphack \if@filesw% {% \let\thepage% \relax\def\protect{\noexpand\noexpand\noexpand}% \xdef\@gtempa{% \write\@auxout{% \string\newlabel{#1}{{\@currentlabel}{\thepage}}% }% }% }% \@gtempa% \if@nobreak% \ifvmode% \nobreak% \fi% \fi% \fi% \@esphack% } \makeatother %%% for @-mark %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%