diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 46e5392..fc886ea 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -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", diff --git a/Makefile b/Makefile index 05fee03..0aec9e8 100644 --- a/Makefile +++ b/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 diff --git a/README.md b/README.md index 28d76d0..1bdf046 100644 --- a/README.md +++ b/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. diff --git a/build.sh b/build.sh deleted file mode 100755 index b50d0d2..0000000 --- a/build.sh +++ /dev/null @@ -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" diff --git a/build/b3.epub b/build/b3.epub index 14497e1..23f4579 100644 Binary files a/build/b3.epub and b/build/b3.epub differ diff --git a/build/b3.html b/build/b3.html index 58bbb23..2ba0443 100644 --- a/build/b3.html +++ b/build/b3.html @@ -102,58 +102,31 @@
-

Big Beautiful Book

-

A book

+

Basic Book Builder

+

A Pandoc Template for building books and articles

- Cover illustration + Cover illustration

John Haverlack

-

© 2025 — CC BY-ND 4.0


+

Title: Basic Book Builder

+

Subtitle: A Pandoc Template for building books and articles

+

Affiliation: Alaska Center for Energy and Power

+

Institution: University of Alaska Fairbanks

Author: John Haverlack

-

Copyright: © 2025 John Haverlack

+

Copyright: © 2025 Alaska Center for Energy and Power

License: CC BY-ND 4.0

-

Version: 0.0.1

-

Date: 2025-11-05

-
- -
- - - -
- -
- Revolving Circles optical illusion -
- - -

- “Revolving Circles.” n.d. Accessed October 31, 2025.
- Wikipedia source -

- -

- 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 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. -

- +

Version: 0.0.2

+

Date: 2025-11-11

+

State: PRE-RELEASE

+

Source: https://github.com/jehaverlack/basic-book-builder


@@ -200,7 +173,7 @@ Constant

Introduction

-

This book builder template was currated by John Haverlack.This book builder template has been curated by John Haverlack.(“John Haverlack ACEP n.d.)

@@ -243,6 +216,19 @@ disprove.

class="math inline">c = 1: E2 = m02 + p2

+

Or Warnings…

+
+

Caution Note

+

Beware of this section.

+
+
+

Warning Note

+

Beware of this section.

+
+
+

Alerts

+

Extreme Highlight

+

Best Words Ever

Blah blah blah

Example Content

@@ -536,9 +522,11 @@ equations:

class="math inline">E = m0 ⋅ c2

Or, with c = 1, this is much simpler to understand. Energy = Mass

-

E = m0 -##### Zero mass objects moving at the speed of light And for objects -with no mass, like photos, (E = m0

+
Zero mass +objects moving at the speed of light
+

And for objects with no mass, like photos, (m0 = 0):

E = pc

diff --git a/build/b3.pdf b/build/b3.pdf index eb56942..9013be4 100644 Binary files a/build/b3.pdf and b/build/b3.pdf differ diff --git a/build/b3.tex b/build/b3.tex index 1741a99..e141fbe 100644 --- a/build/b3.tex +++ b/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 diff --git a/build/conf/style.css b/build/conf/style.css index 41b6986..d95c397 100644 --- a/build/conf/style.css +++ b/build/conf/style.css @@ -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; +} diff --git a/build/lib/img/ACEP Logo for Canvas.png b/build/lib/img/ACEP Logo for Canvas.png new file mode 100644 index 0000000..2a8c398 Binary files /dev/null and b/build/lib/img/ACEP Logo for Canvas.png differ diff --git a/build/lib/img/ACEP Logo.png b/build/lib/img/ACEP Logo.png new file mode 100644 index 0000000..220a4a6 Binary files /dev/null and b/build/lib/img/ACEP Logo.png differ diff --git a/build/lib/img/ACEP-50px.png b/build/lib/img/ACEP-50px.png new file mode 100644 index 0000000..2bc5f56 Binary files /dev/null and b/build/lib/img/ACEP-50px.png differ diff --git a/build/lib/img/ACEP.png b/build/lib/img/ACEP.png new file mode 100644 index 0000000..b479164 Binary files /dev/null and b/build/lib/img/ACEP.png differ diff --git a/build/lib/img/ACEPLogo.png b/build/lib/img/ACEPLogo.png new file mode 100644 index 0000000..220a4a6 Binary files /dev/null and b/build/lib/img/ACEPLogo.png differ diff --git a/build/lib/img/UAF.png b/build/lib/img/UAF.png new file mode 100644 index 0000000..c33780a Binary files /dev/null and b/build/lib/img/UAF.png differ diff --git a/build/lib/img/UAFLogo_A_black.png b/build/lib/img/UAFLogo_A_black.png new file mode 100644 index 0000000..c9249f6 Binary files /dev/null and b/build/lib/img/UAFLogo_A_black.png differ diff --git a/build/lib/img/UAFLogo_A_blue.png b/build/lib/img/UAFLogo_A_blue.png new file mode 100644 index 0000000..fa625fa Binary files /dev/null and b/build/lib/img/UAFLogo_A_blue.png differ diff --git a/chapters/00_Introduction.md b/chapters/00_Introduction.md index 8095736..e2718d6 100644 --- a/chapters/00_Introduction.md +++ b/chapters/00_Introduction.md @@ -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 + diff --git a/chapters/02_Chapter2.md b/chapters/02_Chapter2.md index 816c9c8..cca63c2 100644 --- a/chapters/02_Chapter2.md +++ b/chapters/02_Chapter2.md @@ -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$ diff --git a/conf/frontmatter.html b/conf/frontmatter.html index 8c1c5d2..a35541e 100644 --- a/conf/frontmatter.html +++ b/conf/frontmatter.html @@ -1,58 +1,31 @@
-

