fix: latex compile error on build
This commit is contained in:
@@ -5,7 +5,6 @@ import os
|
||||
import re
|
||||
import shutil # which, copyfile, rmtree
|
||||
import subprocess as shell # run, DEVNULL
|
||||
from weakref import ref
|
||||
from typing import TYPE_CHECKING, List, Tuple, Generator
|
||||
if TYPE_CHECKING:
|
||||
from lektor.builder import Artifact, Builder, BuildState
|
||||
@@ -192,7 +191,7 @@ class TexSources:
|
||||
except AttributeError:
|
||||
refs = list()
|
||||
builder.__tex_files = refs # type: ignore[attr-defined]
|
||||
refs.append(ref(record))
|
||||
refs.append(record)
|
||||
|
||||
@staticmethod
|
||||
def build(builder: 'Builder') -> None:
|
||||
@@ -209,7 +208,7 @@ class TexSources:
|
||||
msg = f'PDF builder ({TEXER})'
|
||||
with Log.group(msg, builder):
|
||||
for rec_ref in sources:
|
||||
builder.build(PdfSource(rec_ref()))
|
||||
builder.build(PdfSource(rec_ref))
|
||||
|
||||
|
||||
# ----------------------------------------------------
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
{# recipe title (start on new page) #}
|
||||
\newrecipe{ {{- recipe._slug -}} }{ {{- recipe.name | latexStr -}} }
|
||||
{# duration & yield subtitle -#}
|
||||
\meta{ {{- recipe.time | asDuration(this.alt) -}} }{ {{- recipe.yield or '' -}} }
|
||||
\meta{ {{- recipe.time | asDuration(this.alt) -}} }{ {{- recipe.yield or '' | latexStr -}} }
|
||||
{# add source link on page footer -#}
|
||||
\footer{ {{- recipe.source.url | latexStr -}} }{ {{- recipe.source.host | latexStr -}} }
|
||||
|
||||
@@ -33,16 +33,16 @@
|
||||
|
||||
{%- for ing in recipe.ingredients %}
|
||||
{%- if ing.isGroup %}
|
||||
\ingGroup{ {{- ing.name -}} }
|
||||
\ingGroup{ {{- ing.name | latexStr -}} }
|
||||
{%- else %}
|
||||
\item[
|
||||
{%- if ing.quantity %}{{ ing.quantity }}{% endif -%}
|
||||
{%- if ing.quantity %}{{ ing.quantity | latexStr }}{% endif -%}
|
||||
{%- if ing.quantity and ing.unit %}~{% endif -%}
|
||||
{%- if ing.unit %}{{ ing.unit }}{% endif -%}
|
||||
] \ingName{ {{- ing.name or '' -}} }
|
||||
{%- if ing.unit %}{{ ing.unit | latexStr }}{% endif -%}
|
||||
] \ingName{ {{- ing.name or '' | latexStr -}} }
|
||||
{%- if ing.note -%}
|
||||
\ingDetail{
|
||||
{%- for word in ing.note.split() -%}
|
||||
{%- for word in (ing.note | latexStr).split() -%}
|
||||
{#- detect recipe reference links -#}
|
||||
{%- if word.startswith('@') %} \pagelink{ {{- word[4:].rstrip('/') -}} }
|
||||
{#- or copy unchanged -#}
|
||||
|
||||
Reference in New Issue
Block a user