diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-09-20 14:44:14 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-09-21 14:32:46 +0200 |
| commit | b713b919756fd420063e7defc30bfc21996de636 (patch) | |
| tree | 59e0f3bcd8dcb4c27413f3f533c27a6e2d2bea87 /documentation/make_header | |
| parent | f072cec13fb7afcc7726bda38869825f963bb483 (diff) | |
PDF docs: generate LaTeX header file from source
The LaTeX header file used when creating PDF documentation depends on
the doxygen and latex versions, respectively.
The old header file 'documentation/src/fltk-book.tex.in' had been
generated manually and needed to be updated for new doxygen versions
which made the PDF documentation generation dependent on the
doxygen/latex versions on the build system.
The new LaTeX header file 'fltk-book.tex' is generated by doxygen,
i.e. taking into account the doxygen and latex versions on the build
system and "edited" to include the page title defined in the new
file 'documentation/src/fltk-title.tex.in'.
This makes the PDF documentation independent of the doxygen and
latex versions of the build system.
Diffstat (limited to 'documentation/make_header')
| -rwxr-xr-x | documentation/make_header | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/documentation/make_header b/documentation/make_header new file mode 100755 index 000000000..44af365dc --- /dev/null +++ b/documentation/make_header @@ -0,0 +1,58 @@ +#!/bin/sh +# +# Create a new LaTeX header file for doxygen PDF docs +# +# Note: this LaTeX file depends on Doxygen and LaTeX versions, resp. +# and needs therefore to be created with current Doxygen and LaTeX +# versions on the build system. +# +# Usage: +# +# $ sh make_header input-file output-file +# +# where 'input-file' is the pure (LaTeX) title page (template) +# and 'output-file' is the generated (LaTeX) title page (template) +# to be used by `make' or `cmake` to generate the final LaTeX page +# header (combined doxygen template + FLTK title page). +# +#======================================================================= +# This script requires a posix shell and uses the following commands: +# cat, rm and sed and (obviously) doxygen +#======================================================================= + +# input and output file names +FLTK_HEAD="$1" +DOXY_HEAD="$2" +# temp file +DOXY_TEMP="doxy-header.tex.$$" + +if test x$FLTK_HEAD = x; then + echo "usage: $0 fltk-header-file output-file" + exit 1 +fi + +if test x$DOXY_HEAD = x; then + echo "usage: $0 fltk-header-file output-file" + exit 1 +fi + +# Create the doxygen LaTeX header template and replace the LaTeX +# code between (and including) the lines containing +# - 'begin{titlepage}' and +# - 'end{titlepage}' +# with our PDF document title page (LaTeX code) and write the +# result to $DOXY_HEAD. + +doxygen -w latex $DOXY_TEMP /dev/null /dev/null + +# combine three parts of these files to the output file +# using '( ... ) > $DOXY_HEAD' to write (concatenate) +# all three parts to one file + +( sed -e'/begin{titlepage}/,$d' < $DOXY_TEMP + cat $FLTK_HEAD + sed -e'1,/end{titlepage}/d' < $DOXY_TEMP +) > $DOXY_HEAD + +# cleanup +rm -f $DOXY_TEMP |
