From 81b46dd01b0b0217b0543601bc0c2213655d4e27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Thu, 16 Sep 2021 18:55:10 +0200 Subject: [PATCH] use import command in master file if lectures are in other directory --- scripts/notes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/notes.py b/scripts/notes.py index 21b76c2..88b62a8 100644 --- a/scripts/notes.py +++ b/scripts/notes.py @@ -53,8 +53,12 @@ class Notes: def update_lectures_in_master(self, r): header, footer = self.get_header_footer(self.master_file) + if self.lectures.root.relative_to(self.root) == Path('.'): + input_command = r'\input{' + else: + input_command = r'\import{' + str(self.lectures.root.relative_to(self.root)) + '/}{' body = ''.join( - ' ' * 4 + r'\input{' + number2filename(number) + '}\n' for number in r) + ' ' * 4 + input_command + number2filename(number) + '}\n' for number in r) self.master_file.write_text(header + body + footer) def compile_master(self):