├── .dir-locals.el ├── .gitattributes ├── .github └── workflows │ ├── check-and-make.yml │ └── create-release.yml ├── .gitignore ├── .pre-commit-config.yaml ├── .ruff.toml ├── Dockerfile ├── GNUmakefile ├── README.md ├── chapters ├── hp-exam.tex ├── hpmor-chapter-000.tex ├── hpmor-chapter-001.tex ├── hpmor-chapter-002.tex ├── hpmor-chapter-003.tex ├── hpmor-chapter-004.tex ├── hpmor-chapter-005.tex ├── hpmor-chapter-006.tex ├── hpmor-chapter-007.tex ├── hpmor-chapter-008.tex ├── hpmor-chapter-009.tex ├── hpmor-chapter-010.tex ├── hpmor-chapter-011.tex ├── hpmor-chapter-012.tex ├── hpmor-chapter-013.tex ├── hpmor-chapter-014.tex ├── hpmor-chapter-015.tex ├── hpmor-chapter-016.tex ├── hpmor-chapter-017.tex ├── hpmor-chapter-018.tex ├── hpmor-chapter-019.tex ├── hpmor-chapter-020.tex ├── hpmor-chapter-021.tex ├── hpmor-chapter-022.tex ├── hpmor-chapter-023.tex ├── hpmor-chapter-024.tex ├── hpmor-chapter-025.tex ├── hpmor-chapter-026.tex ├── hpmor-chapter-027.tex ├── hpmor-chapter-028.tex ├── hpmor-chapter-029.tex ├── hpmor-chapter-030.tex ├── hpmor-chapter-031.tex ├── hpmor-chapter-032.tex ├── hpmor-chapter-033.tex ├── hpmor-chapter-034.tex ├── hpmor-chapter-035.tex ├── hpmor-chapter-036.tex ├── hpmor-chapter-037.tex ├── hpmor-chapter-038.tex ├── hpmor-chapter-039.tex ├── hpmor-chapter-040.tex ├── hpmor-chapter-041.tex ├── hpmor-chapter-042.tex ├── hpmor-chapter-043.tex ├── hpmor-chapter-044.tex ├── hpmor-chapter-045.tex ├── hpmor-chapter-046.tex ├── hpmor-chapter-047.tex ├── hpmor-chapter-048.tex ├── hpmor-chapter-049.tex ├── hpmor-chapter-050.tex ├── hpmor-chapter-051.tex ├── hpmor-chapter-052.tex ├── hpmor-chapter-053.tex ├── hpmor-chapter-054.tex ├── hpmor-chapter-055.tex ├── hpmor-chapter-056.tex ├── hpmor-chapter-057.tex ├── hpmor-chapter-058.tex ├── hpmor-chapter-059.tex ├── hpmor-chapter-060.tex ├── hpmor-chapter-061.tex ├── hpmor-chapter-062.tex ├── hpmor-chapter-063.tex ├── hpmor-chapter-064.tex ├── hpmor-chapter-065.tex ├── hpmor-chapter-066.tex ├── hpmor-chapter-067.tex ├── hpmor-chapter-068.tex ├── hpmor-chapter-069.tex ├── hpmor-chapter-070.tex ├── hpmor-chapter-071.tex ├── hpmor-chapter-072.tex ├── hpmor-chapter-073.tex ├── hpmor-chapter-074.tex ├── hpmor-chapter-075.tex ├── hpmor-chapter-076.tex ├── hpmor-chapter-077.tex ├── hpmor-chapter-078.tex ├── hpmor-chapter-079.tex ├── hpmor-chapter-080.tex ├── hpmor-chapter-081.tex ├── hpmor-chapter-082.tex ├── hpmor-chapter-083.tex ├── hpmor-chapter-084.tex ├── hpmor-chapter-085.tex ├── hpmor-chapter-086.tex ├── hpmor-chapter-087.tex ├── hpmor-chapter-088.tex ├── hpmor-chapter-089.tex ├── hpmor-chapter-090.tex ├── hpmor-chapter-091.tex ├── hpmor-chapter-092.tex ├── hpmor-chapter-093.tex ├── hpmor-chapter-094.tex ├── hpmor-chapter-095.tex ├── hpmor-chapter-096.tex ├── hpmor-chapter-097.tex ├── hpmor-chapter-098.tex ├── hpmor-chapter-099.tex ├── hpmor-chapter-100.tex ├── hpmor-chapter-101.tex ├── hpmor-chapter-102.tex ├── hpmor-chapter-103.tex ├── hpmor-chapter-104.tex ├── hpmor-chapter-105.tex ├── hpmor-chapter-106.tex ├── hpmor-chapter-107.tex ├── hpmor-chapter-108.tex ├── hpmor-chapter-109.tex ├── hpmor-chapter-110.tex ├── hpmor-chapter-111.tex ├── hpmor-chapter-112.tex ├── hpmor-chapter-113.tex ├── hpmor-chapter-114.tex ├── hpmor-chapter-115.tex ├── hpmor-chapter-116.tex ├── hpmor-chapter-117.tex ├── hpmor-chapter-118.tex ├── hpmor-chapter-119.tex ├── hpmor-chapter-120.tex ├── hpmor-chapter-121.tex └── hpmor-chapter-122.tex ├── fonts ├── AlegreyaSans │ ├── AlegreyaSans-LightItalic.ttf │ └── LICENSE.md ├── Florante │ ├── Florante.ttf │ ├── FloranteatLaura.sfd │ └── Nyek! License.txt ├── Licenses.md ├── Miscelanea.ttf ├── Parseltongue │ ├── PARSELTO.TTF │ ├── Parseltongue.afm │ ├── Parseltongue.sfd │ ├── Parseltongue.ttf │ └── readme.txt ├── Twilight.ttf ├── alegreya │ ├── Alegreya-Black.otf │ ├── Alegreya-BlackItalic.otf │ ├── Alegreya-Bold.otf │ ├── Alegreya-BoldItalic.otf │ ├── Alegreya-Italic.otf │ ├── Alegreya-Regular.otf │ ├── AlegreyaSC-Black.otf │ ├── AlegreyaSC-BlackItalic.otf │ ├── AlegreyaSC-Bold.otf │ ├── AlegreyaSC-BoldItalic.otf │ ├── AlegreyaSC-Italic.otf │ ├── AlegreyaSC-Regular.otf │ ├── AlegreyaSans-Black.otf │ ├── AlegreyaSans-BlackItalic.otf │ ├── AlegreyaSans-Bold.otf │ ├── AlegreyaSans-BoldItalic.otf │ ├── AlegreyaSans-ExtraBold.otf │ ├── AlegreyaSans-ExtraBoldItalic.otf │ ├── AlegreyaSans-Italic.otf │ ├── AlegreyaSans-Light.otf │ ├── AlegreyaSans-LightItalic.otf │ ├── AlegreyaSans-Medium.otf │ ├── AlegreyaSans-MediumItalic.otf │ ├── AlegreyaSans-Regular.otf │ ├── AlegreyaSans-Thin.otf │ ├── AlegreyaSans-ThinItalic.otf │ ├── AlegreyaSansSC-Black.otf │ ├── AlegreyaSansSC-BlackItalic.otf │ ├── AlegreyaSansSC-Bold.otf │ ├── AlegreyaSansSC-BoldItalic.otf │ ├── AlegreyaSansSC-ExtraBold.otf │ ├── AlegreyaSansSC-ExtraBoldItalic.otf │ ├── AlegreyaSansSC-Italic.otf │ ├── AlegreyaSansSC-Light.otf │ ├── AlegreyaSansSC-LightItalic.otf │ ├── AlegreyaSansSC-Medium.otf │ ├── AlegreyaSansSC-MediumItalic.otf │ ├── AlegreyaSansSC-Regular.otf │ ├── AlegreyaSansSC-Thin.otf │ ├── AlegreyaSansSC-ThinItalic.otf │ └── SIL Open Font License.txt ├── architects-daughter │ ├── ArchitectsDaughter.ttf │ └── SIL Open Font License.txt ├── automobile_contest │ ├── Automobile Contest.otf │ ├── Automobile Contest.ttf │ └── AutomobileContest.sfd ├── gabriele_bad_ah │ ├── GabrieleBadAH.sfd │ ├── gabriele-bad.ttf │ └── gabriele.txt ├── graphe │ ├── GrapheAlpha_alt.sfd │ └── Graphe_Alpha_alt.ttf ├── lumos │ ├── Lumos.sfd │ ├── Lumos.ttf │ └── readme.txt ├── narnia_bll │ ├── NarniaBLL.ttf │ └── SpecialReadMe.txt ├── ringbearer │ ├── RingBearer.ttf │ ├── liesmich.html │ └── readme.html └── thundercats │ ├── Thundercats.ttf │ └── Thundercats.txt ├── hpmor-1.tex ├── hpmor-2.tex ├── hpmor-3.tex ├── hpmor-4.tex ├── hpmor-5.tex ├── hpmor-6.tex ├── hpmor.tex ├── images ├── Deathly_Hallows_Sign.pdf ├── Deathly_Hallows_Sign.png ├── bubble0.jpg ├── bubble0.png └── cover0.jpg ├── latexmkrc ├── layout ├── hp-blurbs.tex ├── hp-book.sty ├── hp-colophon.tex ├── hp-contents.tex ├── hp-dust-jacket.tex ├── hp-format.tex ├── hp-header.tex ├── hp-intro.tex ├── hp-markup.tex ├── hp-paper-type.tex ├── hp-title.tex ├── hpmor-dust-jacket-1.tex ├── hpmor-dust-jacket-2.tex ├── hpmor-dust-jacket-3.tex ├── hpmor-dust-jacket-4.tex ├── hpmor-dust-jacket-5.tex ├── hpmor-dust-jacket-6.tex ├── hpmor-title-1.tex ├── hpmor-title-2.tex ├── hpmor-title-3.tex ├── hpmor-title-4.tex ├── hpmor-title-5.tex ├── hpmor-title-6.tex ├── hpmor-title.tex └── papers.tex ├── post-checkout ├── python-requirements.txt ├── scripts ├── check-chapters.json ├── check_chapters.py ├── check_chapters_settings.py ├── check_chapters_test.py ├── check_pre-commit.sh ├── cleanup.sh ├── ebook │ ├── hpmor-ebook.tex │ ├── html.css │ ├── step_1.sh │ ├── step_2.sh │ ├── step_3.py │ ├── step_4.py │ ├── step_4_test.py │ ├── step_5.sh │ ├── step_6.py │ ├── step_6_test.py │ ├── step_7.sh │ ├── step_8.sh │ └── v1 │ │ ├── .gitignore │ │ ├── 1_latex2html.py │ │ └── 2_html2epub.sh ├── install_requirements.sh ├── make_ebooks.sh └── make_pdfs.sh └── spelling-list.txt /.dir-locals.el: -------------------------------------------------------------------------------- 1 | ;; Adapted from https://stackoverflow.com/questions/4012321/how-can-i-access-the-path-to-the-current-directory-in-an-emacs-directory-variabl 2 | ((latex-mode . ((eval . (progn 3 | (set (make-local-variable 'ispell-personal-dictionary) 4 | (expand-file-name 5 | "spelling-list.txt" 6 | (file-name-directory 7 | (let ((d (dir-locals-find-file "."))) 8 | (if (stringp d) d (car d))))))))))) 9 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.css text eol=lf diff=css 2 | *.json text eol=lf 3 | *.md text eol=lf diff=markdown 4 | *.py text eol=lf diff=python 5 | *.sh text eol=lf 6 | *.tex text eol=lf 7 | *.toml text eol=lf 8 | *.txt text eol=lf 9 | *.yaml text eol=lf 10 | *.yml text eol=lf 11 | LICENSE text eol=lf 12 | -------------------------------------------------------------------------------- /.github/workflows/check-and-make.yml: -------------------------------------------------------------------------------- 1 | # This workflow performs 2 | # check: Quality checks on chapter text and code upon new commits and PRs. 3 | # make: Makes PDFs and eBooks if .tex files have changed. 4 | # upload: Uploads the artifacts to release WorkInProgress, but only for push into main branch. 5 | 6 | name: Check and Make 7 | 8 | # This workflow runs upon 9 | # - manual triggering 10 | # - create new PR (check, make) 11 | # - push to main (check, make, upload) 12 | 13 | on: 14 | workflow_dispatch: 15 | pull_request: 16 | branches: ["main"] 17 | push: 18 | branches: ["main"] 19 | 20 | jobs: 21 | check: 22 | runs-on: ubuntu-24.04 23 | outputs: 24 | cache-hit: ${{ steps.cache-lookup.outputs.cache-hit }} 25 | 26 | steps: 27 | - name: Checkout repository 28 | uses: actions/checkout@v4 29 | with: 30 | persist-credentials: false 31 | fetch-depth: 1 # 0 if you want to push to repo 32 | 33 | - name: Calculate hash on chapters/*.tex 34 | id: calculate-hash 35 | run: | 36 | echo "hash=${{ hashFiles('chapters/*.tex') }}" >> $GITHUB_OUTPUT 37 | touch hash-chapters.txt 38 | 39 | - name: Cache lookup 40 | id: cache-lookup 41 | uses: actions/cache@v4 42 | with: 43 | path: hash-chapters.txt 44 | key: chapter-hash-for-ebook-${{ github.ref_name }}-${{ steps.calculate-hash.outputs.hash }} 45 | 46 | - name: Preparations 47 | run: ln -s python-requirements.txt requirements.txt 48 | 49 | - name: Python set up 50 | uses: actions/setup-python@v5 51 | with: 52 | python-version: "3.13" 53 | cache: "pip" 54 | 55 | - name: Check chapters for known issues 56 | run: python3 -O scripts/check_chapters.py 57 | 58 | - name: Check pre-commit tests 59 | uses: pre-commit/action@v3.0.1 60 | 61 | make: 62 | needs: check 63 | # do not run for unchanged tex files 64 | if: needs.check.outputs.cache-hit != 'true' 65 | 66 | runs-on: ubuntu-24.04 67 | 68 | steps: 69 | - name: Checkout repository 70 | uses: actions/checkout@v4 71 | with: 72 | persist-credentials: false 73 | fetch-depth: 1 # 0 if you want to push to repo 74 | 75 | - name: Cache LaTeX files 76 | uses: actions/cache@v4 77 | with: 78 | path: | 79 | chapters/*.aux 80 | hpmor*.aux 81 | hpmor*.fdb_latexmk 82 | hpmor*.fls 83 | hpmor*.out 84 | hpmor*.pdf 85 | hpmor*.toc 86 | hpmor*.xdv 87 | key: tex-cache 88 | 89 | - name: Preparations 90 | run: ln -s python-requirements.txt requirements.txt 91 | 92 | - name: Python set up 93 | uses: actions/setup-python@v5 94 | with: 95 | python-version: "3.13" 96 | cache: "pip" 97 | 98 | - name: Speed up apt-get steps 99 | uses: abbbi/github-actions-tune@v1 100 | 101 | - name: Install requirements (apt and python) 102 | run: sh scripts/install_requirements.sh > /dev/null 103 | 104 | - name: Print versions 105 | run: | 106 | cat /etc/os-release 107 | xelatex -v 108 | latexmk -v 109 | calibre --version 110 | pandoc --version 111 | ebook-convert --version 112 | python3 --version 113 | 114 | - name: Make PDFs 115 | run: sh scripts/make_pdfs.sh > /dev/null 116 | 117 | - name: Make eBooks 118 | run: | 119 | wget --quiet https://github.com/${{ github.repository }}/releases/latest/download/hpmor.html -O hpmor-prev.html 120 | sh scripts/make_ebooks.sh 121 | 122 | - name: Compare to previous hpmor.html 123 | run: | 124 | diff -U 0 -s hpmor-prev.html hpmor.html > hpmor-html-diff.log || : 125 | 126 | - name: ls after 127 | run: | 128 | pwd 129 | ls -al 130 | 131 | - name: Upload eBooks as artifact 132 | uses: actions/upload-artifact@v4 133 | with: 134 | name: ebooks 135 | path: | 136 | ./hpmor-html-diff.log 137 | ./hpmor.epub 138 | ./hpmor.fb2 139 | ./hpmor.html 140 | ./hpmor.mobi 141 | ./hpmor.pdf 142 | retention-days: 14 143 | 144 | # 145 | # upload to release WorkInProgress 146 | # 147 | upload: 148 | needs: make 149 | # only for push into main branch 150 | if: github.event_name == 'push' && github.ref == 'refs/heads/main' 151 | 152 | runs-on: ubuntu-24.04 153 | 154 | steps: 155 | - name: Download eBooks artifact 156 | uses: actions/download-artifact@v4 157 | with: 158 | name: ebooks 159 | 160 | - name: Publish eBooks to release WorkInProgress 161 | uses: softprops/action-gh-release@v2 162 | with: 163 | tag_name: WorkInProgress 164 | prerelease: true 165 | files: | 166 | ./hpmor-html-diff.log 167 | ./hpmor.epub 168 | ./hpmor.fb2 169 | ./hpmor.html 170 | ./hpmor.mobi 171 | ./hpmor*.pdf 172 | -------------------------------------------------------------------------------- /.github/workflows/create-release.yml: -------------------------------------------------------------------------------- 1 | # This manually started workflow builds PDFs and eBooks and creates a new release with these assets. 2 | 3 | name: Create Release 4 | 5 | on: 6 | workflow_dispatch: # manual triggering 7 | inputs: 8 | version_number: 9 | description: "Version number" 10 | required: true 11 | default: "v1.2.12" 12 | version_text: 13 | description: "Description" 14 | required: true 15 | default: "" 16 | 17 | jobs: 18 | release: 19 | runs-on: ubuntu-24.04 20 | 21 | steps: 22 | # - name: test print 23 | # run: | 24 | # echo "version_number: ${{ github.event.inputs.version_number }}" 25 | # echo "version_number: ${{ github.event.inputs.version_text }}" 26 | 27 | # steps are copied from make.yml 28 | 29 | - name: Checkout repository 30 | uses: actions/checkout@v4 31 | with: 32 | persist-credentials: false 33 | fetch-depth: 1 # 0 if you want to push to repo 34 | 35 | - name: Cache LaTeX files 36 | uses: actions/cache@v4 37 | with: 38 | path: | 39 | chapters/*.aux 40 | hpmor*.aux 41 | hpmor*.fdb_latexmk 42 | hpmor*.fls 43 | hpmor*.out 44 | hpmor*.pdf 45 | hpmor*.toc 46 | hpmor*.xdv 47 | key: tex-cache 48 | 49 | - name: Preparations 50 | run: ln -s python-requirements.txt requirements.txt 51 | 52 | - name: Python set up 53 | uses: actions/setup-python@v5 54 | with: 55 | python-version: "3.13" 56 | cache: "pip" 57 | 58 | - name: Check chapters for known issues 59 | run: python3 scripts/check_chapters.py 60 | 61 | - name: Check pre-commit tests 62 | uses: pre-commit/action@v3.0.1 63 | 64 | - name: Speed up apt-get steps 65 | uses: abbbi/github-actions-tune@v1 66 | 67 | - name: Install requirements 68 | run: sh scripts/install_requirements.sh > /dev/null 69 | 70 | - name: Download previous hpmor.html 71 | run: | 72 | wget --quiet https://github.com/${{ github.repository }}/releases/download/WorkInProgress/hpmor.html -O hpmor-prev.html 73 | 74 | - name: Make PDFs 75 | run: sh scripts/make_pdfs.sh > /dev/null 76 | 77 | - name: Make eBooks 78 | run: sh scripts/make_ebooks.sh 79 | 80 | - name: Compare to previous hpmor.html 81 | run: | 82 | diff -u -s hpmor-prev.html hpmor.html > hpmor-html-diff.log || : 83 | rm hpmor-prev.html 84 | 85 | - name: Upload eBooks as artifact 86 | uses: actions/upload-artifact@v4 87 | with: 88 | name: ebooks 89 | path: | 90 | ./hpmor-html-diff.log 91 | ./hpmor.epub 92 | ./hpmor.html 93 | ./hpmor.pdf 94 | retention-days: 14 95 | 96 | - name: Publish release 97 | uses: softprops/action-gh-release@v2 98 | with: 99 | tag_name: "${{ inputs.version_number }}" 100 | body: "${{ inputs.version_text }}" 101 | prerelease: false 102 | files: | 103 | ./hpmor.epub 104 | ./hpmor.fb2 105 | ./hpmor.html 106 | ./hpmor.mobi 107 | ./hpmor*.pdf 108 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | .vscode/ 3 | tmp/ 4 | 5 | *.acn 6 | *.acr 7 | *.alg 8 | *.aux 9 | *.bbl 10 | *.blg 11 | *.dvi 12 | *.fdb_latexmk 13 | *.fls 14 | *.glg 15 | *.glo 16 | *.gls 17 | *.idx 18 | *.ilg 19 | *.ind 20 | *.ist 21 | *.lof 22 | *.log 23 | *.lot 24 | *.maf 25 | *.mtc 26 | *.mtc0 27 | *.nav 28 | *.nlo 29 | *.out 30 | *.pdfsync 31 | *.ps 32 | *.snm 33 | *.synctex.gz 34 | *.tdo 35 | *.toc 36 | *.vrb 37 | *.xdv 38 | *.xdy 39 | *~ 40 | ~$hpmor.docx 41 | chapters/*-autofix.tex 42 | hp-*.pdf 43 | hpmor-*.pdf 44 | hpmor.pdf 45 | hpmor*.docx 46 | hpmor*.epub 47 | hpmor*.fb2 48 | hpmor*.html 49 | hpmor*.mobi 50 | hpmor*.zip 51 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | # install package 2 | # pip3 install pre-commit 3 | # register as git commit-hook to run automatically 4 | # pre-commit install 5 | # run manually 6 | # pre-commit run --all-files 7 | # update hooks to latest version 8 | # pre-commit autoupdate 9 | 10 | exclude: | 11 | (?x)^( 12 | scripts/ebook/v1.*| 13 | )$ 14 | 15 | repos: 16 | - repo: https://github.com/pre-commit/pre-commit-hooks 17 | rev: v5.0.0 18 | hooks: 19 | - id: check-added-large-files 20 | args: ["--maxkb=500"] 21 | - id: check-ast 22 | - id: check-builtin-literals 23 | - id: check-case-conflict 24 | - id: check-docstring-first 25 | - id: check-executables-have-shebangs 26 | - id: check-json 27 | - id: check-merge-conflict 28 | - id: check-shebang-scripts-are-executable 29 | - id: check-symlinks 30 | - id: check-toml 31 | - id: check-vcs-permalinks 32 | - id: check-xml 33 | - id: check-yaml 34 | - id: debug-statements 35 | - id: destroyed-symlinks 36 | # - id: detect-aws-credentials 37 | - id: detect-private-key 38 | # conflict with black below 39 | # - id: double-quote-string-fixer 40 | - id: end-of-file-fixer 41 | - id: file-contents-sorter 42 | - id: fix-byte-order-marker 43 | - id: fix-encoding-pragma 44 | args: ["--remove"] 45 | - id: forbid-new-submodules 46 | # - id: forbid-submodules 47 | # args: ['--fix=lf'] 48 | - id: mixed-line-ending 49 | - id: name-tests-test 50 | # - id: no-commit-to-branch 51 | # args: [--branch, staging] 52 | # not, since it decodes utf-8 53 | # - id: pretty-format-json 54 | # args: ["--autofix"] 55 | - id: requirements-txt-fixer 56 | # - id: sort-simple-yaml 57 | - id: trailing-whitespace 58 | 59 | - repo: https://github.com/charliermarsh/ruff-pre-commit 60 | rev: "v0.9.4" 61 | hooks: 62 | - id: ruff 63 | args: [--fix, --exit-non-zero-on-fix] 64 | - id: ruff-format 65 | 66 | - repo: https://github.com/pre-commit/pygrep-hooks 67 | rev: v1.10.0 68 | hooks: 69 | - id: python-check-blanket-noqa 70 | # not, since '# type: ignore' is ok for me 71 | # - id: python-check-blanket-type-ignore 72 | - id: python-check-mock-methods 73 | - id: python-no-eval 74 | - id: python-no-log-warn 75 | - id: python-use-type-annotations 76 | - id: rst-backticks 77 | - id: rst-directive-colons 78 | - id: rst-inline-touching-normal 79 | - id: text-unicode-replacement-char 80 | 81 | - repo: https://github.com/igorshubovych/markdownlint-cli 82 | rev: v0.44.0 83 | hooks: 84 | - id: markdownlint 85 | args: ["--disable", "MD013"] 86 | 87 | default_language_version: 88 | python: python3.13 89 | -------------------------------------------------------------------------------- /.ruff.toml: -------------------------------------------------------------------------------- 1 | fix = true # auto-fix findings 2 | line-length = 88 # same as Black 3 | target-version = "py313" # Python 3.13 4 | 5 | [lint] 6 | # comment this out to use only default rules (["E4", "E7", "E9", "F"]) 7 | select = ["ALL"] # activate all rules 8 | 9 | # add some more rules to include 10 | # extend-select = ["B", "Q", "E", "W"] 11 | 12 | # rule not to apply 13 | extend-ignore = [ 14 | "COM812", # missing-trailing-comma, 15 | "D200", # fits-on-one-line" 16 | "D211", # blank-line-before-class 17 | "D212", # multi-line-summary-second-line 18 | "ERA", # commented-out code 19 | "FIX002", # line-contains-todo 20 | "ISC001", # implicit-str-concat 21 | "PD901", # df name 22 | "PGH003", # blanket-type-ignore 23 | "RET504", # unnecessary-assign 24 | "T201", # print 25 | "TD002", # missing-todo-author 26 | "TD003", # missing-todo-link 27 | ] 28 | 29 | 30 | [format] 31 | line-ending = "lf" # force lf 32 | preview = false # enable unstable preview style formatting 33 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | 3 | # base image 4 | FROM ubuntu:24.04 5 | 6 | # set timezone 7 | ENV TZ=Europe/Berlin 8 | 9 | # prevent keyboard input requests in apt install 10 | ENV DEBIAN_FRONTEND=noninteractive 11 | 12 | # install packages and cleanup afterwards 13 | RUN apt-get update && apt-get dist-upgrade -y && \ 14 | apt-get install -y python3 python3-lxml git texlive-xetex texlive-lang-greek texlive-lang-german latexmk texlive-extra-utils pandoc calibre imagemagick ghostscript && \ 15 | apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/{apt,dpkg,cache,log}/ 16 | 17 | # set working directory 18 | WORKDIR /app 19 | 20 | # mount host directory as volume 21 | VOLUME /app 22 | 23 | # default command: build 1-vol pdf and all ebook formats 24 | # CMD latexmk hpmor ; ./scripts/make_ebooks.sh 25 | 26 | # 1. preparation 27 | # 1.1 build/update image from Dockerfile 28 | # docker build -t hpmor . 29 | 30 | # 1.2 create container that mounts current working dir to /app 31 | # docker run --name hpmor-en -it --mount type=bind,src="$(pwd)",dst=/app hpmor bash 32 | # exit 33 | 34 | # note: in Windows you need to replace "$(pwd)" by "%cd%" for the following commands 35 | 36 | # 2. use container 37 | # docker start -ai hpmor-en 38 | # latexmk hpmor ; ./scripts/make_ebooks.sh 39 | # exit 40 | 41 | # 3. optionally: cleanup/delete hpmor from docker 42 | # delete container 43 | # docker rm hpmor-en 44 | # delete image 45 | # docker rmi hpmor 46 | # delete all docker containers and cache 47 | # docker system prune -f 48 | -------------------------------------------------------------------------------- /GNUmakefile: -------------------------------------------------------------------------------- 1 | # Make a PDF and e-book release 2 | 3 | PROJECT=hpmor 4 | 5 | TAG := $(shell git describe --tags) 6 | VERSION := $(shell echo $(TAG) | sed -e 's/^v//') 7 | EBOOKS = $(PROJECT).epub $(PROJECT).mobi $(PROJECT).fb2 8 | ZIPFILE = $(PROJECT)-$(VERSION).zip 9 | 10 | all: ebooks pdf 11 | 12 | .PHONY: all 13 | 14 | clean: 15 | latexmk -C 16 | 17 | .PHONY: clean 18 | 19 | pdf: 20 | latexmk 21 | 22 | ebooks: pdf 23 | sh scripts/make_ebooks.sh 24 | 25 | zip: pdf ebooks 26 | rm -f $(ZIPFILE) && \ 27 | zip $(ZIPFILE) *.pdf $(EBOOKS) 28 | 29 | # To make a release: git tag vx.y && make release 30 | # Needs woger from https://github.com/rrthomas/woger/ 31 | release: zip 32 | git diff --exit-code && \ 33 | git push --tags && \ 34 | woger github package=$(PROJECT) version=$(VERSION) dist_type=zip && \ 35 | for file in $(PROJECT).pdf $(EBOOKS); do \ 36 | suffix=$${file##*.}; \ 37 | gh release upload $(TAG) $$file#$(PROJECT)-$(VERSION).$$suffix; \ 38 | done 39 | -------------------------------------------------------------------------------- /chapters/hp-exam.tex: -------------------------------------------------------------------------------- 1 | \chapter{Final Exam} 2 | 3 | \section{The following was posted at the end of Chapter 113:} 4 | 5 | {% 6 | \setlength{\parindent}{0pt} 7 | \setlength{\parskip}{.5\baselineskip} 8 | 9 | This is your final exam. 10 | 11 | You have 60 hours. 12 | 13 | Your solution must at least allow Harry to evade immediate death, despite being naked, holding only his wand, facing 36 Death Eaters plus the fully resurrected Lord Voldemort. 14 | 15 | \textbf{If a viable solution is posted before \emph{12:01\am Pacific Time} (8:01\am UTC) on Tuesday, March 3rd, 2015, the story will continue to Ch.~121.} 16 | 17 | \textbf{Otherwise you will get a shorter and sadder ending.} 18 | 19 | Keep in mind the following: 20 | \begin{enumerate} 21 | \item Harry must succeed via his own efforts. The cavalry is not coming. Everyone who might want to help Harry thinks he is at a Quidditch game. 22 | \item Harry may only use capabilities the story has already shown him to have; he cannot develop wordless wandless Legilimency in the next 60 seconds. 23 | \item Voldemort is evil and cannot be persuaded to be good; the Dark Lord’s utility function cannot be changed by talking to him. 24 | \item If Harry raises his wand or speaks in anything except Parseltongue, the Death Eaters will fire on him immediately. 25 | \item If the simplest timeline is otherwise one where Harry dies—if Harry cannot reach his Time-Turner without Time-Turned help—then the Time-Turner will not come into play. 26 | \item It is impossible to tell lies in Parseltongue. 27 | \end{enumerate} 28 | Within these constraints, Harry is allowed to attain his full potential as a rationalist, now in this moment or never, regardless of his previous flaws. 29 | 30 | Of course ‘the rational solution’, if you are using the word ‘rational’ correctly, is just a needlessly fancy way of saying ‘the best solution’ or ‘the solution I like’ or ‘the solution I think we should use’, and you should usually say one of the latter instead. (We only need the word ‘rational’ to talk about ways of thinking, considered apart from any particular solutions.) 31 | 32 | And by Vinge’s Principle, if you know exactly what a smart mind would do, you must be at least that smart yourself. Asking someone “What would an optimal player think is the best move?” should produce answers no better than “What do you think is best?” 33 | 34 | So what I mean in practice, when I say Harry is allowed to attain his full potential as a rationalist, is that Harry is allowed to solve this problem the way \emph{you} would solve it. If you can tell me exactly how to do something, Harry is allowed to think of it. 35 | 36 | But it does not serve as a solution to say, for example, “Harry should persuade Voldemort to let him out of the box” if you can’t yourself figure out how. 37 | 38 | \textbf{The rules on Fanfiction dot Net allow at most one review per chapter. Please submit \emph{only one} review of Ch.~113, to submit one suggested solution.} 39 | 40 | For the best experience, if you have not already been following Internet conversations about recent chapters, I suggest \textbf{not} doing so, trying to complete this exam on your own, not looking at other reviews, and waiting for Ch.~114 to see how you did. 41 | 42 | I wish you all the best of luck, or rather the best of skill. 43 | 44 | Ch.~114 will post at \textbf{10\am Pacific (6\pm UTC) on Tuesday, March 3rd, 2015.} 45 | 46 | ADDED: 47 | 48 | If you have pending exams, then even though the bystander effect is a thing, I expect that the collective effect of ‘everyone with more urgent life issues stays out of the effort’ shifts the probabilities very little (because diminishing marginal returns on more eyes and an already-huge population that is participating). 49 | 50 | \textbf{So if you can’t take the time, then please don’t.} Like any author, I enjoy the delicious taste of my readers’ suffering, finer than any chocolate; but I don’t want to \emph{hurt} you. 51 | 52 | Likewise, if you hate hate hate this sort of thing, then don’t participate! Other people ARE enjoying it. Just come back in a few days. I shouldn’t even need to point this out. 53 | 54 | I remind you again that you have hours to think. Use the Hold Off On Proposing Solutions, Luke. 55 | 56 | And really truly, I do mean it, Harry cannot develop any new magical powers or transcend previously stated constraints on them in the next sixty seconds. 57 | 58 | \later 59 | 60 | Unsurprisingly, this led to a lot of reader submissions. An awful lot. 61 | 62 | You can see the fallout \href{https://www.reddit.com/r/HPMOR/comments/2xnyi0/113_help_my_evil_plan_has_worked_all_too_well/}{on the /r/HPMOR subreddit}. If you’re reading this somewhere that the previous text isn’t a link, you can go to \url{https://www.reddit.com/r/HPMOR} and search for “Help! My evil plan has worked all too well!” 63 | 64 | } 65 | % LocalWords: Ch 66 | -------------------------------------------------------------------------------- /chapters/hpmor-chapter-000.tex: -------------------------------------------------------------------------------- 1 | \chapter*{Preface} 2 | % from https://www.hpmor.com/chapter/1 3 | % This is not a strict single-point-of-departure fic—there exists a primary point of departure, at some point in the past, but also other alterations. The best term I’ve heard for this fic is “parallel universe”. 4 | 5 | The text contains many clues: obvious clues, not-so-obvious clues, truly obscure hints which I was shocked to see some readers successfully decode, and massive evidence left out in plain sight. This is a rationalist story; its mysteries are solvable, and meant to be solved. 6 | 7 | The pacing of the story is that of serial fiction, i.e., that of a TV show running for a predetermined number of seasons, whose episodes are individually plotted but with an overall arc building to a final conclusion. 8 | 9 | % The story has been corrected to British English up to Ch. 17, and further Britpicking is currently in progress (see the /HPMOR subreddit). 10 | 11 | All science mentioned is real science. But please keep in mind that, beyond the realm of science, the views of the characters may not be those of the author. Not everything the protagonist does is a lesson in wisdom, and advice offered by darker characters may be untrustworthy or dangerously double-edged. 12 | 13 | \chapter*{Author’s introduction} 14 | % from https://www.hpmor.com/chapter/22 15 | 16 | \section*{Something, somewhere, somewhen, must have happened differently…} 17 | 18 | \begin{itemize} 19 | \item \textsc{Petunia Evans} married Michael Verres, a Professor of Biochemistry at Oxford. 20 | \item \textsc{Harry James Potter-Evans-Verres} grew up in a house filled to the brim with books. He once bit a math teacher who didn’t know what a logarithm was. He’s read \emph{Gödel, Escher, Bach} and \emph{Judgment Under Uncertainty: Heuristics and Biases} and volume one of \emph{The Feynman Lectures on Physics}. And despite what everyone who’s met him seems to fear, he doesn’t want to become the next Dark Lord. He was raised better than that. He wants to discover the laws of magic and become a god. 21 | \item \textsc{Hermione Granger} is doing better than him in every class except broomstick riding. 22 | \item \textsc{Draco Malfoy} is exactly what you would expect an eleven-year-old boy to be like if Darth Vader were his doting father. 23 | \item \textsc{Professor Quirrell} is living his lifelong dream of teaching Defense Against the Dark Arts, or as he prefers to call his class, Battle Magic. His students are all wondering what’s going to go wrong with the Defense Professor this time. 24 | \item \textsc{Dumbledore} is either insane, or playing some vastly deeper game which involved setting fire to a chicken. 25 | \item \textsc{Minerva Mcgonagall} needs to go off somewhere private and scream for a while. 26 | \end{itemize} 27 | 28 | % \begin{center} 29 | % Presenting: 30 | % 31 | % \textsc{Harry Potter and the Methods of Rationality} 32 | % 33 | % You ain't guessin' where this one's going. 34 | % \end{center} 35 | 36 | \section*{Some notes} 37 | The opinions of characters in this story are not necessarily those of the author. What warm!Harry thinks is \emph{often} meant as a good pattern to follow, especially if Harry thinks about how he can cite scientific studies to back up a particular principle. But not everything Harry does or thinks is a good idea. That wouldn’t work as a story. And the less warm characters may sometimes have valuable lessons to offer, but those lessons may also be dangerously double-edged. 38 | 39 | If you haven’t visited \url{https://hpmor.com}, don’t forget to do that at some point; otherwise you'll miss out on the fan art, how to learn everything Harry knows, and more. 40 | 41 | If you don’t just enjoy this fic, but learn something from it, then please consider blogging it or tweeting it. A work like this only does as much good as there are people who read it. 42 | 43 | % LocalWords: 44 | -------------------------------------------------------------------------------- /chapters/hpmor-chapter-031.tex: -------------------------------------------------------------------------------- 1 | \partchapter{Working in Groups}{II} 2 | 3 | \section{Aftermaths} 4 | 5 | \lettrine{H}{arry} paced backward and forward in his general’s office, which made a wonderful room for pacing, it didn’t have any other uses as far as he could tell. 6 | 7 | \emph{How?} 8 | 9 | \emph{How?} 10 | 11 | Hermione shouldn’t have won that battle! Not on her first try, not when she wasn’t at all violent by her nature, automatically being a great military commander on top of everything else was too much even for \emph{her}. 12 | 13 | Had she read about the tactic in a military history book? But it hadn’t been just that one tactic, she’d had her forces perfectly positioned to block any retreat, her troops had been better coordinated than his \emph{or} Draco’s… 14 | 15 | Had Professor Quirrell broken his promise not to help her? Had he given her the diary of General Tacticus or something? 16 | 17 | Harry was missing something here, something really important, and his mind went around and around in circles, and he still couldn’t figure it out. 18 | 19 | Finally Harry sighed. He wasn’t getting anywhere on this, and he had to go and learn the Breaking Drill Hex from Hermione or someone before the next battle—Professor Quirrell had explained to Harry, his voice amused but with a sharp undertone of warning, that “no magical items except the ones I give you” included Muggle technology no matter how much that \emph{wasn’t magic}. Plus Harry also needed to figure out how to bring down Mr~Goyle next time… 20 | 21 | Battles counted for a lot of Quirrell points if you were a general, and Harry needed to get cracking if he wanted to win Professor Quirrell’s Christmas wish. 22 | 23 | \later 24 | 25 | In his private room at Slytherin, Draco Malfoy stared off into space, as though the wall in front of his desk was the most fascinating surface in the world. 26 | 27 | \emph{How?} 28 | 29 | \emph{How?} 30 | 31 | In retrospect it had been an obvious sort of idea as cunning plots went, but Granger wasn’t \emph{supposed} to be cunning! She’d been too much of a Hufflepuff to use a Simple Strike Hex! Had Professor Quirrell been advising her despite his promise, or… 32 | 33 | And then Draco finally did what he should have done much earlier. 34 | 35 | What he should have done after the first time he met with Granger. 36 | 37 | What Harry Potter had \emph{told} him to do, \emph{trained} him to do, and yet Harry had also warned Draco that it would take time to make his brain realize that the methods applied to real life, and Draco hadn’t \emph{understood} that until today. He could have avoided every single one of his mistakes if he’d just \emph{applied} the things Harry had already \emph{told} him— 38 | 39 | Draco said out loud, “I notice that I am confused.” 40 | 41 | \emph{Your strength as a rationalist is your ability to be more confused by fiction than by reality…} 42 | 43 | Draco was confused. 44 | 45 | Therefore, something he believed was fiction. 46 | 47 | Granger should not have been able to do all that. 48 | 49 | Therefore, she probably hadn’t. 50 | 51 | \emph{I promise not to help General Granger in any way that the two of you don’t know about.} 52 | 53 | With sudden horrified realization, Draco swept papers out of the way, hunting through the mess on his desk, until he found it. 54 | 55 | And there it was. 56 | 57 | Right in the list of people and equipment assigned to each of the three armies. 58 | 59 | \emph{Curse} Professor Quirrell! 60 | 61 | Draco had \emph{read} it and he still hadn’t \emph{seen} it— 62 | 63 | \later 64 | 65 | The afternoon sunlight poured down into the office of the Sunshine Regiment, illuminating General Granger in her chair as though she glowed with a golden aura. 66 | 67 | “How long do you think it will take Malfoy to figure it out?” said General Granger. 68 | 69 | “Not long,” said Colonel Blaise Zabini. “He may have already. How long will it take Potter to figure it out?” 70 | 71 | “Forever,” said General Granger, “unless Malfoy tells him, or one of his own soldiers realizes. Harry Potter just doesn’t think like that.” 72 | 73 | “Really?” said Captain Ernie Macmillan, looking up from one of the corner tables where he was being crushed at chess by Captain Ron Weasley. (They’d brought back all the other chairs after Malfoy had left, of course.) “I mean it seems kind of obvious to me. Who would try to come up with all the ideas just by themselves?” 74 | 75 | “Harry,” said Hermione, at exactly the same time Zabini said, “Malfoy.” 76 | 77 | “Malfoy thinks he’s way better than everyone else,” said Zabini. 78 | 79 | “And Harry…doesn’t really \emph{see} most other people like that,” said Hermione. 80 | 81 | It was kind of sad, actually. Harry had grown up very, very alone. It wasn’t that he went around thinking in words that only geniuses had a right to exist. It just wouldn’t \emph{occur} to him that anyone in Hermione’s army besides Hermione could have any good ideas. 82 | 83 | “Anyhow,” Hermione said. “Captains Goldstein and Weasley, you’re on duty for thinking up strategic ideas for our next battle. Captains Macmillan and Susan—sorry, I mean Macmillan and Bones—try to come up with some tactics we can use, also any training you think we should try. Oh, and congratulations on your marching song, Captain Goldstein, I think it was a big plus for \emph{esprit de corps}.” 84 | 85 | “What’re you doing?” said Susan. “And Colonel Zabini?” 86 | 87 | Hermione stood up out of her chair, stretching. “I’ll try to figure out what Harry Potter is thinking and Colonel Zabini will try to figure out what Draco Malfoy might do, and both of us will join you again after we come up with something. I’m going to walk while I think. Zabini, you want to come along?” 88 | 89 | “Yes, General,” said Zabini stiffly. 90 | 91 | It hadn’t been meant as an order. Hermione sighed to herself a little. This was going to take some getting used to, and although Zabini’s first idea had certainly worked, she wasn’t \emph{quite} sure that Professor Quirrell’s quote mixture of positive and negative incentives unquote would be enough to keep the Slytherin fully on her side until December when traitors would be allowed for the first time… 92 | 93 | She still had no idea what she was going to do with Professor Quirrell’s Christmas wish, either. Maybe she’d just ask Mandy if she wanted anything, when the time came around. 94 | 95 | % LocalWords: arry 96 | -------------------------------------------------------------------------------- /chapters/hpmor-chapter-032.tex: -------------------------------------------------------------------------------- 1 | \chapter{Interlude: Personal Financial Management} 2 | 3 | \lettrine[ante=“]{B}{ut} Headmaster,” Harry argued, some of his desperation leaking into his voice, “leaving all of my assets in one undiversified vault full of gold coins—it’s crazy, Headmaster! It’s like, I don’t know, doing Transfiguration experiments without consulting a recognized authority! You just don’t do that with money!” 4 | 5 | From the lined face of the old wizard—underneath a festive holiday hat like a catastrophic crash between cars of green and red cloth—a grave, sad look peered out at Harry. 6 | 7 | “I’m sorry, Harry,” said Dumbledore, “and I do apologize, but allowing you control over your own finances would give you far too much independence of action.” 8 | 9 | Harry’s mouth opened and no sound came out. He was, literally, speechless. 10 | 11 | “I will permit you to withdraw five Galleons for Christmas presents,” said Dumbledore, “which is more than any boy your age should spend, but poses no threat, I think—” 12 | 13 | “\emph{I can’t believe you just said that!}” the words burst out of Harry’s mouth. “You \emph{admit} to being that manipulative?” 14 | 15 | “Manipulative?” said the old wizard, smiling slightly. “No, manipulative would be if I did \emph{not} admit it, or if I had some deeper motive behind the obvious. This is quite straightforward, Harry. You are not yet ready to play the game, and it would be foolish to allow you thousands of Galleons with which to upset the game board.” 16 | 17 | \later 18 | 19 | The bright hustle and bustle of Diagon Alley had increased by a hundredfold and redoubled as Christmas approached, with all the shops enshrouded in brilliant sorceries that flashed and sparkled as though the season’s spirit was about to blaze out of control and turn the whole area into a cheerful holiday crater. The streets were so crowded with witches and wizards in festive and \emph{loud} clothing that your eyes were assaulted almost as severely as your ears; and it was clear, from the bewildering variety of the shoppers, that Diagon Alley was considered an international attraction. There were witches wrapped in giant swathes of cloth like towelled mummies, and wizards in formal top hats and bath-robes, and young children barely past toddling age who were decorated with lights that blazed almost as bright as the shops themselves, as their parents took them hand in hand through that magic wonderland and let them shriek to their heart’s content. It was the season to be merry. 20 | 21 | And in the midst of all that light and cheer, a note of blackest night; a cold, dark atmosphere that cleared a few precious paces of distance even in the midst of all that crush. 22 | 23 | “No,” said Professor Quirrell, with a look of grim revulsion, like he’d just bitten into food that not only tasted horrible but was morally repugnant to boot. It was the sort of grim face an ordinary person might make after biting into a meat pie, and discovering that it was rotten and had been made from kittens. 24 | 25 | “Oh, come \emph{on},” Harry said. “You must have \emph{some} ideas.” 26 | 27 | “Mr~Potter,” Professor Quirrell said, his lips set in a thin line, “I agreed to act as your adult guardian on this expedition. I did not agree to advise you on your choice of presents. I don’t do Christmas, Mr~Potter.” 28 | 29 | “How about Newtonmas?” Harry said brightly. “Isaac Newton actually \emph{was} born on December 25th, unlike some other historical figures I could name.” 30 | 31 | This failed to impress Professor Quirrell. 32 | 33 | “Look,” said Harry, “I’m sorry, but I’ve got to do \emph{something} special for Fred and George and I’ve got no idea of my options.” 34 | 35 | Professor Quirrell made a thoughtful humming sound. “You could ask which family members they most dislike, and then hire an assassin. I know someone from a certain government-in-exile who is quite competent, and he would give you a discount on multiple Weasleys.” 36 | 37 | “\emph{This} Christmas,” Harry said, dropping his voice into a lower register, “give your friends the gift…of \emph{death}.” 38 | 39 | That made Professor Quirrell smile. It went all the way to his eyes. 40 | 41 | “Well,” said Harry, “at least you didn’t suggest getting them a pet rat—” Harry’s mouth snapped shut, and he was regretting the words almost as soon as they were out of his mouth. 42 | 43 | “Pardon me?” said Professor Quirrell. 44 | 45 | “Nothing,” Harry said at once, “long dumb story.” And telling it seemed wrong somehow, maybe because Harry was afraid Professor Quirrell would have laughed even if Bill Weasley \emph{hadn’t} been cured and everything put back to right… 46 | 47 | And where had Professor Quirrell \emph{been} that he’d never heard the story? Harry had got the impression that everyone in magical Britain knew. 48 | 49 | “Look,” said Harry, “I’m trying to \emph{solidify their loyalty to me}, you know? Make the Weasley twins my minions? Like the old saying goes: a friend isn’t someone you use once and then throw away, a friend is someone you use over and over again. Fred and George are two of the most useful friends I have in Hogwarts, Professor Quirrell, and I plan to use them over and over again. So if you’d help me be Slytherin here, and suggest something they might be \emph{very} grateful for…” Harry’s voice trailed off invitingly. 50 | 51 | You just had to pitch these things the right way. 52 | 53 | They walked on for a good way before Professor Quirrell spoke again, his voice practically dripping with distaste. “The Weasley twins are using second-hand wands, Mr~Potter. They would be reminded of your generosity with every Charm they cast.” 54 | 55 | Harry clapped his hands together in involuntary excitement. Just put the money on account at Ollivander’s, and tell Mr~Ollivander to never refund it—no, better yet, to send it to Lucius Malfoy if the Weasley twins didn’t show up before the start of their next school year. “That’s \emph{brilliant}, Professor!” 56 | 57 | Professor Quirrell did not look like he appreciated the compliment. “I suppose I can tolerate Christmas in \emph{that} spirit, Mr~Potter, though only barely.” Then he smiled slightly. “Of course that will cost you fourteen Galleons, and you only have five.” 58 | 59 | “\emph{Five} Galleons,” Harry said, with a sniff of outrage. “Just who does the Headmaster think he’s dealing with, anyway?” 60 | 61 | “I think,” said Professor Quirrell, “that it simply did not occur to him to fear the consequences if you turned your ingenuity to the task of obtaining funds. Though you were wise to lose, rather than making it an explicit threat. Out of curiosity, Mr~Potter, what \emph{would} you have done if I hadn’t turned away in boredom while you, in a fit of childish pique, counted out five Galleons worth of Knuts?” 62 | 63 | “Well, the easiest way would’ve been to borrow money from Draco Malfoy,” said Harry. 64 | 65 | Professor Quirrell chuckled briefly. “Seriously, Mr~Potter.” 66 | 67 | \emph{Duly noted.} “Probably I’d have done a few celebrity appearances. I wouldn’t resort to anything economically disruptive just for spending money.” Harry had checked, and he \emph{would} be allowed to keep the Time-Turner while he went home for the holidays, so that his sleep cycle didn’t start to rotate. But then it was \emph{also} possible that someone kept an eye out for magical day traders. The gold and silver trick would’ve taken work on the Muggle end, and seed funding, and the goblins might’ve become suspicious after the first cycle. And starting a real bank would be a \emph{lot} of work…Harry hadn’t \emph{quite} worked out any money-making methods that were fast \emph{and} certain \emph{and} safe, so he’d been very glad when Professor Quirrell had turned out to be so easily fooled. 68 | 69 | “I do hope those five Galleons will be enough to last, since you counted them so carefully,” said Professor Quirrell. “I doubt the Headmaster shall be so eager to entrust me with your vault key a second time, once he discovers I’ve been tricked.” 70 | 71 | “I’m sure you did your best,” Harry said with deep gratitude. 72 | 73 | “Do you need any assistance finding a safe place to store all those Knuts, Mr~Potter?” 74 | 75 | “Well, sort of,” said Harry. “Do you know of any good investment opportunities, Professor Quirrell?” 76 | 77 | And the two of them walked on, in their tiny sphere of silence and isolation, through the brilliant and bustling crowds; and if you looked carefully, you would see that where they went, leafy boughs faded, and flowers withered, and children’s toys that played cheerful bells changed to lower and more ominous notes. 78 | 79 | Harry \emph{did} notice, but he didn’t say anything, just smiled a little to himself. 80 | 81 | Everyone had their own way of celebrating the holidays, and the Grinch was as much a part of Christmas as Santa. 82 | 83 | % LocalWords: ut Newtonmas 84 | -------------------------------------------------------------------------------- /chapters/hpmor-chapter-037.tex: -------------------------------------------------------------------------------- 1 | \chapter{Interlude: Crossing the Boundary} 2 | 3 | \lettrinepara{I}{t} was almost midnight. 4 | 5 | \hplettrineextrapara 6 | Staying up late was simple enough for Harry. He just hadn’t used the Time-Turner. Harry followed a tradition of timing his sleep cycle to make sure he was awake for when Christmas Eve turned into Christmas Day; because while he’d never been young enough to \emph{believe} in Santa Claus, he’d once been young enough to doubt. 7 | 8 | It would have been nice if there \emph{had} been a mysterious figure who entered your house in the night and brought you presents… 9 | 10 | A chill went down Harry’s spine then. 11 | 12 | An intimation of something dreadful approaching. 13 | 14 | A creeping terror. 15 | 16 | A sense of doom. 17 | 18 | Harry sat bolt upright in bed. 19 | 20 | He looked at the window. 21 | 22 | “\emph{Professor Quirrell?}” Harry shrieked very quietly. 23 | 24 | Professor Quirrell made a slight lifting gesture, and Harry’s window seemed to fold into its frame. At once a cold gust of winter blew into the room through the gap, along with a scant few flakes of snow from a sky spotted with grey night-clouds, amid the black and stars. 25 | 26 | “Fear not, Mr~Potter,” said the Defence Professor in a normal voice. “I have Charmed your parents asleep; they shall not wake until I have departed.” 27 | 28 | “No-one’s supposed to know where I am!” said Harry, still keeping the shriek quiet. “Even owls are supposed to deliver my mail to Hogwarts, not here!” Harry had agreed to that willingly; it would be silly if a Death Eater could win the whole war at any time just by owling him a magically triggered hand grenade. 29 | 30 | Professor Quirrell was grinning, from where he stood in the backyard beyond the window. “Oh, I shouldn’t worry, Mr~Potter. You \emph{are} well protected against locating Charms, and no blood purist is likely to think of consulting a phone book.” His grin grew wider. “And it did take considerable effort to cross the wards that the Headmaster put around this house—though of course anyone who knew your address could simply wait outside and attack you the next time you left.” 31 | 32 | Harry stared at Professor Quirrell for a while. “What are you \emph{doing} here?” Harry said finally. 33 | 34 | The smile left Professor Quirrell’s face. “I’ve come to apologize, Mr~Potter,” the Defence Professor said quietly. “I should not have spoken to you so harshly as I—” 35 | 36 | “Don’t,” Harry said. He looked down at the blanket that he was clutching around his pyjamas. “Just don’t.” 37 | 38 | “Have I offended you that much?” said Professor Quirrell’s quiet voice. 39 | 40 | “No,” Harry said. “But you \emph{will} if you apologize.” 41 | 42 | “I see,” said Professor Quirrell, and in an instant his voice grew stern. “Then if I am to treat you as an equal, Mr~Potter, I should say that you have gravely violated the etiquette that holds between friendly Slytherins. If you are not currently playing the game against someone, you \emph{must} not meddle in their plans like that, not without asking them \emph{before}. For you do not know what their true design may be, nor what stakes they may lose. It would mark you as their enemy, Mr~Potter.” 43 | 44 | “I’m sorry,” Harry said, in just the same quiet tone that Professor Quirrell had used. 45 | 46 | “Apology accepted,” said Professor Quirrell. 47 | 48 | “But,” Harry said, still quietly, “you and I really must speak further on politics, at some point.” 49 | 50 | Professor Quirrell sighed. 51 | 52 | “I know you dislike condescension, Mr~Potter—” 53 | 54 | That was a bit of an understatement. 55 | 56 | “But it would be even more condescending,” said Professor Quirrell, “if I were not to state it clearly. You are missing some life experience, Mr~Potter.” 57 | 58 | “And does everyone who has sufficient life experience agree with you, then?” said Harry calmly. 59 | 60 | “What good is life experience to someone who plays Quidditch?” said Professor Quirrell, and shrugged. “I think you will change your mind in time, after every trust you place has failed you, and you have become cynical.” 61 | 62 | The Defence Professor said it as though it were the most ordinary statement in the world, framed against the black and the stars and the cloud-spotted sky, as one or two tiny snowflakes blew past him in the biting winter air. 63 | 64 | “That reminds me,” said Harry. “Merry Christmas.” 65 | 66 | “I suppose,” said Professor Quirrell. “After all, if it is \emph{not} an apology, then it must be a Christmas gift. The very first one I have ever given, in fact.” 67 | 68 | Harry hadn’t even started yet on learning Latin so he could read the experimental diary of Roger Bacon; and he hardly dared open his mouth to ask. 69 | 70 | “Put on your winter coat,” said Professor Quirrell, “or take a warming potion if you have one; and meet me outside, under the stars. I shall see if I can maintain it a little longer this time.” 71 | 72 | It took Harry a moment to process the words, and then he was dashing for the wardrobe. 73 | 74 | Professor Quirrell kept the spell of starlight going for more than an hour, though the Defence Professor’s face grew strained, and he had to sit down after a while. Harry protested only once, and was shushed. 75 | 76 | They crossed the boundary from Christmas Eve to Christmas Day within that timeless void where Earthly rotations meant nothing, the one true everlasting Silent Night. 77 | 78 | And just as promised, Harry’s parents slept soundly all through it, until Harry was safely back in his room, and the Defence Professor had gone. 79 | -------------------------------------------------------------------------------- /chapters/hpmor-chapter-044.tex: -------------------------------------------------------------------------------- 1 | \partchapter{Humanism}{II} 2 | 3 | \lettrine[ante=“]{F}{awkes},” said Albus Dumbledore, his voice cracking, “help him, please—” 4 | 5 | A brilliant creature of red-gold shuffled into the field of vision, looking down quizzically; and it began to croon. 6 | 7 | The meaningless chirps slid off the emptiness, there was nothing onto which they could hold. 8 | 9 | “You’re noisy,” said the voice, “you should die.” 10 | 11 | “Chocolate,” Albus Dumbledore said, “you need chocolate, and your friends—but I dare not take you back—” 12 | 13 | Then a shining raven came, and spoke in Professor Flitwick’s voice; whereupon Albus Dumbledore gasped in sudden comprehension, and cursed aloud at his own stupidity. 14 | 15 | The empty thing laughed at that, for it had retained the capacity to be amused. 16 | 17 | And a moment later they had all vanished in another flash of fire. 18 | 19 | \later 20 | 21 | It was only a moment, it seemed, between when Flitwick’s raven had flown to elsewhere, and when Albus Dumbledore reappeared in another crack of red and golden fire with Harry in his arms; but somehow in that time Hermione had already managed to fill her hands with chocolate. 22 | 23 | Before Hermione even got there, chocolate had zoomed off the table and straight into Harry’s mouth, which a tiny part of her mind said was unfair, \emph{he’d} had a chance to do it for \emph{her—} 24 | 25 | Harry spat the chocolate back out again. 26 | 27 | “Go away,” said a voice so empty it wasn’t even cold. 28 | 29 | … 30 | 31 | Everything seemed to freeze, everyone who had been moving toward Harry halted, all movements broken by the shock of those two dead words. 32 | 33 | Then: “No,” said Albus Dumbledore, “I will not,” and time resumed again, even as another piece of chocolate zoomed off the table and into Harry’s mouth. 34 | 35 | Hermione was close enough now that she could see Harry’s expression become more hateful, as his mouth chewed with a mechanical, unnatural rhythm. 36 | 37 | The Headmaster’s voice was grim as iron. “Filius, call Minerva, tell her she must come at speed.” 38 | 39 | Professor Flitwick whispered to his silver raven, and it flew into the air and vanished. 40 | 41 | Another piece of chocolate floated into Harry’s mouth, and the mechanical chewing continued. 42 | 43 | There were more students gathering around where the Headmaster watched over Harry with grim eyes: Neville, Seamus, Dean, Lavender, Ernie, Terry, Anthony, none of them daring to approach any closer than Hermione had. 44 | 45 | “What can we do?” said Dean in a trembling voice. 46 | 47 | “Back off and give him more space—” said the dry voice of Professor Quirrell. 48 | 49 | “No!” interrupted the Headmaster. “Let him be surrounded by his friends.” 50 | 51 | Harry swallowed his chocolate, and said in that empty voice, “They’re stupid. They should die\emph{mmmppphhh}” as another piece of chocolate entered his mouth. 52 | 53 | Hermione saw the looks of shock that crossed their faces. 54 | 55 | “He doesn’t mean it, does he?” Seamus said it like he was begging. 56 | 57 | “You don’t understand,” Hermione said, her voice breaking, “\emph{that’s not Harry—}” and she shut up before she said anything more, but she \emph{had} to say that much. 58 | 59 | She saw from the look on his face that Neville understood, and she also saw that the others didn’t. If Harry had really never thought anything like that, then being exposed to a Dementor for less than a minute wouldn’t have made him say it. That’s what they were probably thinking. 60 | 61 | Less than a minute of Dementor exposure couldn’t create a whole new evil person inside you out of nothing. 62 | 63 | But if that person was \emph{already there}— 64 | 65 | \emph{Does the Headmaster know?} 66 | 67 | Hermione looked up at the Headmaster, and found that Albus Dumbledore was gazing at \emph{her}, and that his blue eyes had grown suddenly piercing— 68 | 69 | Words came into her mind. 70 | 71 | \emph{Do not speak of it,} said the will of Dumbledore to her. 72 | 73 | \emph{You know,} thought Hermione. \emph{About his dark side.} 74 | 75 | \emph{I know. But this is beyond even that. Fawkes’s song cannot reach him, where he is lost.} 76 | 77 | \emph{What can we—} 78 | 79 | \emph{I have a plan,} sent the Headmaster. \emph{Patience.} 80 | 81 | Something about the tenor of that thought made Hermione nervous. \emph{What sort of plan?} 82 | 83 | \emph{It is better that you not know,} sent the Headmaster. 84 | 85 | Now Hermione was getting \emph{really} nervous. She didn’t know how \emph{much} the Headmaster knew about Harry’s dark side— 86 | 87 | \emph{A fair point,} sent the Headmaster. \emph{I am about to tell you; steel yourself so as not to react. Are you ready? Good. I am going to pretend to cast the Killing Curse on Professor McGonagall—\emph{do not react}, Hermione!} 88 | 89 | That took work. The Headmaster really was crazy! That wouldn’t bring Harry \emph{out} of his dark side, Harry would go \emph{completely berserk}, he’d \emph{kill} the Headmaster— 90 | 91 | \emph{But that is not true darkness,} sent Albus Dumbledore. \emph{That is protectiveness, that is love. Fawkes will be able to reach him, then. And when Harry sees that Minerva is alive after all, it will return him fully.} 92 | 93 | The thought came to Hermione— 94 | 95 | \emph{I doubt that will work,} sent the Headmaster, \emph{and you may not like the way he reacts if you try. But you may try if you wish.} 96 | 97 | She hadn’t really meant that seriously! It was too— 98 | 99 | Then her eyes moved, breaking gaze with the Headmaster, going to the boy looking around with empty, despising eyes as his mouth kept chewing and swallowing bar after bar of chocolate without effect. Her heart wrenched, and suddenly a lot of things didn’t seem to matter, only that there was a chance. 100 | 101 | \later 102 | 103 | There was a compulsion to chew and swallow chocolate. The response to compulsion was killing. 104 | 105 | People had gathered around and stared. That was annoying. The response to annoyance was killing. 106 | 107 | Other people were chattering in the background. That was insolent. The response to insolence was to inflict pain, but since none of them were useful, killing them would be simpler. 108 | 109 | Killing all those people would be difficult. But many of them didn’t trust Quirrell, who was strong. Finding exactly the right trigger could cause them all to kill each other. 110 | 111 | Then a person leaned over into the field of vision and did something completely strange, something that belonged to a foreign mode of thought, for which there was only a single response stored anywhere— 112 | 113 | \later 114 | 115 | She heard the gasps around her, and they didn’t matter, she maintained the kiss on those chocolate-smeared lips as the tears welled in her eyes. 116 | 117 | And Harry’s arms came up and pushed her away, and his lips yelled, “\emph{I told you, no kissing!}” 118 | 119 | \later 120 | 121 | “I think he’ll be all right now,” the Headmaster said, looking at where Harry was crying in great wretched sobs as Fawkes crooned over him. “Excellently done, Miss~Granger. Do you know, not even I would have expected that to actually work?” 122 | 123 | The phœnix’s song wasn’t meant for her, Hermione knew, but she could still be soothed by it, which she needed, because her life was officially over. 124 | 125 | % LocalWords: awkes mmmppphhh 126 | -------------------------------------------------------------------------------- /chapters/hpmor-chapter-053.tex: -------------------------------------------------------------------------------- 1 | \partchapter{The Stanford Prison Experiment}{III} 2 | 3 | \lettrine{T}{he} corpse of a woman opened her eyes, and the dull sunken orbs gazed out at nothing. 4 | 5 | “Mad,” Bellatrix muttered in a cracked voice, “It seems that little Bella is going mad…” 6 | 7 | Professor Quirrell had instructed Harry, calmly and precisely, how he was to act in Bellatrix’s presence; how to form the pretence he would maintain in his mind. 8 | 9 | \emph{You found it expedient, or perhaps just amusing, to make Bellatrix fall in love with you, to bind her to your service.} 10 | 11 | That love would have persisted through Azkaban, Professor Quirrell had said, because to Bellatrix it would not be a happy thought. 12 | 13 | \emph{She loves you utterly, completely, with her whole being. You do not return her love, but consider her useful. She knows this.} 14 | 15 | \emph{She was the deadliest weapon you possessed, and you called her your dear Bella.} 16 | 17 | Harry remembered it from the night the Dark Lord killed his parents: the cold amusement, the contemptuous laughter, that high-pitched voice of deathly hate. It didn’t seem at all difficult to guess what the Dark Lord would say. 18 | 19 | “I hope you are \emph{not} mad, Bella dear,” said the chill whisper. “Mad is not useful.” 20 | 21 | Bellatrix’s eyes flickered, tried to focus on empty air. 22 | 23 | “My…Lord…I waited for you but you did not come…I looked for you but I could not find you…you are alive…” All her words came out in a low mutter, if there was emotion in it, Harry could not tell. 24 | 25 | “\parsel{Show her your face,}” hissed the snake at Harry’s feet. 26 | 27 | Harry cast back the hood of the Cloak of Invisibility. 28 | 29 | The part of him that Harry had placed in control of his facial expressions looked at Bella without the slightest trace of pity, only cool, calm interest. (While in his core, Harry thought, \emph{I will save you, I will save you no matter what…}) 30 | 31 | “The scar…” muttered Bellatrix. “That child…” 32 | 33 | “So they all still think,” said Harry’s voice, and gave a thin little chuckle. “You looked for me in the wrong place, Bella dear.” 34 | 35 | (Harry had asked why Professor Quirrell couldn’t be the one to play the part of the Dark Lord, and Professor Quirrell had pointed out that there was no plausible reason for \emph{him} to be possessed by the shade of He-Who-Must-Not-Be-Named.) 36 | 37 | Bellatrix’s eyes remained fixed on Harry, she said no word. 38 | 39 | “\parsel{Say something in Parseltongue,}” hissed the snake. 40 | 41 | Harry’s face turned to the snake, to make it clear that he was addressing it, and hissed, “\parsel{One two three four five six seven eight nine ten.}” 42 | 43 | There was a pause. 44 | 45 | “Those who do not fear the darkness…” murmured Bellatrix. 46 | 47 | The snake hissed, “\parsel{Will be consumed by it.}” 48 | 49 | “Will be consumed by it,” whispered the chill voice. Harry didn’t particularly want to think about how Professor Quirrell had obtained that password. His brain, which thought about it anyway, suggested that it had probably involved a Death Eater, a quiet isolated place, and some lead-pipe Legilimency. 50 | 51 | “Your wand,” murmured Bellatrix, “I took it from the Potters’ house and hid it, my lord…under the tombstone to the right of your father’s grave…will you kill me, now, if that was all you wished of me…I think I must have always wanted you to be the one to kill me…but I can’t remember now, it must have been a happy thought…” 52 | 53 | Harry’s heart wrenched inside him, it was unbearable, and—and he couldn’t cry, couldn’t let his Patronus fade— 54 | 55 | Harry’s face showed a flicker of annoyance, and his voice was sharp as it said, “Enough foolishness. You’re to come with me, Bella dear, unless you prefer the company of the Dementors.” 56 | 57 | Bellatrix’s face twitched in brief puzzlement, the shrunken limbs did not stir. 58 | 59 | “\parsel{You’ll need to float her out,}” Harry hissed to the snake. “\parsel{She can no longer think of escaping.}” 60 | 61 | “\parsel{Yes,}” hissed the snake, “\parsel{but do not underestimate her, she was the deadliest of warriors.}” The green head dipped in warning. “\parsel{One would be wise to fear me, boy, even were I starved and nine-tenths dead; be wary of her, allow no single flaw in your pretence.}” 62 | 63 | The green snake smoothly glided out of the door. 64 | 65 | And shortly after, a man with sallow skin and a fearful expression on his bearded face cringed into the room with his wand in hand. 66 | 67 | “My Lord?” the servant said falteringly. 68 | 69 | “Do as you were instructed,” the Dark Lord whispered in that chill voice, sounding even more terrible coming from a child’s body. “And do not let your Patronus falter. Remember, if I do not return there will be no reward for you, and it will be long before your family is allowed to die.” 70 | 71 | Having spoken those dreadful words, the Dark Lord pulled his invisibility cloak over his head, and disappeared. 72 | 73 | The cringing servant opened the door to Bellatrix’s cage, and pulled a tiny needle from his robes with which he poked the human skeleton. The single drop of red blood produced was soon absorbed into a small doll, which was laid upon the floor, and the servant began to chant in a whisper. 74 | 75 | Soon another living skeleton lay upon the floor, motionless. Afterwards the servant seemed to hesitate for a moment, until from the empty air hissed an impatient command. Then the servant pointed his wand at Bellatrix and spoke a word, and the living skeleton lying on the bed was naked, and the skeleton lying on the floor was clothed in her faded dress. 76 | 77 | The servant tore a small strip of cloth from the dress, as it lay upon the seeming corpse; and from his own robes, the fearful man then produced an empty glass flask with small traces of golden fluid clinging to its inside. This flask was concealed in a corner, the strip of skirt laid over it, the leached cloth nearly blending with the grey metal wall. 78 | 79 | Another wave of the servant’s wand floated the human skeleton lying on the bed into the air, and in almost the same motion clothed her in new black robes. An ordinary-looking bottle of chocolate milk was put into her hand, and a chill whisper ordered Bellatrix to grasp the bottle and begin drinking it, which she did, her face still looking only puzzled. 80 | 81 | Then the servant turned Bellatrix invisible, and turned himself invisible, and they left. The door closed behind them all and clicked as it locked, plunging the corridor into darkness once more, unchanged but for a small flask concealed in the corner of one cell, and a fresh corpse lying upon its floor. 82 | 83 | \later 84 | 85 | Earlier, in the deserted shop, Professor Quirrell had told Harry that they were going to commit the perfect crime. 86 | 87 | Harry had unthinkingly started to repeat back the standard proverb that there was no such thing as a perfect crime, before he actually thought about it for two-thirds of a second, remembered a wiser proverb, and shut his mouth in mid-sentence. 88 | 89 | \emph{What do you think you know, and how do you think you know it?} 90 | 91 | If you \emph{did} commit the perfect crime, nobody would ever find out—so how could anyone possibly \emph{know} that there weren’t perfect crimes? 92 | 93 | And as soon as you looked at it that way, you realized that perfect crimes probably got committed \emph{all the time}, and the coroner marked it down as death by natural causes, or the newspaper reported that the shop had never been very profitable and had finally gone out of business… 94 | 95 | When Bellatrix Black’s corpse was found dead in her cell the next morning, there within the prison of Azkaban from which (everyone knew) no-one had ever escaped, nobody bothered doing an autopsy. Nobody thought twice about it. They just locked up the corridor and left, and the \emph{Daily Prophet} reported it in the obituary column the next day… 96 | 97 | …that was the perfect crime which Professor Quirrell had planned. 98 | 99 | And it wasn’t Professor Quirrell who screwed it up. 100 | -------------------------------------------------------------------------------- /chapters/hpmor-chapter-083.tex: -------------------------------------------------------------------------------- 1 | \partchapter{Taboo Trade-offs, Aftermath}{I} 2 | 3 | \lettrine{W}{hen} Padma entered the Transfiguration classroom, she saw that half the class had beaten her there, a strange, deathly silence pervading the room. Harry Potter sat alone in one corner, staring off into some unknown distance, his eyes half-lidded, nearly closed. 4 | 5 | Rumour said that the Aurors had discovered that the Defence Professor had Polyjuiced as Granger to fool Malfoy. 6 | 7 | Rumour said that Hermione had been bound by the Unbreakable Vow to be Draco Malfoy’s slave. 8 | 9 | Rumour said that Hermione had had the Dementor’s Kiss. 10 | 11 | But if \emph{that} were true, Harry Potter wouldn’t be sitting there, he would be— 12 | 13 | Padma didn’t know what General Potter would do. Her mind went blank, trying to think about it. 14 | 15 | Even when Professor McGonagall got there, the silence hadn’t broken. The Transfiguration Professor walked up to the board without a pause, erased it with a sweep of her hand, and then began to write. 16 | 17 | “Today, children,” began the calm professional voice of the Transfiguration Professor, just as though nothing out of the ordinary had happened that week, “we shall learn how much effort it takes to sustain a Transfiguration, and why, at your age, you should not even try. The original Form is not gone, only suppressed; and to maintain that suppression—” 18 | 19 | “Excuse me,” said Padma Patil. She knew her voice was shaking, she knew that she was trembling visibly, but she had to ask. “Excuse me, Professor, what happened with Miss~Granger?” 20 | 21 | The Transfiguration Professor paused at the board, and turned to look at Padma. The Professor should have looked stern, having been interrupted without a hand being raised, but instead her face was kindly. “You don’t already know, Miss~Patil? I expected that rumour would have spread.” 22 | 23 | “There’s too many rumours,” said Padma. “I don’t know what’s true.” 24 | 25 | Morag MacDougal raised her hand, then said without waiting to be called, “I told you, Padma, what’s \emph{true} is that the Wizengamot found Granger guilty and ordered her to get the Dementor’s Kiss and they brought in the Dementor and Potter glued it to the ceiling and wouldn’t let it down until—” 26 | 27 | “Oh, dear Merlin,” said Professor McGonagall, her expression growing sharp, but then she visibly calmed herself. “The affair was utterly ridiculous and I shan’t go into detail. Let it stand that Miss~Granger is resting with Madam Pomfrey for now, and coming back to classes tomorrow. And if I catch anyone bothering her, I shall turn them into glass vases and drop them.” 28 | 29 | The entire class gasped at this; it wasn’t so much that the threat was fatal, as that it broke the safety rules for Transfiguration. 30 | 31 | Professor McGonagall turned back to her board— 32 | 33 | From a corner of the classroom, another voice rose up. “What about Professor Quirrell?” said Terry Boot. “Has he been arrested?” 34 | 35 | “The Aurors are only detaining him,” said the Transfiguration Professor without turning around. “If they have not given back our Defence Professor by tomorrow, I shall ask the Headmaster to go fetch him. Though I may as well tell you now that the Board of Governors has scheduled a vote on whether Professor Quirrell’s battles shall be allowed to continue.” 36 | 37 | Kevin Entwhistle spoke. “And General Malfoy? When’s he getting back from St. Mungo’s?” 38 | 39 | The Transfiguration Professor paused in her drawing. 40 | 41 | She turned around again, more slowly, this time. 42 | 43 | “I \emph{am} sorry, Mr~Entwhistle,” said Professor McGonagall. Her face looked a little more lined than when she had entered the room. “Mr~Malfoy’s health is in no danger, I am given to understand. Unfortunately, I have received an owl from Mr~Malfoy’s father withdrawing him from Hogwarts. I am afraid he is not coming back.” 44 | -------------------------------------------------------------------------------- /chapters/hpmor-chapter-099.tex: -------------------------------------------------------------------------------- 1 | \chapter{Roles, Aftermath} 2 | 3 | \lettrine{T}{en} days later, the first dead unicorn was found in the Forbidden Forest. 4 | -------------------------------------------------------------------------------- /chapters/hpmor-chapter-106.tex: -------------------------------------------------------------------------------- 1 | \partchapter{The Truth}{III} 2 | 3 | \lettrine{A}{fter} a single step into Dumbledore’s forbidden chamber, Harry shrieked and jumped back and collided with Professor Snape, sending the two of them down in a heap. 4 | 5 | Professor Snape picked himself up and resumed standing in front of the door. His head tracked to look at Harry. “I am guarding this door at the Headmaster’s orders,” said Professor Snape in his usual sardonic tones. “Be off with you at once, or I shall deduct House Points.” 6 | 7 | This was bone-chillingly creepy, but Harry’s attention was occupied by the gigantic three-headed dog which had lunged forward, only to be stopped metres from Harry by the chains upon its three collars. 8 | 9 | “That—that—that—” Harry said. 10 | 11 | “Yes,” Professor Quirrell said from some way behind him, “that is indeed the usual occupant of that chamber, which is off-limits to all students, especially first-years.” 12 | 13 | “\emph{That’s not safe even by wizard standards!}” Within the chamber, the enormous black beast gave a multi-voiced bellow, flecks of white saliva flying from three fanged mouths. 14 | 15 | Professor Quirrell sighed. “It is enchanted not to eat students, just spit them back out through the door. Now, boy, how would you recommend that we deal with this dangerous creature?” 16 | 17 | “Uh,” Harry stuttered, trying to think over the continued roaring of the chamber’s guardian. “Uh. If it’s like the Cerberus from the Muggle legend of Orpheus and Eurydice, then we have to sing it to sleep so we can pass—” 18 | 19 | “\emph{Avada Kedavra.}” 20 | 21 | The three-headed beast fell over. 22 | 23 | Harry looked back at Professor Quirrell, who was giving him a look of extreme disappointment, as if to ask whether Harry had attended any of his classes, ever. 24 | 25 | “I sort of \emph{assumed},” Harry said, still trying to catch his breath, “that going through this challenge in any way except the one used by first-years, might perhaps trigger an \emph{alarm}.” 26 | 27 | “That is a lie, boy, you simply did not remember your lessons when you faced the occasion in true life. As for alarms, I have spent months befuddling all the wards and tripsigns upon these chambers.” 28 | 29 | “Then why did you send me in first, exactly?” 30 | 31 | Professor Quirrell just smiled. It looked significantly more evil than usual. 32 | 33 | “Never mind,” Harry said, and walked slowly into the chamber, his limbs still shaking. 34 | 35 | The chamber was all of stone, illuminated by a pale blue light that shone from arched nooks carved into the wall; as if the light of a grey sky were passing through windows, though there were no windows. At the far end of the chamber was a wooden trapdoor upon the floor, with a single ring attached. In the middle of the chamber lay a gigantic dead dog with three lifeless heads. 36 | 37 | Harry turned toward one of the arched nooks and looked inside it. There was nothing there but the sourceless blue glow, so he walked over and looked in the next one, also scrutinizing the wall as he passed. 38 | 39 | “What,” said Professor Quirrell, “are you doing?” 40 | 41 | “Searching the room,” Harry said. “There could be a clue, or an inscription, or a key we’ll need later, or something—” 42 | 43 | “Are you serious, or are you deliberately trying to slow us down? Answer in Parseltongue.” 44 | 45 | Harry looked back. “\parsel{Was serious,}” hissed Harry. “\parsel{Would have done same if came by myself.}” 46 | 47 | Professor Quirrell briefly massaged his forehead. “I confess,” he said, “that your approach would serve you well in, say, exploring the tomb of Amon-Set, so I will not quite call you an idiot, but still. The false puzzle, the outer form of the challenge, is a game meant for first-years. We simply go down through the trapdoor.” 48 | 49 | Beneath the trapdoor was a gigantic plant, something like an enormous dieffenbachia with wide leaves emerging from the central stem like a spiral staircase, but darker-coloured than a normal dieffenbachia, with tendril-like vines emerging from the central stem and hanging down. The base spread out wide with bigger leaves and tendrils, as though promising to cushion anyone’s fall. Beneath was another stone chamber like the first, with the same nooks like false arched windows, emitting the same grey-blue light. 50 | 51 | “The obvious thought is to fly down on the broomstick in my pouch, or toss something heavy to see if those tendrils are traps,” Harry said, peering down. “But I’m guessing you’ll say that we just walk down the leaves.” They certainly looked like they were meant to be a spiral staircase. 52 | 53 | “After you,” said Professor Quirrell. 54 | 55 | Harry carefully put a foot down on a leaf and found that it indeed supported his weight. Then Harry took a last look around the room before departing, to see if there was anything worth noticing. 56 | 57 | The enormous dead dog called enough attention to itself that it was hard to focus on anything else. 58 | 59 | “Professor Quirrell,” Harry said, omitting the phrase \emph{your approach to dealing with obstacles has certain drawbacks}, “what if somebody looks in the door and sees that the Cerberus is dead?” 60 | 61 | “Then they have probably already noticed something wrong with Snape,” said Professor Quirrell. “But since you insist…” The Defence Professor walked over to the three-headed corpse and placed his wand against it. He began a Latin-sounding incantation that was accompanied by a sense of rising apprehension, the Boy-Who-Lived feeling the Dark Lord’s power as he always had. 62 | 63 | The last word spoken was “\emph{Inferius}” and it was accompanied by a final surge of \emph{STOP, DON’T}. 64 | 65 | And the three-headed dog rose to a stand, its six eyes dull and blank, turning to watch the door once more. 66 | 67 | Harry stared at the huge Inferius with a horrible sinking sensation in his stomach, the third-worst feeling he’d ever felt in his life. 68 | 69 | He knew then that he’d seen and sensed this procedure before, only without the spoken Latin. 70 | 71 | The centaur who’d confronted him in the Forbidden Forest was dead. The Defence Professor had hit it with a real Avada Kedavra, not a fake one. 72 | 73 | Somewhere in the back of his mind, Harry had thought that if he could just get Hermione \emph{back} then he could return to the code of nobody dying, the ethic of Batman. Most people went through their whole lives without anyone getting killed on whatever adventures they had. 74 | 75 | And that was not to be. 76 | 77 | He hadn’t even noticed, the day he lost his last chance to win. Even if Hermione was resurrected, now, Harry wouldn’t have come through the whole mess without anyone getting killed. 78 | 79 | He hadn’t even learned the centaur’s name. 80 | 81 | Harry said nothing aloud. The Defence Professor would either confirm the accusation in Parseltongue or lie in plain speech, and either way the Defence Professor would have more reason to suspect Harry’s next actions. But Harry knew that—although he didn’t know \emph{how} he would stop Professor Quirrell, although he didn’t dare any positive act of betrayal, maybe not even making the \emph{decision}, until it was almost time to win—there would never be an amicable settlement between him and Lord Voldemort, for those two different spirits could not exist in the same world. 82 | 83 | And it was as if that resolution, that knowledge of opposition, invoked a strength from what Harry had thought of as his dark side. Harry had stopped trying to call deliberately on his dark side after the day he’d killed the troll. But his dark side had never been something separate from him. It had been something remembered from Tom Riddle. Harry didn’t know how that had happened, but taking the assumption and running with it, whatever echoes of cognitive skill were in his dark side should be there for him to use. Not as a separate mode, as Harry had conceptualized at first, but just as neural patterns with a strong tendency to chain into one another since they had once formed part of a connected whole. 84 | 85 | This unfortunately did not change that Professor Quirrell had the same skills with far more life experience backing them up, and also had the gun. 86 | 87 | Harry turned, and set foot on the giant plant, and began to walk down the spiral staircase provided by the leaves. It had taken Harry too long this time, but he’d recovered himself to some degree, despite the grief still weighing him down like thick water. It wasn’t a cold steel rod in his spine, but it was something straight and solid nonetheless. He was going to play this through, see Hermione returned to life first, and then, somehow, stop Professor Quirrell. Or stop Professor Quirrell first and then get the Stone himself. There had to be something, some possibility, some opportunity that would present itself, some way to stop Voldemort \emph{and} return Hermione to life… 88 | 89 | Harry continued his descent. 90 | 91 | Behind him, the three-headed dog waited, guarding the gate. 92 | 93 | % LocalWords: fter Amon 94 | -------------------------------------------------------------------------------- /chapters/hpmor-chapter-112.tex: -------------------------------------------------------------------------------- 1 | \partchapter{Failure}{II} 2 | 3 | \lettrine{E}{ven} as Harry had raised the gun, he’d \emph{known} he was making a mistake, his forebrain saw it and tried to stop his hand, but somehow the sick certainty didn’t propagate fast enough to prevent his finger from pulling the trigger— 4 | 5 | The echo of the shots died away within the graveyard. 6 | 7 | A fraction of a second before Harry had pulled the trigger, Voldemort had jabbed his wand downward, and a wide wall of dirt had shot up between them from the graveyard earth, intercepting all three bullets. 8 | 9 | An instant after that, pain flared in Harry’s scar, a crawling feeling came close to his skin; and then Harry’s pouch, clothes, gun, everything except his wand disappeared, leaving him naked but for the wand still in his right hand, and the glasses he’d Charmed to stick to his nose. The steel ring upon his left pinky finger was yanked off hard enough to scrape skin, taking the Transfigured jewel with it. 10 | 11 | “That,” said the voice of Voldemort from behind the dirt wall, “was \emph{absolutely} predictable. Do you really think I would shout it aloud for you to hear, if my immortality were disrupted? Really, stupid child? Lower your wand, do not raise it up again at any time, or you die upon the spot.” 12 | 13 | Harry swallowed, and pointed his wand downward. “You would have been disappointed in me,” Harry said, his own voice now unusually high, “if I’d missed an opportunity like that, I mean.” There was no time to think, and Harry’s mouth was operating on autopilot for trying to placate evil overlords that might have paternal feelings for you and whom you’d just failed to assassinate. 14 | 15 | Voldemort stepped around from behind the dirt wall, smiling that horrible smile that seemed to contain too many teeth. “I promised not to raise my hand or wand against you, child, if you did not raise your hand or wand against me.” 16 | 17 | “I used bullets,” Harry said, his voice still high. “That’s not a fist or a spell.” 18 | 19 | “My curse thinks differently. That is the puzzle piece that you missed. Did you think I would leave the peace between us to mere fortune? Before I created you, I invoked a curse upon myself and all other Tom Riddles who would descend from me. A curse to enforce that none of us would threaten the others’ immortality, so long as the other made no attempt upon our own. Typical of that ridiculous fiasco, the curse seems to have ended up binding me, but taking no hold upon the infant with his self so lost.” A low, lethal chuckle. “\parsel{But you tried to end my true life just then, stupid child. Now curse is lifted, and I may kill you any time I wish.}” 20 | 21 | “I see,” Harry said. He did see; \emph{that} was why Voldemort had told him about his horcrux system in the first place, just to set up the moment when Harry knowingly tried to violate his immortality. Harry’s mind was frantically churning through options, none of which seemed helpful. His pouch, his clothes, Harry saw by the moonlight that they all now lay in another heap by the altar, out of reach. “And now you kill me?” Harry still had his wand, presumably the Dark Lord couldn’t cast his own magic on that, or his glasses, because of the disharmony. \emph{Cast my own spell first? No, Voldemort just jabs his wand downward to make another shield, then shoots me—what else is there? \emph{What else?}} 22 | 23 | “Still a fool. If no further matters remained between us, I would already have killed you.” The dirt wall crumbled at another gesture of the wand, and Voldemort moved smoothly back toward the heap of items by the altar. The Dark Lord stretched out a hand, and the diary of Roger Bacon flew to him. “\parsel{This is, indeed, horcrux of girl-child, my superior version.}” In his other hand appeared a parchment. “\parsel{This is ritual for resurrecting her, if it must be done again. Instructions are honest, no traps. Remember that girl-child’s spirit cannot float free like ghost, Resurrection Stone is my horcrux, not hers. Do not lose her horcrux, or her spirit may be trapped within it.}” Voldemort reached down, picked up Harry’s pouch, fed both the diary and the parchment into it. “\parsel{Remember that, in case something goes wrong with next moves.}” 24 | 25 | “I don’t understand what is happening,” Harry said. There was nothing else left. “Please explain to me.” 26 | 27 | The Dark Lord was now regarding Harry with a grim look. “\parsel{When girl-child died, was in company of school’s Seer, heard prophecy spoken that you would become force of vast destruction. You would become threat beyond imagination, beyond apocalypse. That is why I went to such lengths to undo my killing of girl-child, keep it undone.}” 28 | 29 | “Are,” what “are you sure,” what. 30 | 31 | “\parsel{Dare not say specifics to you. Prophecy I heard of myself led me to fulfil it. Have not forgotten that disaster.}” Voldemort backed further away from Harry, red-slitted eyes fixed upon the Boy-Who-Lived, gun unwavering in the left hand. “\parsel{All this, all I have done, is to smash that destiny at every point of intervention. If some fate makes me fail in what comes next, idiot-child of foretold destruction, then you must kill yourself to save girl-child. Else all you claim to value dies by your own hand.}” 32 | 33 | “I,” Harry’s voice went up an octave, “I,” another octave, “I \emph{really really wouldn’t do that, seriously!}” 34 | 35 | “\parsel{Silence, fool. Remain silent unless given leave by me to speak. Keep your wand pointed down and do not raise it unless told. Else you die upon the spot, and mark that I said that in Parseltongue.}” Voldemort reached into the altar again. 36 | 37 | For a second Harry’s mind couldn’t process what he was seeing, and then he saw that Voldemort was holding a human arm, severed near the shoulder; it seemed too thin, that arm. 38 | 39 | The Dark Lord pressed his wand to the flesh above the severed arm’s elbow, and the fingers twitched, twitched like they were alive; by dim moonlight Harry saw a darker mark appear on that flesh, just above the elbow. 40 | 41 | Seconds later the first hooded figure appeared inside the graveyard with the popping sound of an Apparition. A moment after that came another pop, and then another. 42 | 43 | The hooded figures wore silver skull masks, and moonlight fled from the robes beneath them. 44 | 45 | “Master!” cried one of the black robes, the third to arrive. The voice was of peculiar timbre, from behind the silver skull mask. “Master—it has been so long—we had lost hope—” 46 | 47 | “Silence!” shouted the high voice of the Dark Lord Voldemort. Every trace of Professor Quirrell was now gone from the too-tall figure. “Train your wand upon the Boy-Who-Lived, and watch him! Do not be distracted, not by anything! Stun him at once if he moves, if he begins to speak!” 48 | 49 | More pops. Between graves, behind a tree, in all the shadowy spaces, more black robes were Apparating, all hooded and masked. Some of them voiced exclamations of joy, many of those sounding rather forced; others moved forwards as though to greet their Master. Voldemort gave them all the same instruction, except that some were commanded to Cruciate Harry Potter if he moved, others to restrain the Boy-Who-Lived if he moved, others told to fire hexes and curses, others told to cancel his magic. 50 | 51 | Thirty-seven pops, Harry counted before the black robes and skull masks seemed to stop arriving. 52 | 53 | All of them were now holding their wands pointed at Harry, aligned in a semicircle before him, where they wouldn’t get into each other’s lines of fire. 54 | 55 | Harry continued pointing his wand downward, insofar as he had been told that, if he tried to raise it, he would die. He remained silent, insofar as he had been told that if he tried to speak, he would die. He tried not to shiver in the falling night temperatures, for he was naked, and it was getting colder. 56 | 57 | \emph{You know,} said the last voice within Harry, the voice of hope, \emph{I think this is getting pretty bad even by my standards.} 58 | 59 | % LocalWords: ven 60 | -------------------------------------------------------------------------------- /chapters/hpmor-chapter-118.tex: -------------------------------------------------------------------------------- 1 | \chapter{Something to Protect: Professor Quirrell} 2 | 3 | \lettrine{T}{he} Sun shone down on the Scottish green, striking sparks of reflected white from every passing dewdrop or reflective leaf that happened to position itself correctly, a clear blue sky for a funeral. 4 | 5 | Harry had declined to give the eulogy. He’d declined for the second time. Professor Flitwick had asked him about it weeks ago in May, to give Harry time to write his lines before it would become necessary to speak; and Harry had said no then, too. 6 | 7 | So it fell to a sixth-year Gryffindor, Oliver Habryka, who had the fourth-highest total of Quirrell points among all the students, and who had been General of an army. The seventeen-year-old boy was tall and not especially handsome in solid black robes; instead of a red tie, he was wearing a purple tie such as Professor Quirrell had sometimes favoured. 8 | 9 | Speaking, under the circumstances, extempore. The previous eulogies, written well in advance, had been discarded; Oliver Habryka had a parchment in his left hand, but he wasn’t looking at it at all. 10 | 11 | “Professor Quirrell was very sick,” the tall boy said, his wavering voice falling into a hush of students, occasionally broken by a muffled sob. “I think if Professor Quirrell had been able to fight in the fullness of his power, You-Know-Who couldn’t have beat him easily, and maybe not at all. They say that David Monroe was the only one that You-Know-Who was ever afraid of, in his day. But,” Oliver’s voice broke, “Professor Quirrell wasn’t in the fullness of his power. He was very sick. He had trouble walking by himself. And he went to face the Dark Lord, alone.” 12 | 13 | There was a pause, then, while the students cried for a while. 14 | 15 | Oliver wiped away his tears with his sleeve, and spoke again. “We don’t know exactly what happened,” said Oliver. “I imagine the Dark Lord laughed at him. Maybe made fun of the Professor, for challenging him when he couldn’t stand up. Well, \emph{he’s not laughing now}, is he.” 16 | 17 | There were fierce nods from the students; all of them that Harry could see, from Gryffindor to Slytherin. 18 | 19 | “Maybe the Dark Lord knew some way of curing Professor Quirrell, You-Know-Who did come back from the dead after all. Maybe he offered Professor Quirrell his life if Professor Quirrell would serve him. Professor Quirrell smiled, and told the Dark Lord it was time for them to play a game called Who’s The Most Dangerous Wizard In The World.” 20 | 21 | \emph{If you don’t know, don’t just make stuff up.} But Harry didn’t say anything. It was what Lord Voldemort might have tried, it was what Professor Quirrell might have said back. 22 | 23 | “And they aren’t telling us everything,” Oliver said, “but we can guess what happened next. We all know that Hermione Granger, who was one of the Professor’s best students, was killed by a troll earlier this year, it must have been the Dark Lord who made it happen, just like he framed her for the Blood-Cooling Charm. Professor Quirrell knew the Dark Lord was behind it, so he stole Miss~Granger’s body and preserved it, kept it safe—” 24 | 25 | Couldn’t blame him for that one. 26 | 27 | “Then Professor Quirrell went out to face the Dark Lord. The Dark Lord killed Professor Quirrell. And Hermione Granger came back to life. They say she’s alive and whole now, and maybe something more. When the Dark Lord tried to seize her, all that was left of him afterwards was his burned robes and his hands around Miss~Granger’s throat. Just as Harry Potter was protected from the Killing Curse by his mother’s love and sacrifice, Professor Quirrell willingly going out, to face, the Dark Lord alone, must have called, Hermione Granger’s spirit, back from, from wherever, she was—” Oliver’s voice was breaking. 28 | 29 | “Not just like that,” Harry said from the front row of seats, his own voice hoarse. He \emph{had} to say something at this point, before it got out of control. If it wasn’t already out of control. “David Monroe was a powerful wizard, more powerful than anyone knew except him and me. I don’t think you can bring someone back from the dead just by sacrificing yourself. No-one should try doing it that way.” 30 | 31 | Such a beautiful story. It should have been true. \emph{It should have been true.} 32 | 33 | “I don’t know very much about the person behind the Professor,” Oliver Habryka said, after he got himself under control again. “I know David Monroe wasn’t a happy man. He never could cast a Patronus Charm.” 34 | 35 | Tears were gathering in Harry’s eyes again. It wasn’t right, it wasn’t fair, Voldemort had killed so many people, he should have died along with his followers, he didn’t deserve special treatment. But it hadn’t just been Harry’s weakness, it had been the horcruxes, Voldemort \emph{couldn’t} have been killed outright. So Harry could admit it, he was glad, he was \emph{glad} Professor Quirrell wasn’t all gone… 36 | 37 | “But I, know,” said Oliver, tears glistening on his own cheeks, “Professor Quirrell, is happy, wherever, he is now.” 38 | 39 | On Harry’s left hand, a tiny emerald glowed bright beneath the morning sun. 40 | 41 | \emph{Not Heaven, not some faraway star, not a different place but a better person, I’ll show you, some day I’ll show you how to be happy—} 42 | 43 | The tall boy glanced down at a parchment he held in his other hand, the first time he’d consulted it. “Professor Quirrell,” Oliver said, his voice now fiercer and faster, “was, by far, the best Professor of Battle Magic that Hogwarts ever had. Salazar Slytherin couldn’t have been half as good a teacher, no matter what spells he knew. Professor Quirrell told us at the beginning of this year that what he taught us would always be our firm foundation in the arts of Defence. And it will be. Forever. We’ll teach it to the new students next year, no matter who we have for a professor. The older students will teach the younger ones. That’s the solution to the curse on the Defence position. We won’t sit around waiting for authority to teach us. And we’ll make sure that Professor Quirrell’s teachings never die out of Hogwarts.” 44 | 45 | Harry looked at where Professor—no, Headmistress McGonagall—was sitting, and saw the Headmistress nodding silently, a look that was sad and stern and proud. 46 | 47 | “They haven’t let us see Miss~Granger yet,” Oliver said. His voice quavered. “The Girl-Who-Revived. But I’ll always think of the Defence Professor when I see her. His sacrifice lives on in her, just as his teachings live on in us.” Oliver glanced at where Harry sat, then looked down again at the parchment. “Here’s to Professor Quirrell, then, the best Slytherin that ever was, what every Slytherin should be! Three cheers for him!” 48 | 49 | “\emph{Huzzah! Huzzah! Huzzah!}” 50 | 51 | No-one stayed silent this time, not a single student that Harry could see. 52 | 53 | % LocalWords: Habryka 54 | -------------------------------------------------------------------------------- /chapters/hpmor-chapter-121.tex: -------------------------------------------------------------------------------- 1 | \chapter{Something to Protect: Severus Snape} 2 | 3 | \lettrine{A}{} sombre mood pervaded the Headmistress’s office. Minerva had returned after dropping off Draco and Narcissa/Nancy at St. Mungo’s, where the Lady Malfoy was being examined to see if a decade living as a Muggle had done any damage to her health; and Harry had come up to the Headmistress’s office again and then…not been able to think of priorities. There was so \emph{much} to do, so many things, that even Headmistress McGonagall didn’t seem to know where to start, and certainly not Harry. Right now Minerva was repeatedly writing words on parchment and then erasing them with a hand-wave, and Harry had closed his eyes for clarity. Was there any \emph{next} first thing that needed to happen… 4 | 5 | There came a knock upon the great oaken door that had been Dumbledore’s, and the Headmistress opened it with a word. 6 | 7 | The man who entered the Headmistress’s office appeared worn, he had discarded his wheelchair but still walked with a limp. He wore black robes that were simple, yet clean and unstained. Over his left shoulder was slung a knapsack, of sturdy grey leather set with silver filigree that held four green pearl-like stones. It looked like a thoroughly enchanted knapsack, one that could contain the contents of a Muggle house. 8 | 9 | One look at him, and Harry knew. 10 | 11 | Headmistress McGonagall sat frozen behind her new desk. 12 | 13 | Severus Snape inclined his head to her. 14 | 15 | “What is the meaning of this?” said the Headmistress, sounding…heart-sick, as if she’d known, at a glance, just like Harry had. 16 | 17 | “I resign my position as the Potions Master of Hogwarts,” the man said simply. “I will not stay to draw my last month’s salary. If there are students who have been particularly harmed by me, you may use the money for their benefit.” 18 | 19 | \emph{He knows.} The thought came to Harry, and he couldn’t have said in words just \emph{what} the Potions Master now knew; except that it was clear that Severus knew it. 20 | 21 | “Severus…” Headmistress McGonagall began. Her voice sounded hollow. “Professor Severus Snape, you may not realize how difficult it is to find Potions Masters who can safely teach Muggle-borns, or Professors sharp enough to keep Slytherin House in any semblance of order…” 22 | 23 | Again the man inclined his head. “I think it need not be said to you, Headmistress, but I recommend in the strongest possible terms that the next Head of Slytherin be nothing like me.” 24 | 25 | “Severus, you only did as Albus told you to do! You could stay on and act differently!” 26 | 27 | “Headmistress,” Harry said. His own voice seemed also hollow, and Harry wondered at it, for he hadn’t known Severus Snape that well. “If he wants to go, I think you should let him go.” 28 | 29 | \emph{Dumbledore was using him. Maybe not exactly the way Professor Quirrell thought, maybe it was prophecy rather than sabotaging Slytherin, but Dumbledore was still using him. There were things that could have been said long ago to Severus, to free him. It’s clear why Dumbledore didn’t risk that, but still, Severus wasn’t being used kindly. Even his blindness and grief were being used, the way he didn’t grasp the consequences of his actions as Potions Master…} 30 | 31 | “It is well to find you here, Mr~Potter,” Severus said. “There is unfinished business between us.” 32 | 33 | Harry didn’t know what to say, so he just nodded. 34 | 35 | Severus seemed to be having some difficulty speaking, as he stood before the two of them with the grey knapsack on his shoulder. Finally he seemed to find the words he’d come to speak. “Your mother. Lily. She was—” 36 | 37 | “I know,” Harry said, through the thickness of his throat. “You don’t have to say it.” 38 | 39 | “Lily was a fine upstanding witch, Mr~Potter. I would not have you think otherwise from any words I said to you.” 40 | 41 | “\emph{Severus?}” said Minerva McGonagall, looking as shocked as if she’d been bitten by her own shoes. 42 | 43 | The former Potions Master kept his eyes on Harry. “More than one bar lay between myself and Lily, most notably my ill-advised attempts to curry favour with the purebloods of my house. If I made it sound like one mistake upon a muddy field ended it all, if I pretended that she had no reason but shallowness not to love me, I hope your books have also told you why fools may say such things.” 44 | 45 | “They did,” Harry said. He was looking at the fine grey knapsack on Severus Snape’s left shoulder, unable to meet the Potions Master’s eyes. “They did.” 46 | 47 | “However,” the former Potions Master continued, “I’m afraid I have nothing more to say about your father than what I’ve already told you.” 48 | 49 | “\emph{Severus!}” 50 | 51 | The former Potions Master seemed to have eyes only for Harry. “The Dark Mark upon my arm is not dead, nor is the prophecy fulfilled by that story you recounted before the crowd. How did you destroy all but a remnant of the Dark Lord?” 52 | 53 | Harry hesitated. “I Obliviated most of his memories and…sealed him, I guess is how wizards say it. Even if the seal breaks, he won’t come back as himself.” 54 | 55 | Severus frowned briefly and then shrugged. “I suppose that is acceptable.” 56 | 57 | “Professor Snape,” Harry said, because this too was now his responsibility, “the Order of the Phœnix owes you for services rendered. I’m in an excellent position to repay it, both financially and magically. Just in case you want to start your next life in a position of wealth, or with better hair, or something.” 58 | 59 | “Strange words to say to such as me,” the former Potions Master said in a soft drawl. “I went to the Dark Lord intending to sell him the prophecy in exchange for Lily’s love becoming mine, by whatever darkness was required to achieve it. That is hardly something to be forgiven lightly. And then, in the years after when I was a Potions Master…that you experienced yourself. Do you think my service to the Order of the Phœnix has repaid all my sins?” 60 | 61 | “People are always broken,” Harry said, though the words stuck in his throat. “They always make mistakes. At least you tried to repay them.” 62 | 63 | “Perhaps,” said the former Potions Master. “My final duty was to fail in guarding the Stone, to be struck down. This I have done, and I survived it, which I never expected to do.” Severus was leaning against the door through which he’d entered, taking his weight off his left leg. “I would not have thought to ask for your forgiveness, but since you offer it so freely, I will accept with thanks. From this day on I wish to take less unkindly ways, and I think that is best done by starting over.” 64 | 65 | Tears glistened on Minerva McGonagall’s nose and cheeks, when she spoke her voice was without hope. “Surely you could start over inside Hogwarts.” 66 | 67 | Severus shook his head. “Too many students would remember me as the evil Potions Master. No, Minerva. I will go somewhere new, and take a new name, and find someone new to love.” 68 | 69 | “Severus Snape,” Harry said, because it was his responsibility to say it, “has all your will been done?” 70 | 71 | “Lily’s killer is vanquished,” the man said. “I am content.” 72 | 73 | The Headmistress lowered her head. “Be well, Severus,” she whispered. 74 | 75 | “I do have one last piece of advice,” Harry said. “If you want it.” 76 | 77 | “What is it?” said Severus Snape. 78 | 79 | “Ruminating about the past can contribute to depression. You have my blanket permission to just never think about your past, ever. You shouldn’t think that it’s your responsibility to Lily to bear your guilt for her, or anything like that. Just keep your mind on your future and whatever new people you meet.” 80 | 81 | “I shall take your wisdom into consideration,” Severus said neutrally. 82 | 83 | “Also, try a different brand of hair shampoo.” 84 | 85 | A wry grin crossed Severus’s face, and Harry thought it might have been, for the first time, that man’s true smile. “Drop dead, Potter.” 86 | 87 | Harry laughed. 88 | 89 | Severus laughed. 90 | 91 | Minerva was sobbing. 92 | 93 | Without saying anything else, the free man took a pinch of Floo powder, and cast it into the office’s fireplace, and strode into the green flame whispering something that nobody caught; and that was the last that anyone ever heard of Severus Snape. 94 | -------------------------------------------------------------------------------- /fonts/AlegreyaSans/AlegreyaSans-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/AlegreyaSans/AlegreyaSans-LightItalic.ttf -------------------------------------------------------------------------------- /fonts/AlegreyaSans/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Juan Pablo del Peral (juan@huertatipografica.com), with Reserved Font Names 'Alegreya Sans' 2 | 3 | 4 | 5 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 6 | This license is copied below, and is also available with a FAQ at: 7 | http://scripts.sil.org/OFL 8 | 9 | 10 | # SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 11 | 12 | 13 | ### PREAMBLE 14 | 15 | The goals of the Open Font License (OFL) are to stimulate worldwide 16 | development of collaborative font projects, to support the font creation 17 | efforts of academic and linguistic communities, and to provide a free and 18 | open framework in which fonts may be shared and improved in partnership 19 | with others. 20 | 21 | The OFL allows the licensed fonts to be used, studied, modified and 22 | redistributed freely as long as they are not sold by themselves. The 23 | fonts, including any derivative works, can be bundled, embedded, 24 | redistributed and/or sold with any software provided that any reserved 25 | names are not used by derivative works. The fonts and derivatives, 26 | however, cannot be released under any other type of license. The 27 | requirement for fonts to remain under this license does not apply 28 | to any document created using the fonts or their derivatives. 29 | 30 | ### DEFINITIONS 31 | 32 | "Font Software" refers to the set of files released by the Copyright 33 | Holder(s) under this license and clearly marked as such. This may 34 | include source files, build scripts and documentation. 35 | 36 | "Reserved Font Name" refers to any names specified as such after the 37 | copyright statement(s). 38 | 39 | "Original Version" refers to the collection of Font Software components as 40 | distributed by the Copyright Holder(s). 41 | 42 | "Modified Version" refers to any derivative made by adding to, deleting, 43 | or substituting -- in part or in whole -- any of the components of the 44 | Original Version, by changing formats or by porting the Font Software to a 45 | new environment. 46 | 47 | "Author" refers to any designer, engineer, programmer, technical 48 | writer or other person who contributed to the Font Software. 49 | 50 | ### PERMISSION & CONDITIONS 51 | 52 | Permission is hereby granted, free of charge, to any person obtaining 53 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 54 | redistribute, and sell modified and unmodified copies of the Font 55 | Software, subject to the following conditions: 56 | 57 | 1. Neither the Font Software nor any of its individual components, 58 | in Original or Modified Versions, may be sold by itself. 59 | 60 | 2. Original or Modified Versions of the Font Software may be bundled, 61 | redistributed and/or sold with any software, provided that each copy 62 | contains the above copyright notice and this license. These can be 63 | included either as stand-alone text files, human-readable headers or 64 | in the appropriate machine-readable metadata fields within text or 65 | binary files as long as those fields can be easily viewed by the user. 66 | 67 | 3. No Modified Version of the Font Software may use the Reserved Font 68 | Name(s) unless explicit written permission is granted by the corresponding 69 | Copyright Holder. This restriction only applies to the primary font name as 70 | presented to the users. 71 | 72 | 4. The name(s) of the Copyright Holder(s) or the Author(s) of the Font 73 | Software shall not be used to promote, endorse or advertise any 74 | Modified Version, except to acknowledge the contribution(s) of the 75 | Copyright Holder(s) and the Author(s) or with their explicit written 76 | permission. 77 | 78 | 5. The Font Software, modified or unmodified, in part or in whole, 79 | must be distributed entirely under this license, and must not be 80 | distributed under any other license. The requirement for fonts to 81 | remain under this license does not apply to any document created 82 | using the Font Software. 83 | 84 | ### TERMINATION 85 | 86 | This license becomes null and void if any of the above conditions are 87 | not met. 88 | 89 | ### DISCLAIMER 90 | 91 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 92 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 93 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 94 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 95 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 96 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 97 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 98 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 99 | OTHER DEALINGS IN THE FONT SOFTWARE. 100 | -------------------------------------------------------------------------------- /fonts/Florante/Florante.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/Florante/Florante.ttf -------------------------------------------------------------------------------- /fonts/Florante/Nyek! License.txt: -------------------------------------------------------------------------------- 1 | These fonts are for free and can be use for commercial and non-commercial purposes. These aren't professionally made--only beta test. Let me know if there are problems with spaces and kernings. 2 | -------------------------------------------------------------------------------- /fonts/Licenses.md: -------------------------------------------------------------------------------- 1 | # Font Licenses 2 | 3 | There follow author license details for all the fonts supplied. Where available, a web page is given. 4 | 5 | ## Alegreya 6 | 7 | By Juan Pablo del Peral, distributed under the SIL Open Font License 1.1; see `alegreya/SIL Open Font License.txt`. 8 | 9 | ## Alegreya Sans 10 | 11 | By Juan Pablo del Paral, distributed under the SIL Open Font License 1.1; see `AlegreyaSans/LICENSE.md`. 12 | 13 | ## Architects Daughter 14 | 15 | By Kimberley Gesweln, distributed under the SIL Open Font License 1.1; see `architects-daughter/SIL Open Font License.txt`. 16 | 17 | ## Florante at Laura 18 | 19 | Free font by Nyek! Pinoy Komek Fonts; see `Florante/Nyek! License.txt`. 20 | 21 | ## Lumos 22 | 23 | Freeware by Sarah McFalls; see `lumos/readme.txt`. The web page listed there is now at: http://www.geocities.ws/carpesaponem/lumos.htm 24 | 25 | ## Miscelanea 26 | 27 | FIXME: This contains the star glyphs for the 3-star divider. The author and license are currently unknown, but the font seems to have been produced specifically for HPMOR. 28 | 29 | ## NarniaBLL 30 | 31 | Freeware for personal use only by Luis Huacuja García; see `narnia_bll/SpecialReadMe.txt`. 32 | 33 | ## Ringbearer 34 | 35 | Freeware for non-commercial use only by Pete Klassen; see `ringbearer/readme.html`. 36 | 37 | ## Thundercats 38 | 39 | Freeware by Neale Davidson. Redistribution not allowed without written consent; this consent was obtained on 26th May 2017. See `thundercats/Thundercats.txt`. 40 | 41 | ## Twilight 42 | 43 | Freeware by sheslikeadream; see http://www.fonts2u.com/twilight.font 44 | -------------------------------------------------------------------------------- /fonts/Miscelanea.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/Miscelanea.ttf -------------------------------------------------------------------------------- /fonts/Parseltongue/PARSELTO.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/Parseltongue/PARSELTO.TTF -------------------------------------------------------------------------------- /fonts/Parseltongue/Parseltongue.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/Parseltongue/Parseltongue.ttf -------------------------------------------------------------------------------- /fonts/Parseltongue/readme.txt: -------------------------------------------------------------------------------- 1 | Original font: https://www.harrypotterfanzone.com/fonts/parseltongue-font/ 2 | yeKcim adds accents: 2022-02-27 3 | -------------------------------------------------------------------------------- /fonts/Twilight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/Twilight.ttf -------------------------------------------------------------------------------- /fonts/alegreya/Alegreya-Black.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/Alegreya-Black.otf -------------------------------------------------------------------------------- /fonts/alegreya/Alegreya-BlackItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/Alegreya-BlackItalic.otf -------------------------------------------------------------------------------- /fonts/alegreya/Alegreya-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/Alegreya-Bold.otf -------------------------------------------------------------------------------- /fonts/alegreya/Alegreya-BoldItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/Alegreya-BoldItalic.otf -------------------------------------------------------------------------------- /fonts/alegreya/Alegreya-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/Alegreya-Italic.otf -------------------------------------------------------------------------------- /fonts/alegreya/Alegreya-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/Alegreya-Regular.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSC-Black.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSC-Black.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSC-BlackItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSC-BlackItalic.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSC-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSC-Bold.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSC-BoldItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSC-BoldItalic.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSC-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSC-Italic.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSC-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSC-Regular.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSans-Black.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSans-Black.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSans-BlackItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSans-BlackItalic.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSans-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSans-Bold.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSans-BoldItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSans-BoldItalic.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSans-ExtraBold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSans-ExtraBold.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSans-ExtraBoldItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSans-ExtraBoldItalic.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSans-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSans-Italic.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSans-Light.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSans-Light.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSans-LightItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSans-LightItalic.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSans-Medium.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSans-Medium.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSans-MediumItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSans-MediumItalic.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSans-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSans-Regular.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSans-Thin.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSans-Thin.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSans-ThinItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSans-ThinItalic.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSansSC-Black.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSansSC-Black.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSansSC-BlackItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSansSC-BlackItalic.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSansSC-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSansSC-Bold.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSansSC-BoldItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSansSC-BoldItalic.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSansSC-ExtraBold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSansSC-ExtraBold.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSansSC-ExtraBoldItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSansSC-ExtraBoldItalic.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSansSC-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSansSC-Italic.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSansSC-Light.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSansSC-Light.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSansSC-LightItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSansSC-LightItalic.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSansSC-Medium.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSansSC-Medium.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSansSC-MediumItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSansSC-MediumItalic.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSansSC-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSansSC-Regular.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSansSC-Thin.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSansSC-Thin.otf -------------------------------------------------------------------------------- /fonts/alegreya/AlegreyaSansSC-ThinItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/alegreya/AlegreyaSansSC-ThinItalic.otf -------------------------------------------------------------------------------- /fonts/alegreya/SIL Open Font License.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Juan Pablo del Peral (juan@huertatipografica.com.ar), with Reserved Font Names 'Alegreya Sans' 2 | 3 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 4 | This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL 5 | 6 | ----------------------------------------------------------- 7 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 8 | ----------------------------------------------------------- 9 | 10 | PREAMBLE 11 | The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. 12 | 13 | The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. 14 | 15 | DEFINITIONS 16 | "Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. 17 | 18 | "Reserved Font Name" refers to any names specified as such after the copyright statement(s). 19 | 20 | "Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s). 21 | 22 | "Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. 23 | 24 | "Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. 25 | 26 | PERMISSION & CONDITIONS 27 | Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: 28 | 29 | 1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. 30 | 31 | 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. 32 | 33 | 3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. 34 | 35 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. 36 | 37 | 5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. 38 | 39 | TERMINATION 40 | This license becomes null and void if any of the above conditions are not met. 41 | 42 | DISCLAIMER 43 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. 44 | -------------------------------------------------------------------------------- /fonts/architects-daughter/ArchitectsDaughter.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/architects-daughter/ArchitectsDaughter.ttf -------------------------------------------------------------------------------- /fonts/architects-daughter/SIL Open Font License.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Kimberly Geswein (kimberlygeswein.com) 2 | 3 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 4 | This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL 5 | 6 | ----------------------------------------------------------- 7 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 8 | ----------------------------------------------------------- 9 | 10 | PREAMBLE 11 | The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. 12 | 13 | The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. 14 | 15 | DEFINITIONS 16 | "Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. 17 | 18 | "Reserved Font Name" refers to any names specified as such after the copyright statement(s). 19 | 20 | "Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s). 21 | 22 | "Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. 23 | 24 | "Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. 25 | 26 | PERMISSION & CONDITIONS 27 | Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: 28 | 29 | 1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. 30 | 31 | 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. 32 | 33 | 3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. 34 | 35 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. 36 | 37 | 5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. 38 | 39 | TERMINATION 40 | This license becomes null and void if any of the above conditions are not met. 41 | 42 | DISCLAIMER 43 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. 44 | -------------------------------------------------------------------------------- /fonts/automobile_contest/Automobile Contest.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/automobile_contest/Automobile Contest.otf -------------------------------------------------------------------------------- /fonts/automobile_contest/Automobile Contest.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/automobile_contest/Automobile Contest.ttf -------------------------------------------------------------------------------- /fonts/gabriele_bad_ah/gabriele-bad.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/gabriele_bad_ah/gabriele-bad.ttf -------------------------------------------------------------------------------- /fonts/gabriele_bad_ah/gabriele.txt: -------------------------------------------------------------------------------- 1 | Gabriele Font Series 2 | ==================== 3 | Gabriele was the name of his granddaughter. In 1957 Max Grundig, German industrialist, bought the two companies Triumph and Adler and merged them into his office machine label 'Triumph Adler'. Thus, 'Gabriele' became the name of a popular series of typewriters in postwar Germany. 4 | 5 | We have chosen this name for our series of typewriter fonts in reminiscence of those machines and all the ladies (called Gabriele or not) that used to type on them from the 1950s to the '80s. 6 | 7 | Ah, yes, another typewriter font. 8 | 9 | Well sort of. We are aware that there are quite a few of them around. But unlike Gabriele, most are not free for commercial use and/or have problems with umlauts and other extended characters. Gabriele has a complete West European charset, the ribbon members even many East European characters. These are monospaced fonts. The characters have all the same width - with the exception of the "ellipsis" character ("...") which is of course three spaces wide. Naturally, these fonts have and need no kerning. 10 | 11 | The Ribbon members of the Gabriele are based on the Dave-Rakowski font "Harting". On his former font activity Dave says on his web site http://home.earthlink.net/~ziodavino/album1_009.htm: 12 | "At this point, I'm no longer interested in the care and feeding of typefaces, and am ignoring any e-mails about fonts that come my way. Y'all may continue to do what you wish with the shareware fonts". 13 | On this basis I have refrained from bothering Dave and have done as I wished. 14 | 15 | Gabriele Bad is named after the somewhat darker and grungy look. Inside, she's really nice. Looking similar to the other two but not based on Rakowski's work. This is the darkest one of the three. She's not so good at Eastern European languages, but she can type Turkish fluently. 16 | 17 | All three fonts are free to use personally, publicly and commercially. Please respect the following license for redistribution. 18 | 19 | 20 | LICENSE 21 | ======= 22 | Use 23 | --- 24 | You may use this font software free of charge and at your own risk for both personal and commercial use. 25 | 26 | Conversion and modification 27 | --------------------------- 28 | You may convert this font to other formats including web font formats or modify it for your own purposes. You may use web font formats of this font to display text on your web pages, but you may not explicitly offer converted or modified versions of this font software for download or re-use by others, unless you have received permission in writing to do so. 29 | 30 | Distribution 31 | ------------ 32 | You may distribute this font on digital media or as a download on your website as long as you comply with the following rules. Violation of one or more of these rules terminates your distribution license and you have to stop distribution immediately: 33 | 34 | 1. You may offer the font only in form of a ZIP file containing only the font software and this readme file. 35 | 2. You are not allowed to distribute the font software without this text file. 36 | 3. You may not redistribute modified or converted copies of the font software (see above). 37 | 4. You may not add advertising messages in text or graphics form to the zip file. 38 | 5. You are not allowed to create a self-extracting executable file containing the font software or require the user to run or install a download manager or other software to get the download. 39 | 6. You may not charge money for the download. 40 | 7. If you want to distribute this font on storage media (CD DVD) produced in numbers of more than 50 identical copies, you must send Fontgrube a specimen copy. 41 | -------------------------------------------------------------------------------- /fonts/graphe/Graphe_Alpha_alt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/graphe/Graphe_Alpha_alt.ttf -------------------------------------------------------------------------------- /fonts/lumos/Lumos.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/lumos/Lumos.ttf -------------------------------------------------------------------------------- /fonts/lumos/readme.txt: -------------------------------------------------------------------------------- 1 | 2024, norwd note: ĉĝĥĵŝŭ… added 2 | 2022, yeKcim note: éêèàœ… added 3 | 4 | N.B. This version of Lumos has had some glyphs added for HPMOR 5 | 6 | 7 | --------------------------------------------------August 4, 2000------ 8 | readme altered 11-3-01 9 | Hi there! Thanks for checking out Lumos v.1, a freeware font inspired 10 | by the Harry Potter books! I made this font after long unsuccessful 11 | searches for the display font used in the US editions of Harry Potter. 12 | I am excited to use the font, and I am equally happy to share it with 13 | other fans of J.K. Rowling's fabulous books. 14 | 15 | TO USE THIS FONT: copy lumos.ttf to your Fonts folder in the Windows 16 | directory. 17 | 18 | You can use it in CAPS ONLY for a more true-to-the-book look, or use 19 | the 'small-caps' (lowercase) letters which have a few quirky variations. 20 | Don't forget to be on the lookout for the hidden dingbats -- I think I 21 | put in six. If you look really hard, you might find the super-tiny 22 | golden snitch! :-) 23 | 24 | You are welcome to share this font with your friends. Please distribute 25 | it with this readme (the zip file is an easy way to pass it along!) 26 | 27 | Enjoy! 28 | ><> Sarah McFalls 29 | CarpeSaponem Fonts 30 | hedwig@owlmail.com <---contact me here w/any questions! 31 | http://www.geocities.com/carpesaponem/ 32 | -------------------------------------------------------------------------------- /fonts/narnia_bll/NarniaBLL.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/narnia_bll/NarniaBLL.ttf -------------------------------------------------------------------------------- /fonts/narnia_bll/SpecialReadMe.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/narnia_bll/SpecialReadMe.txt -------------------------------------------------------------------------------- /fonts/ringbearer/RingBearer.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/ringbearer/RingBearer.ttf -------------------------------------------------------------------------------- /fonts/ringbearer/liesmich.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/ringbearer/liesmich.html -------------------------------------------------------------------------------- /fonts/ringbearer/readme.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/ringbearer/readme.html -------------------------------------------------------------------------------- /fonts/thundercats/Thundercats.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/fonts/thundercats/Thundercats.ttf -------------------------------------------------------------------------------- /fonts/thundercats/Thundercats.txt: -------------------------------------------------------------------------------- 1 | Thundercats (True Type Font) 2 | ---------------------------- 3 | Based on the logo from the toyline and cartoon. Lots of sharp angles and 4 | 'mis-sized' letters to give a stylized fantasy look. 5 | 6 | Legal Notice 7 | ------------ 8 | This font is released as freeware. It may not be sold, manipulated, edited, 9 | or redistributed without direct written consent by Neale Davidson. It may be 10 | used without royalties for any reasonable purpose. 11 | 12 | Version Information 13 | ------------------- 14 | 1.00 - August 28, 2000 15 | 16 | Special Symbols 17 | --------------- 18 | 19 | '@' - Thundercats logo 20 | 21 | 22 | Written permission for distribution with HPMOR: 23 | 24 | From: Pixelsagas Contact 25 | To: Reuben Thomas 26 | Date: Thu, 25 May 2017 20:16:04 -0400 27 | 28 | Thanks for checking with me! The biggest concern was that it would 29 | get “wild” without the license text along with it or resold in a 30 | bundle. As long as the license stays paired up as it is in the GitHub, this 31 | should be fine. 32 | 33 | Enjoy! 34 | -------------------------------------------------------------------------------- /hpmor-1.tex: -------------------------------------------------------------------------------- 1 | \RequirePackage{layout/hp-book} 2 | 3 | \begin{document} 4 | { 5 | \pagestyle{empty} 6 | \input{layout/hpmor-title-1} 7 | \input{layout/hp-intro} 8 | \pagenumbering{gobble} 9 | \input{layout/hp-contents} 10 | \cleartorecto 11 | } 12 | \pagenumbering{arabic} 13 | 14 | \include{chapters/hpmor-chapter-000} 15 | \include{chapters/hpmor-chapter-001} 16 | \include{chapters/hpmor-chapter-002} 17 | \include{chapters/hpmor-chapter-003} 18 | \include{chapters/hpmor-chapter-004} 19 | \include{chapters/hpmor-chapter-005} 20 | \include{chapters/hpmor-chapter-006} 21 | \include{chapters/hpmor-chapter-007} 22 | \include{chapters/hpmor-chapter-008} 23 | \include{chapters/hpmor-chapter-009} 24 | \include{chapters/hpmor-chapter-010} 25 | \include{chapters/hpmor-chapter-012} 26 | \include{chapters/hpmor-chapter-013} 27 | \include{chapters/hpmor-chapter-014} 28 | \include{chapters/hpmor-chapter-015} 29 | \include{chapters/hpmor-chapter-016} 30 | \include{chapters/hpmor-chapter-017} 31 | \include{chapters/hpmor-chapter-018} 32 | \include{chapters/hpmor-chapter-019} 33 | \include{chapters/hpmor-chapter-020} 34 | \include{chapters/hpmor-chapter-021} 35 | 36 | \include{layout/hp-colophon} 37 | \end{document} 38 | -------------------------------------------------------------------------------- /hpmor-2.tex: -------------------------------------------------------------------------------- 1 | \RequirePackage{layout/hp-book} 2 | 3 | \begin{document} 4 | { 5 | \pagestyle{empty} 6 | \input{layout/hpmor-title-2} 7 | \input{layout/hp-intro} 8 | \pagenumbering{gobble} 9 | \input{layout/hp-contents} 10 | \cleartorecto 11 | } 12 | \pagenumbering{arabic} 13 | 14 | \include{chapters/hpmor-chapter-022} 15 | \include{chapters/hpmor-chapter-023} 16 | \include{chapters/hpmor-chapter-024} 17 | \include{chapters/hpmor-chapter-025} 18 | \include{chapters/hpmor-chapter-026} 19 | \include{chapters/hpmor-chapter-027} 20 | \include{chapters/hpmor-chapter-028} 21 | \include{chapters/hpmor-chapter-029} 22 | \include{chapters/hpmor-chapter-030} 23 | \include{chapters/hpmor-chapter-031} 24 | \include{chapters/hpmor-chapter-032} 25 | \include{chapters/hpmor-chapter-033} 26 | \include{chapters/hpmor-chapter-034} 27 | \include{chapters/hpmor-chapter-035} 28 | \include{chapters/hpmor-chapter-036} 29 | \include{chapters/hpmor-chapter-037} 30 | 31 | \include{layout/hp-colophon} 32 | \end{document} 33 | -------------------------------------------------------------------------------- /hpmor-3.tex: -------------------------------------------------------------------------------- 1 | \RequirePackage{layout/hp-book} 2 | 3 | \begin{document} 4 | { 5 | \pagestyle{empty} 6 | \input{layout/hpmor-title-3} 7 | \input{layout/hp-intro} 8 | \pagenumbering{gobble} 9 | \input{layout/hp-contents} 10 | \cleartorecto 11 | } 12 | \pagenumbering{arabic} 13 | 14 | \include{chapters/hpmor-chapter-038} 15 | \include{chapters/hpmor-chapter-039} 16 | \include{chapters/hpmor-chapter-040} 17 | \include{chapters/hpmor-chapter-041} 18 | \include{chapters/hpmor-chapter-042} 19 | \include{chapters/hpmor-chapter-043} 20 | \include{chapters/hpmor-chapter-044} 21 | \include{chapters/hpmor-chapter-045} 22 | \include{chapters/hpmor-chapter-046} 23 | \include{chapters/hpmor-chapter-047} 24 | \include{chapters/hpmor-chapter-048} 25 | \include{chapters/hpmor-chapter-049} 26 | \include{chapters/hpmor-chapter-050} 27 | \include{chapters/hpmor-chapter-051} 28 | \include{chapters/hpmor-chapter-052} 29 | \include{chapters/hpmor-chapter-053} 30 | \include{chapters/hpmor-chapter-054} 31 | \include{chapters/hpmor-chapter-055} 32 | \include{chapters/hpmor-chapter-056} 33 | \include{chapters/hpmor-chapter-057} 34 | \include{chapters/hpmor-chapter-058} 35 | \include{chapters/hpmor-chapter-059} 36 | \include{chapters/hpmor-chapter-060} 37 | \include{chapters/hpmor-chapter-061} 38 | \include{chapters/hpmor-chapter-062} 39 | \include{chapters/hpmor-chapter-063} 40 | 41 | \include{layout/hp-colophon} 42 | \end{document} 43 | -------------------------------------------------------------------------------- /hpmor-4.tex: -------------------------------------------------------------------------------- 1 | \RequirePackage{layout/hp-book} 2 | 3 | \begin{document} 4 | { 5 | \pagestyle{empty} 6 | \input{layout/hpmor-title-4} 7 | \input{layout/hp-intro} 8 | \pagenumbering{gobble} 9 | \input{layout/hp-contents} 10 | \cleartorecto 11 | } 12 | \pagenumbering{arabic} 13 | 14 | \include{chapters/hpmor-chapter-065} 15 | \include{chapters/hpmor-chapter-066} 16 | \include{chapters/hpmor-chapter-067} 17 | \include{chapters/hpmor-chapter-068} 18 | \include{chapters/hpmor-chapter-069} 19 | \include{chapters/hpmor-chapter-070} 20 | \include{chapters/hpmor-chapter-071} 21 | \include{chapters/hpmor-chapter-072} 22 | \include{chapters/hpmor-chapter-073} 23 | \include{chapters/hpmor-chapter-074} 24 | \include{chapters/hpmor-chapter-075} 25 | \include{chapters/hpmor-chapter-076} 26 | \include{chapters/hpmor-chapter-077} 27 | \include{chapters/hpmor-chapter-078} 28 | \include{chapters/hpmor-chapter-079} 29 | \include{chapters/hpmor-chapter-080} 30 | \include{chapters/hpmor-chapter-081} 31 | \include{chapters/hpmor-chapter-082} 32 | \include{chapters/hpmor-chapter-083} 33 | \include{chapters/hpmor-chapter-084} 34 | \include{chapters/hpmor-chapter-085} 35 | 36 | \include{layout/hp-colophon} 37 | \end{document} 38 | -------------------------------------------------------------------------------- /hpmor-5.tex: -------------------------------------------------------------------------------- 1 | \RequirePackage{layout/hp-book} 2 | 3 | \begin{document} 4 | { 5 | \pagestyle{empty} 6 | \input{layout/hpmor-title-5} 7 | \input{layout/hp-intro} 8 | \pagenumbering{gobble} 9 | \input{layout/hp-contents} 10 | \cleartorecto 11 | } 12 | \pagenumbering{arabic} 13 | 14 | \include{chapters/hpmor-chapter-086} 15 | \include{chapters/hpmor-chapter-087} 16 | \include{chapters/hpmor-chapter-088} 17 | \include{chapters/hpmor-chapter-089} 18 | \include{chapters/hpmor-chapter-090} 19 | \include{chapters/hpmor-chapter-091} 20 | \include{chapters/hpmor-chapter-092} 21 | \include{chapters/hpmor-chapter-093} 22 | \include{chapters/hpmor-chapter-094} 23 | \include{chapters/hpmor-chapter-095} 24 | \include{chapters/hpmor-chapter-096} 25 | \include{chapters/hpmor-chapter-097} 26 | \include{chapters/hpmor-chapter-098} 27 | \include{chapters/hpmor-chapter-099} 28 | 29 | \include{layout/hp-colophon} 30 | \end{document} 31 | -------------------------------------------------------------------------------- /hpmor-6.tex: -------------------------------------------------------------------------------- 1 | \RequirePackage{layout/hp-book} 2 | 3 | \begin{document} 4 | { 5 | \pagestyle{empty} 6 | \input{layout/hpmor-title-6} 7 | \input{layout/hp-intro} 8 | \pagenumbering{gobble} 9 | \input{layout/hp-contents} 10 | \cleartorecto 11 | } 12 | \pagenumbering{arabic} 13 | 14 | \include{chapters/hpmor-chapter-100} 15 | \include{chapters/hpmor-chapter-101} 16 | \include{chapters/hpmor-chapter-102} 17 | \include{chapters/hpmor-chapter-103} 18 | \include{chapters/hpmor-chapter-104} 19 | \include{chapters/hpmor-chapter-105} 20 | \include{chapters/hpmor-chapter-106} 21 | \include{chapters/hpmor-chapter-107} 22 | \include{chapters/hpmor-chapter-108} 23 | \include{chapters/hpmor-chapter-109} 24 | \include{chapters/hpmor-chapter-110} 25 | \include{chapters/hpmor-chapter-111} 26 | \include{chapters/hpmor-chapter-112} 27 | \include{chapters/hpmor-chapter-113} 28 | \include{chapters/hpmor-chapter-114} 29 | \include{chapters/hpmor-chapter-115} 30 | \include{chapters/hpmor-chapter-116} 31 | \include{chapters/hpmor-chapter-117} 32 | \include{chapters/hpmor-chapter-118} 33 | \include{chapters/hpmor-chapter-119} 34 | \include{chapters/hpmor-chapter-120} 35 | \include{chapters/hpmor-chapter-121} 36 | \include{chapters/hpmor-chapter-122} 37 | 38 | \include{layout/hp-colophon} 39 | \end{document} 40 | -------------------------------------------------------------------------------- /hpmor.tex: -------------------------------------------------------------------------------- 1 | \RequirePackage[pdf]{layout/hp-book} 2 | 3 | \begin{document} 4 | { 5 | \pagestyle{empty} 6 | \input{layout/hpmor-title} 7 | \input{layout/hp-intro} 8 | 9 | \chapter*{Content warnings} 10 | \thispagestyle{empty} 11 | 12 | Discussion (not depiction) of non-consensual sex: About 60\% of the way through Chapter 7; very briefly in an omake in Chapter 11. 13 | 14 | First-person depiction (experienced by viewpoint character) of intense school bullying. Starting halfway through Chapter 19. 15 | 16 | Violent character death. Chapter 89. 17 | 18 | For more information (with spoilers!), see: 19 | \begin{center}\url{https://wiki.lesswrong.com/wiki/MethodsOfRationality/TriggerWarnings}\end{center} 20 | \pagenumbering{gobble} 21 | \input{layout/hp-contents} 22 | \include{layout/hp-blurbs} 23 | \cleartorecto 24 | } 25 | \pagenumbering{arabic} 26 | \setcounter{page}{1} 27 | 28 | \include{chapters/hpmor-chapter-000} 29 | \part{Harry James Potter-Evans-Verres and the Methods of Rationality} 30 | \include{chapters/hpmor-chapter-001} 31 | \include{chapters/hpmor-chapter-002} 32 | \include{chapters/hpmor-chapter-003} 33 | \include{chapters/hpmor-chapter-004} 34 | \include{chapters/hpmor-chapter-005} 35 | \include{chapters/hpmor-chapter-006} 36 | \include{chapters/hpmor-chapter-007} 37 | \include{chapters/hpmor-chapter-008} 38 | \include{chapters/hpmor-chapter-009} 39 | \include{chapters/hpmor-chapter-010} 40 | \setcounter{chapter}{11} 41 | \include{chapters/hpmor-chapter-012} 42 | \include{chapters/hpmor-chapter-013} 43 | \include{chapters/hpmor-chapter-014} 44 | \include{chapters/hpmor-chapter-015} 45 | \include{chapters/hpmor-chapter-016} 46 | \include{chapters/hpmor-chapter-017} 47 | \include{chapters/hpmor-chapter-018} 48 | \include{chapters/hpmor-chapter-019} 49 | \include{chapters/hpmor-chapter-020} 50 | \include{chapters/hpmor-chapter-021} 51 | \part{Harry James Potter-Evans-Verres and the Professor's Games} 52 | \include{chapters/hpmor-chapter-022} 53 | \include{chapters/hpmor-chapter-023} 54 | \include{chapters/hpmor-chapter-024} 55 | \include{chapters/hpmor-chapter-025} 56 | \include{chapters/hpmor-chapter-026} 57 | \include{chapters/hpmor-chapter-027} 58 | \include{chapters/hpmor-chapter-028} 59 | \include{chapters/hpmor-chapter-029} 60 | \include{chapters/hpmor-chapter-030} 61 | \include{chapters/hpmor-chapter-031} 62 | \include{chapters/hpmor-chapter-032} 63 | \include{chapters/hpmor-chapter-033} 64 | \include{chapters/hpmor-chapter-034} 65 | \include{chapters/hpmor-chapter-035} 66 | \include{chapters/hpmor-chapter-036} 67 | \include{chapters/hpmor-chapter-037} 68 | \part{Harry James Potter-Evans-Verres and the Shadows of Death} 69 | \include{chapters/hpmor-chapter-038} 70 | \include{chapters/hpmor-chapter-039} 71 | \include{chapters/hpmor-chapter-040} 72 | \include{chapters/hpmor-chapter-041} 73 | \include{chapters/hpmor-chapter-042} 74 | \include{chapters/hpmor-chapter-043} 75 | \include{chapters/hpmor-chapter-044} 76 | \include{chapters/hpmor-chapter-045} 77 | \include{chapters/hpmor-chapter-046} 78 | \include{chapters/hpmor-chapter-047} 79 | \include{chapters/hpmor-chapter-048} 80 | \include{chapters/hpmor-chapter-049} 81 | \include{chapters/hpmor-chapter-050} 82 | \include{chapters/hpmor-chapter-051} 83 | \include{chapters/hpmor-chapter-052} 84 | \include{chapters/hpmor-chapter-053} 85 | \include{chapters/hpmor-chapter-054} 86 | \include{chapters/hpmor-chapter-055} 87 | \include{chapters/hpmor-chapter-056} 88 | \include{chapters/hpmor-chapter-057} 89 | \include{chapters/hpmor-chapter-058} 90 | \include{chapters/hpmor-chapter-059} 91 | \include{chapters/hpmor-chapter-060} 92 | \include{chapters/hpmor-chapter-061} 93 | \include{chapters/hpmor-chapter-062} 94 | \include{chapters/hpmor-chapter-063} 95 | \part{Hermione Jean Granger and the Phoenix's Call} 96 | \setcounter{chapter}{64} 97 | \include{chapters/hpmor-chapter-065} 98 | \include{chapters/hpmor-chapter-066} 99 | \include{chapters/hpmor-chapter-067} 100 | \include{chapters/hpmor-chapter-068} 101 | \include{chapters/hpmor-chapter-069} 102 | \include{chapters/hpmor-chapter-070} 103 | \include{chapters/hpmor-chapter-071} 104 | \include{chapters/hpmor-chapter-072} 105 | \include{chapters/hpmor-chapter-073} 106 | \include{chapters/hpmor-chapter-074} 107 | \include{chapters/hpmor-chapter-075} 108 | \include{chapters/hpmor-chapter-076} 109 | \include{chapters/hpmor-chapter-077} 110 | \include{chapters/hpmor-chapter-078} 111 | \include{chapters/hpmor-chapter-079} 112 | \include{chapters/hpmor-chapter-080} 113 | \include{chapters/hpmor-chapter-081} 114 | \include{chapters/hpmor-chapter-082} 115 | \include{chapters/hpmor-chapter-083} 116 | \include{chapters/hpmor-chapter-084} 117 | \include{chapters/hpmor-chapter-085} 118 | \part{Harry James Potter-Evans-Verres and the Last Enemy} 119 | \include{chapters/hpmor-chapter-086} 120 | \include{chapters/hpmor-chapter-087} 121 | \include{chapters/hpmor-chapter-088} 122 | \include{chapters/hpmor-chapter-089} 123 | \include{chapters/hpmor-chapter-090} 124 | \include{chapters/hpmor-chapter-091} 125 | \include{chapters/hpmor-chapter-092} 126 | \include{chapters/hpmor-chapter-093} 127 | \include{chapters/hpmor-chapter-094} 128 | \include{chapters/hpmor-chapter-095} 129 | \include{chapters/hpmor-chapter-096} 130 | \include{chapters/hpmor-chapter-097} 131 | \include{chapters/hpmor-chapter-098} 132 | \include{chapters/hpmor-chapter-099} 133 | \part{Harry James Potter-Evans-Verres and the Philosopher's Stone} 134 | \include{chapters/hpmor-chapter-100} 135 | \include{chapters/hpmor-chapter-101} 136 | \include{chapters/hpmor-chapter-102} 137 | \include{chapters/hpmor-chapter-103} 138 | \include{chapters/hpmor-chapter-104} 139 | \include{chapters/hpmor-chapter-105} 140 | \include{chapters/hpmor-chapter-106} 141 | \include{chapters/hpmor-chapter-107} 142 | \include{chapters/hpmor-chapter-108} 143 | \include{chapters/hpmor-chapter-109} 144 | \include{chapters/hpmor-chapter-110} 145 | \include{chapters/hpmor-chapter-111} 146 | \include{chapters/hpmor-chapter-112} 147 | \include{chapters/hpmor-chapter-113} 148 | \include{chapters/hpmor-chapter-114} 149 | \include{chapters/hpmor-chapter-115} 150 | \include{chapters/hpmor-chapter-116} 151 | \include{chapters/hpmor-chapter-117} 152 | \include{chapters/hpmor-chapter-118} 153 | \include{chapters/hpmor-chapter-119} 154 | \include{chapters/hpmor-chapter-120} 155 | \include{chapters/hpmor-chapter-121} 156 | \include{chapters/hpmor-chapter-122} 157 | \label{last:chapter} 158 | 159 | % Appendices, etc. 160 | \appendix 161 | \renewcommand\chaptername{Appendix} 162 | 163 | % \include{chapters/hp-epigraphs} 164 | \include{chapters/hpmor-chapter-011} 165 | \include{chapters/hpmor-chapter-064} 166 | \include{chapters/hp-exam} 167 | 168 | \include{layout/hp-colophon} 169 | \end{document} 170 | -------------------------------------------------------------------------------- /images/Deathly_Hallows_Sign.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/images/Deathly_Hallows_Sign.pdf -------------------------------------------------------------------------------- /images/Deathly_Hallows_Sign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/images/Deathly_Hallows_Sign.png -------------------------------------------------------------------------------- /images/bubble0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/images/bubble0.jpg -------------------------------------------------------------------------------- /images/bubble0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/images/bubble0.png -------------------------------------------------------------------------------- /images/cover0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrthomas/hpmor/3b989e2a61a6f2da983ea2287c58bbc0fb6e53a8/images/cover0.jpg -------------------------------------------------------------------------------- /latexmkrc: -------------------------------------------------------------------------------- 1 | # latexmk configuration to build HPMOR -*- mode: perl -*- 2 | 3 | use Config; 4 | use File::Spec::Functions; 5 | 6 | @default_files = ( 7 | 'hpmor', 8 | 'hpmor-1', 'hpmor-2', 'hpmor-3', 'hpmor-4', 'hpmor-5', 'hpmor-6', 9 | 'layout/hpmor-dust-jacket-1', 'layout/hpmor-dust-jacket-2', 10 | 'layout/hpmor-dust-jacket-3', 'layout/hpmor-dust-jacket-4', 11 | 'layout/hpmor-dust-jacket-5', 'layout/hpmor-dust-jacket-6', 12 | ); 13 | 14 | # Install git hooks for gitinfo2 if not already installed 15 | my $hooks_dir = catdir('.git', 'hooks'); 16 | if (-d $hooks_dir) { 17 | my $checkout = catfile($hooks_dir, 'post-checkout'); 18 | if (!-e $checkout) { 19 | use File::Copy; 20 | foreach ('post-checkout', 'post-commit', 'post-merge') { 21 | my $hook = catfile($hooks_dir, $_); 22 | copy('post-checkout', $hook) or die "Could not copy `post-checkout' to `$hook'\n"; 23 | my $mode = (stat($hook))[2]; 24 | chmod $mode | 0111, $hook; 25 | } 26 | system "git", "checkout"; # Generate .git/gitHeadInfo.gin 27 | } 28 | } 29 | 30 | # Use XeLaTeX (equivalent to command-line -xelatex option) 31 | $xelatex = "xelatex %O \"\\PassOptionsToPackage{$options}{hp-book}\\input{%S}\"" if $options; 32 | my $basedir = curdir(); 33 | if (defined($chapter) || defined($chapterfile)) { 34 | if (defined($chapter)) { 35 | die "Not in `chapters' directory" if !-d catdir('..', $hooks_dir); 36 | $basedir = updir(); 37 | $ENV{TEXINPUTS} = ".$Config{path_sep}$basedir$Config{path_sep}"; 38 | $chapterfile = 'hpmor-chapter-' . sprintf('%03d', $chapter); 39 | } else { 40 | $chapter = 1; 41 | } 42 | $xelatex = "xelatex -jobname=$chapterfile %O \"\\RequirePackage[pdf]{layout/hp-book}\\begin{document}\\setcounter{chapter}{" . ($chapter - 1) . "}\\input{$chapterfile}\\end{document}\""; 43 | } 44 | $pdf_mode = 5; 45 | $postscript_mode = $dvi_mode = 0; 46 | 47 | # Make our fonts available to TeX 48 | $ENV{TEXFONTS} = catfile($basedir, 'fonts') . catfile('', '') x 2 . $Config{path_sep}; 49 | -------------------------------------------------------------------------------- /layout/hp-blurbs.tex: -------------------------------------------------------------------------------- 1 | \makeatletter 2 | \newlength{\beforeblurbskip} 3 | \setlength{\beforeblurbskip}{.5\baselineskip} 4 | \newlength{\afterblurbskip} 5 | \setlength{\afterblurbskip}{.5\baselineskip} 6 | \newlength{\blurbwidth} 7 | \setlength{\blurbwidth}{.6\textwidth} 8 | \newlength{\blurbrule} 9 | \setlength{\blurbrule}{.4\p@} 10 | \newcommand{\blurbsize}{\small} 11 | \newcommand{\blurbflush}{flushright} 12 | 13 | \newcommand{\blurbfontsize}[1]{\def\blurbsize{#1}} 14 | \newcommand{\blurbposition}[1]{\long\def\blurbflush{#1}} 15 | \newcommand{\blurbtextposition}[1]{\def\textflush{#1}} 16 | \newcommand{\blurbsourceposition}[1]{\def\sourceflush{#1}} 17 | 18 | \newcommand{\@blurbrule}{\rule[.5ex]{\blurbwidth}{\blurbrule}} 19 | 20 | \newcommand{\@blurbtext}[1]{% 21 | \begin{minipage}{\blurbwidth}\begin{\textflush} #1\par 22 | \ifdim\blurbrule>\z@ \@blurbrule \else \vspace*{1ex} \fi 23 | \end{\textflush}\end{minipage}} 24 | 25 | \newcommand{\@blurbsource}[1]{% 26 | \begin{minipage}{\blurbwidth} 27 | \begin{\sourceflush} #1\par 28 | \end{\sourceflush}\end{minipage}} 29 | 30 | \newcommand{\blurb}[2]{ 31 | \vspace{\beforeblurbskip} 32 | {\blurbsize 33 | \begin{\blurbflush} 34 | \begin{minipage}{8cm} \@blurbtext{#1}\\ \@blurbsource{#2} \end{minipage} 35 | \end{\blurbflush} 36 | \vspace{\afterblurbskip}}} 37 | \makeatother 38 | 39 | \thispagestyle{empty} 40 | \blurb{“[...A] terrific series, subtle and dramatic and stimulating.”}{David Brin} 41 | \blurb{“Oh Thoth Trismegistus, oh Ma’at, oh Ganesha, oh sweet lady Eris… I have not laughed so hard in years!”}{Eric S. Raymond} 42 | \thispagestyle{empty} 43 | -------------------------------------------------------------------------------- /layout/hp-book.sty: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e} 2 | \ProvidesPackage{layout/hp-book} 3 | 4 | % Options 5 | \gdef\hplrmargins{1.5} 6 | \DeclareOption{pdf}{\gdef\hplrmargins{1}} 7 | \newif\ifcover\covertrue 8 | \DeclareOption{nocover}{\coverfalse} 9 | \ProcessOptions % process now as some are used immediately 10 | 11 | \documentclass[12pt,extrafontsizes,twoside,openright,final,msmallroyalvopaper]{memoir} 12 | 13 | \input{layout/hp-header} 14 | 15 | 16 | % Book-specific settings 17 | 18 | % 19 | % Set up page 20 | % FIXME: Improve the layout: margins not perhaps as wide as the default, but 21 | % wider than currently. (The type block is currently the same as for the previous, larger paper.) 22 | % 23 | \settypeblocksize{\topskip + 34\baselineskip}{352pt}{*} 24 | \setlrmargins{*}{*}{\hplrmargins} 25 | \setulmargins{*}{*}{1} 26 | \setheadfoot{\topskip + \baselineskip}{2\baselineskip} 27 | \checkandfixthelayout[fixed] 28 | 29 | 30 | % 31 | % Page header 32 | % 33 | \usepackage{graphicx} % for \reflectbox 34 | \makeevenhead{headings}{\Stars}{ 35 | \hpfont\hyperref[contents]{\textls[50]{\rightmark}}}{\reflectbox{\Stars}} 36 | \makeoddhead{headings}{\Stars}{\parbox{97mm}{\centering\hpfont\textls[50]{\leftmark}}}{\reflectbox{\Stars}} 37 | \renewcommand*{\sectionmark}[1]{} 38 | 39 | 40 | % 41 | % Page numbering/footer 42 | % 43 | \def\pageInFooter{\Star\ \hpfont\makebox[4em][c]{\textls[30]{\thepage}}\Star} 44 | \makeevenfoot{plain}{}{\pageInFooter}{} 45 | \makeoddfoot{plain}{}{\pageInFooter}{} 46 | \makeevenfoot{headings}{}{\pageInFooter}{} 47 | \makeoddfoot{headings}{}{\pageInFooter}{} 48 | 49 | 50 | % 51 | % Custom chapter style 52 | % 53 | \makeatletter 54 | \makechapterstyle{evans}{% 55 | \renewcommand*{\partnamefont}{\hpfont\huge} 56 | \renewcommand*{\partnumfont}{\partnamefont} 57 | \renewcommand*{\parttitlefont}{\hpfont\Huge} 58 | \renewcommand*{\chapnamefont}{\hpfont\large} 59 | \renewcommand*{\chapnumfont}{\chapnamefont} 60 | \renewcommand*{\chaptitlefont}{\hpfont\huge} 61 | 62 | \setlength{\beforechapskip}{4\baselineskip plus 2\baselineskip minus 2\baselineskip } 63 | \setlength{\midchapskip}{0pt} 64 | \setlength{\afterchapskip}{1\baselineskip} 65 | 66 | \renewcommand*{\printchapternum}{% 67 | \chapnumfont \hyperref[contents]{\textls[30]{ 68 | \IfInteger{\thechapter}{\NUMBERstring{chapter}}{\thechapter} 69 | }}} 70 | 71 | \renewcommand*{\printchaptername}{% 72 | \centering \chapnamefont \hyperref[contents]{\MakeUppercase{\textls[30]{\@chapapp}}} 73 | } 74 | 75 | \renewcommand*{\printchaptertitle}[1]{% 76 | \vskip 0pt\begin{center}\chaptitlefont \textls[50]{\MakeUppercase{##1}}\end{center}\par 77 | } 78 | 79 | \renewcommand*{\chaptermark}[1]{ 80 | \markboth{ 81 | \MakeUppercase{##1} 82 | }{ 83 | \MakeUppercase{\chaptername}~ 84 | \thechapter 85 | } 86 | } 87 | 88 | \renewcommand*{\tocmark}{\markboth{}{\MakeUppercase{Contents}}} 89 | \renewcommand{\tocheadstart}{\chapterheadstart} 90 | \renewcommand{\aftertoctitle}{\thispagestyle{empty}\afterchaptertitle} 91 | } 92 | \makeatother 93 | \chapterstyle{evans} 94 | 95 | \def\chapterheadstart{\vspace*{-1\baselineskip}\vspace*{-1\topskip}\vspace*{\beforechapskip}} 96 | 97 | % 98 | % Section 99 | % 100 | \setsecheadstyle{\scshape} 101 | \beforesecskip=1.5\baselineskip % skip before the heading 102 | \aftersecskip=.5\baselineskip plus .5\baselineskip % skip after the heading 103 | \setsechook{\nopagebreak\vskip 0pt plus 3\baselineskip\setsecnumformat{}} 104 | -------------------------------------------------------------------------------- /layout/hp-colophon.tex: -------------------------------------------------------------------------------- 1 | \cleartorecto 2 | {\null\vfil% 3 | \thispagestyle{empty}\noindent\rightskip=0pt plus 1fil\leftskip=0pt plus 1fil\parfillskip=0pt% 4 | \vbox{ 5 | \parshape 1 0em 18em 6 | \noindent 7 | \leftskip=0pt\rightskip=0pt\parfillskip=0pt plus 1fil{}This book was 8 | formatted by fans of the story, and built on 9 | \today\ from version \gitFirstTagDescribe. 10 | The text was set in 11 | Huerta Tipografica's Alegreya type family. 12 | Chapter headings were set in Lumos, inspired by 13 | the display font used in the US editions of the Harry Potter books, 14 | drawn by Sarah McFalls. 15 | The book was typeset with \LaTeX, and the cover artwork was created with the GIMP. 16 | The source code can be found at \url{https://github.com/rrthomas/hpmor/}. 17 | }\vskip\footskip% 18 | \vfil\vfil 19 | \newpage} 20 | 21 | % LocalWords: Huerta Tipografica's Alegreya McFalls 22 | -------------------------------------------------------------------------------- /layout/hp-contents.tex: -------------------------------------------------------------------------------- 1 | \cleartorecto 2 | \renewcommand*{\printtoctitle}[1]{\centering\Huge{\hpfont\MakeUppercase{#1}}} 3 | \setlength{\cftbeforechapterskip}{.5\baselineskip plus 12pt minus 3pt} 4 | \setlength{\cftbeforepartskip}{1\baselineskip plus 12pt minus 3pt} 5 | \renewcommand*{\cftpartleader}{\space—\space} 6 | \renewcommand*{\cftpartfillnum}[1]{% 7 | \cftpartafterpnum\par} 8 | \renewcommand*{\cftchapterleader}{\space—\space} 9 | \renewcommand*{\cftchapterfillnum}[1]{% 10 | {\cftchapterleader}\nobreak% 11 | {#1}% 12 | \cftchapterafterpnum\par} 13 | \setrmarg{0em} 14 | \setlength\cftpartindent{0pt} 15 | \setlength\cftpartnumwidth{0pt} 16 | \setlength\cftchapterindent{0pt} 17 | \setlength\cftchapternumwidth{0pt} 18 | \renewcommand*{\cftpartafterpnum}{\cftparfillskip} 19 | \renewcommand*{\cftchapterafterpnum}{\cftparfillskip} 20 | \renewcommand*{\cftpartfont}{} 21 | \renewcommand*{\cftchapterfont}{} 22 | 23 | \renewcommand\partnumberline[1]{\hfil\thispagestyle{empty}{\hpfont\textls[30]{\large\MakeUppercase{\partname} #1}}\hfil\strut\par\nopagebreak\hfil} 24 | \renewcommand\chapternumberline[1]{\hfil\thispagestyle{empty}{\hpfont\textls[30]{\IfInteger{#1}{\NUMBERstringnum{#1}}{Appendix #1}}}\hfil\strut\par\nopagebreak\hfil} 25 | 26 | \settocdepth{chapter} 27 | \phantomsection 28 | \label{contents} 29 | 30 | \thispagestyle{empty} 31 | 32 | \tableofcontents* 33 | 34 | \clearpage 35 | \thispagestyle{empty} 36 | \hbox{} 37 | -------------------------------------------------------------------------------- /layout/hp-dust-jacket.tex: -------------------------------------------------------------------------------- 1 | \input{layout/hp-paper-type} 2 | 3 | % N.B. All text and images should be 6mm away from all edges 4 | \newcounter{bookpagecount} 5 | \setcounter{bookpagecount}{\XeTeXpdfpagecount"\bookfile"} 6 | \RequirePackage{calc} % This line must be after the previous to avoid an error 7 | \newlength{\hppaperwidth} % no. of pages ÷ 2 × width per sheet 8 | \setlength{\hppaperwidth}{\bookpaper * \value{bookpagecount} / \real{2.0}} 9 | \newlength{\hpspinewidth} % paper thickness + 5mm 10 | \setlength{\hpspinewidth}{\hppaperwidth + 5mm} 11 | \makeatletter 12 | \setbox\z@=\hbox{\XeTeXpdffile"\bookfile"\relax} 13 | \newlength{\hpcoverwidth} % paper width + 8mm 14 | \setlength{\hpcoverwidth}{\the\wd\z@ + 8mm} 15 | \newlength{\hpcoverheight} % coverheight: paper height + 1mm 16 | \setlength{\hpcoverheight}{\the\ht\z@ + 1mm} 17 | \makeatother 18 | % flapwidth: 60mm+3mm each side 19 | \documentclass[12pt,coverwidth=\the\hpcoverwidth,coverheight=\the\hpcoverheight,spinewidth=\the\hpspinewidth,marklength=0mm,bleedwidth=5mm,flapwidth=63mm]{bookcover} 20 | 21 | \input{layout/hp-header} 22 | 23 | \usepackage{contour} 24 | 25 | \input{layout/hp-title} 26 | 27 | \begin{document} 28 | \begin{bookcover} 29 | \bookcovercomponent{color}{bg whole}{black} 30 | \bookcovercomponent{center}{above front}{\bfseries\color{blue}DUST JACKET} 31 | \bookcovercomponent{picture}{front}{images/cover0.jpg} 32 | \bookcovercomponent{normal}{front}{\hptitle[\coverwidth]{\fullvolumetitle{\volumenumber}}} 33 | 34 | % Spine 35 | \begin{bookcoverelement}{normal}{spine} 36 | \centering 37 | \color{white}\scshape 38 | \vspace{0.5cm}\huge \volumenumber\\[2ex]\Large 39 | \vfill 40 | \rotatebox[origin=c]{90}{\contour[120]{black}{\volumetitle}} 41 | \vfill 42 | \end{bookcoverelement} 43 | 44 | % Back cover 45 | \begin{bookcoverelement}{normal}{back} 46 | \centering 47 | \vspace{20mm} 48 | \parbox{110mm}{\color{white}\Large\raggedright 49 | Petunia married a biochemist, and Harry grew up reading science and science fiction. Then came the Hogwarts letter, and a world of intriguing new possibilities to exploit. And new friends, like Hermione Granger, and Professor McGonagall, and Professor Quirrell… 50 | } 51 | \end{bookcoverelement} 52 | 53 | % Text on the front flap 54 | \begin{bookcoverelement}{normal}{front flap} 55 | \centering 56 | \vspace{20mm} 57 | \parbox{40mm}{\color{white}\raggedright\small 58 | HPMOR comes from the world of fan-fiction. With J.~K.~Rowling’s approval, it tells the story of an alternate Harry, an auto-didact rationalist who brings all his powers to bear on the strange new vistas of the world of magic. 59 | 60 | \bigskip The books introduce the reader to the ways of thinking Yudkowsky lays out in his blog, \url{lesswrong.com}.} 61 | \end{bookcoverelement} 62 | 63 | % Text on the back flap 64 | \begin{bookcoverelement}{normal}{back flap} 65 | \centering 66 | \vspace{20mm} 67 | \parbox{40mm}{\color{white}\small\raggedright 68 | % PUT YOUR BACK DUST-FLAP TEXT HERE! 69 | } 70 | \end{bookcoverelement} 71 | 72 | \end{bookcover} 73 | \end{document} 74 | -------------------------------------------------------------------------------- /layout/hp-format.tex: -------------------------------------------------------------------------------- 1 | % This file includes all the generic formatting for HPatMoR. This mostly entails configuring 2 | % the memoir package, though “configuring” on occasion means “completely messing it up”. 3 | 4 | \RequirePackage{fmtcount} 5 | \RequirePackage{calc} 6 | 7 | % Fonts used generally (specific fonts used only once or twice are not here). 8 | \usepackage{xltxtra} 9 | \defaultfontfeatures{Ligatures={TeX}} 10 | \setmainfont[ 11 | Extension=.otf 12 | , UprightFont=*-Regular 13 | , ItalicFont=*-Italic 14 | , BoldFont=*-Bold 15 | , BoldItalicFont=*-BoldItalic 16 | , SmallCapsFont=AlegreyaSC-Regular 17 | ]{Alegreya} 18 | 19 | \newfontface\hpfont[ExternalLocation]{Lumos} 20 | \newfontface\ptsansi[ExternalLocation]{AlegreyaSans-Italic} 21 | 22 | % Drop-caps at start of chapters 23 | \renewcommand{\LettrineFontHook}{\hpfont} 24 | \renewcommand{\LettrineTextFont}{} 25 | \renewcommand{\DefaultLoversize}{.2} 26 | \renewcommand{\DefaultLraise}{0.1} 27 | 28 | % Extend lettrine cutout when more than one paragraph goes alongside the drop-cap 29 | % Copied, with different macro names, from 30 | % https://tex.stackexchange.com/questions/369868/using-lettrine-with-short-paragraphs 31 | \newcount\hplettrinecount 32 | \makeatletter 33 | \def\hplettrineextrapara{% 34 | \ifnum\prevgraf<\c@L@lines 35 | \hplettrinecount\z@ 36 | \loop 37 | \ifnum\hplettrinecount<\prevgraf 38 | \advance\hplettrinecount\@ne 39 | \afterassignment\hplettrinedima\count@\L@parshape\relax 40 | \repeat 41 | \parshape\L@parshape 42 | \fi} 43 | \def\hplettrinedima{\afterassignment\hplettrinedimb\dimen@} 44 | \def\hplettrinedimb{\afterassignment\hplettrinedef\dimen@} 45 | \def\hplettrinedef#1\relax{\edef\L@parshape{\the\numexpr\count@-1\relax\space #1}} 46 | \makeatother 47 | \newcommand{\lettrinepara}[3][]{\lettrine[nindent=0pt,#1]{#2}{#3}} 48 | 49 | % Allow linebreaks after em-dash and hyphens, except when they’re followed by punctuation 50 | \newXeTeXintercharclass \punctuationClass 51 | 52 | \XeTeXcharclass `\’ \punctuationClass 53 | \XeTeXcharclass `\‘ \punctuationClass 54 | \XeTeXcharclass `\“ \punctuationClass 55 | \XeTeXcharclass `\” \punctuationClass 56 | \XeTeXcharclass `\. \punctuationClass 57 | \XeTeXcharclass `\, \punctuationClass 58 | \XeTeXcharclass `\: \punctuationClass 59 | \XeTeXcharclass `\? \punctuationClass 60 | \XeTeXcharclass `\! \punctuationClass 61 | \XeTeXcharclass `\: \punctuationClass 62 | 63 | \newXeTeXintercharclass \digitClass 64 | \XeTeXcharclass `\0 \digitClass 65 | \XeTeXcharclass `\1 \digitClass 66 | \XeTeXcharclass `\2 \digitClass 67 | \XeTeXcharclass `\3 \digitClass 68 | \XeTeXcharclass `\4 \digitClass 69 | \XeTeXcharclass `\5 \digitClass 70 | \XeTeXcharclass `\6 \digitClass 71 | \XeTeXcharclass `\7 \digitClass 72 | \XeTeXcharclass `\8 \digitClass 73 | \XeTeXcharclass `\9 \digitClass 74 | 75 | \newXeTeXintercharclass \dashClass 76 | \XeTeXcharclass `\— \dashClass % em 77 | \XeTeXcharclass `\– \dashClass % en 78 | \XeTeXcharclass `\- \dashClass % hyphen 79 | \XeTeXcharclass `\… \dashClass 80 | 81 | \XeTeXinterchartokenstate = 1 82 | 83 | \def\morhyphenpenalty{75} 84 | \exhyphenpenalty=10000 85 | 86 | \XeTeXinterchartoks \dashClass 0 = {\hskip 0pt\penalty \morhyphenpenalty} 87 | 88 | % Adjust space around lists 89 | \setlength{\topsep}{.5\baselineskip plus 1\baselineskip minus .5\baselineskip} 90 | \setlength{\partopsep}{.5\baselineskip plus 1\baselineskip minus .5\baselineskip} 91 | 92 | % Miscellaneous global typesetting parameters 93 | \frenchspacing 94 | \setlength{\emergencystretch}{.06\textwidth} 95 | 96 | % Try to avoid excessive hyphens 97 | \doublehyphendemerits=30000 98 | \finalhyphendemerits=30000 99 | \adjdemerits=10000 100 | \brokenpenalty10000\relax 101 | 102 | % Make it easier to manage hyphenation 103 | \makeatletter 104 | \newcommand{\emdashhyp}{\leavevmode% 105 | \prw@zbreak—\discretionary{}{}{}\prw@zbreak} 106 | \makeatother 107 | 108 | % Avoid widows and orphans 109 | % https://mailman.ntg.nl/pipermail/ntg-context/2013/074250.html 110 | \widowpenalty 10000 111 | \clubpenalty 10000 112 | 113 | % Various packages used 114 | \usepackage[normalem]{ulem} 115 | \usepackage{xfrac} 116 | \usepackage{censor} 117 | \usepackage[useregional]{datetime2} 118 | \usepackage[nopagecolor=white,pagecolor=white]{pagecolor} 119 | \usepackage{afterpage} 120 | \usepackage{gitinfo2} 121 | \usepackage{hyphenat} 122 | \usepackage{comment} 123 | \usepackage{hyphenat} 124 | -------------------------------------------------------------------------------- /layout/hp-header.tex: -------------------------------------------------------------------------------- 1 | \usepackage{lettrine} % Used for the fancy caps at each start of each chapter. 2 | \usepackage{xspace} % Takes care of spaces after macros 3 | \usepackage{amsmath} % Provides the align environment, used in chapter 13 for the notes 4 | 5 | \usepackage[protrusion=true]{microtype} 6 | 7 | \usepackage{fontspec} % For the many fonts 8 | \usepackage{xunicode} 9 | 10 | \usepackage{xstring} 11 | 12 | \usepackage{eso-pic,picture} 13 | 14 | \usepackage[bookmarks=true,unicode=true,pdfborder={0 0 0}, 15 | pdftitle={Harry Potter and the Methods of Rationality}, 16 | pdfauthor={Eliezer Yudkowsky}, breaklinks={true}, 17 | pdfkeywords={Harry Potter, rationality, hpmor},pdfencoding=auto 18 | ]{hyperref} 19 | 20 | \input{layout/hp-format} 21 | \input{layout/hp-markup} 22 | 23 | \hyphenation{Her-mi-o-ne Gran-ger bru-shes Gryf-fin-dor Le-strange 24 | some-where which-ev-er Hog-warts re-pli-cat-ed ran-dom sta-tis-ti-cal 25 | Wi-zen-gam-ot an-aly-se an-aly-sis remem-ber Sly-the-rin Sly-the-rins 26 | Se-ve-rus Mc-Gon-agall Dum-ble-do-re Quir-rell Mal-foy} 27 | 28 | 29 | % Redefine \textls for XeTeX 30 | \usepackage{calc} 31 | \newcounter{hpletterspacing} 32 | \renewcommand{\textls}[2][100]{% 33 | \setcounter{hpletterspacing}{#1 / \real{10.0}}% 34 | \addfontfeature{LetterSpace=\thehpletterspacing}#2% 35 | } 36 | -------------------------------------------------------------------------------- /layout/hp-intro.tex: -------------------------------------------------------------------------------- 1 | \input{layout/hp-title} 2 | \ifcover% 3 | \newpagecolor{black}\afterpage{\restorepagecolor} 4 | \newcommand\BackgroundPic{ 5 | \put(0,0){% 6 | \parbox[b][\paperheight]{\paperwidth}{% 7 | \vfill% 8 | \centering% 9 | \includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{images/cover0.jpg}% 10 | \vfill% 11 | }}}\AddToShipoutPicture*{\BackgroundPic}% 12 | \AddToShipoutPicture*{\put(0,0){% 13 | \parbox[b][\paperheight]{\paperwidth}{% 14 | \hptitle{\fullvolumetitle{\volumenumber}}% 15 | }}}% 16 | \ % 17 | \cleartorecto 18 | \fi 19 | \begin{center} 20 | \thispagestyle{empty} 21 | {\hpfont 22 | \Huge\MakeUppercase{Harry Potter}\vspace*{0.5cm} 23 | 24 | \Large\MakeUppercase{and the Methods of Rationality} % 25 | 26 | \includegraphics[scale=0.5]{images/bubble0.jpg} 27 | 28 | \Large BY \vspace*{.25cm} 29 | 30 | \huge \MakeUppercase{Eliezer Yudkowsky}% 31 | 32 | \normalsize 33 | 34 | \vspace*{1\baselineskip} 35 | \fullvolumetitle{\volumenumber} 36 | } 37 | 38 | \vfill 39 | Find the original text, with author’s notes, fan art and other info at:\\ 40 | \url{https://hpmor.com} 41 | 42 | Home of this revised e-book version is:\\ 43 | \url{https://github.com/rrthomas/hpmor/} 44 | \end{center} 45 | 46 | \cleartoverso 47 | 48 | \begin{center} 49 | \vspace*{2cm} 50 | 51 | \thispagestyle{empty} 52 | Fanfiction based on the characters of 53 | 54 | \vspace*{.5cm} 55 | 56 | \Large \MakeUppercase{J.~K.~Rowling} \normalsize 57 | 58 | \vspace*{.5cm} 59 | 60 | and her books: 61 | 62 | \vspace*{.5cm} 63 | 64 | { 65 | \newcounter{books_list_counter} 66 | \def \hpBook #1{ 67 | \addtocounter{books_list_counter}{1} 68 | \textit{Harry Potter and the #1} \par 69 | Year \numtoName{\value{books_list_counter}} at Hogwarts 70 | \smallskip\par 71 | } 72 | \hpBook{Philosopher’s Stone} 73 | \hpBook{Chamber of Secrets} 74 | \hpBook{Prisoner of Azkaban} 75 | \hpBook{Goblet of Fire} 76 | \hpBook{Order of the Phoenix} 77 | \hpBook{Half-Blood Prince} 78 | \hpBook{Deathly Hallows} 79 | } 80 | \end{center} 81 | \cleartorecto% FIXME: For some reason, without this the contents ends up on a verso page (an extra blank page is added) 82 | 83 | % \chapter{Disclaimer} 84 | \newpage 85 | \vspace*{4cm} 86 | \begin{center} 87 | Disclaimer:\\J.~K.~Rowling owns Harry Potter,\\and no-one owns the methods of rationality. 88 | \end{center} 89 | 90 | \vfill 91 | This e-book was created at \today{}. 92 | -------------------------------------------------------------------------------- /layout/hp-markup.tex: -------------------------------------------------------------------------------- 1 | % Logical markup 2 | 3 | % These commands should be used to help make the source easy to understand 4 | % and consistently typeset. 5 | % Search for them in the source files to see how to use them. 6 | 7 | % Special types of text 8 | \newcommand{\abbrev}[1]{\textsc{\MakeLowercase{#1}}\xspace} 9 | 10 | % Common abbreviations 11 | \newcommand{\am}{~a.m.\xspace} 12 | \renewcommand{\pm}{~p.m.\xspace} 13 | \newcommand{\SPHEW}{\abbrev{SPHEW}} 14 | % Tone of voice 15 | \newcommand{\shout}[1]{\textsc{#1}} 16 | \newcommand{\scream}[1]{\MakeUppercase{#1}} 17 | \newcommand{\prophesy}[1]{\shout{#1}} 18 | 19 | % parsel 20 | \newcommand{\parselify}[1]{% 21 | \StrSubstitute{#1}{ss}{ß}[\parselstring]% 22 | \StrSubstitute{\parselstring}{s}{ss}[\parsselstring]% 23 | \StrSubstitute{\parsselstring}{ß}{sss}[\parssselstring]% 24 | } 25 | % N.B. Other commands, such as \emph, cannot be used inside \parsel 26 | % 27 | % parsel 28 | % old version of parsel 29 | \newcommand{\parsela}[1]{\parselify{#1}% 30 | {\ptsansi\parssselstring}} 31 | % 32 | % new FR version of parsel by yeKcim 33 | % note: Other commands, such as \emph, cannot be used inside \parsel 34 | \newcommand{\parselb}[1]{\parselify{\fontspec[ExternalLocation]{Parseltongue.ttf}#1}% 35 | {\ptsansi\parssselstring}} 36 | % 37 | % select one of above 38 | \newcommand{\parsel}[1]{\parsela{#1}} 39 | 40 | % \spell macro 41 | \newcommand{\spell}[1]{{\Star}\emph{#1}{\Star}} 42 | 43 | % Author’s notes 44 | % \newcommand{\authorsnotefootnotemark}{\footnotemark} 45 | % \newcommand{\authorsnotetext}[1]{\footnotetext{Author’s note: #1}} 46 | \newcommand{\authorsnotefootnotemark}{} 47 | \newcommand{\authorsnotetext}[1]{} 48 | 49 | % McGonagall's board 50 | \newcommand{\McGonagallWhiteBoard}[1]{% 51 | \begin{center} 52 | \newsavebox{\hpbox}% 53 | \fontspec[ExternalLocation,Color=AA0000]{Florante} 54 | \savebox{\hpbox}{\MakeUppercase{#1}} 55 | \vspace{0.5ex} 56 | \usebox{\hpbox} 57 | \settowidth{\versewidth}{\usebox{\hpbox}} 58 | \vskip -1ex 59 | \fontspec[ExternalLocation,Color=2020FF]{ArchitectsDaughter} 60 | \resizebox{\versewidth}{.6ex}{\rotatebox{90}{I}} 61 | \end{center}% 62 | } 63 | 64 | 65 | % Newspaper headlines 66 | 67 | \newcommand{\headline}[1]{% 68 | \begin{center}% 69 | \textsc{#1}% 70 | \end{center}} 71 | 72 | \newcommand{\inlineheadline}[1]{% 73 | \textsc{#1}% 74 | } 75 | 76 | \newcommand{\newspaperHeader}[1]{\begin{SingleSpace}\upshape #1\end{SingleSpace}} 77 | \newcommand{\newspaperName}[1]{\upshape\itshape #1} 78 | 79 | \newenvironment{headlines}{% 80 | \begin{Spacing}{0.75} 81 | \begin{center} 82 | \scshape 83 | \nonzeroparskip 84 | }{ 85 | \end{center} 86 | \end{Spacing} 87 | } 88 | 89 | 90 | % Letters / writtenNote 91 | 92 | \newenvironment{writtenNote}{% 93 | \fontspec[ExternalLocation]{Graphe_Alpha_alt.ttf}\scriptsize% 94 | \renewcommand{\emph}{\uline}% 95 | \vskip .1\baselineskip plus .1\baselineskip minus .1\baselineskip% 96 | \begin{adjustwidth}{\parindent}{\parindent}% 97 | \par\setlength{\parindent}{0pt}\setlength{\parskip}{\baselineskip}% 98 | \itshape% 99 | } 100 | {% 101 | \par 102 | \end{adjustwidth}% 103 | \vskip 1\baselineskip plus 1\baselineskip minus 1\baselineskip% 104 | } 105 | 106 | % \letterAddress 107 | \newcommand{\letterAddress}[1]{% 108 | \pagebreak[1]\fontspec[ExternalLocation]{Graphe_Alpha_alt.ttf}% 109 | \scriptsize#1\nopagebreak[4]\par% 110 | } 111 | 112 | % \letterClosing 113 | \newcommand{\letterClosing}[2][\vskip 1\baselineskip]{% 114 | \nopagebreak[4]\fontspec[ExternalLocation]{Graphe_Alpha_alt.ttf}% 115 | \par\scriptsize#1% 116 | \par\nopagebreak[5]#2% 117 | } 118 | 119 | 120 | % PartChapters 121 | % \partchapter{The Stanford Prison Experiment}{TSPE}{XIII}{Aftermaths} 122 | % TOC: TSPE part XIII: Aftermaths 123 | % Page header: The Stanford Prison Experiment XIII: \\? Aftermaths 124 | % Title: The Stanford Prison Experiment, Part XIII: \\? Aftermaths 125 | \newcommand{\partchapter}[3][\relax]{% 126 | \chapter[\texorpdfstring{#2, \abbrev{part #3}}{#2, part #3}]% 127 | [#2 #3]{#2, Part~#3#1}} 128 | \newcommand{\namedpartchapter}[5][\relax]{% 129 | \chapter[% 130 | \texorpdfstring{% 131 | \abbrev{#3, part #4}: #5}{% 132 | #3, part #4: #5}][% 133 | \mbox{#2 #4:} \mbox{#5}]{% 134 | #2, Part~#4:\protect\linebreak[1] #5#1}% 135 | } 136 | 137 | % Hanging paras for play scripts (used in Omake IV) 138 | \newenvironment{playdialog}{\begin{hangparas}{2em}{1}}{\end{hangparas}} 139 | 140 | % Chapter openings 141 | % Definition of chapterOpeningAuthorNote when they are desired to be printed 142 | % FIXME: Make the environment definition switchable with a flag 143 | % \newenvironment{chapterOpeningAuthorNote}{% 144 | % \par\noindent% 145 | % E.~Y.:~ 146 | % } 147 | % {% 148 | % \newline\rule[1ex]{\textwidth}{.1pt}\newline% 149 | % } 150 | \excludecomment{chapterOpeningAuthorNote} 151 | 152 | \newenvironment{chapterOpeningQuote}{% 153 | \parindent=0pt% 154 | \itshape} 155 | {% 156 | \\[1\baselineskip]% 157 | %\newline% 158 | %\rule[1ex]{\textwidth}{.1pt}\newline%x 159 | } 160 | 161 | % Stars and breaks 162 | 163 | % Single “magic star” decoration 164 | \newcommand{\Star}{{\fontspec[ExternalLocation]{Miscelanea.ttf}*}} 165 | 166 | % Three “magic stars” decoration 167 | \def\Stars{{\large\Star\kern-.6ex\lower1.3ex\hbox{\large\Star}\kern-.1ex\raise.2ex\hbox{\tiny\Star}\spacefactor1000}} 168 | 169 | % Text break made of \Stars (only used to define other commands) 170 | \makeatletter 171 | \def\sbre@k{\mbox{}\nobreak\hfill\mbox{}\allowbreak\rule{.60\textwidth}{.0pt}\par% 172 | \vskip 0pt plus 2\baselineskip\noindent{% 173 | \parbox[c][0pt][c]{\textwidth}{% 174 | \hfil \hbox{\lower14pt\hbox{\normalsize\Stars}}% 175 | }% 176 | }} 177 | 178 | % A standalone break 179 | \def\later{\sbre@k% 180 | \vskip 0pt plus 2\baselineskip% 181 | \par\rule{.5\textwidth}{.0pt}\vskip1pt\noindent} 182 | 183 | % A break followed by a new section 184 | \newcommand{\latersection}[1]{\sbre@k\section{#1}} 185 | \makeatother 186 | -------------------------------------------------------------------------------- /layout/hp-paper-type.tex: -------------------------------------------------------------------------------- 1 | % Paper weight used 2 | \input{layout/papers} 3 | \def\bookpaper{\lxxxgsm} 4 | -------------------------------------------------------------------------------- /layout/hp-title.tex: -------------------------------------------------------------------------------- 1 | \definecolor{gold}{rgb}{0.77,0.69,0.37} 2 | \newlength{\hptitlewidth} 3 | \newlength{\rationalh} 4 | \newcommand{\hptitle}[2][\stockwidth]{% 5 | \setlength{\hptitlewidth}{#1}% 6 | \centering\color{white}% 7 | \vskip 3cm\resizebox{.95\hptitlewidth}{!}{\textls[100]{HARRY POTTER AND THE}}% 8 | \vskip 2mm% 9 | \color{gold}% 10 | \settoheight{\rationalh}{\resizebox{.95\hptitlewidth}{!}{\textls[20]{RATIONALITY}}} 11 | \resizebox{!}{\rationalh}{\textls[50]{METHODS}}% 12 | \hfil\resizebox{!}{\rationalh}{\textls[50]{OF}}% 13 | \vskip 2mm% 14 | \resizebox{.95\hptitlewidth}{!}{\textls[20]{RATIONALITY}}% 15 | \vskip 8mm% 16 | \color{white}% 17 | \resizebox{.5\hptitlewidth}{!}{\textls[50]{\scshape{}by Eliezer Yudkowsky}}% 18 | \vfill% 19 | \textls[50]{\scshape #2}% 20 | \color{black}% 21 | \vskip 1cm\ % 22 | } 23 | \providecommand{\fullvolumetitle}[1]{Book #1: \volumetitle} 24 | -------------------------------------------------------------------------------- /layout/hpmor-dust-jacket-1.tex: -------------------------------------------------------------------------------- 1 | \def\bookfile{hpmor-1.pdf} 2 | \input{layout/hpmor-title-1} 3 | 4 | \input{layout/hp-dust-jacket} 5 | -------------------------------------------------------------------------------- /layout/hpmor-dust-jacket-2.tex: -------------------------------------------------------------------------------- 1 | \def\bookfile{hpmor-2.pdf} 2 | \input{layout/hpmor-title-2} 3 | 4 | \input{layout/hp-dust-jacket} 5 | -------------------------------------------------------------------------------- /layout/hpmor-dust-jacket-3.tex: -------------------------------------------------------------------------------- 1 | \def\bookfile{hpmor-3.pdf} 2 | \input{layout/hpmor-title-3} 3 | 4 | \input{layout/hp-dust-jacket} 5 | -------------------------------------------------------------------------------- /layout/hpmor-dust-jacket-4.tex: -------------------------------------------------------------------------------- 1 | \def\bookfile{hpmor-4.pdf} 2 | \input{layout/hpmor-title-4} 3 | 4 | \input{layout/hp-dust-jacket} 5 | -------------------------------------------------------------------------------- /layout/hpmor-dust-jacket-5.tex: -------------------------------------------------------------------------------- 1 | \def\bookfile{hpmor-5.pdf} 2 | \input{layout/hpmor-title-5} 3 | 4 | \input{layout/hp-dust-jacket} 5 | -------------------------------------------------------------------------------- /layout/hpmor-dust-jacket-6.tex: -------------------------------------------------------------------------------- 1 | \def\bookfile{hpmor-6.pdf} 2 | \input{layout/hpmor-title-6} 3 | 4 | \input{layout/hp-dust-jacket} 5 | -------------------------------------------------------------------------------- /layout/hpmor-title-1.tex: -------------------------------------------------------------------------------- 1 | \def\volumenumber{1} 2 | \def\volumetitle{Harry James Potter-Evans-Verres and the Methods of Rationality} 3 | -------------------------------------------------------------------------------- /layout/hpmor-title-2.tex: -------------------------------------------------------------------------------- 1 | \def\volumenumber{2} 2 | \def\volumetitle{Harry James Potter-Evans-Verres and the Professor's Games} 3 | -------------------------------------------------------------------------------- /layout/hpmor-title-3.tex: -------------------------------------------------------------------------------- 1 | \def\volumenumber{3} 2 | \def\volumetitle{Harry James Potter-Evans-Verres and the Shadows of Death} 3 | -------------------------------------------------------------------------------- /layout/hpmor-title-4.tex: -------------------------------------------------------------------------------- 1 | \def\volumenumber{4} 2 | \def\volumetitle{Hermione Jean Granger and the Phoenix's Call} 3 | -------------------------------------------------------------------------------- /layout/hpmor-title-5.tex: -------------------------------------------------------------------------------- 1 | \def\volumenumber{5} 2 | \def\volumetitle{Harry James Potter-Evans-Verres and the Last Enemy} 3 | -------------------------------------------------------------------------------- /layout/hpmor-title-6.tex: -------------------------------------------------------------------------------- 1 | \def\volumenumber{6} 2 | \def\volumetitle{Harry James Potter-Evans-Verres and the Philosopher's Stone} 3 | -------------------------------------------------------------------------------- /layout/hpmor-title.tex: -------------------------------------------------------------------------------- 1 | \def\volumenumber{} 2 | \def\volumetitle{chapters 1--\ref{last:chapter} plus omake files 1--{4}} 3 | \newcommand{\fullvolumetitle}{\volumetitle} 4 | -------------------------------------------------------------------------------- /layout/papers.tex: -------------------------------------------------------------------------------- 1 | % Paper thicknesses 2 | 3 | % 70gsm Bond 4 | \def\lxxgsm{0.095mm} 5 | % 80gsm Bond 6 | \def\lxxxgsm{0.1mm} 7 | % 90gsm Bond 8 | \def\xcgsm{0.12mm} 9 | % 100gsm Bond 10 | \def\cgsm{0.125mm} 11 | % 115gsm Silk Bond 12 | \def\cxvgsmsilk{0.105mm} 13 | % 115gsm Gloss Bond 14 | \def\cxvgsmgloss{0.09mm} 15 | % 120gsm Bond 16 | \def\cxxgsm{0.13mm} 17 | % 135gsm Silk Bond 18 | \def\cxxxvgsmsilk{0.118mm} 19 | % 135gsm Gloss Bond 20 | \def\cxxxvgsmgloss{0.1mm} 21 | % 170gsm Silk Bond 22 | \def\clxxgsmsilk{0.165mm} 23 | % 170gsm Gloss Bond 24 | \def\clxxgsmgloss{0.146mm} 25 | -------------------------------------------------------------------------------- /post-checkout: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright 2015 Brent Longborough 3 | # Part of gitinfo2 package Version 2 4 | # Release 2.0.7 2015-11-22 5 | # Please read gitinfo2.pdf for licencing and other details 6 | # ----------------------------------------------------- 7 | # Post-{commit,checkout,merge} hook for the gitinfo2 package 8 | # 9 | # Get the first tag found in the history from the current HEAD 10 | FIRSTTAG=$(git describe --tags --always --dirty='-*' 2>/dev/null) 11 | # Get the first tag in history that looks like a Release 12 | RELTAG=$(git describe --tags --long --always --dirty='-*' --match '[0-9]*.*' 2>/dev/null) 13 | # Hoover up the metadata 14 | git --no-pager log -1 --date=short --decorate=short \ 15 | --pretty=format:"\usepackage[% 16 | shash={%h}, 17 | lhash={%H}, 18 | authname={%an}, 19 | authemail={%ae}, 20 | authsdate={%ad}, 21 | authidate={%ai}, 22 | authudate={%at}, 23 | commname={%cn}, 24 | commemail={%ce}, 25 | commsdate={%cd}, 26 | commidate={%ci}, 27 | commudate={%ct}, 28 | refnames={%d}, 29 | firsttagdescribe={$FIRSTTAG}, 30 | reltag={$RELTAG} 31 | ]{gitexinfo}" HEAD > .git/gitHeadInfo.gin 32 | -------------------------------------------------------------------------------- /python-requirements.txt: -------------------------------------------------------------------------------- 1 | lxml 2 | pytest 3 | -------------------------------------------------------------------------------- /scripts/check-chapters.json: -------------------------------------------------------------------------------- 1 | { 2 | "lang": "EN", 3 | "print_diff": true, 4 | "raise_error": true 5 | } 6 | -------------------------------------------------------------------------------- /scripts/check_chapters_settings.py: -------------------------------------------------------------------------------- 1 | # ruff: # noqa: INP001 2 | 3 | """ 4 | Settings. 5 | 6 | lang: EN, DE, FR, ... 7 | raise_error: true -> script exits with error, used for autobuild of releases 8 | print_diff: true : print line of issues 9 | inline_fixing: modify the source file directly, USE WITH CAUTION 10 | """ 11 | 12 | settings = { 13 | "lang": "EN", 14 | "print_diff": True, 15 | "raise_error": True, 16 | "inline_fixing": False, 17 | } 18 | -------------------------------------------------------------------------------- /scripts/check_chapters_test.py: -------------------------------------------------------------------------------- 1 | """Tests for check_chapters.py .""" # noqa: INP001 2 | # ruff: noqa: S101 RUF001 RUF003 D103 3 | 4 | from collections.abc import Callable 5 | 6 | from check_chapters import ( 7 | fix_common_typos, 8 | fix_ellipsis, 9 | fix_emph, 10 | fix_hyphens, 11 | fix_latex, 12 | fix_line, 13 | fix_linebreaks_speach, 14 | fix_MrMrs, 15 | fix_numbers, 16 | fix_punctuation, 17 | fix_spaces, 18 | fix_spell, 19 | ) 20 | from check_chapters_settings import settings 21 | 22 | 23 | def test_it(fct: Callable, pairs: list[tuple[str, str]]) -> None: 24 | for text, expected_output in pairs: 25 | # test of isolated function 26 | assert fct(text) == expected_output, f"'{fct(text)}' != '{expected_output}'" 27 | # test in complete fix_line context 28 | assert fix_line(text) == expected_output, ( 29 | f"'{fix_line(text)}' != '{expected_output}'" 30 | ) 31 | 32 | 33 | for lang in ["EN", "DE"]: 34 | settings["lang"] = lang 35 | 36 | # 37 | # fix_common_typos 38 | # 39 | pairs = [ 40 | ("Test Mungo's King's Cross", "Test Mungo’s King’s Cross"), 41 | ("Test", "Test"), 42 | ] 43 | if lang == "EN": 44 | pairs.extend( 45 | [ 46 | ("I'm happy", "I’m happy"), 47 | ("can't be", "can’t be"), 48 | ] 49 | ) 50 | elif lang == "DE": 51 | pairs.extend( 52 | [ 53 | ("Junge-der-überlebt-hat", "Junge-der-überlebte"), 54 | ("Fritz'sche Gesetz", "Fritz’sche Gesetz"), 55 | ("Fritz'schen Gesetz", "Fritz’schen Gesetz"), 56 | ("Fritz'scher Gesetz", "Fritz’scher Gesetz"), 57 | ] 58 | ) 59 | test_it(fix_common_typos, pairs) 60 | 61 | # 62 | # fix_ellipsis 63 | # 64 | pairs = [ 65 | ("foo…bar", "foo…bar"), 66 | ("foo … bar", "foo…bar"), 67 | ("foo… bar", "foo…bar"), 68 | ("foo …bar", "foo…bar"), 69 | ("foo, …", "foo, …"), 70 | ] 71 | test_it(fix_ellipsis, pairs) 72 | 73 | # 74 | # fix_emph 75 | # 76 | pairs = [ 77 | (r"That’s not \emph{true!}", r"That’s not \emph{true}!"), 78 | (r"she got \emph{magic,} can you", r"she got \emph{magic}, can you"), 79 | ("asdf", "asdf"), 80 | ] 81 | if lang == "EN": 82 | pairs.extend( 83 | [ 84 | ( 85 | r"briefly. \emph{Hopeless.} Both", 86 | r"briefly. \emph{Hopeless.} Both", # . unchanged 87 | ), 88 | ("asdf", "asdf"), 89 | ] 90 | ) 91 | elif lang == "DE": 92 | pairs.extend( 93 | [ 94 | ( 95 | r"briefly. \emph{Hopeless.} Both", 96 | r"briefly. \emph{Hopeless}. Both", # . now out 97 | ), 98 | ("asdf", "asdf"), 99 | ] 100 | ) 101 | test_it(fix_emph, pairs) 102 | 103 | # 104 | # fix_hyphens 105 | # 106 | pairs = [ 107 | ("2-3-4", "2–3–4"), 108 | (" —,", "—,"), 109 | (" —.", "—."), 110 | (" —!", "—!"), 111 | (" —?", "—?"), 112 | # start of line 113 | ("— asdf", "—asdf"), 114 | ("- asdf", "—asdf"), 115 | ("-asdf", "—asdf"), 116 | ] 117 | if lang == "DE": 118 | pairs.extend( 119 | [ 120 | # end of line 121 | ("Text —", "Text—"), 122 | # start of quote 123 | ("Text—„", "Text— „"), 124 | ("Text —„", "Text— „"), 125 | ("Text „ —Quote", "Text „—Quote"), 126 | ("Text „ — Quote", "Text „—Quote"), 127 | ("Text—„— Quote", "Text— „—Quote"), 128 | # end of quote 129 | ("Text -“asdf", "Text—“ asdf"), 130 | ("Text —“", "Text—“"), 131 | ] 132 | ) 133 | test_it(fix_hyphens, pairs) 134 | 135 | # 136 | # fix_latex 137 | # 138 | pairs = [ 139 | ("begin at new line\\begin{em}", "begin at new line\n\\begin{em}"), 140 | ("end at new line\\end{em}", "end at new line\n\\end{em}"), 141 | ("new line after \\\\ asdf", "new line after \\\\\nasdf"), 142 | ("no new line after \\\\", "no new line after \\\\"), 143 | ] 144 | test_it(fix_latex, pairs) 145 | 146 | # 147 | # fix_linebreaks_speach 148 | # 149 | if lang == "DE": 150 | pairs = [ 151 | (" „Hello", "\n„Hello"), 152 | (" „hello", " „hello"), 153 | ("„hello", "„hello"), 154 | ] 155 | test_it(fix_linebreaks_speach, pairs) 156 | 157 | # 158 | # fix_MrMrs 159 | # 160 | pairs = [ 161 | ("Mr. H. Potter", "Mr~H.~Potter"), 162 | ("it’s Doctor now, not Miss.", "it’s Doctor now, not Miss."), 163 | ] 164 | if lang == "DE": 165 | pairs.extend( 166 | [ 167 | ("Mr. Potter", "Mr~Potter"), 168 | ("Mrs. Potter", "Mrs~Potter"), 169 | ("Miss. Potter", "Miss~Potter"), 170 | ("Dr. Potter", "Dr~Potter"), 171 | ("Dr Potter", "Dr~Potter"), 172 | ("Mr Potter", "Mr~Potter"), 173 | ("Mr. and Mrs. Davis", "Mr~and Mrs~Davis"), 174 | ] 175 | ) 176 | test_it(fix_MrMrs, pairs) 177 | 178 | # 179 | # fix_numbers 180 | # 181 | if lang == "DE": 182 | pairs = [ 183 | ("Es ist 12:23 Uhr.", "Es ist 12:23~Uhr."), 184 | ("asdf", "asdf"), 185 | ] 186 | test_it(fix_numbers, pairs) 187 | 188 | # 189 | # fix_punctuation 190 | # 191 | pairs = [ 192 | ("!!", "!"), 193 | ("??", "?"), 194 | ("! !", "!"), 195 | ("..", "."), 196 | (",,", ","), 197 | ] 198 | test_it(fix_punctuation, pairs) 199 | 200 | # 201 | # fix_spaces 202 | # 203 | pairs = [ 204 | ("Hallo  Harry", "Hallo Harry"), 205 | ("tabs\tto\t\tspace", "tabs to space"), 206 | ("trailing spaces ", "trailing spaces"), 207 | (" ", ""), 208 | ("multiple spaces", "multiple spaces"), 209 | ] 210 | test_it(fix_spaces, pairs) 211 | 212 | # 213 | # fix_spell 214 | # 215 | if lang == "DE": 216 | pairs = [ 217 | (r"‚Lumos‘", r"\spell{Lumos}"), 218 | (r"„Lumos“", r"\spell{Lumos}"), 219 | (r"„\emph{Lumos}“", r"\spell{Lumos}"), 220 | (r"\emph{„Lumos“}", r"\spell{Lumos}"), 221 | (r"\emph{Lumos!}", r"\spell{Lumos}"), 222 | (r"„\spell{Lumos}“", r"\spell{Lumos}"), 223 | ] 224 | test_it(fix_spell, pairs) 225 | -------------------------------------------------------------------------------- /scripts/check_pre-commit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ensure we are in the hpmor root dir 4 | script_dir=$(dirname $0) 5 | cd $script_dir/.. 6 | 7 | pip3 install pre-commit 8 | pre-commit run -a 9 | -------------------------------------------------------------------------------- /scripts/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ensure we are in the hpmor root dir 4 | script_dir=$(dirname $0) 5 | cd $script_dir/.. 6 | 7 | latexmk -C 8 | rm -rf tmp 9 | -------------------------------------------------------------------------------- /scripts/ebook/hpmor-ebook.tex: -------------------------------------------------------------------------------- 1 | \RequirePackage[pdf]{layout/hp-book} 2 | 3 | \begin{document} 4 | 5 | \input{layout/hp-format} 6 | \input{layout/hp-markup} 7 | 8 | \input{layout/hp-intro} 9 | 10 | \newcommand{\writtenNoteA}[1]{\par\textcolor{writtenNote}{#1}} 11 | \renewcommand{\parsel}[1]{\textcolor{parsel}{#1}} 12 | \renewcommand{\McGonagallWhiteBoard}[1]{\textcolor{McGonagallWhiteBoard}{\par#1}} 13 | \renewcommand{\headline}[1]{\begin{center}\textcolor{headline}{#1}\end{center}} 14 | \renewcommand{\inlineheadline}[1]{\textcolor{headline}{#1}} 15 | \renewcommand{\newspaperHeader}[1]{#1} 16 | \renewcommand{\hplettrineextrapara}[0]{} 17 | 18 | \include{chapters/hpmor-chapter-000} 19 | \part{Harry James Potter-Evans-Verres and the Methods of Rationality} 20 | \include{chapters/hpmor-chapter-001} 21 | \include{chapters/hpmor-chapter-002} 22 | \include{chapters/hpmor-chapter-003} 23 | \include{chapters/hpmor-chapter-004} 24 | \include{chapters/hpmor-chapter-005} 25 | \include{chapters/hpmor-chapter-006} 26 | \include{chapters/hpmor-chapter-007} 27 | \include{chapters/hpmor-chapter-008} 28 | \include{chapters/hpmor-chapter-009} 29 | \include{chapters/hpmor-chapter-010} 30 | \include{chapters/hpmor-chapter-011} 31 | \include{chapters/hpmor-chapter-012} 32 | \include{chapters/hpmor-chapter-013} 33 | \include{chapters/hpmor-chapter-014} 34 | \include{chapters/hpmor-chapter-015} 35 | \include{chapters/hpmor-chapter-016} 36 | \include{chapters/hpmor-chapter-017} 37 | \include{chapters/hpmor-chapter-018} 38 | \include{chapters/hpmor-chapter-019} 39 | \include{chapters/hpmor-chapter-020} 40 | \include{chapters/hpmor-chapter-021} 41 | \part{Harry James Potter-Evans-Verres and the Professor's Games} 42 | \include{chapters/hpmor-chapter-022} 43 | \include{chapters/hpmor-chapter-023} 44 | \include{chapters/hpmor-chapter-024} 45 | \include{chapters/hpmor-chapter-025} 46 | \include{chapters/hpmor-chapter-026} 47 | \include{chapters/hpmor-chapter-027} 48 | \include{chapters/hpmor-chapter-028} 49 | \include{chapters/hpmor-chapter-029} 50 | \include{chapters/hpmor-chapter-030} 51 | \include{chapters/hpmor-chapter-031} 52 | \include{chapters/hpmor-chapter-032} 53 | \include{chapters/hpmor-chapter-033} 54 | \include{chapters/hpmor-chapter-034} 55 | \include{chapters/hpmor-chapter-035} 56 | \include{chapters/hpmor-chapter-036} 57 | \include{chapters/hpmor-chapter-037} 58 | \part{Harry James Potter-Evans-Verres and the Shadows of Death} 59 | \include{chapters/hpmor-chapter-038} 60 | \include{chapters/hpmor-chapter-039} 61 | \include{chapters/hpmor-chapter-040} 62 | \include{chapters/hpmor-chapter-041} 63 | \include{chapters/hpmor-chapter-042} 64 | \include{chapters/hpmor-chapter-043} 65 | \include{chapters/hpmor-chapter-044} 66 | \include{chapters/hpmor-chapter-045} 67 | \include{chapters/hpmor-chapter-046} 68 | \include{chapters/hpmor-chapter-047} 69 | \include{chapters/hpmor-chapter-048} 70 | \include{chapters/hpmor-chapter-049} 71 | \include{chapters/hpmor-chapter-050} 72 | \include{chapters/hpmor-chapter-051} 73 | \include{chapters/hpmor-chapter-052} 74 | \include{chapters/hpmor-chapter-053} 75 | \include{chapters/hpmor-chapter-054} 76 | \include{chapters/hpmor-chapter-055} 77 | \include{chapters/hpmor-chapter-056} 78 | \include{chapters/hpmor-chapter-057} 79 | \include{chapters/hpmor-chapter-058} 80 | \include{chapters/hpmor-chapter-059} 81 | \include{chapters/hpmor-chapter-060} 82 | \include{chapters/hpmor-chapter-061} 83 | \include{chapters/hpmor-chapter-062} 84 | \include{chapters/hpmor-chapter-063} 85 | \part{Hermione Jean Granger and the Phoenix's Call} 86 | \include{chapters/hpmor-chapter-064} 87 | \include{chapters/hpmor-chapter-065} 88 | \include{chapters/hpmor-chapter-066} 89 | \include{chapters/hpmor-chapter-067} 90 | \include{chapters/hpmor-chapter-068} 91 | \include{chapters/hpmor-chapter-069} 92 | \include{chapters/hpmor-chapter-070} 93 | \include{chapters/hpmor-chapter-071} 94 | \include{chapters/hpmor-chapter-072} 95 | \include{chapters/hpmor-chapter-073} 96 | \include{chapters/hpmor-chapter-074} 97 | \include{chapters/hpmor-chapter-075} 98 | \include{chapters/hpmor-chapter-076} 99 | \include{chapters/hpmor-chapter-077} 100 | \include{chapters/hpmor-chapter-078} 101 | \include{chapters/hpmor-chapter-079} 102 | \include{chapters/hpmor-chapter-080} 103 | \include{chapters/hpmor-chapter-081} 104 | \include{chapters/hpmor-chapter-082} 105 | \include{chapters/hpmor-chapter-083} 106 | \include{chapters/hpmor-chapter-084} 107 | \include{chapters/hpmor-chapter-085} 108 | \part{Harry James Potter-Evans-Verres and the Last Enemy} 109 | \include{chapters/hpmor-chapter-086} 110 | \include{chapters/hpmor-chapter-087} 111 | \include{chapters/hpmor-chapter-088} 112 | \include{chapters/hpmor-chapter-089} 113 | \include{chapters/hpmor-chapter-090} 114 | \include{chapters/hpmor-chapter-091} 115 | \include{chapters/hpmor-chapter-092} 116 | \include{chapters/hpmor-chapter-093} 117 | \include{chapters/hpmor-chapter-094} 118 | \include{chapters/hpmor-chapter-095} 119 | \include{chapters/hpmor-chapter-096} 120 | \include{chapters/hpmor-chapter-097} 121 | \include{chapters/hpmor-chapter-098} 122 | \include{chapters/hpmor-chapter-099} 123 | \part{Harry James Potter-Evans-Verres and the Philosopher's Stone} 124 | \include{chapters/hpmor-chapter-100} 125 | \include{chapters/hpmor-chapter-101} 126 | \include{chapters/hpmor-chapter-102} 127 | \include{chapters/hpmor-chapter-103} 128 | \include{chapters/hpmor-chapter-104} 129 | \include{chapters/hpmor-chapter-105} 130 | \include{chapters/hpmor-chapter-106} 131 | \include{chapters/hpmor-chapter-107} 132 | \include{chapters/hpmor-chapter-108} 133 | \include{chapters/hpmor-chapter-109} 134 | \include{chapters/hpmor-chapter-110} 135 | \include{chapters/hpmor-chapter-111} 136 | \include{chapters/hpmor-chapter-112} 137 | \include{chapters/hpmor-chapter-113} 138 | \include{chapters/hp-exam} 139 | \include{chapters/hpmor-chapter-114} 140 | \include{chapters/hpmor-chapter-115} 141 | \include{chapters/hpmor-chapter-116} 142 | \include{chapters/hpmor-chapter-117} 143 | \include{chapters/hpmor-chapter-118} 144 | \include{chapters/hpmor-chapter-119} 145 | \include{chapters/hpmor-chapter-120} 146 | \include{chapters/hpmor-chapter-121} 147 | \include{chapters/hpmor-chapter-122} 148 | 149 | \end{document} 150 | -------------------------------------------------------------------------------- /scripts/ebook/html.css: -------------------------------------------------------------------------------- 1 | /* start html.css */ 2 | 3 | p { 4 | text-align: justify; 5 | line-height: 1.25; 6 | } 7 | 8 | em { 9 | font-style: italic; 10 | } 11 | 12 | em em { 13 | font-style: normal; 14 | } 15 | 16 | em em em { 17 | font-style: italic; 18 | } 19 | 20 | /* V1: using custom fonts */ 21 | 22 | /* @font-face { 23 | font-family: "Automobile Contest"; 24 | font-weight: normal; 25 | font-style: normal; 26 | src: url("./fonts/automobile_contest/Automobile Contest.ttf"); 27 | } 28 | span.McGonagallWhiteBoard { 29 | font: 5em "Automobile Contest"; 30 | color: #cc3333; 31 | text-decoration: underline; 32 | text-decoration-color: #3333cc; 33 | text-decoration-thickness: 1px; 34 | } 35 | 36 | /* @font-face { 37 | font-family: "gabriele-bad"; 38 | font-weight: normal; 39 | font-style: normal; 40 | src: url("./fonts/gabriele_bad_ah/gabriele-bad.ttf"); 41 | } 42 | span.headline { 43 | font: 1.2em "gabriele-bad"; 44 | font-variant: small-caps; 45 | color: #424242; 46 | } 47 | 48 | @font-face { 49 | font-family: "Parseltongue"; 50 | font-weight: normal; 51 | font-style: italic; 52 | src: url("./fonts/Parseltongue/Parseltongue.ttf"); 53 | } 54 | span.parsel { 55 | font: 1.0em "Parseltongue"; 56 | font: "Parseltongue"; 57 | font-style: italic; 58 | } 59 | div.parsel { 60 | font: 1.0em "Parseltongue"; 61 | font: "Parseltongue"; 62 | font-style: italic; 63 | } 64 | 65 | @font-face { 66 | font-family: "Graphe_Alpha_alt"; 67 | font-weight: normal; 68 | font-style: normal; 69 | src: url("./fonts/graphe/Graphe_Alpha_alt.ttf"); 70 | } 71 | div.writtenNote { 72 | font: 1em "Graphe_Alpha_alt"; 73 | font-style: italic; 74 | margin-left: 1em; 75 | } 76 | span.writtenNote { 77 | font: 1em "Graphe_Alpha_alt"; 78 | font-style: italic; 79 | margin-left: 1em; 80 | } 81 | */ 82 | 83 | 84 | /* V2: no custom font to increase compatibility (modi seems not to support fonts, and char ß is missing in some of the fonts */ 85 | 86 | 87 | 88 | span.lettrine { 89 | font-size: 150%; 90 | } 91 | 92 | span.parsel { 93 | font-style: italic; 94 | } 95 | 96 | div.parsel { 97 | font-style: italic; 98 | } 99 | 100 | div.writtenNote { 101 | font-style: italic; 102 | margin-left: 1em; 103 | } 104 | 105 | span.writtenNote { 106 | font-style: italic; 107 | margin-left: 1em; 108 | } 109 | 110 | div.McGonagallWhiteBoard p { 111 | color: #cc3333; 112 | text-align: center; 113 | text-transform: uppercase; 114 | text-decoration: underline; 115 | text-decoration-color: #3333cc; 116 | /* text-decoration-thickness: 1px; */ 117 | } 118 | 119 | span.headline { 120 | font-variant: small-caps; 121 | } 122 | 123 | 124 | /* end html.css */ 125 | -------------------------------------------------------------------------------- /scripts/ebook/step_1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # based on work by yeKcim 4 | # https://github.com/yeKcim/hpmor/tree/master/ebook 5 | 6 | echo === 1. extract cover from PDF to image=== 7 | 8 | # ensure we are in the hpmor root dir 9 | script_dir=$(dirname $0) 10 | cd $script_dir/../.. 11 | 12 | mkdir -p tmp/ 13 | 14 | source_file="hpmor.pdf" 15 | target_file="tmp/title.png" 16 | 17 | # extract title page from PDF and convert to jpeg 18 | # V1 via imagemagick 19 | # sudo apt install imagemagick 20 | # convert -density 150 tmp/hpmor.pdf[0] -quality 75 tmp/title-en.jpg 21 | # imagemagick complains: 22 | # attempt to perform an operation not allowed by the security policy 23 | 24 | # V2 via ghostscript 25 | gs -dSAFER -r600 -sDEVICE=pngalpha -dFirstPage=1 -dLastPage=1 -o $target_file $source_file 26 | 27 | # now imagemagick can be used for converting to the proper size 28 | source_file="tmp/title.png" 29 | target_file="tmp/title.jpg" 30 | convert -density 150 $source_file -resize 1186x1186\> -quality 75 $target_file 31 | -------------------------------------------------------------------------------- /scripts/ebook/step_2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # based on work by yeKcim 4 | # https://github.com/yeKcim/hpmor/tree/master/ebook 5 | 6 | echo === 2. flatten .tex files === 7 | 8 | # ensure we are in the hpmor root dir 9 | script_dir=$(dirname $0) 10 | cd $script_dir/../.. 11 | 12 | source_file="scripts/ebook/hpmor-ebook.tex" 13 | target_file="tmp/hpmor-epub-2-flatten.tex" 14 | 15 | # flatten the .tex files to one file 16 | latexpand $source_file -o $target_file 17 | -------------------------------------------------------------------------------- /scripts/ebook/step_3.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # by Torben Menke https://entorb.net 3 | 4 | """ 5 | Modify flattened .tex file. 6 | """ 7 | 8 | import datetime as dt 9 | import os 10 | import re 11 | from pathlib import Path 12 | 13 | os.chdir(Path(__file__).parent.parent.parent) 14 | 15 | source_file = Path("tmp/hpmor-epub-2-flatten.tex") 16 | target_file = Path("tmp/hpmor-epub-3-flatten-mod.tex") 17 | 18 | if __name__ == "__main__": 19 | print("=== 3. modify flattened file ===") 20 | 21 | with source_file.open(encoding="utf-8", newline="\n") as fh_in: 22 | cont = fh_in.read() 23 | 24 | # \today 25 | date_str = dt.datetime.now(dt.UTC).date().strftime("%d.%m.%Y") 26 | cont = cont.replace("\\today{}", date_str) 27 | 28 | # empty the newenvironments: headlines, writtenNote, playdialog 29 | # to prevent implications on other cleanup scripts 30 | cont = re.sub( 31 | r"\\newenvironment\{(headlines|writtenNote|playdialog)\}.*?\n\n", 32 | r"\\newenvironment{\1}{}{}\n\n", 33 | cont, 34 | flags=re.DOTALL, 35 | count=3, 36 | ) 37 | 38 | # writtenNote env -> \writtenNoteA 39 | cont = re.sub( 40 | r"\s*\\begin\{writtenNote\}\s*(.*?)\s*\\end\{writtenNote\}", 41 | r"\\writtenNoteA{\1}", 42 | cont, 43 | flags=re.DOTALL, 44 | ) 45 | 46 | # fix chapterOpeningAuthorNote 47 | cont = re.sub( 48 | r"(\\begin\{chapterOpeningAuthorNote\}\n)(.*?\n)(\\end\{chapterOpeningAuthorNote\}\n)", 49 | r"\1E.~Y.:~\2\\newline\\rule[1ex]{\\textwidth}{.1pt}\\newline%\n\3", 50 | cont, 51 | flags=re.DOTALL, 52 | ) 53 | 54 | # some cleanup 55 | cont = cont.replace("\\hplettrineextrapara\n", "") 56 | 57 | # additional linebreaks in verses of chapter 64 58 | cont = cont.replace("\\\\\n\n", "\n\n") 59 | 60 | # manual pagebreaks 61 | cont = re.sub(r"\\clearpage(\{\}|)\n?", "", cont) 62 | 63 | # \vskip 1\baselineskip plus .5\textheight minus 1\baselineskip 64 | cont = re.sub(r"\\vskip .*\\baselineskip", "", cont) 65 | 66 | # remove \settowidth{\versewidth}... \begin{verse}[\versewidth] 67 | cont = re.sub( 68 | r"\n[^\n]*?\\settowidth\{\\versewidth\}[^\n]*?\n(\\begin\{verse\}\[\\versewidth\])", 69 | r"\n\\begin{verse}", 70 | cont, 71 | ) 72 | 73 | # remove \settowidth 74 | cont = re.sub( 75 | r"\\settowidth\{[^\}]*\}\{([^\}]*)\}", 76 | r"\1", 77 | cont, 78 | flags=re.DOTALL, 79 | ) 80 | 81 | # fix „ at start of chapter 82 | # \lettrine[ante=„] -> „\lettrine 83 | # \lettrinepara[ante=„] -> „\lettrine 84 | cont = re.sub( 85 | r"\\(lettrine|lettrinepara)\[ante=(.)\]", 86 | r"\2\\lettrine", 87 | cont, 88 | ) 89 | 90 | # OMakeIV sections 91 | # \OmakeIVsection{My Little Pony: Friendship is Science} 92 | cont = re.sub(r"\\OmakeIVsection(\[[^\]]*\]|)\{(.*)\}\n+", r"\\section{\2}\n", cont) 93 | 94 | cont = re.sub( 95 | r"\\OmakeIVspecialsection[^\n]+\{RingBearer\}.*?\n\n", 96 | r"\\section{Lord of the Rationality}\n", 97 | cont, 98 | flags=re.DOTALL, 99 | count=1, 100 | ) 101 | cont = re.sub( 102 | r"\\OmakeIVspecialsection[^\n]+\{NarniaBLL\}.*?\n\n", 103 | r"\\section{The Witch and the Wardrobe}\n", 104 | cont, 105 | flags=re.DOTALL, 106 | count=1, 107 | ) 108 | cont = re.sub( 109 | r"\\OmakeIVspecialsection[^\n]+\{Thundercats\}.*?\n\n", 110 | r"\\section{ThunderSmarts}\n", 111 | cont, 112 | flags=re.DOTALL, 113 | count=1, 114 | ) 115 | 116 | cont = re.sub( 117 | r"\\OmakeIVspecialsection[^\n]+\{Twilight\}.*?\n\n", 118 | r"\\section{Utilitarian Twilight}\n", 119 | cont, 120 | flags=re.DOTALL, 121 | count=1, 122 | ) 123 | 124 | # \censor 125 | cont = re.sub(r"\\censor\{.*?\}", r"xxxxxx", cont) 126 | 127 | # # remove Deathly_Hallows_Sign.pdf and other pdf images 128 | # # \includegraphics[scale=0.125]{images/Deathly_Hallows_Sign.pdf} 129 | # cont = re.sub( 130 | # # r"\\includegraphics.*?\{images/Deathly_Hallows_Sign.*?\}", 131 | # r"\\includegraphics.*?\.pdf\}", 132 | # "", 133 | # cont, 134 | # ) 135 | 136 | # remove all images 137 | cont = re.sub( 138 | r"\\includegraphics\[.*?\]\{.*?\}", 139 | "", 140 | cont, 141 | flags=re.DOTALL, 142 | ) 143 | 144 | # remove empty envs 145 | cont = re.sub( 146 | r"\\begin\{([^\}]*)\}\s*\\end\{\1}", 147 | "", 148 | cont, 149 | flags=re.DOTALL, 150 | ) 151 | 152 | # remove end stuff 153 | cont = re.sub( 154 | r"(.*)\\end\{chapterOpeningAuthorNote\}.*?\\end\{document\}", 155 | r"\1\\end{chapterOpeningAuthorNote}\n\\end{document}", 156 | cont, 157 | flags=re.DOTALL, 158 | count=1, 159 | ) 160 | 161 | with target_file.open(mode="w", encoding="utf-8", newline="\n") as fh_out: 162 | fh_out.write(cont) 163 | -------------------------------------------------------------------------------- /scripts/ebook/step_4.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # by Torben Menke https://entorb.net 3 | 4 | """ 5 | Parselify flattened .tex file. 6 | """ 7 | 8 | import os 9 | import re 10 | from pathlib import Path 11 | 12 | os.chdir(Path(__file__).parent.parent.parent) 13 | 14 | source_file = Path("tmp/hpmor-epub-3-flatten-mod.tex") 15 | target_file = Path("tmp/hpmor-epub-4-flatten-parsel.tex") 16 | 17 | 18 | def convert_parsel(s: str) -> str: 19 | """Convert text to Parsel.""" 20 | # TODO: for spellcheck doc version we should return here 21 | # return s 22 | # small ss -> ß -> sss ; s->ss 23 | s = s.replace("ss", "ß").replace("s", "ss").replace("ß", "sss") 24 | # capital S -> Ss ; capital SS -> SSS ; S->SS 25 | s = s.replace("SS", "ẞ").replace("S", "Ss").replace("ẞ", "SSS") 26 | # small zz -> zzz ; z->zz 27 | s = s.replace("zz", "ß").replace("z", "zz").replace("ß", "zzz") 28 | # capital Z -> Zz ; ZZ->ZZZ 29 | s = s.replace("ZZ", "ẞ").replace("Z", "Zz").replace("ß", "ZZZ") 30 | # small x -> xs 31 | s = s.replace("x", "xs") 32 | return s 33 | 34 | 35 | if __name__ == "__main__": 36 | print("=== 4. parselify flattened file in python ===") 37 | 38 | with source_file.open(encoding="utf-8", newline="\n") as fh_in: 39 | cont = fh_in.read() 40 | 41 | # \parsel 42 | my_matches = re.finditer(r"(\\parsel\{([^\}\\]+)\})", cont) 43 | for my_match in my_matches: 44 | was = my_match.group(1) 45 | womit = convert_parsel(my_match.group(2)) 46 | cont = cont.replace(was, "\\parsel{" + womit + "}") 47 | 48 | with target_file.open(mode="w", encoding="utf-8", newline="\n") as fh_out: 49 | fh_out.write(cont) 50 | -------------------------------------------------------------------------------- /scripts/ebook/step_4_test.py: -------------------------------------------------------------------------------- 1 | """Unit Tests.""" # noqa: INP001 2 | # ruff: noqa: S101 3 | 4 | from step_4 import convert_parsel 5 | 6 | assert convert_parsel("foo") == "foo" 7 | # s 8 | assert convert_parsel("house") == "housse" 9 | assert convert_parsel("Special") == "Sspecial" 10 | # ss and ß 11 | assert convert_parsel("Professor") == "Professsor" 12 | assert convert_parsel("muß") == "musss" 13 | # z 14 | assert convert_parsel("zero") == "zzero" 15 | assert convert_parsel("Zero") == "Zzero" 16 | # zz 17 | assert convert_parsel("puzzled") == "puzzzled" 18 | # x -> xs 19 | assert convert_parsel("Bellatrix") == "Bellatrixs" 20 | 21 | # combined 22 | assert convert_parsel("expression") == "exspresssion" 23 | assert convert_parsel("Salazar") == "Ssalazzar" 24 | -------------------------------------------------------------------------------- /scripts/ebook/step_5.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # based on work by yeKcim 4 | # https://github.com/yeKcim/hpmor/tree/master/ebook 5 | 6 | echo === 5. LaTeX -\> HTML via pandoc === 7 | 8 | # ensure we are in the hpmor root dir 9 | script_dir=$(dirname $0) 10 | cd $script_dir/../.. 11 | 12 | source_file="tmp/hpmor-epub-4-flatten-parsel.tex" 13 | target_file="tmp/hpmor-epub-5-html-unmod.html" 14 | 15 | # extract title and author from hp-header.tex 16 | title=$(grep "pdftitle=" layout/hp-header.tex | awk -F '[{}]' '{print $2}') 17 | author=$(grep "pdfauthor=" layout/hp-header.tex | awk -F '[{}]' '{print $2}') 18 | 19 | pandoc --standalone -V lang=en --from=latex+latex_macros $source_file -o $target_file --metadata title="$title" --metadata author="$author" 20 | -------------------------------------------------------------------------------- /scripts/ebook/step_6.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # by Torben Menke https://entorb.net 3 | # ruff: noqa: RUF001 4 | 5 | """ 6 | HTML modifications. 7 | """ 8 | 9 | import os 10 | import re 11 | import sys 12 | from pathlib import Path 13 | 14 | from lxml import etree # pip install lxml 15 | 16 | os.chdir(Path(__file__).parent.parent.parent) 17 | 18 | source_file = Path("tmp/hpmor-epub-5-html-unmod.html") 19 | target_file = Path("hpmor.html") 20 | 21 | 22 | def check_html(cont: str) -> None: 23 | """Check html syntax.""" 24 | parser = etree.XMLParser(recover=False) # Do not auto-fix errors 25 | try: 26 | etree.fromstring(cont, parser) # noqa: S320 27 | except etree.XMLSyntaxError as e: 28 | print("HTML Error:", e) 29 | sys.exit(1) 30 | # raise 31 | 32 | 33 | def fix_ellipsis(s: str) -> str: 34 | """ 35 | Fix ellipsis spacing for ebooks. 36 | """ 37 | # 1. remove all spaces around ellipsis 38 | s = re.sub(r" *… *", "…", s) 39 | # 2. recreate some spaces 40 | # before punctuation : no space, so covered by 1. 41 | # between words 42 | s = re.sub(r"(?<=[\w])…(?=[\w])", "… ", s) 43 | # after punctuation: add space 44 | s = re.sub(r"(?<=[\.\?!:,;])…", r" …", s) 45 | # fine-tuning … and … 46 | s = re.sub(r"(?<=)…", "… ", s) 47 | s = re.sub(r"…(?=)", "… ", s) 48 | # before opening EN-quotes: add space 49 | s = re.sub(r"…(?=[“])", "… ", s) 50 | # NO: before opening DE-quotes: add space 51 | # s = re.sub(r"…(?=[„])", "… ", s) 52 | return s 53 | 54 | 55 | if __name__ == "__main__": 56 | print("=== 6. HTML modifications ===") 57 | 58 | with source_file.open(encoding="utf-8", newline="\n") as fh_in: 59 | cont = fh_in.read() 60 | print("checking source html") 61 | check_html(cont) 62 | 63 | # remove strange leftovers from tex -> html conversion 64 | cont = re.sub( 65 | r"().*?

