Adding conf/metadata.yaml
|
|
@ -20,23 +20,8 @@
|
|||
"icon": "lucide-file",
|
||||
"title": "00_Introduction"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "09afe60c287c13ed",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "chapters/00_Introduction.md",
|
||||
"mode": "source",
|
||||
"source": false
|
||||
},
|
||||
"icon": "lucide-file",
|
||||
"title": "00_Introduction"
|
||||
}
|
||||
}
|
||||
],
|
||||
"currentTab": 1
|
||||
]
|
||||
}
|
||||
],
|
||||
"direction": "vertical"
|
||||
|
|
@ -235,6 +220,16 @@
|
|||
{
|
||||
"id": "e9804fd12413705d",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "mathpad-view",
|
||||
"state": {},
|
||||
"icon": "lucide-ghost",
|
||||
"title": "mathpad-view"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "1e80d66b61fedf35",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "mathpad-view",
|
||||
"state": {},
|
||||
|
|
@ -247,8 +242,7 @@
|
|||
}
|
||||
],
|
||||
"direction": "horizontal",
|
||||
"width": 200,
|
||||
"collapsed": true
|
||||
"width": 200
|
||||
},
|
||||
"left-ribbon": {
|
||||
"hiddenItems": {
|
||||
|
|
@ -263,16 +257,26 @@
|
|||
"obsidian-kanban:Create new board": false
|
||||
}
|
||||
},
|
||||
"active": "09afe60c287c13ed",
|
||||
"active": "c8db6b72741a9d4b",
|
||||
"lastOpenFiles": [
|
||||
"README.md",
|
||||
"conf/sedcoz12V",
|
||||
"build/lib/diag",
|
||||
"build/lib/img/ACEP Logo for Canvas.png",
|
||||
"build/lib/img/ACEP Logo.png",
|
||||
"build/lib/img/ACEP-50px.png",
|
||||
"build/lib/img/ACEP.png",
|
||||
"build/lib/img/ACEPLogo.png",
|
||||
"build/lib/img/UAF.png",
|
||||
"build/lib/img/UAFLogo_A_black.png",
|
||||
"build/lib/img/UAFLogo_A_blue.png",
|
||||
"chapters/02_Chapter2.md",
|
||||
"chapters/01_Chapter1.md",
|
||||
"chapters/00_Introduction.md",
|
||||
"README.md",
|
||||
"build/b3.epub",
|
||||
"build/Paths-to-Perception.epub",
|
||||
"build/media",
|
||||
"chapters/Citations.md",
|
||||
"chapters/01_Chapter1.md",
|
||||
"chapters/00_Introduction.md",
|
||||
"chapters/Terminology.md",
|
||||
"lib/old-citations.bib",
|
||||
"build/b3.html",
|
||||
|
|
@ -280,17 +284,8 @@
|
|||
"build/Paths-to-Perception.tex",
|
||||
"build/Paths-to-Perception.html",
|
||||
"build/conf/style.css",
|
||||
"build/lib/mathjax/ui/safe.js",
|
||||
"build/lib/img/unit-circle-with-tau.png",
|
||||
"build/lib/img/unit-circle-with-pi.png.png",
|
||||
"build/lib/img/unit-circle-with-pi.png",
|
||||
"build/lib/img/udir-proximity.png",
|
||||
"build/lib/img/directed-proximity.png",
|
||||
"build/lib/img/Unit_circle_angles_color.png",
|
||||
"build/lib/img/Revolving_circles.svg",
|
||||
"build/lib/img/Revolving_circles.480x480_white.png",
|
||||
"build/lib/img/Revolving_circles.480x480.png",
|
||||
"build/lib/img/Poo.png",
|
||||
"pm/Book Action Items.md",
|
||||
"chapters/Unitfication.md",
|
||||
"chapters/03_Cylindrical_Spacetime.md",
|
||||
|
|
|
|||
14
Makefile
|
|
@ -1,26 +1,36 @@
|
|||
PANDOC = pandoc
|
||||
BASE = conf/pandoc.yaml
|
||||
|
||||
all: build/pdf build/epub build/html
|
||||
all: pdf epub html latex markdown
|
||||
|
||||
pdf:
|
||||
@mkdir -p build
|
||||
@scripts/build-frontmatter.sh conf/metadata.yaml templates/frontmatter.tex conf/frontmatter.tex
|
||||
$(PANDOC) --defaults=$(BASE) --defaults=conf/pdf.yaml
|
||||
|
||||
epub:
|
||||
@mkdir -p build/media
|
||||
# @scripts/build-frontmatter.sh conf/metadata.yaml templates/frontmatter.html conf/frontmatter.html
|
||||
$(PANDOC) --defaults=$(BASE) --defaults=conf/epub.yaml
|
||||
|
||||
html:
|
||||
@mkdir -p build/lib/img build/lib/mathjax build/conf
|
||||
cp -r lib/img build/lib/
|
||||
cp -r lib/diag build/lib/
|
||||
cp -r lib/mathjax build/lib/
|
||||
cp conf/style.css build/conf/
|
||||
@scripts/build-frontmatter.sh conf/metadata.yaml templates/frontmatter.html conf/frontmatter.html
|
||||
$(PANDOC) --defaults=$(BASE) --defaults=conf/html.yaml
|
||||
|
||||
latex:
|
||||
@mkdir -p build
|
||||
pandoc --defaults=$(BASE) --defaults=conf/latex.yaml
|
||||
# @scripts/build-frontmatter.sh conf/metadata.yaml templates/frontmatter.tex conf/frontmatter.tex
|
||||
$(PANDOC) --defaults=$(BASE) --defaults=conf/latex.yaml
|
||||
|
||||
markdown:
|
||||
@mkdir -p build
|
||||
# @scripts/build-frontmatter.sh conf/metadata.yaml templates/frontmatter.tex conf/frontmatter.tex
|
||||
$(PANDOC) --defaults=$(BASE) -t gfm -o build/ClearSkies.md
|
||||
|
||||
clean:
|
||||
rm -rf build
|
||||
|
|
|
|||
18
README.md
|
|
@ -1,11 +1,11 @@
|
|||
# beautiful-book-builder
|
||||
# basic-book-builder (b3)
|
||||
|
||||
This is a basic book builder template based on a Pandoc build process in conjunction with a number of other tools to generate PDF, ODT, HTML, LaTex, and Epub book formats from Markdown source content in an Obsidian vault.
|
||||
This is a basic book (article) builder template based on a Pandoc build process in conjunction with a number of other tools to generate PDF, ODT, HTML, LaTex, and Epub book formats from Markdown source content in an Obsidian vault.
|
||||
|
||||
## Directory Structure
|
||||
|
||||
```
|
||||
beautiful-book-builder/
|
||||
basic-book-builder/
|
||||
├── build (Target Destination for Final Outputs)
|
||||
├── chapters (Input Content for the Book)
|
||||
├── conf (Configuration for the Pandoc Builds)
|
||||
|
|
@ -76,7 +76,7 @@ Install the Better BibTex Plugin for Zotero
|
|||
- Zotero > File > Export Library > Format: Better BibTeX
|
||||
- [ ] Keep Updated
|
||||
- [ ] Save to: ~/Documents/Lib/Citations.bib
|
||||
- [ ] Symlink your ~/Documents/Lib/Citations.bib to beautiful-book-builder/lib/citations.bib
|
||||
- [ ] Symlink your ~/Documents/Lib/Citations.bib to basic-book-builder/lib/citations.bib
|
||||
|
||||
#### Zotero Connector Browser Plugin
|
||||
|
||||
|
|
@ -104,6 +104,14 @@ sudo apt install https://github.com/jgm/pandoc/releases/download/3.8.2.1/pandoc-
|
|||
```
|
||||
sudo apt install make
|
||||
```
|
||||
|
||||
#### jq and yq
|
||||
|
||||
```
|
||||
sudo apt install jq yq
|
||||
```
|
||||
|
||||
|
||||
#### texlive
|
||||
|
||||
```
|
||||
|
|
@ -188,7 +196,7 @@ There are 2 Version of the FrontMatter for PDF, and HTML bases formats that set
|
|||
|
||||
### Editing Content
|
||||
|
||||
To edit the book open the `beautiful-book-builder` directory as an Obsidian Vault.
|
||||
To edit the book open the `basic-book-builder` directory as an Obsidian Vault.
|
||||
|
||||
- Edit the Markdown content in the `chapters` directory.
|
||||
|
||||
|
|
|
|||
42
build.sh
|
|
@ -1,42 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# set -e
|
||||
|
||||
# echo "=== Building PDF ==="
|
||||
# pandoc --defaults=pandoc.yaml -o build/Paths-to-Perception.pdf
|
||||
|
||||
# echo "=== Building EPUB ==="
|
||||
# pandoc --defaults=pandoc.yaml \
|
||||
# # --mathjax \
|
||||
# -t epub \
|
||||
# --epub-cover-image=lib/img/Revolving_circles.480x480_white.png \
|
||||
# -o build/Paths-to-Perception.epub
|
||||
|
||||
# echo "=== Building HTML ==="
|
||||
# pandoc --defaults=pandoc.yaml \
|
||||
# # --mathjax \
|
||||
# -t html5 \
|
||||
# -s \
|
||||
# -o build/Paths-to-Perception.html
|
||||
|
||||
# echo "=== Done ==="
|
||||
|
||||
# # Open PDF automatically if on macOS
|
||||
# if command -v open >/dev/null; then
|
||||
# open build/Paths-to-Perception.pdf
|
||||
# fi
|
||||
|
||||
|
||||
set -e
|
||||
|
||||
echo "=== PDF ==="
|
||||
pandoc --defaults=conf/pandoc.yaml --defaults=conf/pdf.yaml
|
||||
|
||||
echo "=== EPUB ==="
|
||||
pandoc --defaults=conf/pandoc.yaml --defaults=conf/epub.yaml \
|
||||
--epub-cover-image=lib/img/Revolving_circles.480x480_white.png
|
||||
|
||||
echo "=== HTML ==="
|
||||
pandoc --defaults=conf/pandoc.yaml --defaults=conf/html.yaml
|
||||
|
||||
echo "✅ All formats built in ./build"
|
||||
BIN
build/b3.epub
|
|
@ -102,58 +102,31 @@
|
|||
<div class="frontmatter">
|
||||
|
||||
<!-- Title Page -->
|
||||
<h1 style="margin-top:3em; font-size:2.4em; text-align:center;">Big Beautiful Book</h1>
|
||||
<h2 style="text-align:center; font-weight:normal;">A book</h2>
|
||||
<h1 style="margin-top:3em; font-size:2.4em; text-align:center;">Basic Book Builder</h1>
|
||||
<h2 style="text-align:center; font-weight:normal;">A Pandoc Template for building books and articles</h2>
|
||||
|
||||
<div style="text-align:center; margin:2em 0;">
|
||||
<img src="lib/img/Revolving_circles.480x480_white.png" alt="Cover illustration" style="max-width:240px;">
|
||||
<img src="lib/img/ACEPLogo.png" alt="Cover illustration" style="max-width:240px;">
|
||||
</div>
|
||||
|
||||
<h3 style="text-align:center;">John Haverlack</h3>
|
||||
<p style="text-align:center;">© 2025 — CC BY-ND 4.0</p>
|
||||
|
||||
<hr style="margin:3em 0;">
|
||||
|
||||
|
||||
<!-- Metadata Page (PDF analog) -->
|
||||
<div style="text-align:center; margin-top:5em;">
|
||||
<p><strong>Title</strong>: Basic Book Builder</p>
|
||||
<p><strong>Subtitle</strong>: A Pandoc Template for building books and articles</p>
|
||||
<p><strong>Affiliation</strong>: Alaska Center for Energy and Power</p>
|
||||
<p><strong>Institution</strong>: University of Alaska Fairbanks</p>
|
||||
<p><strong>Author</strong>: John Haverlack</p>
|
||||
<p><strong>Copyright</strong>: © 2025 John Haverlack</p>
|
||||
<p><strong>Copyright</strong>: © 2025 Alaska Center for Energy and Power</p>
|
||||
<p><strong>License</strong>: CC BY-ND 4.0</p>
|
||||
<p><strong>Version</strong>: 0.0.1</p>
|
||||
<p><strong>Date</strong>: 2025-11-05</p>
|
||||
</div>
|
||||
|
||||
<hr style="margin:3em 0;">
|
||||
|
||||
|
||||
<!-- Image attribution + perception note (PDF analog) -->
|
||||
<div style="max-width:40em; margin:auto;">
|
||||
|
||||
<div style="width:100%; text-align:center; display:block; margin:1em 0;">
|
||||
<img src="lib/img/Revolving_circles.480x480_white.png"
|
||||
alt="Revolving Circles optical illusion"
|
||||
style="display:inline-block; max-width:200px;">
|
||||
</div>
|
||||
|
||||
|
||||
<p style="font-size:0.9em; text-align:center;">
|
||||
<em>“Revolving Circles.” n.d. Accessed October 31, 2025.</em><br>
|
||||
<a href="https://en.wikipedia.org/wiki/File/Revolving_circles.svg">Wikipedia source</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The cover image presents a visual illusion of motion. When you focus on the
|
||||
central point and move the page toward or away from your eyes, the concentric
|
||||
circles appear to rotate.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
This reflects a central theme of this work: perception shapes what we think of as
|
||||
“reality.” In this illusion, motion exists only in our minds. We perceive, we do
|
||||
not directly know; our brains construct experience.
|
||||
</p>
|
||||
|
||||
<p><strong>Version</strong>: 0.0.2</p>
|
||||
<p><strong>Date</strong>: 2025-11-11</p>
|
||||
<p><strong>State</strong>: PRE-RELEASE</p>
|
||||
<p><strong>Source</strong>: https://github.com/jehaverlack/basic-book-builder</p>
|
||||
</div>
|
||||
|
||||
<hr style="margin:4em 0;">
|
||||
|
|
@ -200,7 +173,7 @@ Constant</a></li>
|
|||
</ul>
|
||||
</nav>
|
||||
<h1 id="introduction">Introduction</h1>
|
||||
<p>This book builder template was currated by John Haverlack.<span
|
||||
<p>This book builder template has been curated by John Haverlack.<span
|
||||
class="citation" data-cites="JohnHaverlackACEP">(<a
|
||||
href="#ref-JohnHaverlackACEP" role="doc-biblioref"><span>“John
|
||||
<span>Haverlack</span> <span>ACEP</span>”</span> n.d.</a>)</span></p>
|
||||
|
|
@ -243,6 +216,19 @@ disprove.</p>
|
|||
class="math inline"><em>c</em> = 1</span>: <span
|
||||
class="math display"><em>E</em><sup>2</sup> = <em>m</em><sub>0</sub><sup>2</sup> + <em>p</em><sup>2</sup></span></p>
|
||||
</div>
|
||||
<p>Or Warnings…</p>
|
||||
<div class="callout-caution">
|
||||
<p><strong>Caution Note</strong></p>
|
||||
<p> Beware of this section.</p>
|
||||
</div>
|
||||
<div class="callout-warning">
|
||||
<p><strong>Warning Note</strong></p>
|
||||
<p> Beware of this section.</p>
|
||||
</div>
|
||||
<div class="callout-danger">
|
||||
<p><strong>Alerts</strong></p>
|
||||
<p> Extreme Highlight</p>
|
||||
</div>
|
||||
<h1 id="best-words-ever">Best Words Ever</h1>
|
||||
<p>Blah blah blah</p>
|
||||
<h1 id="example-content">Example Content</h1>
|
||||
|
|
@ -536,9 +522,11 @@ equations:</p>
|
|||
class="math inline"><em>E</em> = <em>m</em><sub>0</sub> ⋅ <em>c</em><sup>2</sup></span></p>
|
||||
<p>Or, with <span class="math inline"><em>c</em> = 1</span>, this is
|
||||
much simpler to understand. Energy = Mass</p>
|
||||
<p><span class="math inline"><em>E</em> = <em>m</em><sub>0</sub></span>
|
||||
##### Zero mass objects moving at the speed of light And for objects
|
||||
with no mass, like photos, (<span
|
||||
<p><span
|
||||
class="math inline"><em>E</em> = <em>m</em><sub>0</sub></span></p>
|
||||
<h5 id="zero-mass-objects-moving-at-the-speed-of-light">Zero mass
|
||||
objects moving at the speed of light</h5>
|
||||
<p>And for objects with no mass, like photos, (<span
|
||||
class="math inline"><em>m</em><sub>0</sub> = 0</span>):</p>
|
||||
<p><span
|
||||
class="math inline"><em>E</em> = <em>p</em><em>c</em></span></p>
|
||||
|
|
|
|||
BIN
build/b3.pdf
16
build/b3.tex
|
|
@ -255,6 +255,17 @@ Speculative Concept With the speed of light, \(c = 1\):
|
|||
\[E^2 = m_{0}^2 + p^2 \]
|
||||
\end{speculativebox}
|
||||
|
||||
\hypertarget{citation-example}{%
|
||||
\chapter{Citation Example}\label{citation-example}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
Numerical Linear
|
||||
Algebra(\protect\hyperlink{ref-trefethenNumericalLinearAlgebra2022a}{Trefethen
|
||||
and Bau 2022})
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{best-words-ever}{%
|
||||
\chapter{Best Words Ever}\label{best-words-ever}}
|
||||
|
||||
|
|
@ -827,6 +838,11 @@ Rν lP = (2.77455e-47)*sqrt(m^3/kg)
|
|||
https://www.uaf.edu/acep/about/our-team/john-haverlack.php. Accessed
|
||||
September 30, 2025.
|
||||
|
||||
\leavevmode\vadjust pre{\hypertarget{ref-trefethenNumericalLinearAlgebra2022a}{}}%
|
||||
Trefethen, Lloyd N., and III David Bau. 2022. \emph{Numerical {Linear
|
||||
Algebra}: {Twenty-Fifth Anniversary Edition}}. Philadelphia, PA:
|
||||
{SIAM-Society for Industrial and Applied Mathematics}.
|
||||
|
||||
\end{CSLReferences}
|
||||
|
||||
\backmatter
|
||||
|
|
|
|||
|
|
@ -79,7 +79,10 @@ ul, ol {
|
|||
|
||||
.callout-established,
|
||||
.callout-proposed,
|
||||
.callout-speculative {
|
||||
.callout-speculative,
|
||||
.callout-caution,
|
||||
.callout-warning,
|
||||
.callout-danger {
|
||||
border-radius: 6px;
|
||||
padding: 5px; /* internal padding */
|
||||
margin-top: 5px; /* external spacing tightened */
|
||||
|
|
@ -91,7 +94,10 @@ ul, ol {
|
|||
/* Title line */
|
||||
.callout-established p:first-child strong,
|
||||
.callout-proposed p:first-child strong,
|
||||
.callout-speculative p:first-child strong {
|
||||
.callout-speculative p:first-child strong,
|
||||
.callout-caution p:first-child strong,
|
||||
.callout-warning p:first-child strong,
|
||||
.callout-danger p:first-child strong {
|
||||
display: block;
|
||||
font-family: "Libertinus Sans", sans-serif;
|
||||
font-weight: 600;
|
||||
|
|
@ -102,7 +108,10 @@ ul, ol {
|
|||
/* Paragraphs inside callouts */
|
||||
.callout-established p,
|
||||
.callout-proposed p,
|
||||
.callout-speculative p {
|
||||
.callout-speculative p,
|
||||
.callout-caution p,
|
||||
.callout-warning p,
|
||||
.callout-danger p {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
line-height: 1.45; /* slightly condensed text spacing */
|
||||
|
|
@ -111,19 +120,28 @@ ul, ol {
|
|||
/* Remove top margin on first paragraph, bottom on last */
|
||||
.callout-established p:first-child,
|
||||
.callout-proposed p:first-child,
|
||||
.callout-speculative p:first-child {
|
||||
.callout-speculative p:first-child,
|
||||
.callout-caution p:first-child,
|
||||
.callout-warning p:first-,
|
||||
.callout-danger p:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
.callout-established p:last-child,
|
||||
.callout-proposed p:last-child,
|
||||
.callout-speculative p:last-child {
|
||||
.callout-speculative p:last-child,
|
||||
.callout-caution p:last-child,
|
||||
.callout-warning p:last-child,
|
||||
.callout-danger p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* Math inside callouts */
|
||||
.callout-established .math.display,
|
||||
.callout-proposed .math.display,
|
||||
.callout-speculative .math.display {
|
||||
.callout-speculative .math.display,
|
||||
.callout-caution .math.display,
|
||||
.callout-warning .math.display,
|
||||
.callout-danger .math.display {
|
||||
margin: 0.4em 0;
|
||||
}
|
||||
|
||||
|
|
@ -141,6 +159,20 @@ ul, ol {
|
|||
border-left-color: #8b2be2;
|
||||
}
|
||||
|
||||
.callout-caution {
|
||||
background: #fff0e8;
|
||||
border-left-color: #f5a22f;
|
||||
}
|
||||
|
||||
.callout-warning {
|
||||
background: #fff0e8;
|
||||
border-left-color: #f5a22f;
|
||||
}
|
||||
|
||||
.callout-danger {
|
||||
background: #ffe8e8;
|
||||
border-left-color: #d83b3a;
|
||||
}
|
||||
|
||||
/* ------------------------------
|
||||
Images (in body content)
|
||||
|
|
@ -183,3 +215,30 @@ code {
|
|||
border-radius: 4px;
|
||||
font-size: 0.95em;
|
||||
}
|
||||
|
||||
/* Force all header cells to left-align their text */
|
||||
table thead th {
|
||||
text-align: left !important;
|
||||
vertical-align: bottom; /* optional: aligns nicely with text baseline */
|
||||
padding: 4px 8px; /* optional: consistent spacing */
|
||||
}
|
||||
|
||||
/* Make data cells match if you want consistent left alignment */
|
||||
table tbody td {
|
||||
text-align: left;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
/* Optional: keep math inline nicely aligned */
|
||||
table td .math,
|
||||
table th .math {
|
||||
display: inline-block;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/* Optional: make math display nicely aligned */
|
||||
table td .math.display,
|
||||
table th .math.display {
|
||||
display: block;
|
||||
margin: 0.4em 0;
|
||||
}
|
||||
|
|
|
|||
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 8.9 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 9.9 KiB |
|
After Width: | Height: | Size: 9.9 KiB |
|
|
@ -1,6 +1,8 @@
|
|||
# Introduction
|
||||
|
||||
This book builder template was currated by John Haverlack.[@JohnHaverlackACEP]
|
||||
This book builder template has been curated by John Haverlack.[@JohnHaverlackACEP]
|
||||
|
||||
|
||||
|
||||
|
||||
> “*If I have seen further it is by standing on the shoulders of Giants.*”
|
||||
|
|
@ -32,3 +34,15 @@ Speculative Idea, that the author wonders about, but does not know how to demons
|
|||
> [!speculative] Speculative Concept
|
||||
With the speed of light, $c = 1$:
|
||||
$$E^2 = m_{0}^2 + p^2 $$
|
||||
|
||||
Or Warnings...
|
||||
|
||||
> [!caution] Caution Note
|
||||
> Beware of this section.
|
||||
|
||||
> [!warning] Warning Note
|
||||
> Beware of this section.
|
||||
|
||||
> [!danger] Alerts
|
||||
> Extreme Highlight
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ $c = 299792458 \frac{m}{s} = 299792458 \frac{m}{s} \cdot 1.74542\times10^{34} \f
|
|||
| Unit Cycle | $\Theta$ | $2\pi = 6.28318...\ Radians$ | $1 \tau = 6.28318...\ Radians$ |
|
||||
|
||||
## Fine Structure Constant
|
||||
|
||||
As a consistency check, we compute the _[Fine Structure Constant](https://en.wikipedia.org/wiki/Fine-structure_constant)_ using Reduced Natural Units which is a unit less ratio that should be independent of our system of units.
|
||||
|
||||
$\huge{\alpha=\frac{e^2}{4\pi\epsilon_o\hbar c}=\frac{e^2}{2\tau}=0.00729735≈\frac{1}{137}}$
|
||||
|
|
@ -111,6 +112,7 @@ From this we can see that Energy, Momentum and Mass have equivalent units.
|
|||
> _While we do not really know what energy, mass and momentum are we know that they are fundamentally “made” out of the same stuff because they have the same units._
|
||||
|
||||
##### Objects of mass at rest
|
||||
|
||||
For an object at rest with no momentum ($p = 0$) we see Einstein's famous equations:
|
||||
|
||||
$E = m_{0} \cdot c^2$
|
||||
|
|
@ -118,7 +120,9 @@ $E = m_{0} \cdot c^2$
|
|||
Or, with $c=1$, this is much simpler to understand. Energy = Mass
|
||||
|
||||
$E = m_0$
|
||||
|
||||
##### Zero mass objects moving at the speed of light
|
||||
|
||||
And for objects with no mass, like photos, ($m_{0}= 0$):
|
||||
|
||||
$E=pc$
|
||||
|
|
|
|||
|
|
@ -1,58 +1,31 @@
|
|||
<div class="frontmatter">
|
||||
|
||||
<!-- Title Page -->
|
||||
<h1 style="margin-top:3em; font-size:2.4em; text-align:center;">Big Beautiful Book</h1>
|
||||
<h2 style="text-align:center; font-weight:normal;">A book</h2>
|
||||
<h1 style="margin-top:3em; font-size:2.4em; text-align:center;">Basic Book Builder</h1>
|
||||
<h2 style="text-align:center; font-weight:normal;">A Pandoc Template for building books and articles</h2>
|
||||
|
||||
<div style="text-align:center; margin:2em 0;">
|
||||
<img src="lib/img/Revolving_circles.480x480_white.png" alt="Cover illustration" style="max-width:240px;">
|
||||
<img src="lib/img/ACEPLogo.png" alt="Cover illustration" style="max-width:240px;">
|
||||
</div>
|
||||
|
||||
<h3 style="text-align:center;">John Haverlack</h3>
|
||||
<p style="text-align:center;">© 2025 — CC BY-ND 4.0</p>
|
||||
|
||||
<hr style="margin:3em 0;">
|
||||
|
||||
|
||||
<!-- Metadata Page (PDF analog) -->
|
||||
<div style="text-align:center; margin-top:5em;">
|
||||
<p><strong>Title</strong>: Basic Book Builder</p>
|
||||
<p><strong>Subtitle</strong>: A Pandoc Template for building books and articles</p>
|
||||
<p><strong>Affiliation</strong>: Alaska Center for Energy and Power</p>
|
||||
<p><strong>Institution</strong>: University of Alaska Fairbanks</p>
|
||||
<p><strong>Author</strong>: John Haverlack</p>
|
||||
<p><strong>Copyright</strong>: © 2025 John Haverlack</p>
|
||||
<p><strong>Copyright</strong>: © 2025 Alaska Center for Energy and Power</p>
|
||||
<p><strong>License</strong>: CC BY-ND 4.0</p>
|
||||
<p><strong>Version</strong>: 0.0.1</p>
|
||||
<p><strong>Date</strong>: 2025-11-05</p>
|
||||
</div>
|
||||
|
||||
<hr style="margin:3em 0;">
|
||||
|
||||
|
||||
<!-- Image attribution + perception note (PDF analog) -->
|
||||
<div style="max-width:40em; margin:auto;">
|
||||
|
||||
<div style="width:100%; text-align:center; display:block; margin:1em 0;">
|
||||
<img src="lib/img/Revolving_circles.480x480_white.png"
|
||||
alt="Revolving Circles optical illusion"
|
||||
style="display:inline-block; max-width:200px;">
|
||||
</div>
|
||||
|
||||
|
||||
<p style="font-size:0.9em; text-align:center;">
|
||||
<em>“Revolving Circles.” n.d. Accessed October 31, 2025.</em><br>
|
||||
<a href="https://en.wikipedia.org/wiki/File/Revolving_circles.svg">Wikipedia source</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The cover image presents a visual illusion of motion. When you focus on the
|
||||
central point and move the page toward or away from your eyes, the concentric
|
||||
circles appear to rotate.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
This reflects a central theme of this work: perception shapes what we think of as
|
||||
“reality.” In this illusion, motion exists only in our minds. We perceive, we do
|
||||
not directly know; our brains construct experience.
|
||||
</p>
|
||||
|
||||
<p><strong>Version</strong>: 0.0.2</p>
|
||||
<p><strong>Date</strong>: 2025-11-11</p>
|
||||
<p><strong>State</strong>: PRE-RELEASE</p>
|
||||
<p><strong>Source</strong>: https://github.com/jehaverlack/basic-book-builder</p>
|
||||
</div>
|
||||
|
||||
<hr style="margin:4em 0;">
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@
|
|||
|
||||
\vspace*{2cm}
|
||||
|
||||
{\Huge\bfseries Big Beautiful Book \par}
|
||||
{\Huge\bfseries Basic Book Builder \par}
|
||||
\vspace{0.4cm}
|
||||
{\Large A book \par}
|
||||
{\Large A Pandoc Template for building books and articles \par}
|
||||
|
||||
\vspace{1.2cm}
|
||||
\includegraphics[width=0.33\textwidth]{lib/img/Revolving_circles.480x480_white.png}
|
||||
\includegraphics[width=0.33\textwidth]{lib/img/ACEPLogo.png}
|
||||
|
||||
\vspace{1.2cm}
|
||||
{\Large John Haverlack \par}
|
||||
|
|
@ -27,51 +27,32 @@
|
|||
|
||||
\vspace*{\fill}
|
||||
|
||||
\textbf{Title}: Basic Book Builder
|
||||
|
||||
\textbf{Subtitle}: A Pandoc Template for building books and articles
|
||||
|
||||
\textbf{Affiliation}: Alaska Center for Energy and Power
|
||||
|
||||
\textbf{Institution}: University of Alaska Fairbanks
|
||||
|
||||
\textbf{Author}: John Haverlack
|
||||
|
||||
\textbf{Copyright} © 2025 John Haverlack
|
||||
\textbf{Copyright} © 2025 Alaska Center for Energy and Power
|
||||
|
||||
\textbf{License}: CC BY-ND 4.0
|
||||
|
||||
\textbf{Version}: 0.0.1
|
||||
\textbf{Version}: 0.0.2
|
||||
|
||||
\textbf{Date}: 2025-11-05
|
||||
\textbf{Date}: 2025-11-11
|
||||
|
||||
\textbf{State}: PRE-RELEASE
|
||||
|
||||
\textbf{Source}: https://github.com/jehaverlack/basic-book-builder
|
||||
|
||||
\vspace*{\fill}
|
||||
|
||||
\end{center}
|
||||
|
||||
% ----- Title Page Image Note -----
|
||||
\newpage
|
||||
\thispagestyle{empty}
|
||||
|
||||
\vspace*{1.5cm}
|
||||
|
||||
\begin{center}
|
||||
\includegraphics[width=0.33\textwidth]{lib/img/Revolving_circles.480x480_white.png}
|
||||
|
||||
\vspace{0.4cm}
|
||||
|
||||
\textit{“Revolving Circles.” n.d. Accessed October 31, 2025.} \\
|
||||
\url{https://en.wikipedia.org/wiki/File/Revolving_circles.svg}
|
||||
\end{center}
|
||||
|
||||
\vspace{1cm}
|
||||
|
||||
\noindent
|
||||
The cover image presents a visual illusion of motion. When you focus on the central
|
||||
point and move the page toward or away from your eyes, the concentric circles appear
|
||||
to rotate. This effect reflects the theme of perception and the mind's role in
|
||||
constructing reality.
|
||||
|
||||
\medskip
|
||||
|
||||
\noindent
|
||||
This image serves as a simple demonstration that what our brains perceive can vary
|
||||
significantly from underlying reality. In this case, we perceive motion where none
|
||||
exists. The point is that the best we can do in the human condition is to perceive,
|
||||
not directly know, reality.
|
||||
|
||||
\vspace*{\fill}
|
||||
|
||||
\clearpage
|
||||
|
|
|
|||
|
|
@ -1,46 +1,81 @@
|
|||
\usepackage{etoolbox}
|
||||
\usepackage[most]{tcolorbox}
|
||||
\usepackage{graphicx}
|
||||
\usepackage{xparse}
|
||||
\tcbuselibrary{breakable}
|
||||
|
||||
\definecolor{speculativeback}{RGB}{247,232,255} % #f7e8ff
|
||||
\definecolor{speculativeframe}{RGB}{139,43,226} % #8b2be2
|
||||
|
||||
% Helper to show a blank title if empty
|
||||
\newcommand{\blanktitle}{\mbox{}}
|
||||
|
||||
% =========================================================
|
||||
% Concept Boxes
|
||||
% =========================================================
|
||||
\newtcolorbox{proposedbox}{
|
||||
title=Proposed Concept,
|
||||
\newtcolorbox{proposedbox}[1][Proposed Concept]{%
|
||||
title=\ifstrempty{#1}{\blanktitle}{#1},
|
||||
colback=blue!5!white,
|
||||
colframe=blue!75!black,
|
||||
colbacktitle=blue!15!white,
|
||||
fonttitle=\bfseries,
|
||||
coltitle=black,
|
||||
enhanced,
|
||||
sharp corners,
|
||||
breakable,
|
||||
after = \par\vspace{6pt}
|
||||
enhanced, sharp corners, breakable,
|
||||
after=\par\vspace{6pt}
|
||||
}
|
||||
|
||||
\newtcolorbox{establishedbox}{
|
||||
title=Established Concept,
|
||||
\newtcolorbox{establishedbox}[1][Established Concept]{%
|
||||
title=\ifstrempty{#1}{\blanktitle}{#1},
|
||||
colback=green!5!white,
|
||||
colframe=green!75!black,
|
||||
colbacktitle=green!15!white,
|
||||
fonttitle=\bfseries,
|
||||
coltitle=black,
|
||||
enhanced,
|
||||
sharp corners,
|
||||
breakable,
|
||||
after = \par\vspace{6pt}
|
||||
enhanced, sharp corners, breakable,
|
||||
after=\par\vspace{6pt}
|
||||
}
|
||||
|
||||
\newtcolorbox{speculativebox}{
|
||||
title=Speculative Concept,
|
||||
colback=purple!5!white,
|
||||
colframe=purple!75!black,
|
||||
colbacktitle=purple!15!white,
|
||||
\newtcolorbox{speculativebox}[1][Speculative Concept]{%
|
||||
title=\ifstrempty{#1}{\blanktitle}{#1},
|
||||
colback=speculativeback,
|
||||
colframe=speculativeframe,
|
||||
colbacktitle=speculativeback!80!white, % lighter variant for title bar
|
||||
fonttitle=\bfseries,
|
||||
coltitle=black,
|
||||
enhanced,
|
||||
sharp corners,
|
||||
breakable,
|
||||
after = \par\vspace{6pt}
|
||||
enhanced, sharp corners, breakable,
|
||||
after=\par\vspace{6pt}
|
||||
}
|
||||
|
||||
|
||||
\newtcolorbox{cautionbox}[1][Caution]{%
|
||||
title=\ifstrempty{#1}{\blanktitle}{#1},
|
||||
colback=orange!5!white,
|
||||
colframe=orange!75!black,
|
||||
colbacktitle=orange!15!white,
|
||||
fonttitle=\bfseries,
|
||||
coltitle=black,
|
||||
enhanced, sharp corners, breakable,
|
||||
after=\par\vspace{6pt}
|
||||
}
|
||||
|
||||
\newtcolorbox{warningbox}[1][Warning]{%
|
||||
title=\ifstrempty{#1}{\blanktitle}{#1},
|
||||
colback=orange!5!white,
|
||||
colframe=orange!75!black,
|
||||
colbacktitle=orange!15!white,
|
||||
fonttitle=\bfseries,
|
||||
coltitle=black,
|
||||
enhanced, sharp corners, breakable,
|
||||
after=\par\vspace{6pt}
|
||||
}
|
||||
|
||||
\newtcolorbox{dangerbox}[1][Danger]{%
|
||||
title=\ifstrempty{#1}{\blanktitle}{#1},
|
||||
colback=red!5!white,
|
||||
colframe=red!75!black,
|
||||
colbacktitle=red!15!white,
|
||||
fonttitle=\bfseries,
|
||||
coltitle=black,
|
||||
enhanced, sharp corners, breakable,
|
||||
after=\par\vspace{6pt}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
title: "Basic Book Builder"
|
||||
subtitle: "A Pandoc Template for building books and articles"
|
||||
author: "John Haverlack"
|
||||
author-email: "jehaverlack@alaska.edu"
|
||||
affiliation: "Alaska Center for Energy and Power"
|
||||
institution: "University of Alaska Fairbanks"
|
||||
logo: "lib/img/ACEPLogo.png"
|
||||
copyright: "© 2025 Alaska Center for Energy and Power"
|
||||
license: "CC BY-ND 4.0"
|
||||
version: "0.0.2"
|
||||
date: "2025-11-11"
|
||||
state: "PRE-RELEASE"
|
||||
source: "https://github.com/jehaverlack/basic-book-builder"
|
||||
|
|
@ -18,7 +18,8 @@ metadata:
|
|||
link-citations: true
|
||||
|
||||
variables:
|
||||
documentclass: book
|
||||
documentclass: article # set to "article" or "book"
|
||||
suppress-chapter: true
|
||||
fontsize: 12pt
|
||||
geometry:
|
||||
- margin=1in
|
||||
|
|
|
|||
|
|
@ -79,7 +79,10 @@ ul, ol {
|
|||
|
||||
.callout-established,
|
||||
.callout-proposed,
|
||||
.callout-speculative {
|
||||
.callout-speculative,
|
||||
.callout-caution,
|
||||
.callout-warning,
|
||||
.callout-danger {
|
||||
border-radius: 6px;
|
||||
padding: 5px; /* internal padding */
|
||||
margin-top: 5px; /* external spacing tightened */
|
||||
|
|
@ -91,7 +94,10 @@ ul, ol {
|
|||
/* Title line */
|
||||
.callout-established p:first-child strong,
|
||||
.callout-proposed p:first-child strong,
|
||||
.callout-speculative p:first-child strong {
|
||||
.callout-speculative p:first-child strong,
|
||||
.callout-caution p:first-child strong,
|
||||
.callout-warning p:first-child strong,
|
||||
.callout-danger p:first-child strong {
|
||||
display: block;
|
||||
font-family: "Libertinus Sans", sans-serif;
|
||||
font-weight: 600;
|
||||
|
|
@ -102,7 +108,10 @@ ul, ol {
|
|||
/* Paragraphs inside callouts */
|
||||
.callout-established p,
|
||||
.callout-proposed p,
|
||||
.callout-speculative p {
|
||||
.callout-speculative p,
|
||||
.callout-caution p,
|
||||
.callout-warning p,
|
||||
.callout-danger p {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
line-height: 1.45; /* slightly condensed text spacing */
|
||||
|
|
@ -111,19 +120,28 @@ ul, ol {
|
|||
/* Remove top margin on first paragraph, bottom on last */
|
||||
.callout-established p:first-child,
|
||||
.callout-proposed p:first-child,
|
||||
.callout-speculative p:first-child {
|
||||
.callout-speculative p:first-child,
|
||||
.callout-caution p:first-child,
|
||||
.callout-warning p:first-,
|
||||
.callout-danger p:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
.callout-established p:last-child,
|
||||
.callout-proposed p:last-child,
|
||||
.callout-speculative p:last-child {
|
||||
.callout-speculative p:last-child,
|
||||
.callout-caution p:last-child,
|
||||
.callout-warning p:last-child,
|
||||
.callout-danger p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* Math inside callouts */
|
||||
.callout-established .math.display,
|
||||
.callout-proposed .math.display,
|
||||
.callout-speculative .math.display {
|
||||
.callout-speculative .math.display,
|
||||
.callout-caution .math.display,
|
||||
.callout-warning .math.display,
|
||||
.callout-danger .math.display {
|
||||
margin: 0.4em 0;
|
||||
}
|
||||
|
||||
|
|
@ -141,6 +159,20 @@ ul, ol {
|
|||
border-left-color: #8b2be2;
|
||||
}
|
||||
|
||||
.callout-caution {
|
||||
background: #fff0e8;
|
||||
border-left-color: #f5a22f;
|
||||
}
|
||||
|
||||
.callout-warning {
|
||||
background: #fff0e8;
|
||||
border-left-color: #f5a22f;
|
||||
}
|
||||
|
||||
.callout-danger {
|
||||
background: #ffe8e8;
|
||||
border-left-color: #d83b3a;
|
||||
}
|
||||
|
||||
/* ------------------------------
|
||||
Images (in body content)
|
||||
|
|
@ -183,3 +215,30 @@ code {
|
|||
border-radius: 4px;
|
||||
font-size: 0.95em;
|
||||
}
|
||||
|
||||
/* Force all header cells to left-align their text */
|
||||
table thead th {
|
||||
text-align: left !important;
|
||||
vertical-align: bottom; /* optional: aligns nicely with text baseline */
|
||||
padding: 4px 8px; /* optional: consistent spacing */
|
||||
}
|
||||
|
||||
/* Make data cells match if you want consistent left alignment */
|
||||
table tbody td {
|
||||
text-align: left;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
/* Optional: keep math inline nicely aligned */
|
||||
table td .math,
|
||||
table th .math {
|
||||
display: inline-block;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/* Optional: make math display nicely aligned */
|
||||
table td .math.display,
|
||||
table th .math.display {
|
||||
display: block;
|
||||
margin: 0.4em 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,30 +3,53 @@ local callout_env_map = {
|
|||
idea = "ideabox",
|
||||
proposed = "proposedbox",
|
||||
established = "establishedbox",
|
||||
speculative = "speculativebox"
|
||||
speculative = "speculativebox",
|
||||
caution = "cautionbox",
|
||||
warning = "warningbox",
|
||||
danger = "dangerbox"
|
||||
}
|
||||
|
||||
function BlockQuote(el)
|
||||
if #el.content > 0 and el.content[1].t == "Para" then
|
||||
local firstPara = el.content[1]
|
||||
if #firstPara.content > 0 and firstPara.content[1].t == "Str" then
|
||||
local firstWord = firstPara.content[1].text
|
||||
local calloutType = firstWord:match("^%[%!(%w+)%]$")
|
||||
if calloutType and callout_env_map[calloutType] then
|
||||
-- Remove the [!type] marker and leading space
|
||||
|
||||
function BlockQuote(el)
|
||||
if #el.content > 0 and el.content[1].t == "Para" then
|
||||
local firstPara = el.content[1]
|
||||
if #firstPara.content > 0 and firstPara.content[1].t == "Str" then
|
||||
local firstWord = firstPara.content[1].text
|
||||
local calloutType = firstWord:match("^%[%!(%w+)%]$")
|
||||
if calloutType and callout_env_map[calloutType] then
|
||||
-- remove the [!type] marker
|
||||
table.remove(firstPara.content, 1)
|
||||
-- remove one following space if present
|
||||
if #firstPara.content > 0 and firstPara.content[1].t == "Space" then
|
||||
table.remove(firstPara.content, 1)
|
||||
if #firstPara.content > 0 and firstPara.content[1].t == "Space" then
|
||||
table.remove(firstPara.content, 1)
|
||||
end
|
||||
|
||||
-- Wrap the content in the appropriate LaTeX box
|
||||
local env = callout_env_map[calloutType]
|
||||
local latex = "\\begin{"..env.."}\n" ..
|
||||
pandoc.write(pandoc.Pandoc(el.content), "latex") ..
|
||||
"\n\\end{"..env.."}"
|
||||
return pandoc.RawBlock("latex", latex)
|
||||
end
|
||||
|
||||
-- gather optional custom title (may contain spaces)
|
||||
local titleInlines = {}
|
||||
while #firstPara.content > 0 do
|
||||
local t = firstPara.content[1].t
|
||||
if t == "SoftBreak" then
|
||||
table.remove(firstPara.content, 1)
|
||||
break
|
||||
elseif t == "Space" or t == "Str" or t == "Emph" or t == "Strong" or t == "Code" then
|
||||
table.insert(titleInlines, table.remove(firstPara.content, 1))
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
local customTitle = pandoc.utils.stringify(pandoc.Span(titleInlines))
|
||||
customTitle = customTitle:gsub("^%s+", ""):gsub("%s+$", "")
|
||||
if customTitle == "" then customTitle = nil end
|
||||
|
||||
local env = callout_env_map[calloutType]
|
||||
local titleOption = customTitle and ("[" .. customTitle .. "]") or "[]"
|
||||
|
||||
local latex = "\\begin{" .. env .. "}" .. titleOption .. "\n"
|
||||
.. pandoc.write(pandoc.Pandoc(el.content), "latex")
|
||||
.. "\n\\end{" .. env .. "}"
|
||||
|
||||
return pandoc.RawBlock("latex", latex)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 8.9 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 9.9 KiB |
|
After Width: | Height: | Size: 9.9 KiB |
|
|
@ -0,0 +1,60 @@
|
|||
#!/usr/bin/env bash
|
||||
# Usage: scripts/build-frontmatter.sh conf/metadata.yaml templates/frontmatter.html conf/frontmatter.html
|
||||
# Description:
|
||||
# Reads templates/frontmatter.html or templates/frontmatter.tex
|
||||
# Replaces all $key$ with values from metadata.yaml
|
||||
# Writes result to conf/frontmatter.html or frontmatter.tex
|
||||
# Requirements:
|
||||
# metadata.yaml must be flat (key: value)
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
META_FILE="$1"
|
||||
TEMPLATE_FILE="$2"
|
||||
OUTPUT_FILE="$3"
|
||||
TEMP_FILE="scripts/tmp/frontmatter.tmp"
|
||||
|
||||
# Check arguments
|
||||
echo " META_FILE: $META_FILE"
|
||||
echo " TEMPLATE_FILE: $TEMPLATE_FILE"
|
||||
echo " OUTPUT_FILE: $OUTPUT_FILE"
|
||||
echo " TEMP_FILE: $TEMP_FILE"
|
||||
echo ""
|
||||
|
||||
# Start fresh output
|
||||
cp "$TEMPLATE_FILE" "$OUTPUT_FILE"
|
||||
|
||||
# Load metadata into Bash associative array
|
||||
declare -A META
|
||||
while IFS= read -r line; do
|
||||
# skip empty or comment lines
|
||||
[[ -z "$line" || "$line" =~ ^# ]] && continue
|
||||
|
||||
key=$(echo "$line" | cut -d ':' -f 1 | xargs)
|
||||
val=$(echo "$line" | cut -d ':' -f 2- | xargs) # capture full value after first colon, trim spaces
|
||||
|
||||
# strip surrounding quotes if present
|
||||
val="${val%\"}"
|
||||
val="${val#\"}"
|
||||
|
||||
META["$key"]="$val"
|
||||
done < "$META_FILE"
|
||||
|
||||
# Read template line by line and substitute
|
||||
for key in "${!META[@]}"; do
|
||||
# Strip leading/trailing whitespace and quotes
|
||||
val="${META[$key]}"
|
||||
val="${val%\"}" # remove trailing "
|
||||
val="${val#\"}" # remove leading "
|
||||
val="$(echo "$val" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')" # trim spaces safely
|
||||
|
||||
# Escape special chars for sed
|
||||
esc_val=$(printf '%s' "$val" | sed -e 's/[\/&$]/\\&/g')
|
||||
|
||||
search_key="\$${key}\$"
|
||||
echo " Replacing ${search_key} → ${val}"
|
||||
sed -i "s|\\\$${key}\\\$|${val}|g" "$OUTPUT_FILE"
|
||||
# ls -l "$OUTPUT_FILE"
|
||||
done
|
||||
|
||||
echo "✅ Rendered: $OUTPUT_FILE"
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<div class="frontmatter">
|
||||
|
||||
<!-- Title Page -->
|
||||
<h1 style="margin-top:3em; font-size:2.4em; text-align:center;">$title$</h1>
|
||||
<h2 style="text-align:center; font-weight:normal;">$subtitle$</h2>
|
||||
|
||||
<div style="text-align:center; margin:2em 0;">
|
||||
<img src="$logo$" alt="Cover illustration" style="max-width:240px;">
|
||||
</div>
|
||||
|
||||
<h3 style="text-align:center;">$author$</h3>
|
||||
|
||||
<hr style="margin:3em 0;">
|
||||
|
||||
|
||||
<!-- Metadata Page (PDF analog) -->
|
||||
<div style="text-align:center; margin-top:5em;">
|
||||
<p><strong>Title</strong>: $title$</p>
|
||||
<p><strong>Subtitle</strong>: $subtitle$</p>
|
||||
<p><strong>Affiliation</strong>: $affiliation$</p>
|
||||
<p><strong>Institution</strong>: $institution$</p>
|
||||
<p><strong>Author</strong>: $author$</p>
|
||||
<p><strong>Copyright</strong>: $copyright$</p>
|
||||
<p><strong>License</strong>: $license$</p>
|
||||
<p><strong>Version</strong>: $version$</p>
|
||||
<p><strong>Date</strong>: $date$</p>
|
||||
<p><strong>State</strong>: $state$</p>
|
||||
<p><strong>Source</strong>: $source$</p>
|
||||
</div>
|
||||
|
||||
<hr style="margin:4em 0;">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
window.MathJax = {
|
||||
tex: { inlineMath: [['$', '$'], ['\\(', '\\)']] },
|
||||
svg: { fontCache: 'global' }
|
||||
};
|
||||
</script>
|
||||
<script src="lib/mathjax/tex-mml-chtml.js"></script>
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
% -------------------------
|
||||
% Custom Title Page
|
||||
% -------------------------
|
||||
\begin{titlepage}
|
||||
\centering
|
||||
|
||||
\vspace*{2cm}
|
||||
|
||||
{\Huge\bfseries $title$ \par}
|
||||
\vspace{0.4cm}
|
||||
{\Large $subtitle$ \par}
|
||||
|
||||
\vspace{1.2cm}
|
||||
\includegraphics[width=0.33\textwidth]{$logo$}
|
||||
|
||||
\vspace{1.2cm}
|
||||
{\Large $author$ \par}
|
||||
|
||||
\vfill
|
||||
|
||||
\end{titlepage}
|
||||
|
||||
% ----- COPYRIGHT / META PAGE -----
|
||||
\newpage
|
||||
\thispagestyle{empty}
|
||||
\begin{center}
|
||||
|
||||
\vspace*{\fill}
|
||||
|
||||
\textbf{Title}: $title$
|
||||
|
||||
\textbf{Subtitle}: $subtitle$
|
||||
|
||||
\textbf{Affiliation}: $affiliation$
|
||||
|
||||
\textbf{Institution}: $institution$
|
||||
|
||||
\textbf{Author}: $author$
|
||||
|
||||
\textbf{Copyright} $copyright$
|
||||
|
||||
\textbf{License}: $license$
|
||||
|
||||
\textbf{Version}: $version$
|
||||
|
||||
\textbf{Date}: $date$
|
||||
|
||||
\textbf{State}: $state$
|
||||
|
||||
\textbf{Source}: $source$
|
||||
|
||||
\vspace*{\fill}
|
||||
|
||||
\end{center}
|
||||
|
||||
\vspace*{\fill}
|
||||
|
||||
\clearpage
|
||||
\pagenumbering{arabic}
|
||||
\setcounter{page}{1}
|
||||