summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--all.do1
-rw-r--r--build/preamble.tex7
-rw-r--r--build/preview/preview.sty.do2
-rwxr-xr-xbuild/tex-filter.hs7
-rw-r--r--default.svg.do19
5 files changed, 25 insertions, 11 deletions
diff --git a/all.do b/all.do
index a8cc947..9facf1a 100644
--- a/all.do
+++ b/all.do
@@ -1,2 +1 @@
1redo-ifchange index.html redo-ifchange index.html
2redo-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 @@
1redo-ifchange preview.dtx preview.ins 1redo-ifchange preview.dtx preview.ins
2KEEP="preview.dtx preview.ins preview.sty.do" 2KEEP="preview.dtx preview.ins preview.sty.do"
3find * -maxdepth 0 $(for x in $KEEP; do echo "-not -name $x"; done) | xargs rm 3find * -maxdepth 0 $(for x in $KEEP; do echo "-not -name $x"; done) | xargs rm >&2
4latex -interaction=batchmode preview.ins >&2 4latex -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
7import Control.Applicative 7import Control.Applicative
8import qualified Data.ByteString.Char8 as BS 8import qualified Data.ByteString.Char8 as BS
9import Crypto.Hash 9import Crypto.Hash
10import System.IO 10import qualified System.IO as SIO
11import System.IO.Strict
11import System.Directory 12import System.Directory
12import System.FilePath 13import System.FilePath
13import Text.Printf 14import Text.Printf
14 15
15import qualified Data.Text 16import qualified Data.Text
16 17
18import Prelude hiding (readFile)
19
17type TeX = String 20type TeX = String
18type RawHTML = String 21type 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
50texify :: [String] -> Inline -> IO Inline 53texify :: [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 @@
1redo-ifchange $2.expr build/preview/preview.sty build/preview/prtightpage.def build/preamble.tex 1redo-ifchange $2.expr build/preview/preview.sty build/preview/prtightpage.def build/preamble.tex
2INPUT=$(realpath $2.expr) 2INPUT=$(realpath $2.expr)
3TDIR=$(mktemp -d --tmpdir=/tmp) 3TDIR=$(mktemp -d --tmpdir=/tmp)
4PREAMBLE=$(realpath build/preamble.tex)
4 5
5cp build/preview/preview.sty build/preview/prtightpage.def build/preamble.tex $TDIR 6pushd $(dirname $2) >/dev/null
7TEXDIR=$(pwd)
8popd >/dev/null
6 9
7pushd $TDIR 10cp build/preview/preview.sty build/preview/prtightpage.def $TDIR
8latex -jobname=image <<EOF 11
9\input{preamble.tex} 12pushd $TDIR >/dev/null
13latex -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}
17EOF 22EOF
18popd
19 23
20dvisvgm --exact --no-fonts -o $3 $TDIR/image.dvi 2>&1 | sed -e '/depth=/!d;s/^.*depth=\(.*\)$/\1/' > $(dirname $2)/vertical-align 24dvisvgm --exact --no-fonts $TDIR/image.dvi 2>&1 | sed -e '/depth=/!d;s/^.*depth=\(.*\)$/\1/' > $TEXDIR/vertical-align
25cat $TDIR/image.svg
26popd >/dev/null
27
21rm -rf $TDIR \ No newline at end of file 28rm -rf $TDIR \ No newline at end of file