Debian Codegraph @

fluid/documentation/make_header

raw
1 #!/bin/sh
2 #
3 # Create a new LaTeX header file for doxygen PDF docs
4 #
5 # Note: this LaTeX file depends on Doxygen and LaTeX versions, resp.
6 # and needs therefore to be created with current Doxygen and LaTeX
7 # versions on the build system.
8 #
9 # Usage:
10 #
11 # $ sh make_header doxygen_path input-file output-file
12 #
13 # where
14 # - 'doxygen_path' is the full path to the doxygen executable
15 # or just 'doxygen'. If the full path is used an arbitrary
16 # doxygen executable and thus doxygen version can be used.
17 # - 'input-file' is the pure (LaTeX) title page (template)
18 # - 'output-file' is the generated (LaTeX) title page (template)
19 # that is used by `make' or `cmake` to generate the final LaTeX
20 # page header (combined doxygen template + FLTK title page).
21 #
22 #=======================================================================
23 # This script requires a posix shell and uses the following commands:
24 # cat, rm and sed and (obviously) doxygen
25 #=======================================================================
26
27 # input and output file names
28 DOXY_CMD="$1"
29 FLTK_HEAD="$2"
30 DOXY_HEAD="$3"
31 # temp file
32 DOXY_TEMP="doxy-header.tex.$$"
33
34 if test x$FLTK_HEAD = x; then
35 echo "usage: $0 fltk-header-file output-file"
36 exit 1
37 fi
38
39 if test x$DOXY_HEAD = x; then
40 echo "usage: $0 fltk-header-file output-file"
41 exit 1
42 fi
43
44 # Create the doxygen LaTeX header template and replace the LaTeX
45 # code between (and including) the lines containing
46 # - 'begin{titlepage}' and
47 # - 'end{titlepage}'
48 # with our PDF document title page (LaTeX code) and write the
49 # result to $DOXY_HEAD.
50
51 "$DOXY_CMD" -w latex $DOXY_TEMP /dev/null /dev/null
52
53 # combine three parts of these files to the output file
54 # using '( ... ) > $DOXY_HEAD' to write (concatenate)
55 # all three parts to one file
56
57 ( sed -e'/begin{titlepage}/,$d' < $DOXY_TEMP
58 cat $FLTK_HEAD
59 sed -e'1,/end{titlepage}/d' < $DOXY_TEMP
60 ) > $DOXY_HEAD
61
62 # cleanup
63 rm -f $DOXY_TEMP