cgal/Manual_tools/format/latex_to_html.sty

183 lines
6.9 KiB
TeX

% ___________________________________________________________________________
% |#########################################################################|
% | |
% | Latex Converter Style File: latex_to_html.sty |
% | ------------------------------------------------------------------ |
% | TeX Macros provided on conjunction with the LaTeX converter. |
% | |
% | (c) 1998 Lutz Kettner |
% | 1999 Susan Hert |
% | 2004 Lutz Kettner |
% | $Revision$ |
% | $Date$ |
% |_________________________________________________________________________|
% |#########################################################################|
% | |
% | Table of Contents: |
% | |
% | o Release Number Support |
% | o Style Selection |
% | o Boolean Values and Control Structures |
% | o HTML Output and Conversion Macros |
% | o Separation of TeX, HTML and ASCII Parts |
% | |
% |#########################################################################|
% ___________________________________________________________________________
% ###########################################################################
% |
% | o Release Number Support
% |
% ###########################################################################
% #1 the macro name for the RCS entry
% #2 the RCS entry
\def\RCSdef{\begingroup\catcode`\$=12 \RCSdefSet}
{ \catcode`\$=12
\gdef\RCSdefSetSpace #1$#2 ${\gdef#1{#2}}%
\gdef\RCSdefSetNonSpace #1$#2${\gdef#1{#2}}%
\gdef\RCSdefSetTest #1#2$#3 $#4\ccEnd{%
\def\xRCSparams{#4}\ifx\xRCSparams\empty
\RCSdefSetNonSpace{#1}#2%
\else
\RCSdefSetSpace{#1}#2%
\fi
}%
\gdef\RCSdefSet #1#2{\RCSdefSetTest{#1}{#2}#2 $\ccEnd\endgroup}%
}
% #1 the macro name for the RCS entry
% #2 the RCS date entry
\def\RCSdefDate{\begingroup\catcode`\$=12 \RCSdefSetDate}
{ \catcode`\$=12
% Define the date if it is set.
% #1 = macro name, #2 = "Date:", #3 = year, #4 = month, #5 = day, #6 = time
\gdef\RCSdefSetDateSet #1$#2 #3/#4/#5 #6${\gdef#1{#2 #3/#4/#5}}%
% Define the date if it is not set.
% #1 = macro name, #2 = string without $'s
\gdef\RCSdefSetDateNonSet #1$#2${\gdef#1{#2 -\,-/-\,-/-\,-}}%
% Test whether the date is set or not.
% #1 = macro name, #2 = full date string, #8 = empty if date is not set
\gdef\RCSdefSetDateTest #1#2$#3 #4/#5/#6 #7$#8\ccEnd{%
\def\xRCSparams{#8}\ifx\xRCSparams\empty
\RCSdefSetDateNonSet{#1}#2%
\else
\RCSdefSetDateSet{#1}#2%
\fi
}%
\gdef\RCSdefSetDate #1#2{%
\RCSdefSetDateTest{#1}{#2}#2 1/2/3 4$\ccEnd\endgroup %$
}%
}
\RCSdef{\lcRevision}{$Revision$}
\RCSdefDate{\lcDate}{$Date$}
% Print a release note.
\catcode`\@=11\relax
\newwrite\@unused
\def\typeout#1{{\let\protect\string\immediate\write\@unused{#1}}}
\typeout{latex_to_html.sty: \lcRevision. \lcDate.}
\catcode`\@=12\relax
% ___________________________________________________________________________
% ###########################################################################
% |
% | o Style Selection
% |
% ###########################################################################
\newcommand{\lcStyle}[1]{}
\gdef\lcBodyAttributes{}
% ___________________________________________________________________________
% ###########################################################################
% |
% | o Boolean Values and Control Structures
% |
% ###########################################################################
\newcommand{\lcFalse}[2]{#2}
\newcommand{\lcTrue}[2]{#1}
\newcommand{\lcAuto}[2]{}
% possibly nested control blocks that suppress cross-linking
\newcommand{\lcNoLinkBegin}{}
\newcommand{\lcNoLinkEnd}{}
\newcommand{\lcNoLinkSync}{}
% ___________________________________________________________________________
% ###########################################################################
% |
% | o HTML Output and Conversion Macros
% |
% ###########################################################################
\newcommand{\lcRawHtml}[1]{}
\newcommand{\lcRawHtmlExpanded}[1]{}
\newcommand{\lcRawAscii}[1]{}
\newcommand{\lcAsciiToHtml}[1]{}
\newcommand{\lcAnchor}[2]{#2}
% ___________________________________________________________________________
% ###########################################################################
% |
% | o Separation of TeX, HTML and ASCII Parts
% |
% ###########################################################################
\newcommand{\lcTex}[1]{#1}
\newcommand{\lcHtml}[1]{}
\newcommand{\lcAscii}[1]{}
\newcommand{\lcHtmlCatcode}{%
\ccCatcode
\catcode`\{=12
\catcode`\}=12
\catcode`\\=12
}
\newcommand{\lcHtmlDefCatcode}{%
\catcode`\@=11\relax
\catcode`\|=0
\catcode`\[=1
\catcode`\]=2
\catcode`\{=12
\catcode`\}=12
\catcode`\\=12
}
\newenvironment{lcTexBlock}{}{}
\newenvironment{lcHtmlBlock}{\begingroup\lcHtmlCatcode \lcParseHtmlBlockBody}{
\endgroup}
% Take care: catcodes changes a lot here!!
\begingroup
\lcHtmlDefCatcode
|long|gdef|lcParseHtmlBlockBody #1\end{lcHtmlBlock}[%
|csname endlcHtmlBlock|endcsname|@checkend[lcHtmlBlock]%
|expandafter|endgroup|if@endpe|@doendpe|fi
|if@ignore|global|@ignorefalse|ignorespaces|fi
]
|endgroup
\newenvironment{lcRawHtmlBlock}{\begingroup\lcHtmlCatcode
\lcParseRawHtmlBlockBody}{\endgroup}
% Take care: catcodes changes a lot here!!
\begingroup
\lcHtmlDefCatcode
|long|gdef|lcParseRawHtmlBlockBody #1\end{lcRawHtmlBlock}[%
|csname endlcRawHtmlBlock|endcsname|@checkend[lcRawHtmlBlock]%
|expandafter|endgroup|if@endpe|@doendpe|fi
|if@ignore|global|@ignorefalse|ignorespaces|fi
]
|endgroup
% ___________________________________________________________________________
% ###########################################################################
% | EOF
% ###########################################################################