Big Beautiful Book

-

A book

+

Basic Book Builder

+

A Pandoc Template for building books and articles

- Cover illustration + Cover illustration

John Haverlack

-

© 2025 — CC BY-ND 4.0


+

Title: Basic Book Builder

+

Subtitle: A Pandoc Template for building books and articles

+

Affiliation: Alaska Center for Energy and Power

+

Institution: University of Alaska Fairbanks

Author: John Haverlack

-

Copyright: © 2025 John Haverlack

+

Copyright: © 2025 Alaska Center for Energy and Power

License: CC BY-ND 4.0

-

Version: 0.0.1

-

Date: 2025-11-05

-
- -
- - - -
- -
- Revolving Circles optical illusion -
- - -

- “Revolving Circles.” n.d. Accessed October 31, 2025.
- Wikipedia source -

- -

- 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 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. -

- +

Version: 0.0.2

+

Date: 2025-11-11

+

State: PRE-RELEASE

+

Source: https://github.com/jehaverlack/basic-book-builder


diff --git a/conf/frontmatter.tex b/conf/frontmatter.tex index 7b74e88..301791e 100644 --- a/conf/frontmatter.tex +++ b/conf/frontmatter.tex @@ -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 diff --git a/conf/header.tex b/conf/header.tex index 6f27907..98db31e 100644 --- a/conf/header.tex +++ b/conf/header.tex @@ -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} +} diff --git a/conf/markdown.yaml b/conf/markdown.yaml new file mode 100644 index 0000000..e69de29 diff --git a/conf/metadata.yaml b/conf/metadata.yaml new file mode 100644 index 0000000..52efc0f --- /dev/null +++ b/conf/metadata.yaml @@ -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" diff --git a/conf/pandoc.yaml b/conf/pandoc.yaml index 868b970..477c64a 100644 --- a/conf/pandoc.yaml +++ b/conf/pandoc.yaml @@ -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 diff --git a/conf/style.css b/conf/style.css index 41b6986..d95c397 100644 --- a/conf/style.css +++ b/conf/style.css @@ -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; +} diff --git a/filters/callouts.lua b/filters/callouts.lua index 235c111..c0c0905 100644 --- a/filters/callouts.lua +++ b/filters/callouts.lua @@ -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 - \ No newline at end of file +end diff --git a/lib/img/ACEP Logo for Canvas.png b/lib/img/ACEP Logo for Canvas.png new file mode 100644 index 0000000..2a8c398 Binary files /dev/null and b/lib/img/ACEP Logo for Canvas.png differ diff --git a/lib/img/ACEP Logo.png b/lib/img/ACEP Logo.png new file mode 100644 index 0000000..220a4a6 Binary files /dev/null and b/lib/img/ACEP Logo.png differ diff --git a/lib/img/ACEP-50px.png b/lib/img/ACEP-50px.png new file mode 100644 index 0000000..2bc5f56 Binary files /dev/null and b/lib/img/ACEP-50px.png differ diff --git a/lib/img/ACEP.png b/lib/img/ACEP.png new file mode 100644 index 0000000..b479164 Binary files /dev/null and b/lib/img/ACEP.png differ diff --git a/lib/img/ACEPLogo.png b/lib/img/ACEPLogo.png new file mode 100644 index 0000000..220a4a6 Binary files /dev/null and b/lib/img/ACEPLogo.png differ diff --git a/lib/img/UAF.png b/lib/img/UAF.png new file mode 100644 index 0000000..c33780a Binary files /dev/null and b/lib/img/UAF.png differ diff --git a/lib/img/UAFLogo_A_black.png b/lib/img/UAFLogo_A_black.png new file mode 100644 index 0000000..c9249f6 Binary files /dev/null and b/lib/img/UAFLogo_A_black.png differ diff --git a/lib/img/UAFLogo_A_blue.png b/lib/img/UAFLogo_A_blue.png new file mode 100644 index 0000000..fa625fa Binary files /dev/null and b/lib/img/UAFLogo_A_blue.png differ diff --git a/scripts/build-frontmatter.sh b/scripts/build-frontmatter.sh new file mode 100755 index 0000000..aa2c4c0 --- /dev/null +++ b/scripts/build-frontmatter.sh @@ -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" diff --git a/templates/frontmatter.html b/templates/frontmatter.html new file mode 100644 index 0000000..51c6333 --- /dev/null +++ b/templates/frontmatter.html @@ -0,0 +1,42 @@ +
+ + +

$title$

+

$subtitle$

+ +
+ Cover illustration +
+ +

$author$

+ +
+ + + +
+

Title: $title$

+

Subtitle: $subtitle$

+

Affiliation: $affiliation$

+

Institution: $institution$

+

Author: $author$

+

Copyright: $copyright$

+

License: $license$

+

Version: $version$

+

Date: $date$

+

State: $state$

+

Source: $source$

+
+ +
+ +
+ + + + diff --git a/templates/frontmatter.tex b/templates/frontmatter.tex new file mode 100644 index 0000000..1797770 --- /dev/null +++ b/templates/frontmatter.tex @@ -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} \ No newline at end of file