diff --git a/caderno.pdf b/caderno.pdf index 4b9d5207012eadeb183f0faa34051d31810dc47a..0b8ead1ae696fa179c417ea1e11169ea7900fd8a 100644 Binary files a/caderno.pdf and b/caderno.pdf differ diff --git a/notebook/gen_latex.py b/notebook/gen_latex.py index 90a150492292f1184010bd9844c340c2bcbcd149..76eee468bb98a4d2461bd6897b02525ea58d0095 100644 --- a/notebook/gen_latex.py +++ b/notebook/gen_latex.py @@ -5,11 +5,11 @@ class Tree: def __init__(self, dirs): self.dirs = dirs; self.tree = {} - self.build() + self._build() # Builds a tree represented as dict, with structure of files # and directories. - def build(self): + def _build(self): for di in self.dirs: path_list = list(Path(di).glob('**/*.cpp')) path_list += list(Path(di).glob('**/*.vim')) @@ -48,7 +48,8 @@ class LatexGenerator: self.header = {} self.code, self.raw_header = [], [] - self.sections = ['Description', 'Time', 'Space', 'Include', 'Status'] + self.sections = ['Description', 'Time', 'Space', 'Include', + 'Status'] self._parse_source(source) self._parse_header() @@ -142,7 +143,8 @@ class LatexGenerator: to_big_o(line[1].strip()))) write('\\end{compactitem}\n') else: - write('\\footnotesize{$%s$}\n' % to_big_o(self.header[comp][0])) + write('\\footnotesize{$%s$}\n' % + to_big_o(self.header[comp][0])) return True return False @@ -190,7 +192,7 @@ class LatexGenerator: self._write('\\%s{%s}\n' % (self.hierarchy[depth], content)) # Prints code in LaTeX format. - def gen_code_latex(self, source): + def _gen_code_latex(self, source): source.output_header(self._write) source.output_code(self._write) self._write('\\hrule\n') @@ -201,7 +203,7 @@ class LatexGenerator: for i in sub: source = self.SourceFile(path + i) self._gen_title_latex(source.name, depth) - self.gen_code_latex(source) + self._gen_code_latex(source) else: if depth == 1: self._write('\\begin{multicols}{3}\n') @@ -221,22 +223,14 @@ class LatexGenerator: # Parses command line arguments and returns them. def get_args(): parser = argparse.ArgumentParser() - - parser.add_argument('--header', - action='store', - type=str, + parser.add_argument('--header', action='store', type=str, help='Header of Latex file') - - parser.add_argument('--output', - action='store', - type=str, + parser.add_argument('--output', action='store', type=str, help='Output Latex file') - return parser.parse_args() def main(): args = get_args() - tree = Tree(['algorithms', 'misc']) tex = LatexGenerator(tree, args.output, args.header)