latex_document 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b2cbd5af2651301865ba4263c2e5be549530eada
4
- data.tar.gz: 7b75c03d661c5f63c2f4b73d541cf6524c8964d5
3
+ metadata.gz: b567f58411d949f31eb9aec61476a308a0f65bd0
4
+ data.tar.gz: 8adc078668ddc6b3746a1b0e6c70ae2fb800a0f1
5
5
  SHA512:
6
- metadata.gz: 1cfbb718f79373b17760aca31b615c6f638afb059f2c764d56d5215b7600f608376c91035a934ec7375d8be28382a8c9c7f302f2500a695e0b4a832cd8b64862
7
- data.tar.gz: 0733d903cd920c031655c7e95c2034004421b136c3debe8c740a5aa9ba7d97c75728816e14e66337675a378d94263ae58547eb96c02655715c92ffa18dcf34dd
6
+ metadata.gz: d84436ad7f585cdfbdbe197ab25213c63f33378641e47fd1297b55051f447d5224f774a45c676b85040c7409241e10dad8e62cc4e3e6dfa0ca4b3bc1a0358905
7
+ data.tar.gz: 53559a57e6e1c6168d8b6b4513dbff99ecf66e478ed523f26a42c4ec81031e650a9cf93f925c8cf6dc173e5f898b682cfc080fee3db150d4e1d8a32e69834c53
data/bin/latex_document CHANGED
@@ -54,41 +54,11 @@ module LatexDocument
54
54
  end
55
55
  end
56
56
 
57
- class Tex < NewDocument
58
- def fill_root
59
- super
60
- empty_directory file_path('src')
61
- empty_directory file_path('include')
62
- end
63
-
64
- def src
65
- template("templates/tex/src/document.tex.tt", file_path("src/#{name}.tex"))
66
- template("templates/references.bib.tt", file_path("src/references.bib"))
67
- end
68
-
69
- def include
70
- create_file_from_template("include/mydefault.sty")
71
- end
72
-
73
- protected
74
-
75
- def create_file_from_template(file_name)
76
- template(
77
- "templates/tex/#{file_name}.tt",
78
- file_path(file_name)
79
- )
80
- end
81
-
82
- end
83
-
84
57
  class Md < NewDocument
85
58
  def fill_root
86
59
  super
87
60
  template("templates/md/document.md.tt", file_path("#{name}.md"))
88
61
  create_file_from_shared_template 'references.bib'
89
- ['pdf', 'tex', 'html'].each do |format|
90
- create_file_from_template "#{format}.template.pandoc"
91
- end
92
62
  end
93
63
 
94
64
  protected
@@ -112,16 +82,6 @@ module LatexDocument
112
82
  puts VERSION
113
83
  end
114
84
 
115
- map 't' => :tex
116
-
117
- register(
118
- Tex,
119
- 'tex',
120
- "tex NAME [--author=AUTHOR]",
121
- "Creates a new latex document with name NAME and author AUTHOR, the latter of which defaults to \"#{Tex::DEFAULT_AUTHOR}\"."
122
- )
123
- tasks["tex"].options = Tex.class_options
124
-
125
85
  map 'm' => :md
126
86
 
