From e29115e28b9efe7d100e8f463675c1526b8fe67f Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sun, 13 Apr 2025 17:18:59 +0200 Subject: [PATCH] capital/small letters for latex in docstrings fixed --- src/pyladoc/__init__.py | 2 +- src/pyladoc/latex.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pyladoc/__init__.py b/src/pyladoc/__init__.py index 4dce06e..86db161 100644 --- a/src/pyladoc/__init__.py +++ b/src/pyladoc/__init__.py @@ -186,7 +186,7 @@ def figure_to_string(fig: Figure, def latex_to_figure(latex_code: str) -> Figure: - assert Figure, 'Matplotlib is required for rendering LaTex expressions for HTML output.' # type:ignore[truthy-function] + assert Figure, 'Matplotlib is required for rendering LaTeX expressions for HTML output.' # type:ignore[truthy-function] fig, ax = plt.subplots() ax.set_xticks([]) ax.set_yticks([]) diff --git a/src/pyladoc/latex.py b/src/pyladoc/latex.py index c025332..62ef193 100644 --- a/src/pyladoc/latex.py +++ b/src/pyladoc/latex.py @@ -16,8 +16,8 @@ def basic_formatter(value: Any) -> str: def to_ascii(text: str) -> str: """ - Replaces/escapes often used unicode characters in latex code or text - with its LaTex ascii equivalents. + Replaces/escapes often used unicode characters in LaTeX code or text + with its LaTeX ascii equivalents. Args: text: The text to convert. @@ -72,7 +72,7 @@ def escape_text(text: str) -> str: for m in re.finditer(regex_filter, text): s1, s2 = m.span() ret.append(text[last_s:s1]) - matches = [v for k, v in latex_translation.items() if re.match(k, m.group())] + matches = [v for k, v in LaTeX_translation.items() if re.match(k, m.group())] if m.group(1): ret.append(matches[0].replace(r'\g<1>', normalize_label_text(m.group(1)))) else: