Compare commits

...

4 Commits

  1. 2
      src/formatitko/context.py
  2. 1
      src/formatitko/tex/formatitko.tex
  3. 6
      src/formatitko/tex/table_of_contents.tex
  4. 5
      src/formatitko/transform_processor.py

2
src/formatitko/context.py

@ -170,7 +170,7 @@ class Context:
def unset_data(self, key: str):
if key == "":
self._doc = {}
data = self._doc
data = self._data
keys = key.split(".")
for k in keys[:-1]:
data = data[k]

1
src/formatitko/tex/formatitko.tex

@ -20,6 +20,7 @@
\pdfglyphtounicode{parenrightBigg}{0029}
\pdfglyphtounicode{radicalbig}{221A}
\pdfglyphtounicode{radicalBig}{221A}
\input minim-xmp.tex

6
src/formatitko/tex/table_of_contents.tex

@ -7,13 +7,13 @@
\def\stdskip{\vskip 3pt}
\def\tocsection#1#2#3#4{
\line{\settextsize{14}\bf\hbox to 2em{#2\hfil}#4~\hfil\pagelink{#1}}\stdskip
{\settextsize{14}\line{\bf\hbox to 2em{#2\hfil}#4~\hfil\pagelink{#1}}\stdskip}
}
\def\tocsubsection#1#2#3#4{
\line{\bf\hskip 1.5cm \hbox to 3em{#2\hfil}#4~\hfil\pagelink{#1}}\stdskip
\line{\hskip 1.5cm \hbox to 3em{#2\hfil}#4~\hfil\pagelink{#1}}\stdskip
}
\def\tocsubsubsection#1#2#3#4{
\line{\bf\hskip 3cm \hbox to 4em{#2\hfil}#4~\hfil\pagelink{#1}}\stdskip
\line{\hskip 3cm \hbox to 4em{#2\hfil}#4~\hfil\pagelink{#1}}\stdskip
}
\def\tocpicture#1#2#3#4{}

5
src/formatitko/transform_processor.py

@ -326,7 +326,10 @@ class TransformProcessor(NOPProcessor):
else:
e.attributes["number"] = self.context.get_data("figure_number_generator")(e, self.context)
self.context.get_data("obj_map")[e.identifier] = e
return super().transform_Figure(e)
self.context.set_data("current_figure", e)
r = super().transform_Figure(e)
self.context.unset_data("current_figure")
return r
def transform_Link(self, e: Link) -> Link:
e = FLink(*e.content, url=e.url, identifier=e.identifier, attributes=e.attributes, classes=e.classes, obj_map=self.context.get_data("obj_map"))

Loading…
Cancel
Save