Skip to content

Commit

Permalink
Fix newspaper header issues (#169)
Browse files Browse the repository at this point in the history
fixes #168
  • Loading branch information
entorb authored Jun 16, 2024
1 parent a4ad53f commit dee9d3f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
version_number:
description: "Version number"
required: true
default: "v1.2.9"
default: "v1.2.12"
version_text:
description: "Description"
required: true
Expand Down Expand Up @@ -77,6 +77,7 @@ jobs:
prerelease: false
files: |
./hpmor*.pdf
./hpmor.html
./hpmor.epub
./hpmor.mobi
./hpmor.fb2
12 changes: 6 additions & 6 deletions chapters/hpmor-chapter-086.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ \chapter{Multiple Hypothesis Testing}

\begin{headlines}

\header{(International news headlines of April 7th, 1992:)}
\newspaperHeader{(International news headlines of April 7th, 1992:)}

\label{Toronto Magical Tribune:}
\newspaperName{Toronto Magical Tribune:}

\headline{Entire British Wizengamot\\
Reports Seeing ‘Boy-Who-Lived’\\
Expand All @@ -17,25 +17,25 @@ \chapter{Multiple Hypothesis Testing}
\headline{France, Germany Accuse Britain\\
of Making the Whole Thing Up}

\label{New Zealand Spellcrafters Diurnal Notice:}
\newspaperName{New Zealand Spellcrafter’s Diurnal Notice:}

\headline{What Drove British Legislature Insane?\\
Could Our Government Be Next?}

\headline{Experts List Top 28 Reasons\\
To Believe It’s Already Happened}

\label{American Mage:}
\newspaperName{American Mage:}

\headline{Werewolf Clan to Become\\
First Inhabitants of Wyoming}

\label{The Quibbler:}
\newspaperName{The Quibbler:}

\headline{Malfoy Flees Hogwarts\\
As Veela Powers Awaken}

\label{Daily Prophet:}
\newspaperName{Daily Prophet:}

\headline{Legal Tricks Free\\
“Mad Muggle-born”\\
Expand Down
7 changes: 3 additions & 4 deletions layout/hp-markup.tex
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,17 @@
\textsc{#1}%
}

\newcommand{\newspaperHeader}[1]{\begin{SingleSpace}\upshape #1\end{SingleSpace}}
\newcommand{\newspaperName}[1]{\upshape\itshape #1}

\newenvironment{headlines}{%
\newcommand{\header}[1]{\begin{SingleSpace}\upshape ##1\end{SingleSpace}}
\let\hmorSavedLabel\label
\renewcommand{\label}[1]{{\upshape\itshape ##1}}%
\begin{Spacing}{0.75}
\begin{center}
\scshape
\nonzeroparskip
}{
\end{center}
\end{Spacing}
\let\label\hmorSavedLabel
}


Expand Down
1 change: 1 addition & 0 deletions scripts/ebook/hpmor-ebook.tex
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
\renewcommand{\McGonagallWhiteBoard}[1]{\textcolor{McGonagallWhiteBoard}{\par#1}}
\renewcommand{\headline}[1]{\begin{center}\textcolor{headline}{#1}\end{center}}
\renewcommand{\inlineheadline}[1]{\textcolor{headline}{#1}}
\renewcommand{\newspaperHeader}[1]{#1}

\include{chapters/hpmor-chapter-000}
\part{Harry James Potter-Evans-Verres and the Methods of Rationality}
Expand Down
3 changes: 0 additions & 3 deletions scripts/ebook/step_6.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ def fix_ellipsis(s: str) -> str:
# fix spaces around ellipsis
cont = fix_ellipsis(cont)

# remove bad span ids (containing spaces) from newspaper spans
cont = re.sub(r'<span id="[^"]+" label="[^"]+">', r"<span>", cont, count=5)

# doc structure (not needed any more, using calibi --level1-toc flag instead)
# sed -i 's/<h1 /<h1 class="part"/g' $target_file
# sed -i 's/<h2 /<h2 class="chapter"/g' $target_file
Expand Down

0 comments on commit dee9d3f

Please sign in to comment.