Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
grp-bio-it
ITPP
Commits
83ea382d
Commit
83ea382d
authored
Feb 16, 2017
by
Toby Hodges
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed documentclass regex sub
parent
81738b8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
generate_handout.py
generate_handout.py
+1
-1
No files found.
generate_handout.py
View file @
83ea382d
...
...
@@ -66,7 +66,7 @@ def main ():
tex
=
re
.
sub
(
"
\\
\section\{.*?\}"
,
""
,
tex
,
flags
=
re
.
DOTALL
)
# Delete all sections (would be duplicate)
tex
=
re
.
sub
(
"
\\
\subsection\{(\d+\. )?"
,
"
\\
\chapter{"
,
tex
)
# rename numbered subsections to chapters
tex
=
re
.
sub
(
"
\\
\documentclass\{.*?\}"
,
"
\\
\documentclass{report}"
,
tex
)
# change documentclass to report
tex
=
re
.
sub
(
"
\\
\documentclass\
[(\d+pt)\]\
{.*?\}"
,
"
\\
\documentclass
[
\\
1]
{report}"
,
tex
)
# change documentclass to report
tex
=
re
.
sub
(
"
\\
\maketitle"
,
"
\\\\
tableofcontents"
,
tex
)
# include tableof
with
open
(
tex_filename
,
'w'
)
as
texfile
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment