Compare commits

...

4 commits

Author SHA1 Message Date
17920077da UCWTeX: Užší tabulka 2024-05-11 11:50:20 +02:00
5a61ea5fac UCWTeX: Alternativní figures 2024-05-11 11:50:04 +02:00
73af3473c7 UCWTeX: Fix languages 2024-05-11 11:49:30 +02:00
6bfb62fcdd UCWTeX bigradical to unicode 2024-05-11 11:46:58 +02:00
2 changed files with 17 additions and 11 deletions

View file

@ -21,6 +21,8 @@
\pdfglyphtounicode{radicalbig}{221A}
\pdfglyphtounicode{radicalBig}{221A}
\pdfglyphtounicode{radicalbigg}{221A}
\pdfglyphtounicode{radicalBigg}{221A}
\pdfglyphtounicode{hatwidest}{0302}
\input formatitkolib.tex

View file

@ -89,7 +89,7 @@ class UCWTexGenerator(OutputGenerator):
elif lang == "sk":
return r"\uselanguage{slovak}\frenchspacing\lefthyphenmin=2\righthyphenmin=2{}"
elif lang == "en":
return r"\uselanguage{english}\nofrenchspacing\lefthyphenmin=2\righthyphenmin=2{}"
return r"\uselanguage{USenglish}\nonfrenchspacing\lefthyphenmin=2\righthyphenmin=2{}"
else:
return ""
@ -170,14 +170,17 @@ class UCWTexGenerator(OutputGenerator):
self.writeln(r"}{")
self.indent_more()
if 'number' in e.attributes:
self.writeln(f"Obrázek {e.attributes['number']}:")
type_text = e.attributes.get("type_text", "Obrázek")
self.writeln(f"{type_text} {e.attributes['number']}:")
self.generate(e.caption)
if 'number' in e.attributes:
self.writeln(r"\addtoc\tocpicture{"+str(e.attributes['number'])+"}{}{")
self.indent_more()
self.generate(e.caption.content)
self.indent_less()
self.writeln("}")
tocmac = e.attributes.get("tocmac", "tocpicture")
if tocmac:
self.writeln("\\addtoc\\"+tocmac+r"{"+str(e.attributes['number'])+"}{}{")
self.indent_more()
self.generate(e.caption.content)
self.indent_less()
self.writeln("}")
self.indent_less()
self.writeln(r"}{}{}")
@ -251,11 +254,12 @@ class UCWTexGenerator(OutputGenerator):
self.write(r"}")
def generate_Table(self, e: Table):
hskip = r"\hskip 0.6em\relax"
aligns = {
"AlignLeft": r"\quad#\quad\hfil",
"AlignRight": r"\quad\hfil#\quad",
"AlignCenter": r"\quad\hfil#\hfil\quad",
"AlignDefault": r"\quad#\quad\hfil"
"AlignLeft": hskip+r"\relax#\hfil"+hskip,
"AlignRight": hskip+r"\hfil#"+hskip,
"AlignCenter": hskip+r"\hfil#\hfil"+hskip,
"AlignDefault": hskip+r"#\hfil"+hskip,
}
self.writeln(r"\vskip1em")
self.writeln(r"\leavevmode\vbox{\halign{\strut"+"&".join([aligns[col[0]] for col in e.colspec])+r"\cr")