Skip to content

Commit dee9d3f

Browse files
authored
Fix newspaper header issues (#169)
fixes #168
1 parent a4ad53f commit dee9d3f

5 files changed

Lines changed: 12 additions & 14 deletions

File tree

.github/workflows/create-release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
version_number:
88
description: "Version number"
99
required: true
10-
default: "v1.2.9"
10+
default: "v1.2.12"
1111
version_text:
1212
description: "Description"
1313
required: true
@@ -77,6 +77,7 @@ jobs:
7777
prerelease: false
7878
files: |
7979
./hpmor*.pdf
80+
./hpmor.html
8081
./hpmor.epub
8182
./hpmor.mobi
8283
./hpmor.fb2

chapters/hpmor-chapter-086.tex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ \chapter{Multiple Hypothesis Testing}
33

44
\begin{headlines}
55

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

8-
\label{Toronto Magical Tribune:}
8+
\newspaperName{Toronto Magical Tribune:}
99

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

20-
\label{New Zealand Spellcrafters Diurnal Notice:}
20+
\newspaperName{New Zealand Spellcrafter’s Diurnal Notice:}
2121

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

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

28-
\label{American Mage:}
28+
\newspaperName{American Mage:}
2929

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

33-
\label{The Quibbler:}
33+
\newspaperName{The Quibbler:}
3434

3535
\headline{Malfoy Flees Hogwarts\\
3636
As Veela Powers Awaken}
3737

38-
\label{Daily Prophet:}
38+
\newspaperName{Daily Prophet:}
3939

4040
\headline{Legal Tricks Free\\
4141
“Mad Muggle-born”\\

layout/hp-markup.tex

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,17 @@
7373
\textsc{#1}%
7474
}
7575

76+
\newcommand{\newspaperHeader}[1]{\begin{SingleSpace}\upshape #1\end{SingleSpace}}
77+
\newcommand{\newspaperName}[1]{\upshape\itshape #1}
78+
7679
\newenvironment{headlines}{%
77-
\newcommand{\header}[1]{\begin{SingleSpace}\upshape ##1\end{SingleSpace}}
78-
\let\hmorSavedLabel\label
79-
\renewcommand{\label}[1]{{\upshape\itshape ##1}}%
8080
\begin{Spacing}{0.75}
8181
\begin{center}
8282
\scshape
8383
\nonzeroparskip
8484
}{
8585
\end{center}
8686
\end{Spacing}
87-
\let\label\hmorSavedLabel
8887
}
8988

9089

scripts/ebook/hpmor-ebook.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
\renewcommand{\McGonagallWhiteBoard}[1]{\textcolor{McGonagallWhiteBoard}{\par#1}}
1717
\renewcommand{\headline}[1]{\begin{center}\textcolor{headline}{#1}\end{center}}
1818
\renewcommand{\inlineheadline}[1]{\textcolor{headline}{#1}}
19+
\renewcommand{\newspaperHeader}[1]{#1}
1920

2021
\include{chapters/hpmor-chapter-000}
2122
\part{Harry James Potter-Evans-Verres and the Methods of Rationality}

scripts/ebook/step_6.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,6 @@ def fix_ellipsis(s: str) -> str:
9292
# fix spaces around ellipsis
9393
cont = fix_ellipsis(cont)
9494

95-
# remove bad span ids (containing spaces) from newspaper spans
96-
cont = re.sub(r'<span id="[^"]+" label="[^"]+">', r"<span>", cont, count=5)
97-
9895
# doc structure (not needed any more, using calibi --level1-toc flag instead)
9996
# sed -i 's/<h1 /<h1 class="part"/g' $target_file
10097
# sed -i 's/<h2 /<h2 class="chapter"/g' $target_file

0 commit comments

Comments
 (0)