|
@ -67,21 +67,17 @@ class UCWTexGenerator(OutputGenerator): |
|
|
self.writepar(r"\vskip5pt\hrule\hfil\vskip5pt{}") |
|
|
self.writepar(r"\vskip5pt\hrule\hfil\vskip5pt{}") |
|
|
|
|
|
|
|
|
def generate_Doc(self, e: Doc): |
|
|
def generate_Doc(self, e: Doc): |
|
|
self.writeln(r"\input ucwmac2.tex") |
|
|
|
|
|
self.writeln(r"\ucwmodule{ofs}") |
|
|
|
|
|
self.writeln(r"\ucwmodule{verb}") |
|
|
|
|
|
self.writeln(r"\ucwmodule{link}") |
|
|
|
|
|
self.writeln(r"\input formatitko.tex") |
|
|
self.writeln(r"\input formatitko.tex") |
|
|
self.generate(e.content) |
|
|
self.generate(e.content) |
|
|
self.writeln(r"\bye") |
|
|
self.writeln(r"\bye") |
|
|
|
|
|
|
|
|
def get_language_macro(self, lang: str): |
|
|
def get_language_macro(self, lang: str): |
|
|
if lang == "cs": |
|
|
if lang == "cs": |
|
|
return r"\chyph\lefthyphenmin=2\righthyphenmin=2{}" |
|
|
return r"\uselanguage{czech}\frenchspacing\lefthyphenmin=2\righthyphenmin=2{}" |
|
|
elif lang == "sk": |
|
|
elif lang == "sk": |
|
|
return r"\shyph\lefthyphenmin=2\righthyphenmin=2{}" |
|
|
return r"\uselanguage{slovak}\frenchspacing\lefthyphenmin=2\righthyphenmin=2{}" |
|
|
elif lang == "en": |
|
|
elif lang == "en": |
|
|
return r"\ehyph\lefthyphenmin=2\righthyphenmin=2{}" |
|
|
return r"\uselanguage{english}\nofrenchspacing\lefthyphenmin=2\righthyphenmin=2{}" |
|
|
else: |
|
|
else: |
|
|
return "" |
|
|
return "" |
|
|
|
|
|
|
|
@ -192,11 +188,11 @@ class UCWTexGenerator(OutputGenerator): |
|
|
|
|
|
|
|
|
def generate_Math(self, e: Math): |
|
|
def generate_Math(self, e: Math): |
|
|
if e.format == "DisplayMath": |
|
|
if e.format == "DisplayMath": |
|
|
self.ensure_empty(2) |
|
|
self.ensure_empty(1) |
|
|
self.writeraw("$$") |
|
|
self.writeraw("$$") |
|
|
self.writeraw(e.text.strip()) |
|
|
self.writeraw(e.text.strip()) |
|
|
self.writeraw("$$") |
|
|
self.writeraw("$$") |
|
|
self.ensure_empty(2) |
|
|
self.ensure_empty(1) |
|
|
else: |
|
|
else: |
|
|
self.write("$") |
|
|
self.write("$") |
|
|
self.write(e.text) |
|
|
self.write(e.text) |
|
|