Skip to content

Commit bbf3a02

Browse files
authored
tikz: use tikzexport (ie, tikzexternalize, t2.7.5) (#1)
Temporary situation: the content of xmPreamble is to be moved into ximeraLatex (ie, ximera.cls...) * test tikzexport * test tikzexport * only one xourse * no .ximera-local * no optimize (for tikzxeternalize) * add veryclean * update xmPreamble; uses adhoc .ximera_local !!! * config.txt: temp hack * use .png; * also compile calculus1 * only testxourse * compile all * xmPreamble: set isXourse; use mutool (and not dvisvgm); use t2.7.5 * cleanup * use -full ... * reset serve-ximera
1 parent c7eb8f4 commit bbf3a02

File tree

5 files changed

+73
-14
lines changed

5 files changed

+73
-14
lines changed

.github/workflows/serve-ximera.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ on:
88
env:
99
GPG_KEY: ${{ secrets.GPG_KEY }}
1010
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
11-
# XIMERA_NAME: mooculuspreview # (re-) set infra per job
11+
XIMERA_NAME: mooculuspreview # (re-) set infra per job
1212
XIMERA_URL: "https://ximera.osu.edu/"
13-
XM_COMPILE_SEQUENCE: html
1413
# XIMERA_URL: "https://xerxes.ximera.org/"
15-
# XM_TO_PROCESS: "testxourse.tex calculus1.tex calculus2"
14+
##XM_COMPILE_SEQUENCE: html
15+
XM_TO_PROCESS: "testxourse.tex"
1616
# XM_TO_PROCESS: "testxourse.tex calculus1.tex calculus2.tex calculus3.tex calculusA2.tex calculusE.tex calculus1TextbookBySection [a-z]*/exercises/exerciseList.tex"
1717
# XM_TO_PROCESS: "review/*/exerciseList.tex *TextbookBySection/*.tex"
18-
XM_TO_PROCESS: "."
18+
# XM_TO_PROCESS: "."
1919

2020
jobs:
2121
build-ximera:
@@ -55,16 +55,14 @@ jobs:
5555
5656
- name: Build and publish Ximera courses
5757
env:
58-
XIMERA_NAME: mooculus
59-
## XIMERA_NAME: mooculuspreview
60-
##notused# XIMERA_URL: ${{ vars.XIMERA_URL }}
61-
##notused# XIMERA_NAME: ${{ vars.XIMERA_NAME }}${{ github.ref_name }}
58+
XIMERA_NAME: mooculuspreview
6259
run: |
6360
echo "Baking and Serving to $XIMERA_URL$XIMERA_NAME"
6461
ls -alrt
65-
./xmScripts/xmlatex ghaction -j 8 $XM_TO_PROCESS -f -s --compile html
66-
echo "Recent git log:"
67-
git log --oneline --graph --decorate --all -n 10
62+
./xmScripts/xmlatex veryclean
63+
./xmScripts/xmlatex all -j 8 $XM_TO_PROCESS
64+
# echo "Recent git log:"
65+
# git log --oneline --graph --decorate --all -n 10
6866
echo "✅ Published to $XIMERA_URL$XIMERA_NAME " >> $GITHUB_STEP_SUMMARY
6967
7068
- name: Setup ximera serve cache (only .git)

higherOrderDerivativesAndGraphs/digInHigherOrderDerivativesAndGraphs.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
\input{../preamble.tex}
44

5+
56
\outcome{Use the first derivative to determine whether a function is increasing or decreasing.}
67
\outcome{Define higher order derivatives.}
78
\outcome{Compare differing notations for higher order derivatives.}

testxourse.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
\activity{understandingFunctions/titlePage.tex}
3131
\sectionstyle
3232
\activity{understandingFunctions/breakGround.tex}
33+
\activity{higherOrderDerivativesAndGraphs/digInHigherOrderDerivativesAndGraphs.tex}
3334

3435

3536
%\pdfOnly{\printindex}

xmPreamble.tex

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,61 @@
1-
\def\xmNotExpandableAsAccordion{true}
2-
\def\xmNotHintAsExpandable{true}
1+
\typeout{Start loading xmPreamble.tex}%
2+
3+
\makeatletter
4+
\typeout{**** Class options: \@classoptionslist ****}
5+
6+
\@ifclassloaded{xourse}{%
7+
\typeout{Start loading preamble.tex (in a XOURSE)}%
8+
\def\isXourse{true} % could/should be in xourse.cls !
9+
}{%
10+
\typeout{Start loading preamble.tex (NOT in a XOURSE)}%
11+
}
12+
\makeatother
13+
14+
\ifdefined\isXourse
15+
\typeout{tikzexport: in xourse no exports in xourse}
16+
\else
17+
\typeout{tikzexport: global export settings}
18+
19+
\usepackage{tikz}
20+
\usetikzlibrary{external}
21+
22+
\makeatletter
23+
% Make sure folder tikz/ exists
24+
\def\tikz@createexternaldir{%
25+
\immediate\write18{mkdir -p tikz}%
26+
}
27+
% Patch TikZ so this runs just before writing the .md5 file
28+
\pretocmd\tikzexternalize{\tikz@createexternaldir}{}{}
29+
30+
% Setup externalization
31+
\ifdefined\HCode
32+
% in htlatex, just include the svg files
33+
\typeout{tikzexport: in HTML}
34+
\def\pgfsys@imagesuffixlist{.svg}
35+
\def\pgfsysdriver{pgfsys-dvisvgm4ht.def}
36+
% \tikzexternalize[verbose,prefix=tikz/,mode=graphics if exists]
37+
% \else
38+
% \tikzexternalize[verbose,prefix=tikz/,optimize=false]
39+
\fi
40+
41+
% Always externalize...
42+
43+
\tikzexternalize[verbose,prefix=tikz/,optimize=false]
44+
\tikzset{
45+
external/system call={
46+
mkdir -p tikz &&
47+
pdflatex \tikzexternalcheckshellescape
48+
-halt-on-error -interaction=batchmode
49+
-jobname "\image" "\string\PassOptionsToClass{tikzexport}{ximera}\texsource" &&
50+
mutool draw -F svg "\image".pdf >"\image".svg;
51+
mutool draw -r 150 -c rgbalpha -o "\image".png "\image".pdf &&
52+
ebb -x "\image".png &&
53+
echo "DONE pdflatex \image"
54+
},
55+
}
56+
\fi
57+
58+
% dvisvgm --pdf --page=1- "\image".pdf -o "\image".svg &&
59+
60+
61+
\makeatother

xmScripts/config.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# version of Ximera xake container to use (with xmlatex)
33
#
44
# : "${XAKE_BASE:=ximeralatex}"
5-
: "${XAKE_VERSION:=v2.7.4}"
5+
: "${XAKE_VERSION:=t2.7.5-full}"
66
# : "${XAKE_VERSION:=latest}" # with texlive_full
77
#
88
# For publishing you'll need a GPG Key

0 commit comments

Comments
 (0)