Skip to content

Commit

Permalink
Merge pull request #27 from martinghunt/fix_make_pdf
Browse files Browse the repository at this point in the history
Fix make pdf
  • Loading branch information
martinghunt committed Sep 27, 2016
2 parents f38b605 + da1f98f commit 858f320
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Admin_scripts/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self,
self.infile = infile
self.outfile = outfile
self.fix_terminal_style = fix_terminal_style
self.parskip = parskip
self.parskip = parskip
self.font_size = font_size
self.notitle = notitle
self.date = date
Expand All @@ -29,6 +29,10 @@ def __init__(self,


def _nbconvert_to_tex(self, infile, outfile):
# on xenial, the --output foo puts foo in the same directory
# as the infile, so use absolute path
outfile = os.path.abspath(outfile)

cmd = 'jupyter nbconvert'
if self.execute_notebook:
cmd += ' --execute'
Expand Down Expand Up @@ -67,7 +71,7 @@ def _fix_figures(self, lines):
lines[i+2] = r'''\includegraphics[''' + graphics_string + ']{' + lines[i+2] + '}'
lines[i+3] = r'''\end{center}'''
lines[i+4] = ''


def _fix_terminal_style(self, lines):
lines.insert(1, r'''\usepackage{listings}
Expand Down Expand Up @@ -125,8 +129,8 @@ def _fix_terminal_style(self, lines):
if in_verbatim and lines[i] == '\end{Verbatim}':
lines[i] += '\n' + r'''\end{terminalinput}'''
in_verbatim = False





Expand Down Expand Up @@ -178,7 +182,7 @@ def run(self):

if self.notitle:
self._remove_title(lines)

self._remove_syntax_highlighting(lines)

self._set_section_heading_style(lines)
Expand Down
1 change: 1 addition & 0 deletions Admin_scripts/make_course_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import subprocess
import os
import sys
import argparse
import file_utils

Expand Down

0 comments on commit 858f320

Please sign in to comment.