diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-12 23:55:42 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-12 23:55:42 +0000 |
commit | c865026ba961cdc11740772de201ef95e4cc022b (patch) | |
tree | 0b814639ec52a51d893cab204783bc5488f361bd /Master/texmf-dist/tex/latex | |
parent | 9aa7845a2c40fb8e53d3365dceb7ede188abc6ff (diff) |
figbib
git-svn-id: svn://tug.org/texlive/trunk@912 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/figbib/figbib.sty | 388 |
1 files changed, 388 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/figbib/figbib.sty b/Master/texmf-dist/tex/latex/figbib/figbib.sty new file mode 100644 index 00000000000..889596ed5b2 --- /dev/null +++ b/Master/texmf-dist/tex/latex/figbib/figbib.sty @@ -0,0 +1,388 @@ + +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{figbib}[2004/08/12] +\usepackage{epsfig} + +% +% Options +% -------- +% +% center, nopics, nopages, nosource, addcaption, nocaption, maincaption, xpart, xplate, german +% +% +% Commands +% -------- +% +% \figbibListHeader +% \figbibPage +% \figbibFig +% \figbibPlate +% \figbibFrom +% +% \fbCaptionStyle +% \fbListStyle +% +% \fbDirectory +% +% \figbibBst +% +% \fbhfill +% \fbhspace#1 +% \fbvspace#1 +% +% \fbList#1 +% \fbTheFigs +% +% \fbEpsfig +% \fbEpsfigM +% \fbEps +% \fbEpsM +% +% \fbref[1] +% \fbpageref[1] +% +% \FigBib +% +% +% Environments +% ------------ +% +% fbMinipage +% fbFloat +% fbForce +% +% +% Lengths +% ------- +% +% \figbibhang +% \figbibsep +% \figbibskip +% \figbibcskip +% + + +\newcommand\figbibListHeader{List of Figures} +\newcommand\figbibPage{p.} +\newcommand\figbibFig{Fig.} +\newcommand\figbibPlate{Plate} +\newcommand\figbibFrom{From:} +\def\figbibFigp{\figbibFig} + +\def\fbCaptionStyle{} +\def\fbListStyle{} + +\def\figurename{\figbibFig} + +\def\fbDirectory{} +\def\figbibBst{figbib} + + + +\DeclareOption{german}{% + \renewcommand\figbibListHeader{Abbildungsverzeichnis}% + \renewcommand\figbibPage{S.}% + \renewcommand\figbibFig{Abb.}% + \renewcommand\figbibPlate{Tafel}% + \renewcommand\figbibFrom{Aus:}} + +\let\if@figbibrefpage\iftrue +\DeclareOption{nopages}{\let\if@figbibrefpage\iffalse} + +\let\if@figbibpics\iftrue +\DeclareOption{nopics}{\let\if@figbibpics\iffalse} + +\let\if@figbibadd\iffalse +\DeclareOption{addcaption}{\let\if@figbibadd\iftrue} + +\let\if@figbibcaption\iftrue +\DeclareOption{nocaption}{\let\if@figbibcaption\iffalse} + +\let\if@figbibxcaption\iftrue +\DeclareOption{maincaption}{\let\if@figbibxcaption\iffalse} + +\let\if@figbibsource\iftrue +\DeclareOption{nosource}{\let\if@figbibsource\iffalse} + +\let\if@figbibxpart\iffalse +\DeclareOption{xpart}{\let\if@figbibxpart\iftrue} + +\DeclareOption{xplate}{\def\figbibFigp{\figbibPlate}} + +\def\figbib@align{flushleft} +\DeclareOption{center}{\def\figbib@align{center}} + +\ProcessOptions* + + + +\newcounter{figbib@pcnt} +\newcounter{figbib@xcnt} + +\def\figbib@bbl{\jobname.figbib.bbl} +\def\figbib@incx{\stepcounter{figbib@xcnt} + \gdef\figbib@figfile{\jobname.figbib.\arabic{figbib@xcnt}.fig}} + +\let\if@figbibpic\if@figbibpics + +\if@filesw + \newwrite\figbib@aux + \immediate\openout\figbib@aux\jobname.figbib.aux + \PackageInfo{figbib}{Writing figbib file \jobname.figbib.aux}% + \if@figbibxpart + \figbib@incx + \newwrite\figbib@figaux + \immediate\openout\figbib@figaux\figbib@figfile + \PackageInfo{figbib}{Writing figbib file \figbib@figfile}% + \fi +\fi + +\def\figbib@EpsfigMain#1#2{% + \immediate\write\@auxout{\string\figbibdefreftype{#1}{\figbibFig}} + \if@figbibpic + \epsfig{file=\fbDirectory\csname figbibf@#1\endcsname, width=#2}% + \fi + \expandafter\let\expandafter\figbib@actadd% + \csname figbiba@#1\endcsname + \expandafter\let\expandafter\figbib@actcap% + \csname figbibc@#1\endcsname + \def\figbib@actmac{\csname figbibm@#1\endcsname% + \if@figbibadd\ifx\figbib@actadd\@empty\else, \figbib@actadd\fi\fi% + }% + \caption{% + \if@figbibxcaption + \ifx\figbib@actcap\@empty\figbib@actmac\else\figbib@actcap\fi + \else + \figbib@actmac + \fi + }% + \label{figbib:#1}% +}% + +\def\fbhfill{\hfill} +\def\fbhspace#1{\hspace{#1}} +\def\fbvspace#1{} +\newenvironment*{fbMinipage}[1]% + {\begin{minipage}[t]{#1}\begin{\figbib@align}}{\end{\figbib@align}\end{minipage}} + +\long\def\figbib@makecaption#1#2{% + \def\@tempcaption{#1% + \if@figbibcaption% + : #2% + \fi% + } + \fbCaptionStyle + \sbox\@tempboxa{\@tempcaption} + \ifdim \wd\@tempboxa >\hsize + \@tempcaption\par + \else + \begin{\figbib@align}\@tempcaption\end{\figbib@align} + \fi +} + +\long\def\@makecaption#1#2{% + \vskip\abovecaptionskip + \figbib@makecaption{#1}{#2} + \vskip\belowcaptionskip +} + +\def\figbibpcaption#1{\refstepcounter{figbib@pcnt} + \begin{minipage}{\textwidth} + \figbib@makecaption{\figbibFigp~\arabic{figbib@pcnt}}{#1} + \end{minipage} +} + +\if@figbibxpart + \def\fbTheFigs{\immediate\closeout\figbib@figaux% + \InputIfFileExists{\figbib@figfile}{}{\typeout{No file \figbib@figfile}} + \figbib@incx + \immediate\openout\figbib@figaux\figbib@figfile + \PackageInfo{figbib}{Writing figbib file \figbib@figfile}% + } + + \def\b@fbFloat#1{ + % + \def\figbib@EpsfigMain##1##2{% + \immediate\write\@auxout{\string\figbibdefreftype{##1}{\figbibFigp}} + {\figbib@noexpands + \if@figbibpic + \immediate\write\figbib@figaux{% + \string\epsfig{file=\fbDirectory\csname figbibf@##1\endcsname, width=##2} + \string\\[\figbibcskip]} + \fi + \expandafter\let\expandafter\figbib@actadd% + \csname figbiba@##1\endcsname + \expandafter\let\expandafter\figbib@actcap% + \csname figbibc@##1\endcsname + \def\figbib@actmac{\csname figbibm@##1\endcsname% + \if@figbibadd\ifx\figbib@actadd\@empty\else, \figbib@actadd\fi\fi% + }% + \immediate\write\figbib@figaux{ + \string\figbibpcaption{% + \if@figbibxcaption + \ifx\figbib@actcap\@empty\figbib@actmac\else\figbib@actcap\fi + \else + \figbib@actmac + \fi + }% + \string\label{figbib:##1} + }% + }% + }% + \def\fbhfill{\immediate\write\figbib@figaux{\string\hfill}} + \def\fbhspace##1{\immediate\write\figbib@figaux{\string\hspace{##1}}} + \def\fbvspace##1{\immediate\write\figbib@figaux{\string\vspace{##1}}} + \renewenvironment*{fbMinipage}[1]% + {\immediate\write\figbib@figaux{\string\begin{minipage}[t]{##1}\string\begin{\figbib@align}}} + {\immediate\write\figbib@figaux{\string\end{\figbib@align}\string\end{minipage}}} + } + \def\e@fbFloat{\immediate\write\figbib@figaux{\string\\[\figbibskip]}} +% +\else + \def\fbTheFigs{\relax} + \def\b@fbFloat#1{\begin{figure}[#1]\begin{\figbib@align}} + \def\e@fbFloat{\end{\figbib@align}\end{figure}} +\fi + +\newenvironment*{fbFloat}[1][tbp]{\b@fbFloat{#1}}{\e@fbFloat}% + +%%% + +\def\figbib@noexpands{ + \def\"{\noexpand\"}% + \def~{\noexpand~}% + \def\emph{\noexpand\emph}\def\em{\noexpand\em}% + \def\textit{\noexpand\textit}\def\it{\noexpand\it}% + \def\textbf{\noexpand\textbf}\def\bf{\noexpand\bf}% + \def\textsc{\noexpand\textsc}\def\sc{\noexpand\sc}% + \def\texttt{\noexpand\texttt}\def\tt{\noexpand\tt}% +} + +\def\figbibdefmain#1#2{\global\@namedef{figbibm@#1}{#2}} +\def\figbibdefadd#1#2{\global\@namedef{figbiba@#1}{#2}} +\def\figbibdeffile#1#2{\global\@namedef{figbibf@#1}{#2}} +\def\figbibdefcaption#1#2{\global\@namedef{figbibc@#1}{#2}} +\def\figbibdefreftype#1#2{\global\@namedef{figbibr@#1}{#2}} + +%%% + + +\newcommand*{\fbEpsfig}[3]{% + \if@filesw\immediate\write\figbib@aux{\string\citation{#1}}\fi + \@ifundefined{figbibm@#1}{\mbox{\reset@font\bfseries \figbibFig ???}% + \G@refundefinedtrue + \PackageWarning{figbib}{Figure `#1' on page \thepage\space undefined}% + }{% + \begin{fbFloat}[#3]% + \begin{fbMinipage}{\textwidth} + \figbib@EpsfigMain{#1}{#2} + \end{fbMinipage}% + \end{fbFloat}% + }} + +\newcommand*{\fbEpsfigM}[3]{% + \if@filesw\immediate\write\figbib@aux{\string\citation{#1}}\fi + \@ifundefined{figbibm@#1}{\mbox{\reset@font\bfseries \figbibFig ???}% + \G@refundefinedtrue + \PackageWarning{figbib}{Figure `#1' on page \thepage\space undefined}% + }{% + \begin{fbFloat}[#3]% + \begin{fbMinipage}{\textwidth} + \begin{fbMinipage}{#2} + \figbib@EpsfigMain{#1}{#2} + \end{fbMinipage}% + \end{fbMinipage}% + \end{fbFloat}% + }} + +\newcommand*{\fbEps}[2]{% + \if@filesw\immediate\write\figbib@aux{\string\citation{#1}}\fi + \@ifundefined{figbibm@#1}{\mbox{\reset@font\bfseries \figbibFig ???}% + \G@refundefinedtrue + \PackageWarning{figbib}{Figure `#1' on page \thepage\space undefined}% + }{% + \begin{fbMinipage}{\textwidth}% + \figbib@EpsfigMain{#1}{#2} + \end{fbMinipage}% + }} + +\newcommand*{\fbEpsM}[2]{% + \if@filesw\immediate\write\figbib@aux{\string\citation{#1}}\fi + \@ifundefined{figbibm@#1}{\mbox{\reset@font\bfseries \figbibFig ???}% + \G@refundefinedtrue + \PackageWarning{figbib}{Figure `#1' on page \thepage\space undefined}% + }{% + \begin{fbMinipage}{#2}% + \figbib@EpsfigMain{#1}{#2} + \end{fbMinipage}% + }} + +%%% + +\@ifundefined{chapter} + {\def\figbib@section{% + \section*{\figbibListHeader}% + \addcontentsline{toc}{section}{\figbibListHeader}}}% + {\def\figbib@section{% + \chapter*{\figbibListHeader}% + \addcontentsline{toc}{chapter}{\figbibListHeader}}} + +\def\fbList#1{% + \if@filesw + \immediate\write\figbib@aux{\string\bibstyle{\figbibBst}}% + \immediate\write\figbib@aux{\string\bibdata{#1}}% + \fi + \InputIfFileExists{\figbib@bbl}{}{\typeout{No file \figbib@bbl}} +} + +\newlength{\figbibhang} +\setlength{\figbibhang}{1cm} +\newlength{\figbibsep} +\setlength{\figbibsep}{1ex} +\newlength{\figbibskip} +\setlength{\figbibskip}{4ex} +\newlength{\figbibcskip} +\setlength{\figbibcskip}{1ex} + +\newenvironment{thefigbiblist}{% + \ifx\figbibListHeader\@empty\else\figbib@section\fi% + \begin{list}{\relax}{% + \def\makelabel##1{##1\hfil}% + \setlength{\labelsep}{0.5em}% + \setlength{\labelwidth}{\figbibhang}% + \addtolength{\labelwidth}{-\labelsep}% + \setlength{\itemindent}{0em}% + \setlength{\parsep}{0ex}% + \setlength{\leftmargin}{\figbibhang}% + \setlength{\itemsep}{\figbibsep}}\fbListStyle% + }{\end{list}} + +\newcommand*\fbref[1]{% + \@ifundefined{figbibr@#1}{\figbibFig}{\csname figbibr@#1\endcsname} \ref{figbib:#1}} + +\newcommand*\fbpageref[1]{\figbibPage~\pageref{figbib:#1}} + +\newcommand*{\figbibitem}[6]{% + {% + \figbib@noexpands + \immediate\write\@auxout{\string\figbibdefmain{#1}{#2}} + \immediate\write\@auxout{\string\figbibdefadd{#1}{#3}} + \immediate\write\@auxout{\string\figbibdeffile{#1}{#4}} + \immediate\write\@auxout{\string\figbibdefcaption{#1}{#6}} + }% + \item[\@ifundefined{figbibr@#1}{\figbibFig}{\csname figbibr@#1\endcsname}~\ref{figbib:#1}% + \if@figbibrefpage% + \ (\figbibPage~\pageref{figbib:#1})% + \fi% + :] #2% + \ifx #3\@empty\else, #3\fi + .% + \if@figbibsource\ifx #5\@empty\else\ \figbibFrom\ #5\fi\fi +} + +\newenvironment{fbForce}{\let\if@figbibpic\iftrue}{\let\if@figbibpic\if@figbibpics} + +\def\FigBib{{\rmfamily F\kern-.05em\lower-.35ex\hbox{\textsc{i\kern-.025em g}}\kern-.05em% + B\kern-.05em\textsc{i\kern-.025em b}}} + +\endinput |