wortsammler 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +6 -0
- data/README.md +8 -10
- data/Rakefile +21 -10
- data/changelog.md +35 -0
- data/lib/wortsammler.rb +11 -5
- data/lib/wortsammler/class.proolib.rb +88 -29
- data/lib/wortsammler/exe.wortsammler.rb +1 -0
- data/lib/wortsammler/log_helper.rb +1 -1
- data/lib/wortsammler/pdf_utilities.rb +174 -0
- data/lib/wortsammler/rake_helper.rb +12 -2
- data/lib/wortsammler/version.rb +2 -1
- data/resources/{default.latex → default.wortsammler.latex} +317 -224
- data/resources/logo.jpg +0 -0
- data/resources/main.md +6 -1
- data/resources/sample_the-sample-document.yaml +5 -3
- data/resources/snippets.xlsx +0 -0
- data/spec/class.proolib_spec.rb +8 -0
- data/spec/floating-image.pdf +0 -0
- data/spec/pdf_utils_spec.rb +48 -0
- data/spec/wortsammler_spec.rb +157 -22
- data/spec/wortsammler_test_pdf.pdf +0 -0
- data/spec/wortsammler_test_pptx.pdf +0 -0
- data/spec/wortsammler_test_pptx.pptx +0 -0
- data/spec/wortsammler_test_xlsx.xlsx +0 -0
- data/testresults/wortsammler_testresults.html +6 -117
- data/testresults/wortsammler_testresults.log +5 -57
- data/wortsammler.gemspec +6 -5
- metadata +57 -57
- data/README.pdf +0 -0
- data/changelog.rb.txt +0 -9
@@ -0,0 +1,174 @@
|
|
1
|
+
require 'tmpdir'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
#
|
5
|
+
#
|
6
|
+
|
7
|
+
#
|
8
|
+
# This module provides utilites to handle pdf file.s
|
9
|
+
#
|
10
|
+
# Note that it only works on Mac OS X.
|
11
|
+
#
|
12
|
+
# @author [Bernhard Weichel]
|
13
|
+
#
|
14
|
+
module Wortsammler
|
15
|
+
|
16
|
+
#
|
17
|
+
# convert an excel workbook to cropped pdf file.
|
18
|
+
# it generates one file per sheet
|
19
|
+
#
|
20
|
+
# @param infile [String] name of the Excel file
|
21
|
+
# @param outfile [String] basis of the generated pdf file. The name of the
|
22
|
+
# sheet is mangled into the file accroding to the pattern
|
23
|
+
# <body_of_outfile> <name of the sheet>.<extension of outfile>
|
24
|
+
# note the space inserted by excel.
|
25
|
+
#
|
26
|
+
# @return [Array of String] the list of generated files.
|
27
|
+
#
|
28
|
+
def self.xlsx_to_cropped_pdf(infile, outfile)
|
29
|
+
outfiles=self.xlsx_to_pdf(infile, outfile)
|
30
|
+
outfiles.each{|f|
|
31
|
+
self.crop_pdf(f)
|
32
|
+
}
|
33
|
+
|
34
|
+
outfiles
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
#
|
39
|
+
# convert an excel workbook to *non cropped* pdf file.
|
40
|
+
# it generates one file per sheet
|
41
|
+
#
|
42
|
+
# @param infile [String] name of the Excel file
|
43
|
+
# @param outfile [String] basis of the generated pdf file. The name of the
|
44
|
+
# sheet is mangled into the file accroding to the pattern
|
45
|
+
# <body_of_outfile> <name of the sheet>.<extension of outfile>
|
46
|
+
# note the space inserted by excel.
|
47
|
+
#
|
48
|
+
# @return [Array of String] the list of generated files.
|
49
|
+
#
|
50
|
+
def self.xlsx_to_pdf(infile, outfile)
|
51
|
+
|
52
|
+
tmpdir=Dir.mktmpdir
|
53
|
+
outext=File.extname(outfile)
|
54
|
+
tmpbase=File.basename(outfile, outext)
|
55
|
+
tmpfile="#{tmpdir}/#{File.basename(infile)}"
|
56
|
+
outdir =File.dirname(File.absolute_path(outfile))
|
57
|
+
|
58
|
+
FileUtils.cp(infile, tmpfile)
|
59
|
+
|
60
|
+
cmd=[]
|
61
|
+
cmd << "osascript <<-EOF"
|
62
|
+
cmd << "set theTmpBase to (POSIX file \"#{tmpdir}/#{tmpbase}.pdf\") as string"
|
63
|
+
cmd << "tell application \"Microsoft Excel\""
|
64
|
+
#cmd << "activate"
|
65
|
+
cmd << ""
|
66
|
+
cmd << "open \"#{tmpfile}\""
|
67
|
+
cmd << ""
|
68
|
+
cmd << "save active workbook in theTmpBase as PDF file format"
|
69
|
+
cmd << "delay 1"
|
70
|
+
cmd << "close active workbook saving no"
|
71
|
+
cmd << "quit"
|
72
|
+
cmd << "end tell"
|
73
|
+
cmd << "EOF"
|
74
|
+
cmd = cmd.join("\n")
|
75
|
+
system(cmd)
|
76
|
+
|
77
|
+
Dir["#{tmpdir}/#{tmpbase}*.pdf"].each do |f|
|
78
|
+
outfilename=File.basename(f).gsub(" ", "_")
|
79
|
+
FileUtils.cp(f, "#{outdir}/#{outfilename}")
|
80
|
+
end
|
81
|
+
|
82
|
+
Dir["#{outdir}/#{tmpbase}*#{outext}"]
|
83
|
+
end
|
84
|
+
|
85
|
+
|
86
|
+
#
|
87
|
+
# convert an Powerpoint presentation to cropped pdf file.
|
88
|
+
# it generates one file per sheet
|
89
|
+
#
|
90
|
+
# @param infile [String] name of the Powerpoint file
|
91
|
+
# @param outfile [String] basis of the generated pdf file.
|
92
|
+
#
|
93
|
+
# @return [Array of String] the list of generated files. In fact it
|
94
|
+
# it is only one file. But for sake of harmonization with
|
95
|
+
# xlsx_to_pdf it is returned as an array.
|
96
|
+
#
|
97
|
+
def self.pptx_to_cropped_pdf(infile, outfile)
|
98
|
+
outfiles=self.pptx_to_pdf(infile, outfile)
|
99
|
+
outfiles.each{|f|
|
100
|
+
self.crop_pdf(f)
|
101
|
+
}
|
102
|
+
outfile
|
103
|
+
end
|
104
|
+
|
105
|
+
#
|
106
|
+
# convert an Powerpoint presentation to non cropped pdf file.
|
107
|
+
# it generates one file per sheet
|
108
|
+
#
|
109
|
+
# @param infile [String] name of the Powerpoint file
|
110
|
+
# @param outfile [String] basis of the generated pdf file.
|
111
|
+
#
|
112
|
+
# @return [Array of String] the list of generated files. In fact it
|
113
|
+
# it is only one file. But for sake of harmonization with
|
114
|
+
# xlsx_to_pdf it is returned as an array.
|
115
|
+
#
|
116
|
+
def self.pptx_to_pdf(infile, outfile)
|
117
|
+
|
118
|
+
tmpdir=Dir.mktmpdir
|
119
|
+
tmpout="#{tmpdir}/#{File.basename(outfile)}"
|
120
|
+
tmpin="#{tmpdir}/#{File.basename(infile)}"
|
121
|
+
outdir =File.dirname(File.absolute_path(outfile))
|
122
|
+
|
123
|
+
FileUtils.cp(infile, tmpin)
|
124
|
+
|
125
|
+
cmd=[]
|
126
|
+
cmd << "osascript <<-EOF"
|
127
|
+
cmd << "tell application \"Microsoft PowerPoint\""
|
128
|
+
#cmd << "activate"
|
129
|
+
cmd << ""
|
130
|
+
cmd << "open \"#{tmpin}\""
|
131
|
+
cmd << "open \"#{tmpin}\"" # todo: I open it twice making sure that it is really open
|
132
|
+
cmd << "set theActivePPT to the active presentation"
|
133
|
+
cmd << "save theActivePPT in \"#{tmpout}\" as save as PDF"
|
134
|
+
cmd << "close theActivePPT"
|
135
|
+
cmd << "quit"
|
136
|
+
cmd << "end tell"
|
137
|
+
cmd = cmd.join("\n")
|
138
|
+
system(cmd)
|
139
|
+
FileUtils.cp("#{tmpout}", outfile)
|
140
|
+
[outfile]
|
141
|
+
end
|
142
|
+
|
143
|
+
|
144
|
+
#
|
145
|
+
# crop a pdf file
|
146
|
+
# @param infile [String] The name of the pdf file
|
147
|
+
# @param outfile [String] The name of the output file.
|
148
|
+
# if no file is given, then the inputfile is
|
149
|
+
# replaced by the cropped file.
|
150
|
+
#
|
151
|
+
# @return [nil] no return
|
152
|
+
#
|
153
|
+
def self.crop_pdf(infile, outfile=nil)
|
154
|
+
|
155
|
+
result=`gs -q -dBATCH -dNOPAUSE -sDEVICE=bbox \"#{infile}\" 2>&1`
|
156
|
+
coords=/%BoundingBox:\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/.match(result).captures.join(" ")
|
157
|
+
|
158
|
+
tmpfile=infile+"_tmp"
|
159
|
+
|
160
|
+
cmd =[]
|
161
|
+
cmd << "gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite"
|
162
|
+
cmd << "-o\"#{tmpfile}\""
|
163
|
+
cmd << "-c \"[/CropBox [#{coords}] /PAGES pdfmark\""
|
164
|
+
cmd << "-f \"#{infile}\""
|
165
|
+
cmd = cmd.join(" ")
|
166
|
+
result = system(cmd)
|
167
|
+
|
168
|
+
outfile=infile if outfile.nil?
|
169
|
+
FileUtils.cp(tmpfile, outfile)
|
170
|
+
FileUtils.rm(tmpfile)
|
171
|
+
nil
|
172
|
+
end
|
173
|
+
|
174
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'rake'
|
2
|
+
|
1
3
|
|
2
4
|
##
|
3
5
|
#
|
@@ -9,7 +11,10 @@
|
|
9
11
|
##
|
10
12
|
# generate a task for each manifest file
|
11
13
|
#
|
12
|
-
|
14
|
+
#
|
15
|
+
manifestfiles=Dir["../ZSUPP_Manifests/*.yaml"]
|
16
|
+
|
17
|
+
manifestfiles.each{|file|
|
13
18
|
taskdesc=File.basename(file, ".yaml")
|
14
19
|
taskname=taskdesc.split("_")[0]
|
15
20
|
desc "generate #{taskdesc}"
|
@@ -19,10 +24,15 @@ Dir["../ZSUPP_Manifests/*.yaml"].each{|file|
|
|
19
24
|
end
|
20
25
|
}
|
21
26
|
|
22
|
-
|
27
|
+
tasknames=manifestfiles.map{|f|File.basename(f, "yaml").split("_")}
|
28
|
+
desc "generate all documents"
|
29
|
+
task :all => tasknames
|
30
|
+
|
31
|
+
#
|
23
32
|
# the default task
|
24
33
|
|
25
34
|
desc "print this help"
|
35
|
+
|
26
36
|
task :default do
|
27
37
|
system "rake -T"
|
28
38
|
end
|
data/lib/wortsammler/version.rb
CHANGED
@@ -1,224 +1,317 @@
|
|
1
|
-
\documentclass[
|
2
|
-
{
|
3
|
-
\
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
\
|
20
|
-
}
|
21
|
-
|
22
|
-
\
|
23
|
-
|
24
|
-
|
25
|
-
\
|
26
|
-
|
27
|
-
|
28
|
-
\
|
29
|
-
|
30
|
-
|
31
|
-
$
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
$if(
|
42
|
-
|
43
|
-
$
|
44
|
-
$
|
45
|
-
|
46
|
-
$endif$
|
47
|
-
$if(
|
48
|
-
|
49
|
-
$endif$
|
50
|
-
$if(
|
51
|
-
|
52
|
-
$endif$
|
53
|
-
|
54
|
-
$
|
55
|
-
|
56
|
-
$
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
\
|
63
|
-
|
64
|
-
\
|
65
|
-
|
66
|
-
|
67
|
-
$
|
68
|
-
\usepackage{
|
69
|
-
|
70
|
-
|
71
|
-
\
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
\
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
\
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
\
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
\
|
94
|
-
%
|
95
|
-
%
|
96
|
-
%
|
97
|
-
|
98
|
-
\
|
99
|
-
\
|
100
|
-
\
|
101
|
-
\
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
\
|
122
|
-
$
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
$
|
128
|
-
\
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
\
|
134
|
-
|
135
|
-
$
|
136
|
-
\
|
137
|
-
$endif$
|
138
|
-
$
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
$
|
146
|
-
$
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
\
|
155
|
-
|
156
|
-
\
|
157
|
-
\
|
158
|
-
\
|
159
|
-
\
|
160
|
-
\
|
161
|
-
\
|
162
|
-
\
|
163
|
-
\
|
164
|
-
|
165
|
-
%
|
166
|
-
\
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
\
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
\
|
178
|
-
\
|
179
|
-
\
|
180
|
-
|
181
|
-
\
|
182
|
-
|
183
|
-
|
184
|
-
\
|
185
|
-
|
186
|
-
\
|
187
|
-
\
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
$
|
194
|
-
|
195
|
-
{
|
196
|
-
|
197
|
-
\
|
198
|
-
\
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
\
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
\
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
\
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
\
|
1
|
+
\documentclass[twoside,a4paper,$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$]{$documentclass$}
|
2
|
+
\usepackage[T1]{fontenc}
|
3
|
+
\usepackage{lmodern}
|
4
|
+
\usepackage{amssymb,amsmath}
|
5
|
+
\usepackage{ifxetex,ifluatex}
|
6
|
+
\usepackage{fixltx2e} % provides \textsubscript
|
7
|
+
% use microtype if available
|
8
|
+
\IfFileExists{microtype.sty}{\usepackage{microtype}}{}
|
9
|
+
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
|
10
|
+
\usepackage[utf8]{inputenc}
|
11
|
+
$if(euro)$
|
12
|
+
\usepackage{eurosym}
|
13
|
+
$endif$
|
14
|
+
\else % if luatex or xelatex
|
15
|
+
\usepackage{fontspec}
|
16
|
+
\ifxetex
|
17
|
+
\usepackage{xltxtra,xunicode}
|
18
|
+
\fi
|
19
|
+
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
|
20
|
+
\newcommand{\euro}{€}
|
21
|
+
$if(mainfont)$
|
22
|
+
\setmainfont{$mainfont$}
|
23
|
+
$endif$
|
24
|
+
$if(sansfont)$
|
25
|
+
\setsansfont{$sansfont$}
|
26
|
+
$endif$
|
27
|
+
$if(monofont)$
|
28
|
+
\setmonofont{$monofont$}
|
29
|
+
$endif$
|
30
|
+
$if(mathfont)$
|
31
|
+
\setmathfont{$mathfont$}
|
32
|
+
$endif$
|
33
|
+
\fi
|
34
|
+
$if(geometry)$
|
35
|
+
\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
|
36
|
+
$endif$
|
37
|
+
$if(natbib)$
|
38
|
+
\usepackage{natbib}
|
39
|
+
\bibliographystyle{plainnat}
|
40
|
+
$endif$
|
41
|
+
$if(biblatex)$
|
42
|
+
\usepackage{biblatex}
|
43
|
+
$if(biblio-files)$
|
44
|
+
\bibliography{$biblio-files$}
|
45
|
+
$endif$
|
46
|
+
$endif$
|
47
|
+
$if(listings)$
|
48
|
+
\usepackage{listings}
|
49
|
+
$endif$
|
50
|
+
$if(lhs)$
|
51
|
+
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
|
52
|
+
$endif$
|
53
|
+
$if(highlighting-macros)$
|
54
|
+
$highlighting-macros$
|
55
|
+
$endif$
|
56
|
+
$if(verbatim-in-note)$
|
57
|
+
\usepackage{fancyvrb}
|
58
|
+
$endif$
|
59
|
+
$if(fancy-enums)$
|
60
|
+
% Redefine labelwidth for lists; otherwise, the enumerate package will cause
|
61
|
+
% markers to extend beyond the left margin.
|
62
|
+
\makeatletter\AtBeginDocument{%
|
63
|
+
\renewcommand{\@listi}
|
64
|
+
{\setlength{\labelwidth}{4em}}
|
65
|
+
}\makeatother
|
66
|
+
\usepackage{enumerate}
|
67
|
+
$endif$
|
68
|
+
\usepackage{longtable}
|
69
|
+
\usepackage{float} % provides the H option for float placement
|
70
|
+
\usepackage{graphicx}
|
71
|
+
% We will generate all images so they have a width \maxwidth. This means
|
72
|
+
% that they will get their normal width if they fit onto the page, but
|
73
|
+
% are scaled down if they would overflow the margins.
|
74
|
+
\makeatletter
|
75
|
+
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth
|
76
|
+
\else\Gin@nat@width\fi}
|
77
|
+
\makeatother
|
78
|
+
\let\Oldincludegraphics\includegraphics
|
79
|
+
\makeatletter
|
80
|
+
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth
|
81
|
+
\else\Gin@nat@width\fi}
|
82
|
+
\makeatother
|
83
|
+
\let\Oldincludegraphics\includegraphics
|
84
|
+
%\renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}}
|
85
|
+
% Determine if the image is too wide for the page.
|
86
|
+
%
|
87
|
+
{%
|
88
|
+
\catcode`\@=11\relax%
|
89
|
+
\gdef\includegraphics{\@ifnextchar[{\Oldincludegraphics}{\Oldincludegraphics[width=\maxwidth]}}%
|
90
|
+
}%
|
91
|
+
%
|
92
|
+
|
93
|
+
\ifxetex
|
94
|
+
\usepackage[setpagesize=false, % page size defined by xetex
|
95
|
+
unicode=false, % unicode breaks when used with xetex
|
96
|
+
bookmarksdepth=3, %
|
97
|
+
xetex]{hyperref}
|
98
|
+
\else
|
99
|
+
\usepackage[unicode=true]{hyperref}
|
100
|
+
\fi
|
101
|
+
\hypersetup{breaklinks=true,
|
102
|
+
bookmarks=true,
|
103
|
+
pdfauthor={$author-meta$},
|
104
|
+
pdftitle={$title-meta$},
|
105
|
+
colorlinks=true,
|
106
|
+
urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$,
|
107
|
+
linkcolor=$if(linkcolor)$$linkcolor$$else$magenta$endif$,
|
108
|
+
pdfborder={0 0 0}}
|
109
|
+
\urlstyle{same} % don't use monospace font for urls
|
110
|
+
$if(links-as-notes)$
|
111
|
+
% Make links footnotes instead of hotlinks:
|
112
|
+
\renewcommand{\href}[2]{#2\footnote{\url{#1}}}
|
113
|
+
$endif$
|
114
|
+
$if(strikeout)$
|
115
|
+
\usepackage[normalem]{ulem}
|
116
|
+
% avoid problems with \sout in headers with hyperref:
|
117
|
+
\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
|
118
|
+
$endif$
|
119
|
+
\setlength{\parindent}{0pt}
|
120
|
+
\setlength{\parskip}{6pt plus 2pt minus 1pt}
|
121
|
+
\setlength{\emergencystretch}{3em} % prevent overfull lines
|
122
|
+
$if(numbersections)$
|
123
|
+
\setcounter{secnumdepth}{5}
|
124
|
+
$else$
|
125
|
+
\setcounter{secnumdepth}{0}
|
126
|
+
$endif$
|
127
|
+
$if(verbatim-in-note)$
|
128
|
+
\VerbatimFootnotes % allows verbatim text in footnotes
|
129
|
+
$endif$
|
130
|
+
$if(lang)$
|
131
|
+
\ifxetex
|
132
|
+
\usepackage{polyglossia}
|
133
|
+
\setmainlanguage{$mainlang$}
|
134
|
+
\else
|
135
|
+
\usepackage[$lang$]{babel}
|
136
|
+
\fi
|
137
|
+
$endif$
|
138
|
+
$for(header-includes)$
|
139
|
+
$header-includes$
|
140
|
+
$endfor$
|
141
|
+
|
142
|
+
$if(title)$
|
143
|
+
\title{$title$}
|
144
|
+
$endif$
|
145
|
+
\author{$for(author)$$author$$sep$ \and $endfor$}
|
146
|
+
\date{$date$}
|
147
|
+
|
148
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
149
|
+
%
|
150
|
+
% Wortsammler specific settings
|
151
|
+
%
|
152
|
+
%list environment by reinhard Jahraus
|
153
|
+
{\catcode`\@=11\relax%
|
154
|
+
\gdef\itemize{%
|
155
|
+
\ifnum \@itemdepth >\thr@@\@toodeep\else
|
156
|
+
\advance\@itemdepth\@ne
|
157
|
+
\edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
|
158
|
+
\expandafter
|
159
|
+
\list
|
160
|
+
\csname\@itemitem\endcsname
|
161
|
+
{\def\makelabel##1{\hss\llap{##1}}%
|
162
|
+
\addtolength{\leftmargin}{-10pt}% 29.37pt
|
163
|
+
\addtolength{\rightmargin}{0.0pt}% 0.0pt
|
164
|
+
\addtolength{\labelsep}{0pt}% 23.50pt
|
165
|
+
\addtolength{\itemsep}{-3.0pt}% 5.0pt
|
166
|
+
\addtolength{\parsep}{-1pt}% 5.0pt
|
167
|
+
\addtolength{\topsep}{-5pt}% 10.0pt
|
168
|
+
\addtolength{\partopsep}{0pt}% 3.0pt
|
169
|
+
}%
|
170
|
+
\fi}
|
171
|
+
}%
|
172
|
+
|
173
|
+
%
|
174
|
+
% improve nesting of lists
|
175
|
+
% %http://stackoverflow.com/questions/1935952/maximum-nesting-level-of-lists-in-latex
|
176
|
+
%
|
177
|
+
\usepackage{enumitem}
|
178
|
+
\setlistdepth{9}
|
179
|
+
\setlist[itemize,1]{label=$$\bullet$$}
|
180
|
+
\setlist[itemize,2]{label=$$\bullet$$}
|
181
|
+
\setlist[itemize,3]{label=$$\bullet$$}
|
182
|
+
\setlist[itemize,4]{label=$$\bullet$$}
|
183
|
+
\setlist[itemize,5]{label=$$\bullet$$}
|
184
|
+
\setlist[itemize,6]{label=$$\bullet$$}
|
185
|
+
\setlist[itemize,7]{label=$$\bullet$$}
|
186
|
+
\setlist[itemize,8]{label=$$\bullet$$}
|
187
|
+
\setlist[itemize,9]{label=$$\bullet$$}
|
188
|
+
\renewlist{itemize}{itemize}{9}
|
189
|
+
%
|
190
|
+
% multicol
|
191
|
+
%
|
192
|
+
\usepackage{multicol}
|
193
|
+
$if(linenumbers)$
|
194
|
+
\newcommand{\wsbegintwocol}{}
|
195
|
+
\newcommand{\wsendtwocol}{}
|
196
|
+
$else$
|
197
|
+
\newcommand{\wsbegintwocol}{\begin{multicols}{2}}
|
198
|
+
\newcommand{\wsendtwocol}{\end{multicols}}
|
199
|
+
$endif$
|
200
|
+
|
201
|
+
%
|
202
|
+
% embed an image in the text
|
203
|
+
%
|
204
|
+
% usage: \wsembedimage{file}{r|l}{width}{height}
|
205
|
+
\usepackage{wrapfig}
|
206
|
+
\usepackage{needspace}
|
207
|
+
\newcommand{\wsembedimage}[4]{\needspace{#4}\begin{wrapfigure}{#2}{#3}\centering%
|
208
|
+
\vspace{-5mm}\includegraphics{#1}\vspace{-1cm}\end{wrapfigure}}
|
209
|
+
%
|
210
|
+
% adjust page layout
|
211
|
+
%
|
212
|
+
\setlength{\oddsidemargin}{-0.5cm}
|
213
|
+
\setlength{\evensidemargin}{-0.5cm}
|
214
|
+
\setlength{\textwidth}{17cm}
|
215
|
+
\setlength{\topmargin}{-2.0cm}
|
216
|
+
\setlength{\headheight}{1cm}
|
217
|
+
\setlength{\headsep}{1.5cm}
|
218
|
+
\setlength{\textheight}{25cm}
|
219
|
+
\setlength{\footskip}{1cm}
|
220
|
+
|
221
|
+
% adjust the toc layout
|
222
|
+
\makeatletter
|
223
|
+
% \renewcommand*\l@section{\@dottedtocline{2}{1.8em}{4em}}
|
224
|
+
\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{4em}}
|
225
|
+
\renewcommand*\l@subsubsection{\@dottedtocline{2}{5.5em}{4em}}
|
226
|
+
\makeatother
|
227
|
+
|
228
|
+
\usepackage{pdfpages}
|
229
|
+
\usepackage{bookmark}
|
230
|
+
\usepackage{fancyhdr}
|
231
|
+
\pagestyle{fancy}
|
232
|
+
\chead{\begin{center}\textbf{$title$} $edition$\end{center}}
|
233
|
+
$if(logofile)$
|
234
|
+
\lhead{\includegraphics{$logofile$}}
|
235
|
+
$endif$
|
236
|
+
\rhead{\leftmark}
|
237
|
+
\lfoot{$author$}
|
238
|
+
\rfoot{\today~$date$}
|
239
|
+
\renewcommand{\footrulewidth}{0.4pt}
|
240
|
+
%
|
241
|
+
\renewcommand{\familydefault}{\sfdefault}
|
242
|
+
%
|
243
|
+
% Marginpars shall always be right
|
244
|
+
\makeatletter
|
245
|
+
\def\marginparright{\@mparswitchfalse}
|
246
|
+
\def\marginparoutside{\@mparswitchtrue}
|
247
|
+
\makeatother
|
248
|
+
\marginparright
|
249
|
+
%
|
250
|
+
%
|
251
|
+
\raggedbottom
|
252
|
+
%
|
253
|
+
|
254
|
+
$if(linenumbers)$
|
255
|
+
\usepackage[pagewise]{lineno}
|
256
|
+
\setlength\linenumbersep{1mm}
|
257
|
+
\modulolinenumbers[5]
|
258
|
+
$endif$
|
259
|
+
%
|
260
|
+
%\renewcommand{Befehl der Gliederungsebene z.B. \chapter}{\@startsection{Name z.B. chapter}{Ebene z.B. 0}{Einrückung z.B. 0pt}{Abstand zum vorigen Text z.B. 3.5ex plus 1ex minus 0pt\relax}{Abstand zum nachfolgenden Text z.B. 2.5ex plus 0.5ex minus 0pt\relax}{Schrift z.B. \normalfont\Large\bfseries}}
|
261
|
+
%
|
262
|
+
% \makeatletter%
|
263
|
+
% \renewcommand{\chapter}{\@startsection{chapter}{0}{0pt}{3.5ex plus 1ex minus 0pt\relax}{2.5ex plus 0.5ex minus 0pt\relax}{\normalfont\Large\bfseries}}%
|
264
|
+
% \makeatother%
|
265
|
+
%
|
266
|
+
%
|
267
|
+
% Wortsammler extensions end here
|
268
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
269
|
+
\begin{document}
|
270
|
+
$if(title)$
|
271
|
+
\maketitle
|
272
|
+
$endif$
|
273
|
+
|
274
|
+
$for(include-before)$
|
275
|
+
$include-before$
|
276
|
+
|
277
|
+
$endfor$
|
278
|
+
$if(title)$
|
279
|
+
\clearpage
|
280
|
+
$endif$
|
281
|
+
|
282
|
+
$if(toc)$
|
283
|
+
{
|
284
|
+
\hypersetup{linkcolor=black}
|
285
|
+
\setcounter{tocdepth}{1}
|
286
|
+
\tableofcontents
|
287
|
+
\newpage
|
288
|
+
}
|
289
|
+
$endif$
|
290
|
+
$if(linenumbers)$
|
291
|
+
\linenumbers
|
292
|
+
$endif$
|
293
|
+
|
294
|
+
$body$
|
295
|
+
|
296
|
+
$if(natbib)$
|
297
|
+
$if(biblio-files)$
|
298
|
+
$if(biblio-title)$
|
299
|
+
$if(book-class)$
|
300
|
+
\renewcommand\bibname{$biblio-title$}
|
301
|
+
$else$
|
302
|
+
\renewcommand\refname{$biblio-title$}
|
303
|
+
$endif$
|
304
|
+
$endif$
|
305
|
+
\bibliography{$biblio-files$}
|
306
|
+
|
307
|
+
$endif$
|
308
|
+
$endif$
|
309
|
+
$if(biblatex)$
|
310
|
+
\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
|
311
|
+
|
312
|
+
$endif$
|
313
|
+
$for(include-after)$
|
314
|
+
$include-after$
|
315
|
+
|
316
|
+
$endfor$
|
317
|
+
\end{document}
|