phc-thesis.scrbl (5135B)
1 #lang scribble/manual @;or classicthesis 2 @require[@for-label[typed/racket/base] 3 "util.rkt" 4 scriblib/render-cond 5 racket/system 6 racket/port 7 racket/string 8 scribble/core] 9 @(use-mathjax) 10 11 @;@tex-header{\usepackage{morewrites}} 12 @tex-header{ 13 \let\realtableofcontents\tableofcontents 14 \def\tableofcontents{\realtableofcontents\let\tableofcontents\relax} 15 } 16 17 @title[#:style (struct-update style 18 (with-html5 manual-doc-style) 19 [properties (λ (p) (cons 'toc p))]) 20 #:version (version-text)]{Thesis} 21 @author[@author+email["Suzanne Soy" "racket@suzanne.soy"]] 22 23 @;@(version-text "Document version: " ".") 24 25 @(cond-element 26 [html @list{Download a @hyperlink["../pdf/phc-thesis.pdf"]{PDF version} 27 of this document. 28 29 Download a @hyperlink[(version-text "../phc-thesis-" ".zip")]{Zip archive} 30 of the HTML and PDF versions of this document.}] 31 [latex 32 (list "HTML version available at " 33 @hyperlink["https://jsmaniac.github.io/phc-thesis/phc-thesis/" 34 ]{https://jsmaniac.github.io/phc-thesis/phc-thesis/} 35 ".")] 36 [else @list{HTML version: https://jsmaniac.github.io/phc-thesis/phc-thesis/ 37 38 PDF version: https://jsmaniac.github.io/phc-thesis/pdf/phc-thesis.pdf 39 40 Zip archive of the HTML and PDF versions: 41 @(version-text "https://jsmaniac.github.io/phc-thesis/phc-thesis-" 42 ".zip")}]) 43 44 @(table-of-contents) 45 46 @include-asection{introduction.scrbl} 47 @include-asection{state-of-the-art.scrbl} 48 @include-asection{initial-examples.scrbl} 49 @include-asection{tr.scrbl} 50 @include-asection{tr-te-adt.scrbl} 51 @asection{ @atitle{Typed nanopass} 52 @asection{@atitle[#:tag "typed-nanotrees-chap"]{Typed nanopass on trees}} 53 @asection{@atitle[#:tag "typed-nanodags-chap"]{Typed nanopass on DAGs}} 54 @asection{@atitle[#:tag "typed-nanographs-chap"]{Typed nanopass on graphs}} 55 @asection{@atitle[#:tag "structural-invariants-chap"]{Structural invariants}} 56 @asection{@atitle[#:tag "future-extensions-chap"]{Further possible 57 extensions}} } 58 @asection{@atitle[#:tag "results-chap"]{Examples and results}} 59 @asection{@atitle[#:tag "conclusion-future-chap"]{Conclusion and future work 60 directions}} 61 62 @;@(generate-bibliography-section) 63 @; Generate the bibliography with a numbered section: 64 @(part-style-update (generate-bibliography-section) 65 (λ (p) (remove 'unnumbered p))) 66 67 @(define default-nb 68 (make-numberer (λ (a b) 69 (eprintf "(my-nb ~s ~s)\n" a b) 70 (values (string-join (append b (list (number->string a))) 71 ".") 72 (add1 a))) 73 1)) 74 75 @(require (for-syntax racket/base 76 mzlib/etc)) 77 @(define-syntax (if-appendices stx) 78 (syntax-case stx () 79 [(_ a) 80 (if (file-exists? (build-path (this-expression-source-directory) 81 'up 82 "no-appendices")) 83 #'(displayln "Appendices turned off on this build." 84 (current-error-port)) 85 #`(begin 86 (displayln "Appendices enabled on this build." 87 (current-error-port)) 88 a))])) 89 @if-appendices[ 90 @aappendix{ 91 @include-asection[ 92 (lib "phc-graph/scribblings/phc-graph-implementation.scrbl")] 93 @include-asection[(lib "phc-adt/scribblings/phc-adt-implementation.scrbl")] 94 @include-asection[ 95 (submod (lib "remember/remember-implementation.hl.rkt") doc)] 96 @include-asection[(submod (lib "multi-id/multi-id.hl.rkt") doc)] 97 @include-asection[ 98 (lib "type-expander/scribblings/type-expander-implementation.scrbl")] 99 }] 100 101 @;{ 102 Notes concerning tikz → SVG conversion: 103 104 To get smooth (non-selectable) text with the LaTeX fonts: 105 106 \documentclass[tikz]{standalone} 107 %\usetikzlibrary{…} 108 \begin{document} 109 \begin{tikzpicture} 110 \draw (0,0) -- (4,4); 111 \node at (2,2) {Some Text}; 112 \end{tikzpicture} 113 \end{document} 114 115 then: 116 pdflatex file.tex 117 pdf2svg file.pdf file.svg 118 119 See also: 120 http://tex.stackexchange.com/questions/51757/ 121 how-can-i-use-tikz-to-make-standalone-svg-graphics 122 123 124 To get real, selectable text (must not contain formatting, otherwise some 125 <span> get inserted inside the SVG <text>, and that is incorrect), but without 126 the LaTeX fonts. If we insert 127 \tikzset{every node/.style={/pgf/tex4ht node/escape=true}}, then it is possible 128 to have slightly fancier things in the text (e.g. colours), but it still is 129 half-broken (a simple $alpha$ prints out a spurious display=”inline”). 130 131 132 Insert right after the documentclass: 133 \def\pgfsysdriver{pgfsys-tex4ht.def} 134 135 htlatex error: 136 http://tex.stackexchange.com/a/232739 137 138 If the text is set to an opacity of 0, then it seems to still be selectable. 139 It should therefore be possible to overlay the two SVGs, in order to get 140 selectable text, with the specific LaTeX fonts. 141 142 We might want to create a special scribble command to typeset "normal" text 143 (rendered using scribble's HTML font), and another to typeset math (possibly 144 with MathJax). 145 }