Compare commits

..

No commits in common. "13c2aaac8b5590e34f0a47b99c0cc290e0e71824" and "3098226c753029c3794e7effd3e00f721d0a3f35" have entirely different histories.

6 changed files with 6 additions and 34 deletions

View File

@ -103,7 +103,7 @@ jobs:
uses: actions/cache@v4
id: miktex
with:
path: C:\tmp\cache
path: miktex-portable
key: miktex-portable-${{ runner.os }}-24.1-x64
- if: ${{ steps.miktex.outputs.cache-hit != 'true' }}
@ -111,11 +111,11 @@ jobs:
run: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest https://www.nonan.net/w/files/miktex-portable-Win-x64.zip -OutFile miktex-portable-Win-x64.zip
Expand-Archive miktex-portable-Win-x64.zip -DestinationPath C:\tmp\cache\
Expand-Archive miktex-portable-Win-x64.zip -DestinationPath .
- name: Copy miktex directory
run: |
robocopy C:\tmp\cache\miktex-portable C:\tmp\test_miktex\miktex-portable /E /NFL /NDL
robocopy miktex-portable C:\tmp\test_miktex\miktex-portable /E /NFL /NDL
if ($LASTEXITCODE -eq 1) { exit 0 }
- name: Add miktex to PATH
@ -140,7 +140,6 @@ jobs:
path: tests/out/test_*_render*.pdf
build-docs:
if: github.event_name == 'push'
needs: build-ubuntu
runs-on: ubuntu-latest
steps:
@ -184,7 +183,6 @@ jobs:
path: docs/build/html
deploy:
if: github.event_name == 'push'
needs: build-docs
runs-on: ubuntu-latest
permissions:

View File

@ -621,7 +621,7 @@ class DocumentWriter():
Args:
text: The markdown text to add
section_class: The HTML-class and LaTeX-environment name for the text section
section_class: The class for the text section
"""
norm_text = _normalize_text_indent(str(text))
@ -633,7 +633,8 @@ class DocumentWriter():
return html
def render_to_latex() -> str:
html = render_to_html()
html = _markdown_to_html(
self._equation_embedding_reescaping(norm_text))
return latex.from_html(html)
self._doc.append([render_to_html, render_to_latex])

View File

@ -191,7 +191,6 @@ def from_html(html_code: str) -> str:
self.header_flag = False
self.attr_dict: dict[str, str] = {}
self.equation_flag = False
self.class_name: str = ''
def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None:
self.attr_dict = {k: v if v else '' for k, v in attrs}
@ -218,10 +217,6 @@ def from_html(html_code: str) -> str:
self.latex_code.append("\n\n\\noindent\\rule[0.5ex]{\\linewidth}{1pt}\n\n")
elif tag == 'latex':
self.equation_flag = True
elif tag == 'div':
self.class_name = self.attr_dict.get('class', '')
if self.class_name:
self.latex_code.append(f"\n\\begin{{{self.class_name}}}\n")
def handle_endtag(self, tag: str) -> None:
if tag in html_to_latex:
@ -247,9 +242,6 @@ def from_html(html_code: str) -> str:
self.latex_code.append("}")
elif tag == 'latex':
self.equation_flag = False
elif tag == 'div':
if self.class_name:
self.latex_code.append(f"\n\\end{{{self.class_name}}}\n")
def handle_data(self, data: str) -> None:
if self.equation_flag:

View File

@ -16,17 +16,11 @@
\usepackage{booktabs} % For professional-looking tables
\usepackage{pgf} % For using pgf grafics
\usepackage{textcomp, gensymb} % provides \degree symbol
\usepackage{xcolor} % For colored text
\sisetup{
table-align-text-post = false
}
% Define fine print environment
\newenvironment{fineprint}
{\par\vspace{0.5\baselineskip}\noindent\footnotesize\color{gray}}
{\par\vspace{0.5\baselineskip}}
% Geometry Settings
\geometry{margin=1in} % 1-inch margins

View File

@ -21,12 +21,6 @@
padding-bottom: 50px;
}
div.fineprint
{
font-size: smaller;
color: grey;
}
div h1
{
font-size: 32px;

View File

@ -81,13 +81,6 @@ def make_document():
doc.add_table(df.style.hide(axis="index"), 'This is a example table', 'example1')
doc.add_text("This is a fine print test text section. It uses smaller text and uses grey color. This is a fine print test"
"text section. It uses smaller text and uses grey color.", section_class='fineprint')
doc.add_text("Standard text section. This is normal text without any special formatting. It uses the default text size and color.")
doc.add_markdown("This is a **fine print** test text section. It uses **smaller text** and uses **grey** color.", section_class='fineprint')
return doc