Compare commits
4 commits
774af0fedf
...
1470239197
Author | SHA1 | Date | |
---|---|---|---|
1470239197 | |||
c883cefdde | |||
8594335bca | |||
089fa8b000 |
4 changed files with 18 additions and 3 deletions
|
@ -2,9 +2,11 @@
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import sys
|
import sys
|
||||||
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
import subprocess
|
import subprocess
|
||||||
import shutil
|
import shutil
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
# Import local files
|
# Import local files
|
||||||
from .util import import_md
|
from .util import import_md
|
||||||
|
@ -112,7 +114,12 @@ def main():
|
||||||
else:
|
else:
|
||||||
filename = args.output_tex
|
filename = args.output_tex
|
||||||
outdir = tempfile.TemporaryDirectory(prefix="formatitko")
|
outdir = tempfile.TemporaryDirectory(prefix="formatitko")
|
||||||
subprocess.run(["pdfcsplain", "-halt-on-error", "-output-directory="+outdir.name, "-jobname=formatitko", filename], check=True)
|
|
||||||
|
env = os.environ.copy()
|
||||||
|
d = Path("/".join(__file__.split("/")[:-1]))
|
||||||
|
env["TEXINPUTS"]=".:"+str(d/"tex")+":"+env.get("TEXINPUTS", "")
|
||||||
|
|
||||||
|
subprocess.run(["luatex", "-halt-on-error", "-output-directory="+outdir.name, "-jobname=formatitko", filename], check=True, env=env)
|
||||||
shutil.move(outdir.name+"/formatitko.pdf", args.output_pdf)
|
shutil.move(outdir.name+"/formatitko.pdf", args.output_pdf)
|
||||||
|
|
||||||
if args.deps is not None:
|
if args.deps is not None:
|
||||||
|
|
|
@ -343,6 +343,9 @@ class HTMLGenerator(OutputGenerator):
|
||||||
|
|
||||||
def generate_DefinitionList(self, e: DefinitionList):
|
def generate_DefinitionList(self, e: DefinitionList):
|
||||||
self.writeln("<!-- FIXME: DefinitionLists not implemented -->")
|
self.writeln("<!-- FIXME: DefinitionLists not implemented -->")
|
||||||
|
|
||||||
|
def generate_SmallCaps(self, e: SmallCaps):
|
||||||
|
self.generate_simple_tag(e, attributes=self.common_attributes(e) | {"style": "font-variant: small-caps;"})
|
||||||
|
|
||||||
|
|
||||||
class StandaloneHTMLGenerator(HTMLGenerator):
|
class StandaloneHTMLGenerator(HTMLGenerator):
|
||||||
|
|
|
@ -71,8 +71,8 @@
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
||||||
\def\superscript#1{\leavevmode\raise3pt\hbox{\fiverm#1}}
|
\def\superscript#1{$^{\hbox{#1}}$}
|
||||||
\def\subscript#1{\leavevmode\lower1pt\hbox{\fiverm#1}}
|
\def\subscript#1{$_{\hbox{#1}}$}
|
||||||
\newcount\fncount
|
\newcount\fncount
|
||||||
\fncount=1
|
\fncount=1
|
||||||
\def\fnmark{\superscript{\the\fncount}}
|
\def\fnmark{\superscript{\the\fncount}}
|
||||||
|
|
|
@ -381,3 +381,8 @@ class UCWTexGenerator(OutputGenerator):
|
||||||
|
|
||||||
def generate_Strikeout(self, e: Strikeout):
|
def generate_Strikeout(self, e: Strikeout):
|
||||||
self.writeln("% FIXME: Strikeouts not implemented")
|
self.writeln("% FIXME: Strikeouts not implemented")
|
||||||
|
|
||||||
|
def generate_SmallCaps(self, e: Strikeout):
|
||||||
|
self.write(r"{\csc{}")
|
||||||
|
self.generate(e.content)
|
||||||
|
self.write(r"}")
|
||||||
|
|
Loading…
Reference in a new issue