dol: initial dol commit
[jump.git] / dol / examples / schema / createschemastex
1 #!/bin/bash
2
3 ##########################################################################
4 # Script to collect together processnetwork.xsd, architecture.xsd, and
5 # mapping.xsd into a single LaTeX document.
6 #
7 # Lines longer than 80 characters in the source files are truncated.
8
9 # modification history:
10 # 2006-08-22: created
11 #
12 ##########################################################################
13
14 ##########################################################################
15 # create LaTeX header
16 ##########################################################################
17
18 echo -e %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'\n'\
19 % XML Schema Definitions.'\n'\
20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'\n'\
21 '\n'\
22 '\\'documentclass[11pt,oneside]{book}'\n'\
23 '\\'usepackage{fancyhdr,ifthen,a4wide,textcomp,version,amsmath,bbm,url}'\n'\
24 '\\'usepackage[latin1]{inputenc}'\n'\
25 '\n'\
26 %package for including listings'\n'\
27 '\\'usepackage{listings}'\n'\
28 '\\'lstset{basicstyle='\\'small, xleftmargin=12pt, numbersep=12pt, numbers=left,'\n'\
29          numberstyle='\\'tiny, numbersep=5pt}'\n'\
30 %print two-digit line numbers'\n'\
31 '\\'newcommand{'\\'twodig}[1]'\n'\
32    {'\\'ifcase#1 00'\\'or01'\\'or02'\\'or03'\\'or04'\\'or05'\\'or06'\\'or07'\\'or08'\\'or09'\\'else#1'\\'fi}'\n'\
33 '\\'renewcommand{'\\'thelstnumber}{'\\'twodig{'\\'arabic{lstnumber}}}'\n'\
34 '\n'\
35 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'\n'\
36 %page layout and graphics path'\n'\
37 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'\n'\
38 '\\'setlength{'\\'textwidth}{18 true cm}'\n'\
39 '\\'setlength{'\\'textheight}{27.4 true cm}'\n'\
40 '\\'oddsidemargin  -1.0 cm'\n'\
41 '\\'evensidemargin -1.0 cm'\n'\
42 '\\'topmargin      -2.4 cm'\n'\
43 '\\'setlength{'\\'parindent}{0pt}'\n'\
44 '\\'sloppy'\n'\
45 '\\'flushbottom'\n'\
46 '\\'pagestyle{empty}'\n'\
47 '\n'\
48 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'\n'\
49 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'\n'\
50 '\n'\
51 '\\'begin{document} > latex_header.tex
52
53
54 ##########################################################################
55 # create LaTeX footer
56 ##########################################################################
57
58 echo -e '\\'end{document} > latex_footer.tex
59
60
61 ##########################################################################
62 # create listings header and footer
63 ##########################################################################
64
65 echo -e '\\'newpage'\n'\
66 '\\'begin{lstlisting} > listing_header.tex
67
68 echo -e '\\'end{lstlisting} > listing_footer.tex
69
70
71 ##########################################################################
72 # create document
73 ##########################################################################
74
75 cat latex_header.tex listing_header.tex processnetwork.xsd listing_footer.tex \
76                      listing_header.tex architecture.xsd   listing_footer.tex \
77                      listing_header.tex mapping.xsd listing_footer.tex latex_footer.tex > schemas.tex
78
79
80 ##########################################################################
81 # truncate lines longer than 80 characters
82 ##########################################################################
83
84 sed -i 's/\(^.\{80\}\).*/\1.../g' schemas.tex
85
86
87 ##########################################################################
88 # remove help files
89 ##########################################################################
90
91 rm -f latex_header.tex latex_footer.tex listing_header.tex listing_footer.tex