-
Notifications
You must be signed in to change notification settings - Fork 4
/
config.py
144 lines (118 loc) · 3.01 KB
/
config.py
1
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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
138
139
140
141
142
143
144
import os
module_dir = os.path.dirname(os.path.abspath(__file__))
"""
The latex template file used if none is specified in command line args
"""
default_latex_template = os.path.join(module_dir, 'templates', 'latex',
'default.tex')
"""
Either the bash command for pandoc, or path to pandoc binary
"""
pandoc_path = 'pandoc2'
"""
The latex-to-pdf renderer used by Pandoc, and the argument used to denote it.
+ Use --latex-engine if using pandoc 1.*
+ Use --pdf-engine if using pandoc 2.*
Examples:
pdf_engine_args = ('--latex-engine', 'pdflatex')
pdf_engine_args = ('--pdf-engine', 'xelatex')
pdf_engine_args = ('--pdf-engine', 'luatex')
"""
pdf_engine_args = ('--pdf-engine', 'xelatex')
"""
Define the maximum memory usage for Pandoc. It can use a lot of memory
for certain applications, but 512MB is almost always sufficient for PDF's.
Examples:
memory_usage_args = ('+RTS', '-K2048m', '-RTS')
memory_usage_args = ('+RTS', '-K128m', '-RTS')
"""
memory_usage_args = ('+RTS', '-K512m', '-RTS')
"""
Pandoc has a ton of extensions. A lot of the most useful ones are enabled by
default.
Run:
pandoc --list-available
to list all available extensions, and view their default status.
"""
input_format = 'markdown'
extension_list = [
# '+lists_without_preceding_blankline',
# '+hard_line_breaks',
# '+ignore_line_breaks',
# '+east_asian_line_breaks',
# '+emoji',
# '+tex_math_single_backslash',
# '+tex_math_double_backslash',
# '+markdown_attribute',
# '+mmd_title_block',
# '+abbreviations',
'+autolink_bare_uris',
'+ascii_identifiers',
# '+mmd_link_attributes',
# '+mmd_header_identifiers',
# '+compact_definition_lists',
# '+escaped_line_breaks',
# '+blank_before_header',
# '+header_attributes',
# '+auto_identifiers',
# '+implicit_header_references',
# '+blank_before_blockquote',
# '+fenced_code_blocks',
# '+backtick_code_blocks',
# '+fenced_code_attributes',
# '+line_blocks'
# '+fancy_lists',
# '+startnum',
# '+definition_lists',
# '+example_lists',
# '+pipe_tables'
# '+table_captions',
# '+simple_tables',
# '+multiline_tables',
# '+grid_tables',
# '+pandoc_title_block'
# '+yaml_metadata_block',
# '+all_symbols_escapable',
# '+strikeout',
# '+superscript',
# '+subscript',
# '+inline_code_attributes',
# '+tex_math_dollars',
# '+raw_html',
# '+markdown_in_html_blocks',
# '+native_divs',
# '+native_spans',
# '+raw_tex',
# '+latex_macros',
# '+shortcut_reference_links',
# '+implicit_figures',
# '+link_attributes',
# '+footnotes'
# '+inline_notes',
# '+citations',
]
input_args = ('--from', input_format + ''.join(extension_list))
"""
Output args
Can be:
output_args = ('--to', 'latex')
output_args = ('--to', 'html')
output_args = ('--to', 'docx')
"""
output_args = ('--to', 'latex')
"""
Highlight style
"""
highlight_args = ('--highlight-style', 'tango',)
"""
Geometry style
Examples:
-V geometry:"top=2cm, bottom=1.5cm, left=1cm, right=1cm"
-V geometry:"left=3cm, width=10cm"
"""
geometry_args = ('-V', 'geometry:margin=1in')
# geometry_args = ()
"""
Any extra args
"""
extra_args = ()