#!/bin/bash # ************************************************************************** # # latex_to_html # =================== # LaTeX to HTML converter. General purpose converter (with some # limitations), but particularly specialized in converting manuals # with C++ specifications written with the cc_manual.sty. # # Conversion works in two steps: First all TeX files are converted into # HTML. Meanwhile the necessary information for the cross links is # collected as set of rules. In the second step the hyperlinks # are generated for all HTML files. # # Besides programs and scripts distributed with this LaTeX converter, # the following programs are necessary to run the converter # # o C Compiler: cc / gcc # o Perl 5 (for subsequent scripts) # # Author : (c) 1997 Lutz Kettner # as of version 3.3 (Sept. 1999) maintained by Susan Hert # as of version 3.11 (Aug. 2001) maintained by # Peter Hachenberger and Lutz Kettner # Revision : $Id$ # Date : $Date$ # # ************************************************************************** # allow wildcard file expansions to become empty if nothing matches shopt -s nullglob # ===================================================================== # Begin of Installation Section: ... # ===================================================================== # Choose appropriate values in the environment or uncomment and # set the values here. See the INSTALLATION file for more details. #Precedence order for variable values is (least to highest): # (1) the variables set in the remainder of this section # (2) variables set in the resource file (gets read after this section) # (3) parameters on the commandline # reads the following resource file if it exists LATEX_CONV_RESOURCE=${HOME}/.latex_to_html.rc # Path to the configuration files of the latex_converter: # Used during installation to copy config files and compiled # into the cc_extract_html program as default config path. # The same variable is used in the cc_manual_to_html script. # LATEX_CONV_CONFIG=${PUBLIC}/CGAL/Tools/latex_converter_config # C Compiler: Gnu gcc 2.6.3 (or above) or the usual system cc: if [ "$CC" == "" ]; then CC=gcc fi # The header files within the \ccInclude macro can be linked to the original # header files if the -header option is given to the cc_extract_html program. # The environment variable LATEX_CONV_HEADER is used as default. # If it is not set, the default setting is empty and include files are not # linked. # LATEX_CONV_HEADER="" # Default parameters used in calling the cc_extract_html program: # They are not necessarily supposed to be set in the environment. if [ "$LATEX_CONV_DATE" == "" ]; then LATEX_CONV_DATE=`date +"%a, %B %e, %Y"` fi if [ "$LATEX_CONV_AUTHOR" == "" ]; then # no longer CGAL default, the cgal_manual script sets it explicitly # LATEX_CONV_AUTHOR='The CGAL Project' LATEX_CONV_AUTHOR="" fi if [ "$LATEX_CONV_TITLE" == "" ]; then LATEX_CONV_TITLE="" fi if [ "$LATEX_CONV_RELEASE" == "" ]; then LATEX_CONV_RELEASE="" fi # ===================================================================== # ... End of Installation Section. # ===================================================================== # keep track of a global exit code, reports first non-zero error code GlobalExitCode=0 #---------------------------------------------------------------------# # version #---------------------------------------------------------------------# version_no() { echo '$Id$' | awk '{print $3}' } version_date() { echo '$Id$' | awk '{print $4}' } version() { echo "${BlueColor}${0##*/}: Revision `version_no` [`version_date`]"\ " (c) Lutz Kettner${ResetColor}" 1>&2 } all_versions() { version echo -n "Using: " 1>&2 cc_extract_html -V 1>&2 } #---------------------------------------------------------------------# # usage #---------------------------------------------------------------------# usage() { version cat 1>&2 <] ${ResetColor} ${BoldColor}Options:${ResetColor} ${BoldColor}-o${ResetColor} output directory for the generated HTML manual ${BoldColor}-header${ResetColor} set the path where the C headers are. ${BoldColor}-config${ResetColor} set the path where to find the config files. ${BoldColor}-tmp${ResetColor} set the path where to put intermediate files. ${BoldColor}-aux${ResetColor} auxiliary file where the \\bibcite\'s are in. ${BoldColor}-sty${ResetColor}