cgal/Manual/doc_tex/Manual/cgal_manual.sty

504 lines
17 KiB
TeX

% +------------------------------------------------------------------------+
% | cgal_manual.sty
% | Common style files and definitions for CGAL User and Reference Manuals
% +------------------------------------------------------------------------+
% Style files used throughout the manuals
% used with LaTeX and also understood by the LaTeX to HTML Converter
\usepackage{cc_manual}
\usepackage{cc_manual_index}
\usepackage{latex_to_html}
\usepackage{path}
\usepackage{alltt}
\usepackage{cprog} % outdated
\usepackage{ifthen}
% used with LaTeX but _not_ understood by the converter
\lcTex{
\usepackage{ifpdf}
\usepackage{makeidx}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{epsfig}
\usepackage{ipe}
\usepackage{pslatex}
\usepackage{psfrag}
\usepackage{rotating}
\usepackage{longtable}
}
% +------------------------------------------------------------------------+
% Configuration section begin ...
% +------------------------------------------------------------------------+
% CGAL release and date, adapt this to the current release
%\newcommand{\cgalrelease}{3.1-I}
% \newcommand{\cgalreleasedate}{November 2003} % use this for public releases
%\newcommand{\cgalreleasedate}{\today} % use this for internal releases
% Read version.tex for release number
\lcTex{\catcode`@=11}
\lcTex{\@input{version.tex}%
\ifx\cgalversion\@ClearUndefdMacro
\gdef\cgalversionnumber{x.y}
\gdef\cgalversion{Separate Build}
\else
\xdef\cgalversionnumber{\cgalversion}
\xdef\cgalversion{Release \cgalversion}
\fi
\ifx\cgalinternalversion\@ClearUndefdMacro
\gdef\cgalinternalversion{}
\else
\xdef\cgalinternalversion{Built from \cgalinternalversion}
\fi
\ifx\cgalversiondate\@ClearUndefdMacro \gdef\cgalversiondate{\today}\fi}
\lcTex{\catcode`@=12}
\lcHtml{
\lciIfFileExists{version.tex}{\input{version.tex}}{}%
\lciIfDefined{\cgalversion}%
{\xdef\cgalTmpVersion{\cgalversion}%
\xdef\cgalversionnumber{\cgalversion}
\gdef\cgalversion{Release \cgalTmpVersion}}%
{\gdef\cgalversion{Separate Build}%
\gdef\cgalversionnumber{x.y}%
}%
\lciIfDefined{\cgalinternalversion}%
{\xdef\cgalTmpInternalVersion{\cgalinternalversion}%
\gdef\cgalinternalversion{Built from \cgalTmpInternalVersion}}%
{\gdef\cgalinternalversion{}}%
\lciIfDefined{\cgalversiondate}{}{\gdef\cgalversiondate{\today}}}
\newboolean{useminitoc}
\setboolean{useminitoc}{true}
% We rather like a less dense table of contents (maybe HTML only)
\setcounter{secnumdepth}{2} % number subsections inclusively
\setcounter{tocdepth}{1} % toc with sections inclusively
% Enable automatic check for C++ include files
\gdef\ccIfCheckInclude{\ccTrue}
% +------------------------------------------------------------------------+
% ... end configuration section.
% +------------------------------------------------------------------------+
% include hyperref for PDF documents
\lcTex{\ifpdf
\pdfinfo{
/Author (CGAL Open Source Project)
/Title (CGAL Manuals)
/Keywords (computational geometry;generic programming;algorithms;software library;C++)
}
% add option ps2pdf=true when using ps2pdf instead of pdflatex
\usepackage[colorlinks=true,
linkcolor=blue,
bookmarksnumbered=true,
pdfborder={0 0 0},
pdfpagelabels=true,
plainpages=false]{hyperref}%
% disable some custom commands, for pdfstrings:
\pdfstringdefDisableCommands{%
\renewcommand{\sc}{}
\renewcommand{\stl}{STL}
\renewcommand{\leda}{Leda}
\renewcommand{\cgal}{CGAL}
\renewcommand{\galia}{Galia}
\renewcommand{\tt}[1]{#1}
\renewcommand{\CC}{C++}
}
%
% Enforce same character spacing in PDFLaTeX
\pdfadjustspacing=1
%
\fi
}
\lcHtml{
% macro for the latex_to_html converter, when hyperref is not used
\newcommand{\texorpdfstring}[2]{#1}
}
% include minitoc if selected above
% The option 'nohints' is passed to minitoc, so that it does not complain
% about hyperref. minitoc is compatible with hyperref, as soon as minitoc
% is included *after* hyperref.
\ifthenelse{\boolean{useminitoc}}{\lcTex{\usepackage[nohints]{minitoc}}}
{\newcommand{\minitoc}{}}
% page dimensions
% ---------------
\lcTex{
\textwidth 15.6cm
\textheight 23 cm
\topmargin -14mm
\evensidemargin 3mm
\oddsidemargin 3mm
\marginparsep10mm % needed for the tab-markers of reference pages
\marginparwidth15mm
}
% Optionally, package authors and a package release can be shown
% right below the chapter title. Comment out the following lines
% to get back to the default behavior.
% -----------------------------------------------------------------
\def\ccTagChapterAuthor{\ccTrue}
% \def\ccTagChapterRelease{\ccTrue}
% default column layout
% ---------------------
\newcommand{\cgalcolumnlayout}{%
\ccSetThreeColumns{CGAL_Oriented_side}{}{\hspace*{8.5cm}}%
\ccPropagateThreeToTwoColumns}
% backwards compatible!
\newcommand{\cgalColumnLayout}{\cgalcolumnlayout}
% reinitialize some settings before each chapter
% ----------------------------------------------
\newcommand{\cgalreinit}{\cgalcolumnlayout\ccTagDefaults}
% The tab marker are aligned with the top of the main text. To align
% them with the page header, the following length definition can be used.
% -----------------------------------------------------------------------
%\setlength{\ccRefTabLift}{12.5mm}
% Be careful to check that other redefinitions of ccRefPageBegin and
% ccRefPageEnd don't cause strange problems
% (e.g. if ccAdvanced is used to bracket a ref page)
% -------------------------------------------------------------------------
\def\ccRefPageBegin{\ccParDims\cgalcolumnlayout}
\def\ccRefPageEnd{\ccParDims\cgalcolumnlayout}
% All identifiers reside in CGAL scope by default
% -----------------------------------------------
\ccDefGlobalScope{CGAL::}
% LaTeX settings
% --------------
% \makeindex --> placed in wrapper
% make LaTeX process the whole manual without stopping for errors
% \batchmode --> placed in wrapper
% relax formatting strictness to avoid many overfull \hbox's etc.
\sloppy
% Provide a default title page macro. Args: <package/module name>
% ---------------------------------------------------------------
\newcommand{\cgaltitlepage}[1]{%
\pagestyle{empty}
% prevent pdf warning:
% ! pdfTeX warning (ext4): destination with the same identifier
% switching to alph pagenumbering does not affect the visual formatting
% as the page number does not appear on the title page, but it will yield
% unique identifiers (given that in our document, we only use roman and arabic)
\pagenumbering{alph}
\begin{titlepage}\mbox{}\vspace{3cm}
\lcTex{\centerline{%
\includegraphics[scale=0.25]{Manual/fig/c-simp}~
\includegraphics[scale=0.25]{Manual/fig/g-simp}~
\includegraphics[scale=0.25]{Manual/fig/a-simp}~
\includegraphics[scale=0.25]{Manual/fig/l-simp}}}
\lcRawHtml{
<p align=center>
<img border="0" src="Manual/fig/cgal_small_FAF8E8.gif" align="center"
alt="[Computational Geometry Algorithms Library]">
</p>}
\vspace{1cm}
% \centerline{{\huge #1}}\vspace{2cm}
\begin{center}{{\huge #1\par}}\end{center}
\vspace{16mm}
\centerline{{\Large \cgalversion}}\vspace{1cm}
\centerline{{\Large \cgalversiondate}}\vspace{0.5cm}
\centerline{{\footnotesize \cgalinternalversion}}
\end{titlepage}
\cleardoublepage
\setcounter{page}{1}
\pagestyle{plain}
}
\newcommand{\ccIgnore}[1]{}
% ----------- license ---------
\newcommand{\ccLicense}[1]{\ccRef[#1]{licenses:#1}}
\newcommand{\ccLicenseGPL}{\ccLicense{GPL}}
\newcommand{\ccLicenseLGPL}{\ccLicense{LGPL}}
\newcommand{\ccLicenseCommercial}{\ccLicense{Commercial}}
% ----------- thirdparty ---------
\newcommand{\ccThirdParty}[1]{\ccRef[#1]{thirdparty:#1}}
% essential
\newcommand{\ccThirdPartySTL}{\ccRef[Standard Template Library]{thirdparty:stl}}
\newcommand{\ccThirdPartyBoost}{\ccThirdParty{Boost}}
\newcommand{\ccThirdPartyGMP}{\ccThirdParty{GMP}}
\newcommand{\ccThirdPartyMPFR}{\ccThirdParty{MPFR}}
\newcommand{\ccThirdPartyZlib}{\ccThirdParty{zlib}}
\newcommand{\ccThirdPartyOpenGL}{\ccThirdParty{OpenGL}}
\newcommand{\ccThirdPartyQt}{\ccThirdParty{Qt}}
% optional
\newcommand{\ccThirdPartyLeda}{\ccThirdParty{Leda}}
\newcommand{\ccThirdPartyMPFI}{\ccThirdParty{MPFI}}
\newcommand{\ccThirdPartyRS}{\ccThirdParty{RS}}
\newcommand{\ccThirdPartyNTL}{\ccThirdParty{NTL}}
\newcommand{\ccThirdPartyOpenNL}{\ccThirdParty{OpenNL}}
\newcommand{\ccThirdPartyTaucs}{\ccThirdParty{Taucs}}
\newcommand{\ccThirdPartyBlas}{\ccThirdParty{Blas}}
\newcommand{\ccThirdPartyLapack}{\ccThirdParty{Lapack}}
\newcommand{\ccThirdPartyLibQGLViewer}{\ccThirdParty{libQGLViewer}}
\newcommand{\ccThirdPartyCoin}{\ccThirdParty{Coin3D}}
\newcommand{\ccThirdPartyEstbl}{\ccThirdParty{Estbl}}
\newcommand{\ccThirdPartyFtoC}{\ccThirdParty{F2C}}
\newcommand{\ccThirdPartyVTL}{\ccThirdParty{Vtk}}
% TODO EBEB delete?
\newcommand{\ccThirdPartyAtlas}{\ccThirdParty{Atlas}}
\newcommand{\ccThirdPartyEigen}{\ccThirdParty{Eigen}}
% --------- plain names of thirdparty stuff -------
\newcommand{\gnu}{\textsc{Gnu}}
% essential
\newcommand{\boost}{\textsc{Boost}}
\newcommand{\gmp}{\textsc{Gmp}}
\newcommand{\gmpxx}{\textsc{Gmpxx}}
\newcommand{\mpfr}{\textsc{Mpfr}}
\newcommand{\zlib}{\textsc{zlib}}
\newcommand{\opengl}{\textsc{OpenGL}}
\newcommand{\qt}{\textsc{Qt}}
% optional
%\newcommand{\leda}{\textsc{Leda}}
\newcommand{\mpfi}{\textsc{Mpfi}}
\newcommand{\rs}{Rs}
\newcommand{\ntl}{\textsc{Ntl}}
\newcommand{\opennl}{\textsc{OpenNL}}
\newcommand{\taucs}{\textsc{Taucs}}
\newcommand{\blas}{\textsc{blas}}
\newcommand{\lapack}{\textsc{lapack}}
%\newcommand{\libqglviewer}{\textsc{libQGLViewer}}
\newcommand{\coin}{\textsc{Coin3D}}
\newcommand{\esbtl}{\textsc{Estbl}}
\newcommand{\vtk}{\textsc{Vtk}}
\newcommand{\ftoc}{\textsc{F2C}}
% TODO EBEB What about these?
\newcommand{\core}{\textsc{Core}}
\newcommand{\lidia}{\textsc{Lidia}}
\newcommand{\bgl}{\textsc{bgl}}
\newcommand{\atlas}{\textsc{atlas}}
\newcommand{\eigen}{\textsc{Eigen}}
\newcommand{\exacus}{\textsc{Exacus}}
% macros for WWW pages
\newcommand{\cgalhomepage}{\path'http://www.cgal.org/'}
\newcommand{\cgaldownloadpage}{\path'http://www.cgal.org/download.html'}
\newcommand{\cmakepage}{\path'http://www.cmake.org/'}
\newcommand{\cpackpage}{\path'http://www.cmake.org/cmake/help/cpack2.6docs.html'}
% essential
\newcommand{\boostpage}{\path'http://www.boost.org/'}
\newcommand{\boostprodownloadpage}{\path'http://www.boostpro.com/download/'}
\newcommand{\gmppage}{\path'http://gmplib.org/'}
\newcommand{\mpfrpage}{\path'http://www.mpfr.org/'}
\newcommand{\zlibpage}{\path'http://www.zlib.net/'}
\newcommand{\openglpage}{\path'http://www.opengl.org/'}
\newcommand{\qtpage}{\path'http://qt-project.org/'}
% optional
\newcommand{\ledapage}{\path'http://www.algorithmic-solutions.com/leda/index.html'}
\newcommand{\mpfipage}{\path'http://mpfi.gforge.inria.fr/'}
\newcommand{\rspage}{\path'http://vegas.loria.fr/rs/'}
\newcommand{\ntlpage}{\path'http://www.shoup.net/ntl/'}
\newcommand{\opennlpage}{\path'http://alice.loria.fr/index.php/software/4-library/23-opennl.html'}
\newcommand{\taucspage}{\path'http://www.tau.ac.il/~stoledo/taucs/'}
\newcommand{\blaspage}{\path'http://www.netlib.org/blas/'}
\newcommand{\lapackpage}{\path'http://www.netlib.org/lapack/'}
\newcommand{\libqglviewerpage}{\path'http://www.libqglviewer.com/'}
\newcommand{\coinpage}{\path'http://www.coin3d.org/'}
\newcommand{\esbtlpage}{\path'http://esbtl.sourceforge.net/'}
% TODO EBEB What about pages for F2C, VTK?
% TODO EBEB What about these pages?
\newcommand{\corepage}{\path'http://www.cs.nyu.edu/exact/'}
\newcommand{\atlaspage}{\path'http://math-atlas.sourceforge.net/'}
\newcommand{\xpage}{\path'http://www.x.org/'}
\newcommand{\nsispage}{\path'http://nsis.sourceforge.net/Main\_Page'}
\newcommand{\fhs}{\path'http://www.pathname.com/fhs/pub/fhs-2.3.html'}
\newcommand{\eigenpage}{\path'http://eigen.tuxfamily.org'}
% Implement the two columns layout for the HTML converted part
% ------------------------------------------------------------
\lcTex{
% Args: <package-name>
% Remembers the package name, such that it can be tested later with
% \cgalifpackage{<package-name>}{<yes-text>}{<no-text>}
\newcommand{\cgaldeclarepackage}[1]{%
\expandafter\xdef\csname CgalPackage#1\endcsname{Dummy}}
% tex just ignores the user-ref-manual association
\newcommand{\cgaldeclarepackageWithRef}[2]{\cgaldeclarepackage{#1}}
% Args: <package-name>, <yes-text>, <no-text>
% Tests, if <package-name> was previously declared with
% \cgaldeclarepackage{<package-name>}, and if so expands the <yes-text>,
% and otherwise expands the <no-text>
\newcommand{\cgalifpackage}[3]{%
\expandafter\ifx\csname CgalPackage#1\endcsname\relax #3\else #2\fi}
}
\lcHtml{
% Args: <package-name>
% Remembers the package name, such that it can be tested later with
% \cgalifpackage{<package-name>}{<yes-text>}{<no-text>}
\newcommand{\cgaldeclarepackage}[1]{\gdef{\CgalPackage#G1}{Dummy}}
\newcommand{\cgaldeclarepackageWithRef}[2]{\gdef{\CgalPackageHasRef#G1}{#2}}
% Args: <package-name>, <yes-text>, <no-text>
% Tests, if <package-name> was previously declared with
% \cgaldeclarepackage{<package-name>}, and if so expands the <yes-text>,
% and otherwise expands the <no-text>
\newcommand{\cgalifpackage}[3]{\lciIfDefined{\CgalPackage#G1}{#2}{#3}}
}
\lcHtml{\lcTwoColumnToc}%
% Group all \entryleft, \entryright, \entryleftright, \package... commands
% as argument to this macro.
\newcommand{\cgalchapters}[1]{%
% make a first run over the argument
% and declare \ifthen variables for packages
\newcommand{\entry}[1]{}%
\newcommand{\entryleft}[1]{}%
\newcommand{\entryright}[1]{}%
\newcommand{\entryleftright}[2]{}%
\newcommand{\packageleft}[1]{\cgaldeclarepackage{##1}}%
\newcommand{\packageright}[1]{\cgaldeclarepackage{##1}}%
\newcommand{\packageleftright}[2]{%
\cgaldeclarepackage{##1}\cgaldeclarepackage{##2}%
\cgaldeclarepackageWithRef{##1}{##2}%
}%
\newcommand{\ccPartDescription}[2]{}
#1
\lcTex{%
\renewcommand{\entry}[1]{##1}%
\renewcommand{\entryleft}[1]{##1}%
\renewcommand{\entryright}[1]{##1}%
\renewcommand{\entryleftright}[2]{##1##2}%
\renewcommand{\packageleft}[1]{%
\gdef\ccCurrentFilename{##1}%
\cgalreinit\include{##1/main}%
}%
\renewcommand{\packageright}[1]{%
\gdef\ccCurrentFilename{##1}%
\cgalreinit\include{##1/main}%
}%
\renewcommand{\packageleftright}[2]{%
\gdef\ccCurrentFilename{##1}%
\cgalreinit\include{##1/main}%
\gdef\ccCurrentFilename{##2}%
\cgalreinit\include{##2/main}%
}%
#1
}%
\lcHtml{
\newcommand{\ccPartDescription}{\ccPartDescriptionImpl}
\newcommand{\entry}[1]{\lcTocCompleteRow ##1}
\newcommand{\lciStartNewPackage}[1]{%
\lciPushOutput{comments}
\lcRawHtml{<package id="##C1">}
\lciPopOutput
}
\lciIfTwoColumnToc{
\newcommand{\entryleft}[1]{\lcTocLeft ##1 \lcTocRight \lcTocToggleOdd}%
\newcommand{\entryright}[1]{\lcTocLeft \lcTocRight ##1 \lcTocToggleOdd}%
\newcommand{\entryleftright}[2]{%
\lcTocSync\lcTocLeft ##1\lcTocRight ##2\lcTocSync\lcTocToggleOdd}%
\newcommand{\packageleft}[1]{%
\lcTocSync%
\lciStartNewPackage{##1}%
\lcTocLeft\cgalreinit\include{##1/main}%
\lciPushOutput{comments}
\lcRawHtml{</package>}
\lciPopOutput%
\lcTocRight%
\lcTocSync%
\lcTocToggleOdd%
}%
\newcommand{\packageright}[1]{%
\lcTocSync%
\lcTocLeft%
\lciStartNewPackage{##1}%
\lcTocRight\cgalreinit\include{##1/main}%
\lciPushOutput{comments}
\lcRawHtml{</package>}
\lciPopOutput%
\lcTocSync%
\lcTocToggleOdd%
}%
\newcommand{\packageleftright}[2]{%
\lcTocSync%
% assume that leftright is used for user/ref manual of the same package
\lciStartNewPackage{##1}%
\lcTocLeft\cgalreinit\include{##1/main}%
\edef\lciUsermanualOutputFilename{\lciOutputFilename}%
\lcTocRight\cgalreinit\include{##2/main}%
\lciPushOutput{comments}
\lcRawHtml{</package>}
\lciPopOutput%
\lciEndPackage{\lciUsermanualOutputFilename}{\lciOutputFilename}%
\lcTocSync%
\lcTocToggleOdd%
}%
#1
}{%
\newcommand{\entryleft}[1]{##1\lcTocToggleOdd}%
\newcommand{\entryright}[1]{}%
\newcommand{\entryleftright}[2]{##1\lcTocToggleOdd}%
\newcommand{\packageleft}[1]{\cgalreinit\include{##1/main}\lcTocToggleOdd}%
\newcommand{\packageright}[1]{}%
\newcommand{\packageleftright}[2]{\cgalreinit\include{##1/main}\lcTocToggleOdd}%
#1
\renewcommand{\entryleft}[1]{}%
\renewcommand{\entryright}[1]{##1\lcTocToggleOdd}%
\renewcommand{\entryleftright}[2]{##2\lcTocToggleOdd}%
\renewcommand{\packageleft}[1]{}%
\renewcommand{\packageright}[1]{\cgalreinit\include{##1/main}\lcTocToggleOdd}%
\renewcommand{\packageleftright}[2]{\cgalreinit\include{##2/main}\lcTocToggleOdd}%
#1
}%
}%
}
\lcTex{\catcode`@=11}
\lcTex{\@input{cgal_include_only.tex}}
\lcTex{\catcode`@=12}
\lcHtml{\lciIfFileExists{cgal_include_only.tex}{\input{cgal_include_only.tex}}{}}
% +------------------------------------------------------------------------+
% | end of cgal_manual.sty
% +------------------------------------------------------------------------+