Skip to content

Commit

Permalink
fixing followup error
Browse files Browse the repository at this point in the history
  • Loading branch information
entorb committed Aug 27, 2024
1 parent 9c0b22c commit 327b83c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 0 additions & 4 deletions scripts/ebook/hpmor-ebook.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

\input{layout/hp-intro}

\renewenvironment{headlines}{}{}
\renewenvironment{writtenNote}{}{}
\renewenvironment{playdialog}{}{}

\newcommand{\writtenNoteA}[1]{\par\textcolor{writtenNote}{#1}}
\renewcommand{\parsel}[1]{\textcolor{parsel}{#1}}
\renewcommand{\McGonagallWhiteBoard}[1]{\textcolor{McGonagallWhiteBoard}{\par#1}}
Expand Down
10 changes: 10 additions & 0 deletions scripts/ebook/step_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@
date_str = dt.datetime.now(dt.UTC).date().strftime("%d.%m.%Y")
cont = cont.replace("\\today{}", date_str)

# empty the newenvironments: headlines, writtenNote, playdialog
# to prevent implications on other cleanup scripts
cont = re.sub(
r"\\newenvironment\{(headlines|writtenNote|playdialog)\}.*?\n\n",
r"\\newenvironment{\1}{}{}\n\n",
cont,
flags=re.DOTALL,
count=3,
)

# writtenNote env -> \writtenNoteA
cont = re.sub(
r"\s*\\begin\{writtenNote\}\s*(.*?)\s*\\end\{writtenNote\}",
Expand Down

0 comments on commit 327b83c

Please sign in to comment.