127
87
  register(
@@ -1,3 +1,3 @@
1
1
  module LatexDocument
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -1,39 +1,83 @@
1
- default: pdf
2
- .PHONY: default
3
-
4
- #THIS_DIR := $(CURDIR)/$(dir $(lastword $(MAKEFILE_LIST)))
5
- THIS_DIR := ./
6
-
7
1
  TARGET_BASE :=<%= name %>
8
- SRC_DIR :=$(THIS_DIR)
9
- TARGET_SRC :=$(SRC_DIR)/$(TARGET_BASE).md
2
+ MD_SRC :=$(TARGET_BASE).md
3
+ TEX_SRC :=$(TARGET_BASE).src.tex
4
+ GENERATED_TEX :=$(TARGET_BASE).tex
10
5
 
11
- BIB :=$(SRC_DIR)/references.bib
6
+ BIB :=references.bib
12
7
 
13
- TEMPLATE_DIR :=$(THIS_DIR)
14
8
  TEMPLATE :=template.pandoc
15
9
 
16
10
  # Default geometry
17
- geometry =margin=1cm
11
+ geometry =margin=2cm
12
+
13
+ # Build Rules
14
+ #============
15
+ default: quick
16
+ .PHONY: default
17
+
18
+ ifeq ("$(wildcard $(TEX_SRC))","")
19
+ $(GENERATED_TEX): $(MD_SRC) tex.$(TEMPLATE) $(BIB)
20
+ pandoc \
21
+ --biblatex \
22
+ --template=tex.$(TEMPLATE) \
23
+ --biblio $(BIB) \
24
+ --variable geometry:$(geometry) \
25
+ --variable fontsize:12pt \
26
+ $(CLASSOPTION) \
27
+ -s \
28
+ $< \
29
+ -o $@
30
+ $(TEX_SRC): $(GENERATED_TEX)
31
+ mv $< $@
32
+ rm $(MD_SRC)
33
+ else
34
+ $(GENERATED_TEX): $(TEX_SRC)
35
+ cp $< $@
36
+ endif
37
+
38
+ $(TARGET_BASE).pdf: $(GENERATED_TEX)
39
+ pdflatex $(TARGET_BASE)
40
+ biber $(TARGET_BASE)
41
+ pdflatex $(TARGET_BASE)
42
+ pdflatex $(TARGET_BASE)
43
+ $(MAKE) clean-extra
18
44
 
19
- $(TARGET_BASE).%:: $(TARGET_SRC) $(TEMPLATE_DIR)/%.$(TEMPLATE) | $(TEMPLATE_DIR)
20
- pandoc $(TARGET_SRC) -o $(THIS_DIR)/$@ --template=$(TEMPLATE_DIR)/$*.$(TEMPLATE) --biblio $(BIB) --variable geometry:$(geometry)
45
+ quick: $(GENERATED_TEX)
46
+ pdflatex $(GENERATED_TEX)
47
+ $(MAKE) clean-extra
48
+ .PHONY: quick
21
49
 
22
- # Add rules for different file types like this:
23
50
  pdf: $(TARGET_BASE).pdf
24
51
  .PHONY: pdf
25
- tex: $(TARGET_BASE).tex
52
+
53
+ tex: $(GENERATED_TEX)
26
54
  .PHONY: tex
27
- html: $(TARGET_BASE).html
28
- .PHONY: html
29
55
 
56
+ tex-src: $(TEX_SRC)
57
+ .PHONY: tex-src
58
+
59
+ draft: CLASSOPTION =--variable classoption:draft
60
+ draft: pdf
61
+ .PHONY: draft
62
+
63
+ final: CLASSOPTION =--variable classoption:final
64
+ final: pdf
65
+ .PHONY: final
30
66
 
31
- # Meta-rules
67
+
68
+ # Meta Rules
32
69
  #===========
33
70
  print-%:
34
71
  @echo $* = $($*)
35
72
  .PHONY: print-%
36
73
 
37
- clean%:
38
- -rm $(TARGET_BASE).$*
39
- .PHONY: clean%
74
+ clean-extra:
75
+ @-rm *.log *.aux *.bcf *.bbl *.blg *.dvi *.out *.run.xml *.lot *.lof *.toc $(GENERATED_TEX) || true
76
+ .PHONY: clean-extra
77
+
78
+ clean: clean-extra clean-pdf
79
+ .PHONY: clean
80
+
81
+ clean-pdf:
82
+ @-rm *.pdf || true
83
+ .PHONY: clean-pdf
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: latex_document
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dustin Morrill
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-08 00:00:00.000000000 Z
11
+ date: 2016-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.18.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.18.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: Latex document generator
@@ -70,13 +70,7 @@ files:
70
70
  - lib/latex_document/version.rb
71
71
  - templates/md/Makefile.tt
72
72
  - templates/md/document.md.tt
73
- - templates/md/html.template.pandoc.tt
74
- - templates/md/pdf.template.pandoc.tt
75
- - templates/md/tex.template.pandoc.tt
76
73
  - templates/references.bib.tt
77
- - templates/tex/Makefile.tt
78
- - templates/tex/include/mydefault.sty.tt
79
- - templates/tex/src/document.tex.tt
80
74
  homepage: https://github.com/dmorrill10/latex_document
81
75
  licenses:
82
76
  - MIT
@@ -87,17 +81,17 @@ require_paths:
87
81
  - lib
88
82
  required_ruby_version: !ruby/object:Gem::Requirement
89
83
  requirements:
90
- - - '>='
84
+ - - ">="
91
85
  - !ruby/object:Gem::Version
92
86
  version: '0'
93
87
  required_rubygems_version: !ruby/object:Gem::Requirement
94
88
  requirements:
95
- - - '>='
89
+ - - ">="
96
90
  - !ruby/object:Gem::Version
97
91
  version: '0'
98
92
  requirements: []
99
93
  rubyforge_project:
100
- rubygems_version: 2.0.3
94
+ rubygems_version: 2.5.1
101
95
  signing_key:
102
96
  specification_version: 4
103
97
  summary: Latex document generator
@@ -1,61 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$>
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
- <meta http-equiv="Content-Style-Type" content="text/css" />
6
- <meta name="generator" content="pandoc" />
7
- $for(author-meta)$
8
- <meta name="author" content="$author-meta$" />
9
- $endfor$
10
- $if(date-meta)$
11
- <meta name="date" content="$date-meta$" />
12
- $endif$
13
- <title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>
14
- <style type="text/css">code{white-space: pre;}</style>
15
- $if(quotes)$
16
- <style type="text/css">q { quotes: "“" "”" "‘" "’"; }</style>
17
- $endif$
18
- $if(highlighting-css)$
19
- <style type="text/css">
20
- $highlighting-css$
21
- </style>
22
- $endif$
23
- $for(css)$
24
- <link rel="stylesheet" href="$css$" $if(html5)$$else$type="text/css" $endif$/>
25
- $endfor$
26
- $if(math)$
27
- $math$
28
- $endif$
29
- $for(header-includes)$
30
- $header-includes$
31
- $endfor$
32
- </head>
33
- <body>
34
- $for(include-before)$
35
- $include-before$
36
- $endfor$
37
- $if(title)$
38
- <div id="$idprefix$header">
39
- <h1 class="title">$title$</h1>
40
- $if(subtitle)$
41
- <h1 class="subtitle">$subtitle$</h1>
42
- $endif$
43
- $for(author)$
44
- <h2 class="author">$author$</h2>
45
- $endfor$
46
- $if(date)$
47
- <h3 class="date">$date$</h3>
48
- $endif$
49
- </div>
50
- $endif$
51
- $if(toc)$
52
- <div id="$idprefix$TOC">
53
- $toc$
54
- </div>
55
- $endif$
56
- $body$
57
- $for(include-after)$
58
- $include-after$
59
- $endfor$
60
- </body>
61
- </html>
@@ -1,206 +0,0 @@
1
- \documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
2
- $if(fontfamily)$
3
- \usepackage{$fontfamily$}
4
- $else$
5
- \usepackage{lmodern}
6
- $endif$
7
- $if(linestretch)$
8
- \usepackage{setspace}
9
- \setstretch{$linestretch$}
10
- $endif$
11
- \usepackage{amssymb,amsmath}
12
- \usepackage{mathtools} % Better boxes around math
13
- \usepackage{ifxetex,ifluatex}
14
- \usepackage{fixltx2e} % provides \textsubscript
15
- \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
16
- \usepackage[T1]{fontenc}
17
- \usepackage[utf8]{inputenc}
18
- $if(euro)$
19
- \usepackage{eurosym}
20
- $endif$
21
- \else % if luatex or xelatex
22
- \ifxetex
23
- \usepackage{mathspec}
24
- \usepackage{xltxtra,xunicode}
25
- \else
26
- \usepackage{fontspec}
27
- \fi
28
- \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
29
- \newcommand{\euro}{€}
30
- $if(mainfont)$
31
- \setmainfont{$mainfont$}
32
- $endif$
33
- $if(sansfont)$
34
- \setsansfont{$sansfont$}
35
- $endif$
36
- $if(monofont)$
37
- \setmonofont[Mapping=tex-ansi]{$monofont$}
38
- $endif$
39
- $if(mathfont)$
40
- \setmathfont(Digits,Latin,Greek){$mathfont$}
41
- $endif$
42
- \fi
43
- % use upquote if available, for straight quotes in verbatim environments
44
- \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
45
- % use microtype if available
46
- \IfFileExists{microtype.sty}{\usepackage{microtype}}{}
47
- $if(geometry)$
48
- \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
49
- $endif$
50
- $if(natbib)$
51
- \usepackage{natbib}
52
- \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
53
- $endif$
54
- $if(biblatex)$
55
- \usepackage{biblatex}
56
- $if(biblio-files)$
57
- \bibliography{$biblio-files$}
58
- $endif$
59
- $endif$
60
- $if(listings)$
61
- \usepackage{listings}
62
- $endif$
63
- $if(lhs)$
64
- \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
65
- $endif$
66
- $if(highlighting-macros)$
67
- $highlighting-macros$
68
- $endif$
69
- $if(verbatim-in-note)$
70
- \usepackage{fancyvrb}
71
- $endif$
72
- $if(tables)$
73
- \usepackage{longtable,booktabs}
74
- $endif$
75
- $if(graphics)$
76
- \usepackage{graphicx}
77
- \makeatletter
78
- \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
79
- \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
80
- \makeatother
81
- % Scale images if necessary, so that they will not overflow the page
82
- % margins by default, and it is still possible to overwrite the defaults
83
- % using explicit options in \includegraphics[width, height, ...]{}
84
- \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
85
- $endif$
86
- \ifxetex
87
- \usepackage[setpagesize=false, % page size defined by xetex
88
- unicode=false, % unicode breaks when used with xetex
89
- xetex]{hyperref}
90
- \else
91
- \usepackage[unicode=true]{hyperref}
92
- \fi
93
- \hypersetup{breaklinks=true,
94
- bookmarks=true,
95
- pdfauthor={$author-meta$},
96
- pdftitle={$title-meta$},
97
- colorlinks=true,
98
- citecolor=$if(citecolor)$$citecolor$$else$blue$endif$,
99
- urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$,
100
- linkcolor=$if(linkcolor)$$linkcolor$$else$magenta$endif$,
101
- pdfborder={0 0 0}}
102
- \urlstyle{same} % don't use monospace font for urls
103
- $if(links-as-notes)$
104
- % Make links footnotes instead of hotlinks:
105
- \renewcommand{\href}[2]{#2\footnote{\url{#1}}}
106
- $endif$
107
- $if(strikeout)$
108
- \usepackage[normalem]{ulem}
109
- % avoid problems with \sout in headers with hyperref:
110
- \pdfstringdefDisableCommands{\renewcommand{\sout}{}}
111
- $endif$
112
- \setlength{\parindent}{0pt}
113
- \setlength{\parskip}{6pt plus 2pt minus 1pt}
114
- \setlength{\emergencystretch}{3em} % prevent overfull lines
115
- $if(numbersections)$
116
- \setcounter{secnumdepth}{5}
117
- $else$
118
- \setcounter{secnumdepth}{0}
119
- $endif$
120
- $if(verbatim-in-note)$
121
- \VerbatimFootnotes % allows verbatim text in footnotes
122
- $endif$
123
- $if(lang)$
124
- \ifxetex
125
- \usepackage{polyglossia}
126
- \setmainlanguage{$mainlang$}
127
- \else
128
- \usepackage[$lang$]{babel}
129
- \fi
130
- $endif$
131
-
132
- %%% macros
133
- \newcommand{\final}{\fbox}
134
- \newcommand{\bs}{\boldsymbol}
135
- \newcommand{\tr}{\operatorname{tr}}
136
- \newcommand{\norm}[1]{\left\lVert#1\right\rVert}
137
- \newcommand{\set}[1]{\left\{ {#1} \right\}}
138
-
139
- \newcommand{\diag}[1]{\mathop{\bigtriangleup\subex{#1}}\nolimits}
140
- \newcommand{\stack}[1]{\operatorname{stack}\subex{#1}}
141
- \newcommand{\deriv}[2]{\frac{d #1}{ d #2 }}
142
-
143
- \newcommand{\subex}[1]{\left(#1\right)}
144
- %%%%
145
-
146
- $if(title)$
147
- \title{$title$}
148
- $endif$
149
- $if(subtitle)$
150
- \subtitle{$subtitle$}
151
- $endif$
152
- $if(author)$
153
- \author{$for(author)$$author$$sep$ \and $endfor$}
154
- $endif$
155
- $if(date)$
156
- \date{$date$}
157
- $endif$
158
- $for(header-includes)$
159
- $header-includes$
160
- $endfor$
161
-
162
- \begin{document}
163
- $if(title)$
164
- \maketitle
165
- $endif$
166
- $if(abstract)$
167
- \begin{abstract}
168
- $abstract$
169
- \end{abstract}
170
- $endif$
171
-
172
- $for(include-before)$
173
- $include-before$
174
-
175
- $endfor$
176
- $if(toc)$
177
- {
178
- \hypersetup{linkcolor=black}
179
- \setcounter{tocdepth}{$toc-depth$}
180
- \tableofcontents
181
- }
182
- $endif$
183
- $body$
184
-
185
- $if(natbib)$
186
- $if(biblio-files)$
187
- $if(biblio-title)$
188
- $if(book-class)$
189
- \renewcommand\bibname{$biblio-title$}
190
- $else$
191
- \renewcommand\refname{$biblio-title$}
192
- $endif$
193
- $endif$
194
- \bibliography{$biblio-files$}
195
-
196
- $endif$
197
- $endif$
198
- $if(biblatex)$
199
- \printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
200
-
201
- $endif$
202
- $for(include-after)$
203
- $include-after$
204
-
205
- $endfor$
206
- \end{document}
@@ -1,213 +0,0 @@
1
- \documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
2
- $if(fontfamily)$
3
- \usepackage{$fontfamily$}
4
- $else$
5
- \usepackage{lmodern}
6
- $endif$
7
- $if(linestretch)$
8
- \usepackage{setspace}
9
- \setstretch{$linestretch$}
10
- $endif$
11
- \usepackage{amssymb,amsmath}
12
- \usepackage{mathtools} % Better boxes around math
13
- \usepackage{ifxetex,ifluatex}
14
- \usepackage{fixltx2e} % provides \textsubscript
15
- \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
16
- \usepackage[T1]{fontenc}
17
- \usepackage[utf8]{inputenc}
18
- $if(euro)$
19
- \usepackage{eurosym}
20
- $endif$
21
- \else % if luatex or xelatex
22
- \ifxetex
23
- \usepackage{mathspec}
24
- \usepackage{xltxtra,xunicode}
25
- \else
26
- \usepackage{fontspec}
27
- \fi
28
- \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
29
- \newcommand{\euro}{€}
30
- $if(mainfont)$
31
- \setmainfont{$mainfont$}
32
- $endif$
33
- $if(sansfont)$
34
- \setsansfont{$sansfont$}
35
- $endif$
36
- $if(monofont)$
37
- \setmonofont[Mapping=tex-ansi]{$monofont$}
38
- $endif$
39
- $if(mathfont)$
40
- \setmathfont(Digits,Latin,Greek){$mathfont$}
41
- $endif$
42
- \fi
43
- % use upquote if available, for straight quotes in verbatim environments
44
- \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
45
- % use microtype if available
46
- \IfFileExists{microtype.sty}{\usepackage{microtype}}{}
47
- $if(geometry)$
48
- \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
49
- $endif$
50
- $if(natbib)$
51
- \usepackage{natbib}
52
- \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
53
- $endif$
54
- $if(biblatex)$
55
- \usepackage{biblatex}
56
- $if(biblio-files)$
57
- \bibliography{$biblio-files$}
58
- $endif$
59
- $endif$
60
- $if(listings)$
61
- \usepackage{listings}
62
- $endif$
63
- $if(lhs)$
64
- \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
65
- $endif$
66
- $if(highlighting-macros)$
67
- $highlighting-macros$
68
- $endif$
69
- $if(verbatim-in-note)$
70
- \usepackage{fancyvrb}
71
- $endif$
72
- $if(tables)$
73
- \usepackage{longtable,booktabs}
74
- $endif$
75
- $if(graphics)$
76
- \usepackage{graphicx}
77
- \makeatletter
78
- \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
79
- \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
80
- \makeatother
81
- % Scale images if necessary, so that they will not overflow the page
82
- % margins by default, and it is still possible to overwrite the defaults
83
- % using explicit options in \includegraphics[width, height, ...]{}
84
- \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
85
- $endif$
86
- \ifxetex
87
- \usepackage[setpagesize=false, % page size defined by xetex
88
- unicode=false, % unicode breaks when used with xetex
89
- xetex]{hyperref}
90
- \else
91
- \usepackage[unicode=true]{hyperref}
92
- \fi
93
- \hypersetup{breaklinks=true,
94
- bookmarks=true,
95
- pdfauthor={$author-meta$},
96
- pdftitle={$title-meta$},
97
- colorlinks=true,
98
- citecolor=$if(citecolor)$$citecolor$$else$blue$endif$,
99
- urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$,
100
- linkcolor=$if(linkcolor)$$linkcolor$$else$magenta$endif$,
101
- pdfborder={0 0 0}}
102
- \urlstyle{same} % don't use monospace font for urls
103
- $if(links-as-notes)$
104
- % Make links footnotes instead of hotlinks:
105
- \renewcommand{\href}[2]{#2\footnote{\url{#1}}}
106
- $endif$
107
- $if(strikeout)$
108
- \usepackage[normalem]{ulem}
109
- % avoid problems with \sout in headers with hyperref:
110
- \pdfstringdefDisableCommands{\renewcommand{\sout}{}}
111
- $endif$
112
- \setlength{\parindent}{0pt}
113
- \setlength{\parskip}{6pt plus 2pt minus 1pt}
114
- \setlength{\emergencystretch}{3em} % prevent overfull lines
115
- $if(numbersections)$
116
- \setcounter{secnumdepth}{5}
117
- $else$
118
- \setcounter{secnumdepth}{0}
119
- $endif$
120
- $if(verbatim-in-note)$
121
- \VerbatimFootnotes % allows verbatim text in footnotes
122
- $endif$
123
- $if(lang)$
124
- \ifxetex
125
- \usepackage{polyglossia}
126
- \setmainlanguage{$mainlang$}
127
- \else
128
- \usepackage[$lang$]{babel}
129
- \fi
130
- $endif$
131
-
132
- %%% macros
133
- \newcommand{\final}{\fbox}
134
- \newcommand{\bs}{\boldsymbol}
135
- \newcommand{\tr}{\operatorname{tr}}
136
- \newcommand{\norm}[1]{\left\lVert#1\right\rVert}
137
- \newcommand{\set}[1]{\left\{ {#1} \right\}}
138
-
139
- \newcommand{\diag}[1]{\mathop{\bigtriangleup\subex{#1}}\nolimits}
140
- \newcommand{\stack}[1]{\operatorname{stack}\subex{#1}}
141
- \newcommand{\deriv}[2]{\frac{d #1}{ d #2 }}
142
-
143
- \newcommand{\subex}[1]{\left(#1\right)}
144
- %%%%
145
-
146
- \usepackage[table]{xcolor}
147
- %\usepackage{colortbl}
148
-
149
- \usepackage{floatrow}
150
- \DeclareFloatFont{tiny}{\tiny}% "scriptsize" is defined by floatrow, "tiny" not
151
- \floatsetup[table]{font=tiny}
152
-
153
- $if(title)$
154
- \title{$title$}
155
- $endif$
156
- $if(subtitle)$
157
- \subtitle{$subtitle$}
158
- $endif$
159
- $if(author)$
160
- \author{$for(author)$$author$$sep$ \and $endfor$}
161
- $endif$
162
- $if(date)$
163
- \date{$date$}
164
- $endif$
165
- $for(header-includes)$
166
- $header-includes$
167
- $endfor$
168
-
169
- \begin{document}
170
- $if(title)$
171
- \maketitle
172
- $endif$
173
- $if(abstract)$
174
- \begin{abstract}
175
- $abstract$
176
- \end{abstract}
177
- $endif$
178
-
179
- $for(include-before)$
180
- $include-before$
181
-
182
- $endfor$
183
- $if(toc)$
184
- {
185
- \hypersetup{linkcolor=black}
186
- \setcounter{tocdepth}{$toc-depth$}
187
- \tableofcontents
188
- }
189
- $endif$
190
- $body$
191
-
192
- $if(natbib)$
193
- $if(biblio-files)$
194
- $if(biblio-title)$
195
- $if(book-class)$
196
- \renewcommand\bibname{$biblio-title$}
197
- $else$
198
- \renewcommand\refname{$biblio-title$}
199
- $endif$
200
- $endif$
201
- \bibliography{$biblio-files$}
202
-
203
- $endif$
204
- $endif$
205
- $if(biblatex)$
206
- \printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
207
-
208
- $endif$
209
- $for(include-after)$
210
- $include-after$
211
-
212
- $endfor$
213
- \end{document}
@@ -1,22 +0,0 @@
1
-
2
- default: pdf
3
-
4
- TARGET_BASE = <%= name %>
5
- DVI_COMMAND := cd build && latex $(TARGET_BASE)
6
-
7
- build:
8
- cp -r src build
9
-
10
- dvi: clean src/$(TARGET_BASE).tex build
11
- $(DVI_COMMAND)
12
- cd build && bibtex $(TARGET_BASE)
13
- $(DVI_COMMAND)
14
- $(DVI_COMMAND) # Odd latex thing necessary for references
15
- mv build/$(TARGET_BASE).dvi ./
16
-
17
- pdf: dvi
18
- dvipdf $(TARGET_BASE).dvi
19
-
20
- clean:
21
- -rm -rf build
22
- -rm *.pdf *.dvi
@@ -1,79 +0,0 @@
1
- %packages
2
- % Deprecation warnings
3
- \RequirePackage[l2tabu, orthodox]{nag}
4
-
5
- % Scientific units
6
- \usepackage{siunitx}
7
-
8
- % Math
9
- \usepackage{amsmath}
10
-
11
- % Page geometry and margins
12
- \usepackage[margin=1.00in]{geometry}
13
- \linespread{1.25}
14
-
15
- % Images
16
- \usepackage{graphicx}
17
- \usepackage{caption}
18
- \usepackage{subcaption}
19
-
20
- % Tables with out vertical separators
21
- \usepackage{booktabs}
22
-
23
- % ?
24
- \usepackage{amssymb}
25
- \usepackage{amsthm}
26
-
27
- \setlength{\parskip}{6pt plus 2pt minus 1pt}
28
- \setlength{\emergencystretch}{3em} % prevent overfull lines
29
-
30
- \usepackage[stable]{footmisc}
31
- \parfillskip 0pt plus 0.75\textwidth
32
-
33
- % Bibliography
34
- \usepackage[english]{babel}% Recommended
35
- \usepackage{csquotes}% Recommended
36
- \usepackage{biblatex}
37
-
38
- % Typesetting enhancements
39
- \usepackage{microtype}
40
-
41
- % Links
42
- \usepackage{xcolor}
43
- \definecolor{dark-red}{rgb}{0.4,0.15,0.15}
44
- \definecolor{dark-blue}{rgb}{0.15,0.15,0.4}
45
- \definecolor{medium-blue}{rgb}{0,0,0.5}
46
- \PassOptionsToPackage{hyphens}{url}\usepackage[pdfborder={0 0 0}]{hyperref}
47
- \hypersetup{
48
- colorlinks, linkcolor={dark-red},
49
- citecolor={dark-blue}, urlcolor={medium-blue}
50
- }
51
-
52
- % Cross-references
53
- \usepackage{cleveref}
54
-
55
- % Code listings
56
- \usepackage{listings}
57
-
58
- % layout
59
- \pdfpagewidth 8.5in
60
- \pdfpageheight 11in
61
- \topmargin 0in
62
- \headheight 0in
63
- \headsep 0in
64
- \textheight 9in
65
- \textwidth 6.5in
66
- \oddsidemargin 0in
67
- \evensidemargin 0in
68
-
69
- % Header
70
- %\usepackage{fancyhdr}
71
- %\pagestyle{fancy}
72
-
73
- % Verbatim text
74
- \usepackage{verbatim}
75
-
76
- % Notes and todos
77
- \usepackage{todonotes}
78
-
79
- \usepackage{appendix}
@@ -1,19 +0,0 @@
1
- \documentclass[11pt]{article}
2
- \usepackage{../include/mydefault}
3
-
4
- \addbibresource{references.bib}
5
-
6
- % Document metadata
7
- \title{<%= title %>}
8
- \author{<%= author %>}
9
- \date{<%= date %>}
10
-
11
- \begin{document}
12
- \sloppy
13
- \maketitle
14
-
15
- \printbibliography
16
-
17
- \appendix
18
-
19
- \end{document}