Book :

\n", 66 | r"\1", 67 | cont, 68 | flags=re.DOTALL | re.IGNORECASE, 69 | count=1, 70 | ) 71 | 72 | # stray leftover 73 | cont = re.sub( 74 | r"(github.com/rrthomas/hpmor/

)\s+", 75 | r"\1", 76 | cont, 77 | flags=re.DOTALL | re.IGNORECASE, 78 | count=1, 79 | ) 80 | 81 | # cleanup hp-intro leftovers 82 | cont = re.sub( 83 | """

Fanfiction based on the characters of

84 |

J. K. ROWLING

85 |

and her books:

""", 86 | "

Fanfiction based on the characters of J. K. Rowling and her books:

", 87 | cont, 88 | count=1, 89 | ) 90 | 91 | cont = re.sub("

Year at Hogwarts

\n", "", cont, count=7) 92 | cont = re.sub( 93 | "

\n

Harry Potter and the", 94 | "
\nHarry Potter and the", 95 | cont, 96 | count=7, 97 | ) 98 | 99 | # now done via pandoc -V lang=en in step_5.sh 100 | # # set language 101 | # cont = re.sub( 102 | # r'(]*) lang="" xml:lang=""', 103 | # r'\1 lang="en" xml:lang="en"', 104 | # cont, 105 | # count=1, 106 | # ) 107 | 108 | # fix spaces around ellipsis 109 | cont = fix_ellipsis(cont) 110 | 111 | # doc structure (not needed any more, using calibi --level1-toc flag instead) 112 | # sed -i 's/

" in cont: 133 | part_no += 1 134 | cont = cont.replace("

", f"{part_no}. ", 1) 135 | cont = cont.replace("", "

") 136 | 137 | # add chapter numbers 138 | chapter_no = 0 139 | while "

" in cont: 140 | chapter_no += 1 141 | cont = cont.replace("

", f"{chapter_no}. ", 1) 142 | cont = cont.replace("", "

") 143 | 144 | # fix double rules 145 | # cont = cont.replace("
\n
", "
") 146 | cont = re.sub( 147 | r"
\n
", 148 | r"
", 149 | cont, 150 | flags=re.DOTALL | re.IGNORECASE, 151 | ) 152 | # fixing linebreak at author's comment 153 | cont = cont.replace("

E. Y.: 

\n

", "

E.Y.: ") 154 | 155 | # converting "color-marked" styles of 1.sh back to proper style classes 156 | cont = re.sub( 157 | r'<(div|span)\s+style="color:\s*(parsel|writtenNote|McGonagallWhiteBoard|headline)"', 158 | r'<\1 class="\2"', 159 | cont, 160 | flags=re.DOTALL, 161 | ) 162 | 163 | # add css style file format for \emph in \emph 164 | with Path("scripts/ebook/html.css").open(encoding="utf-8", newline="\n") as fh_in: 165 | css = fh_in.read() 166 | cont = cont.replace("\n", css + "\n\n") 167 | 168 | print("checking target html") 169 | check_html(cont) 170 | 171 | # remove training slashes to satisfy https://validator.w3.org 172 | cont = cont.replace("
", "
") 173 | cont = cont.replace("


", "
") 174 | cont = re.sub( 175 | r"(]*) />", 176 | r"\1>", 177 | cont, 178 | ) 179 | 180 | with target_file.open(mode="w", encoding="utf-8", newline="\n") as fh_out: 181 | fh_out.write(cont) 182 | -------------------------------------------------------------------------------- /scripts/ebook/step_6_test.py: -------------------------------------------------------------------------------- 1 | """Unit Tests.""" # noqa: INP001 2 | # ruff: noqa: S101 3 | 4 | from step_6 import fix_ellipsis 5 | 6 | test_cases = [ 7 | # quotations 8 | ("foo…”", "foo…”"), 9 | ("“…foo", "“…foo"), 10 | # html 11 | ("foo…

", "foo…

"), 12 | ("

…foo", "

…foo"), 13 | # between 2 words 14 | ("foo…bar", "foo… bar"), 15 | ("foo …bar", "foo… bar"), 16 | ("foo … bar", "foo… bar"), 17 | ("foo… bar", "foo… bar"), 18 | # start of sentence 19 | ("foo.…bar", "foo. …bar"), 20 | ("foo!…bar", "foo! …bar"), 21 | ("foo?…bar", "foo? …bar"), 22 | # end of sentence 23 | ("foo…. bar", "foo…. bar"), 24 | ("foo…! bar", "foo…! bar"), 25 | ("foo…? bar", "foo…? bar"), 26 | # emph 27 | ("foo…bar", "foo… bar"), 28 | ("foo…bar", "foo… bar"), 29 | ] 30 | 31 | for inp, exp in test_cases: 32 | assert fix_ellipsis(inp) == exp, fix_ellipsis(inp) 33 | -------------------------------------------------------------------------------- /scripts/ebook/step_7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # based on work by yeKcim 4 | # https://github.com/yeKcim/hpmor/tree/master/ebook 5 | 6 | echo === 7. HTML -\> epub,mobi, doc === 7 | 8 | script_dir=$(dirname $0) 9 | cd $script_dir/../.. 10 | 11 | source_file="hpmor.html" 12 | target_file="hpmor.epub" 13 | 14 | # echo ==== 7.1a pandoc: html -\> epub==== 15 | # version 1. trying pandoc 16 | # pandoc --standalone --from=html $source_file -o $target_file --epub-cover-image="ebook/tmp/title.jpg" --epub-chapter-level=2 --epub-embed-font="fonts/automobile_contest/Automobile Contest.ttf" --epub-embed-font="fonts/graphe/Graphe_Alpha_alt.ttf" --epub-embed-font="fonts/Parseltongue/Parseltongue.ttf" --epub-embed-font="fonts/graphe/Graphe_Alpha_alt.ttf" --epub-embed-font="fonts/gabriele_bad_ah/gabriele-bad.ttf" -c "./ebook/pandoc.css" 17 | 18 | echo ==== 7.1b calibre: html -\> epub ==== 19 | # calibre is a bit better in ebook generation than pandoc and the result can be converted to mobi and docx 20 | ebook-convert $source_file $target_file --language en-US --no-default-epub-cover --cover "tmp/title.jpg" --book-producer "Torben Menke" --level1-toc "//h:h1" --level2-toc "//h:h2" --level3-toc "//h:h3" 21 | 22 | source_file="hpmor.epub" 23 | echo ==== 7.2 calibre: epub -\> mobi ==== 24 | # note: fonts are not included for some strange reason, so not using special fonts for headlines, writtenNotes and McGonagallWhiteBoard any more in html.css 25 | target_file="hpmor.mobi" 26 | ebook-convert $source_file $target_file 27 | 28 | # echo ==== 7.3 epub -\> docx ==== 29 | # target_file="hpmor.docx" 30 | # ebook-convert $source_file $target_file 31 | # # pandoc --standalone $source_file -o $target_file 32 | 33 | echo ==== 7.4 epub -\> fb2 ==== 34 | target_file="hpmor.fb2" 35 | # ebook-convert does not support fb2 36 | pandoc --standalone $source_file -o $target_file 37 | -------------------------------------------------------------------------------- /scripts/ebook/step_8.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo === 8. HTML comparison with latest release === 4 | 5 | script_dir=$(dirname $0) 6 | cd $script_dir/../.. 7 | 8 | source_file="hpmor.html" 9 | target_file="hpmor-html-diff.log" 10 | 11 | echo ==== 8.1 downloading from latest release ==== 12 | wget --quiet https://github.com/rrthomas/hpmor/releases/latest/download/hpmor.html -O hpmor-prev.html 13 | # or use WorkInProgress release, like https://github.com/rrthomas/hpmor/releases/download/WorkInProgress/hpmor.html 14 | 15 | echo ==== 8.2 diff ==== 16 | diff -U 0 -s hpmor-prev.html $source_file >$target_file 17 | -------------------------------------------------------------------------------- /scripts/ebook/v1/.gitignore: -------------------------------------------------------------------------------- 1 | tmp/ 2 | output/ 3 | -------------------------------------------------------------------------------- /scripts/ebook/v1/2_html2epub.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # by Torben Menke https://entorb.net 4 | 5 | # run from within ebook dir via 6 | # ./2_html2epub.sh 7 | 8 | mkdir -p tmp 9 | 10 | echo 1. extract titlepage from PDF 11 | cp ../hpmor.pdf tmp/ 12 | 13 | # 1.2 extract title page from PDF and convert to jpeg 14 | # 1.2a via imagemagick 15 | # sudo apt install imagemagick 16 | # convert -density 150 tmp/hpmor.pdf[0] -quality 75 tmp/title-en.jpg 17 | # imagemagick complains: 18 | # attempt to perform an operation not allowed by the security policy 19 | 20 | # 1.2b via ghostscript 21 | gs -dSAFER -r600 -sDEVICE=pngalpha -dFirstPage=1 -dLastPage=1 -o tmp/title-en.png tmp/hpmor.pdf 22 | # now imagemagick can be used for converting to the proper size 23 | convert -density 150 tmp/title-en.png -resize 1186x1186\> -quality 75 tmp/title-en.jpg 24 | 25 | echo 2. convert html to epub 26 | # use calibre instead of pandoc, as pandoc loses the css style 27 | # see https://manual.calibre-ebook.com/generated/en/ebook-convert.html 28 | # linux: sudo apt install calibre 29 | # windows: obtain from https://calibre-ebook.com/download_windows 30 | echo 2.1 calibre: html to epub 31 | ebook-convert output/hpmor.html output/hpmor.epub --no-default-epub-cover --cover tmp/title-en.jpg --authors "Eliezer Yudkowsky" --title "Harry Potter and the Methods of Rationality" --book-producer "Torben Menke" --pubdate 2015-03-14 --language en-US 32 | 33 | echo 2.2 calibre: epub to mobi 34 | ebook-convert output/hpmor.epub output/hpmor.mobi 35 | 36 | echo 2.3 pandoc: epub to fb2 37 | # ebook-convert does not support fb2 38 | pandoc --standalone output/hpmor.epub -o output/hpmor.fb2 39 | -------------------------------------------------------------------------------- /scripts/install_requirements.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ensure we are in the hpmor root dir 4 | script_dir=$(dirname $0) 5 | cd $script_dir/.. 6 | 7 | # update apt list 8 | sudo apt-get update --fix-missing 9 | 10 | # pdf 11 | sudo apt-get install texlive-xetex texlive-lang-greek latexmk 12 | 13 | # ebook 14 | sudo apt-get install pandoc calibre texlive-extra-utils imagemagick ghostscript 15 | # texlive-extra-utils for latexpand 16 | # imagemagick ghostscript : for pdf title page to image conversion 17 | 18 | pip install -r python-requirements.txt 19 | -------------------------------------------------------------------------------- /scripts/make_ebooks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ensure we are in the hpmor root dir 4 | script_dir=$(dirname $0) 5 | cd $script_dir/.. 6 | 7 | # TODO: 8 | # image on last page 9 | 10 | sh scripts/ebook/step_1.sh 11 | sh scripts/ebook/step_2.sh 12 | python3 scripts/ebook/step_3.py 13 | python3 scripts/ebook/step_4.py 14 | sh scripts/ebook/step_5.sh 15 | python3 scripts/ebook/step_6.py 16 | sh scripts/ebook/step_7.sh 17 | echo optionally run scripts/ebook/step_8.sh to compare HTML to latest release 18 | -------------------------------------------------------------------------------- /scripts/make_pdfs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ensure we are in the hpmor root dir 4 | script_dir=$(dirname $0) 5 | cd $script_dir/.. 6 | 7 | # latexmk hpmor 8 | 9 | # latexmk hpmor-1 10 | # latexmk hpmor-2 11 | # latexmk hpmor-3 12 | # latexmk hpmor-4 13 | # latexmk hpmor-5 14 | # latexmk hpmor-6 15 | 16 | # make all 17 | latexmk 18 | --------------------------------------------------------------------------------