diff options
-rw-r--r-- | all.do | 1 | ||||
-rw-r--r-- | build/preamble.tex | 7 | ||||
-rw-r--r-- | build/preview/preview.sty.do | 2 | ||||
-rwxr-xr-x | build/tex-filter.hs | 7 | ||||
-rw-r--r-- | default.svg.do | 19 |
5 files changed, 25 insertions, 11 deletions
@@ -1,2 +1 @@ | |||
1 | redo-ifchange index.html | redo-ifchange index.html | |
2 | redo-ifchange htdocs | ||
diff --git a/build/preamble.tex b/build/preamble.tex index 01c8146..cf3623b 100644 --- a/build/preamble.tex +++ b/build/preamble.tex | |||
@@ -4,6 +4,8 @@ | |||
4 | \usepackage{amsmath} | 4 | \usepackage{amsmath} |
5 | \usepackage{etoolbox} | 5 | \usepackage{etoolbox} |
6 | \usepackage{xspace} | 6 | \usepackage{xspace} |
7 | \usepackage{mathrsfs} | ||
8 | \usepackage{xifthen} | ||
7 | 9 | ||
8 | \usepackage{tikz} | 10 | \usepackage{tikz} |
9 | \usetikzlibrary{arrows,decorations.markings,chains,calc,matrix} | 11 | \usetikzlibrary{arrows,decorations.markings,chains,calc,matrix} |
@@ -38,6 +40,8 @@ | |||
38 | \DeclareMathOperator{\thom}{\textnormal{Th}} | 40 | \DeclareMathOperator{\thom}{\textnormal{Th}} |
39 | \DeclareMathOperator{\Bl}{\textnormal{Bl}} | 41 | \DeclareMathOperator{\Bl}{\textnormal{Bl}} |
40 | \DeclareMathOperator{\Stab}{\textnormal{Stab}} | 42 | \DeclareMathOperator{\Stab}{\textnormal{Stab}} |
43 | \DeclareMathOperator{\Grp}{\textnormal{\textsf{Grp}}} | ||
44 | \DeclareMathOperator{\Set}{\textnormal{\textsf{Set}}} | ||
41 | 45 | ||
42 | \newcommand*{\alg}[1]{\ensuremath{\overline{#1}}\xspace} | 46 | \newcommand*{\alg}[1]{\ensuremath{\overline{#1}}\xspace} |
43 | \newcommand*{\sep}[1]{\ensuremath{#1^{\textnormal{sep}}}\xspace} | 47 | \newcommand*{\sep}[1]{\ensuremath{#1^{\textnormal{sep}}}\xspace} |
@@ -214,7 +218,7 @@ | |||
214 | \newcommand*{\Alg}{\operatorname{\textnormal{\textsf{Alg}}}} | 218 | \newcommand*{\Alg}{\operatorname{\textnormal{\textsf{Alg}}}} |
215 | \newcommand*{\Disc}{\operatorname{\textnormal{\textsf{Disc}}}} | 219 | \newcommand*{\Disc}{\operatorname{\textnormal{\textsf{Disc}}}} |
216 | \newcommand*{\mfd}{\operatorname{\textnormal{\textsf{Mfd}}}} | 220 | \newcommand*{\mfd}{\operatorname{\textnormal{\textsf{Mfd}}}} |
217 | \newcommand*{\sm}[1][k]{\mathop{\textnormal{\textsf{Sm}}/k}} | 221 | \newcommand*{\sm}[1][k]{\mathop{\textnormal{\textsf{Sm}}/#1}} |
218 | \newcommand*{\Simp}{\mathbf{\Delta}} | 222 | \newcommand*{\Simp}{\mathbf{\Delta}} |
219 | \newcommand*{\sset}{\operatorname{\textnormal{\textsf{sSet}}}} | 223 | \newcommand*{\sset}{\operatorname{\textnormal{\textsf{sSet}}}} |
220 | \newcommand*{\ssetQ}{\operatorname{\textnormal{\textsf{sSet}}_{\textnormal{\textsf{Q}}}}} | 224 | \newcommand*{\ssetQ}{\operatorname{\textnormal{\textsf{sSet}}_{\textnormal{\textsf{Q}}}}} |
@@ -224,6 +228,7 @@ | |||
224 | \newcommand*{\Fin}{\operatorname{\textnormal{\textsf{Fin}}_{*}}} | 228 | \newcommand*{\Fin}{\operatorname{\textnormal{\textsf{Fin}}_{*}}} |
225 | \newcommand*{\tang}[1]{\textnormal{T}\mkern-2mu_{#1}} | 229 | \newcommand*{\tang}[1]{\textnormal{T}\mkern-2mu_{#1}} |
226 | \newcommand*{\dual}[1]{\textnormal{D}#1} | 230 | \newcommand*{\dual}[1]{\textnormal{D}#1} |
231 | \newcommand*{\sch}[1][k]{\mathop{\textnormal{\textsf{Sch}}/#1}} | ||
227 | 232 | ||
228 | \def\<#1>{\left\langle #1 \right\rangle} | 233 | \def\<#1>{\left\langle #1 \right\rangle} |
229 | 234 | ||
diff --git a/build/preview/preview.sty.do b/build/preview/preview.sty.do index 20af68c..cf10bef 100644 --- a/build/preview/preview.sty.do +++ b/build/preview/preview.sty.do | |||
@@ -1,4 +1,4 @@ | |||
1 | redo-ifchange preview.dtx preview.ins | 1 | redo-ifchange preview.dtx preview.ins |
2 | KEEP="preview.dtx preview.ins preview.sty.do" | 2 | KEEP="preview.dtx preview.ins preview.sty.do" |
3 | find * -maxdepth 0 $(for x in $KEEP; do echo "-not -name $x"; done) | xargs rm | 3 | find * -maxdepth 0 $(for x in $KEEP; do echo "-not -name $x"; done) | xargs rm >&2 |
4 | latex -interaction=batchmode preview.ins >&2 | 4 | latex -interaction=batchmode preview.ins >&2 |
diff --git a/build/tex-filter.hs b/build/tex-filter.hs index 67cc88c..13701c3 100755 --- a/build/tex-filter.hs +++ b/build/tex-filter.hs | |||
@@ -7,13 +7,16 @@ import Control.Monad | |||
7 | import Control.Applicative | 7 | import Control.Applicative |
8 | import qualified Data.ByteString.Char8 as BS | 8 | import qualified Data.ByteString.Char8 as BS |
9 | import Crypto.Hash | 9 | import Crypto.Hash |
10 | import System.IO | 10 | import qualified System.IO as SIO |
11 | import System.IO.Strict | ||
11 | import System.Directory | 12 | import System.Directory |
12 | import System.FilePath | 13 | import System.FilePath |
13 | import Text.Printf | 14 | import Text.Printf |
14 | 15 | ||
15 | import qualified Data.Text | 16 | import qualified Data.Text |
16 | 17 | ||
18 | import Prelude hiding (readFile) | ||
19 | |||
17 | type TeX = String | 20 | type TeX = String |
18 | type RawHTML = String | 21 | type RawHTML = String |
19 | 22 | ||
@@ -44,7 +47,7 @@ compileToSVG basepath t s = let tex = Data.Text.unpack $ Data.Text.strip $ Data. | |||
44 | (do writeFile expr_path $ (display t) ++ tex | 47 | (do writeFile expr_path $ (display t) ++ tex |
45 | writeFile align_path "0") | 48 | writeFile align_path "0") |
46 | alignment <- head.lines <$> readFile align_path | 49 | alignment <- head.lines <$> readFile align_path |
47 | hPutStrLn stderr path | 50 | SIO.hPutStrLn SIO.stderr path |
48 | return $ printf "<object data=\"/%s\" type=\"image/svg+xml\" style=\"vertical-align:-%s\">%s</object>" svg_web_path alignment tex | 51 | return $ printf "<object data=\"/%s\" type=\"image/svg+xml\" style=\"vertical-align:-%s\">%s</object>" svg_web_path alignment tex |
49 | 52 | ||
50 | texify :: [String] -> Inline -> IO Inline | 53 | texify :: [String] -> Inline -> IO Inline |
diff --git a/default.svg.do b/default.svg.do index 403fd2d..76a3b0b 100644 --- a/default.svg.do +++ b/default.svg.do | |||
@@ -1,12 +1,17 @@ | |||
1 | redo-ifchange $2.expr build/preview/preview.sty build/preview/prtightpage.def build/preamble.tex | 1 | redo-ifchange $2.expr build/preview/preview.sty build/preview/prtightpage.def build/preamble.tex |
2 | INPUT=$(realpath $2.expr) | 2 | INPUT=$(realpath $2.expr) |
3 | TDIR=$(mktemp -d --tmpdir=/tmp) | 3 | TDIR=$(mktemp -d --tmpdir=/tmp) |
4 | PREAMBLE=$(realpath build/preamble.tex) | ||
4 | 5 | ||
5 | cp build/preview/preview.sty build/preview/prtightpage.def build/preamble.tex $TDIR | 6 | pushd $(dirname $2) >/dev/null |
7 | TEXDIR=$(pwd) | ||
8 | popd >/dev/null | ||
6 | 9 | ||
7 | pushd $TDIR | 10 | cp build/preview/preview.sty build/preview/prtightpage.def $TDIR |
8 | latex -jobname=image <<EOF | 11 | |
9 | \input{preamble.tex} | 12 | pushd $TDIR >/dev/null |
13 | latex -jobname=image >/dev/null <<EOF | ||
14 | \input{$PREAMBLE} | ||
10 | \begin{document} | 15 | \begin{document} |
11 | \begin{preview} | 16 | \begin{preview} |
12 | \( | 17 | \( |
@@ -15,7 +20,9 @@ latex -jobname=image <<EOF | |||
15 | \end{preview} | 20 | \end{preview} |
16 | \end{document} | 21 | \end{document} |
17 | EOF | 22 | EOF |
18 | popd | ||
19 | 23 | ||
20 | dvisvgm --exact --no-fonts -o $3 $TDIR/image.dvi 2>&1 | sed -e '/depth=/!d;s/^.*depth=\(.*\)$/\1/' > $(dirname $2)/vertical-align | 24 | dvisvgm --exact --no-fonts $TDIR/image.dvi 2>&1 | sed -e '/depth=/!d;s/^.*depth=\(.*\)$/\1/' > $TEXDIR/vertical-align |
25 | cat $TDIR/image.svg | ||
26 | popd >/dev/null | ||
27 | |||
21 | rm -rf $TDIR \ No newline at end of file | 28 | rm -rf $TDIR \ No newline at end of file |