tmtex.scm (TeXmacs-2.1.1-src) | : | tmtex.scm (TeXmacs-2.1.2-src) | ||
---|---|---|---|---|
skipping to change at line 143 | skipping to change at line 143 | |||
(set! tmtex-env (make-ahash-table)) | (set! tmtex-env (make-ahash-table)) | |||
(set! tmtex-macros (make-ahash-table)) | (set! tmtex-macros (make-ahash-table)) | |||
(set! tmtex-dynamic (make-ahash-table)) | (set! tmtex-dynamic (make-ahash-table)) | |||
(set! tmtex-serial 0) | (set! tmtex-serial 0) | |||
(set! tmtex-auto-produce 0) | (set! tmtex-auto-produce 0) | |||
(set! tmtex-auto-consume 0) | (set! tmtex-auto-consume 0) | |||
(set! tmtex-mathjax? #f) | (set! tmtex-mathjax? #f) | |||
(if (== (url-suffix current-save-target) "tex") | (if (== (url-suffix current-save-target) "tex") | |||
(begin | (begin | |||
(set! tmtex-image-root-url (url-unglue current-save-target 4)) | (set! tmtex-image-root-url (url-unglue current-save-target 4)) | |||
(with suf (url-suffix tmtex-image-root-url) | ||||
(when (!= suf "") | ||||
(set! tmtex-image-root-url | ||||
(url-unglue tmtex-image-root-url | ||||
(+ (string-length suf) 1))))) | ||||
(set! tmtex-image-root-string | (set! tmtex-image-root-string | |||
(url->unix (url-tail tmtex-image-root-url)))) | (url->unix (url-tail tmtex-image-root-url)))) | |||
(begin | (begin | |||
(set! tmtex-image-root-url (unix->url "image")) | (set! tmtex-image-root-url (unix->url "image")) | |||
(set! tmtex-image-root-string "image"))) | (set! tmtex-image-root-string "image"))) | |||
(set! tmtex-appendices? #f) | (set! tmtex-appendices? #f) | |||
(set! tmtex-replace-style? | (set! tmtex-replace-style? | |||
(== (assoc-ref opts "texmacs->latex:replace-style") "on")) | (== (assoc-ref opts "texmacs->latex:replace-style") "on")) | |||
(set! tmtex-indirect-bib? | (set! tmtex-indirect-bib? | |||
(== (assoc-ref opts "texmacs->latex:indirect-bib") "on")) | (== (assoc-ref opts "texmacs->latex:indirect-bib") "on")) | |||
skipping to change at line 1823 | skipping to change at line 1828 | |||
(tmtex-eps (cons (string->symbol s) l))) | (tmtex-eps (cons (string->symbol s) l))) | |||
(define (tmtex-graphics l) | (define (tmtex-graphics l) | |||
(tmtex-eps (cons 'graphics l))) | (tmtex-eps (cons 'graphics l))) | |||
(define (tmtex-as-eps name) | (define (tmtex-as-eps name) | |||
(let* ((u (url-relative current-save-target (unix->url name))) | (let* ((u (url-relative current-save-target (unix->url name))) | |||
(suffix (url-suffix u)) | (suffix (url-suffix u)) | |||
(fm (string-append (format-from-suffix suffix) "-file"))) | (fm (string-append (format-from-suffix suffix) "-file"))) | |||
(if (and (url-exists? u) (in? suffix (list "eps" "pdf" "png" "jpg"))) | (if (and (url-exists? u) (in? suffix (list "eps" "pdf" "png" "jpg"))) | |||
(list 'includegraphics name) | (with p (url->string "$TEXMACS_PATH") | |||
(set! name (string-replace name "$TEXMACS_PATH" p)) | ||||
(set! name (string-replace name "file://" "")) | ||||
(list 'includegraphics name)) | ||||
(receive (name-url name-string) (tmtex-eps-names) | (receive (name-url name-string) (tmtex-eps-names) | |||
(convert-to-file u fm "postscript-file" name-url) | (when (string-starts? name "..") | |||
(set! u (url-relative current-save-source (unix->url name)))) | ||||
(with nfm (if (== (url-suffix name-url) "pdf") "pdf-file" | ||||
"postscript-file") | ||||
(convert-to-file u fm nfm name-url)) | ||||
(list 'includegraphics name-string))))) | (list 'includegraphics name-string))))) | |||
(define (tmtex-image-length len) | (define (tmtex-image-length len) | |||
(let* ((s (force-string len)) | (let* ((s (force-string len)) | |||
(unit (and (tm-length? s) (tm-length-unit len)))) | (unit (and (tm-length? s) (tm-length-unit len)))) | |||
(cond ((== s "") "!") | (cond ((== s "") "!") | |||
((string-ends? s "%") "!") | ((string-ends? s "%") "!") | |||
((in? unit '("w" "h")) "!") | ((in? unit '("w" "h")) "!") | |||
(else (tmtex-decode-length len))))) | (else (tmtex-decode-length len))))) | |||
skipping to change at line 2715 | skipping to change at line 2727 | |||
(define (tmtex-session s l) | (define (tmtex-session s l) | |||
(let* ((tag (string->symbol (string-append "tm" (string-replace s "-" "")))) | (let* ((tag (string->symbol (string-append "tm" (string-replace s "-" "")))) | |||
(arg (tmtex (car l))) | (arg (tmtex (car l))) | |||
(lan (tmtex (cadr l))) | (lan (tmtex (cadr l))) | |||
(lst (tmtex (caddr l)))) | (lst (tmtex (caddr l)))) | |||
(if (func? lst '!document) | (if (func? lst '!document) | |||
(set! lst `(!indent (!paragraph ,@(cdr lst))))) | (set! lst `(!indent (!paragraph ,@(cdr lst))))) | |||
`(!document (,tag ,arg ,lan ,lst)))) | `(!document (,tag ,arg ,lan ,lst)))) | |||
(define (escape-backslashes-in-url l) | (define (escape-hyperref-url l) | |||
(cond ((string? l) (string-replace l "\\" "\\\\")) | (cond ((string? l) | |||
(let* ((r1 (string-replace l "\\" "\\\\")) | ||||
(r2 (string-replace r1 "#" "\\#")) | ||||
(r3 (string-replace r2 "_" "\\_"))) | ||||
r3)) | ||||
((symbol? l) l) | ((symbol? l) l) | |||
(else (map escape-backslashes-in-url l)))) | (else (map escape-hyperref-url l)))) | |||
(define (tmtex-hyperref u) | (define (tmtex-hyperref u) | |||
(tmtex-tt (escape-backslashes-in-url u))) | (tmtex-tt (escape-hyperref-url u))) | |||
(define (tmtex-hlink s l) | (define (tmtex-hlink s l) | |||
(let* ((h (cadr l)) | (let* ((h (cadr l)) | |||
(d (tmtex (car l)))) | (d (tmtex (car l)))) | |||
(if (and (string? h) (string-starts? h "#")) | (if (and (string? h) (string-starts? h "#")) | |||
(list 'hyperref `(!option ,(string-drop h 1)) d) | (list 'hyperref `(!option ,(string-drop h 1)) d) | |||
(list 'href (tmtex-hyperref h) d)))) | (list 'href (tmtex-hyperref h) d)))) | |||
(define (tmtex-href s l) | (define (tmtex-href s l) | |||
(list 'url (tmtex-verb-string (car l)))) | (list 'url (tmtex-verb-string (car l)))) | |||
skipping to change at line 3453 | skipping to change at line 3469 | |||
"gap" "gap-dots" "gap-underlined" "gap-box" | "gap" "gap-dots" "gap-underlined" "gap-box" | |||
"gap-wide" "gap-dots-wide" "gap-underlined-wide" "gap-box-wide" | "gap-wide" "gap-dots-wide" "gap-underlined-wide" "gap-box-wide" | |||
"gap-long" "gap-dots-long" "gap-underlined-long" "gap-box-long" | "gap-long" "gap-dots-long" "gap-underlined-long" "gap-box-long" | |||
"with-button-box" "with-button-box*" | "with-button-box" "with-button-box*" | |||
"with-button-circle" "with-button-circle*" | "with-button-circle" "with-button-circle*" | |||
"with-button-arabic" "with-button-alpha" "with-button-Alpha" | "with-button-arabic" "with-button-alpha" "with-button-Alpha" | |||
"with-button-roman" "with-button-Roman" | "with-button-roman" "with-button-Roman" | |||
"mc-field" "mc-wide-field" "show-reply" "hide-reply" | "mc-field" "mc-wide-field" "show-reply" "hide-reply" | |||
"mc" "mc-monospaced" "mc-horizontal" "mc-vertical")) | "mc" "mc-monospaced" "mc-horizontal" "mc-vertical" | |||
"textual-table" "numeric-dot-table" | ||||
"calc-table" "calc-inert" "calc-input" "calc-output" "calc-ref" | ||||
"cell-inert" "cell-input" "cell-output" "cell-ref" | ||||
"cell-range" "cell-sum" "cell-plusses" "cell-commas" | ||||
"tmdoc-title" "icon" "shortcut" "key" "prefix" | ||||
"menu" "render-menu" "submenu" "subsubmenu" "subsubsubmenu" | ||||
"markup" "tmstyle" "tmpackage" "tmdtd" "def-index" | ||||
"src-arg" "src-var" "scm-arg" "scm-args" | ||||
"descriptive-table" "tm-fragment" "framed-fragment" | ||||
"explain" "explain-synopsis" "explain-macro" | ||||
"small-envbox" "big-envbox" "small-focus" "big-focus" | ||||
"cursor" "math-cursor" "TeXmacs-version" "c++" "BibTeX")) | ||||
(tm-define (tmtex-env-patch t l0) | (tm-define (tmtex-env-patch t l0) | |||
(let* ((st (tree->stree t)) | (let* ((st (tree->stree t)) | |||
(l0 (logic-first-list 'tmtex-primitives%)) | (l0 (logic-first-list 'tmtex-primitives%)) | |||
(l1 (logic-first-list 'tmtex-extra-methods%)) | (l1 (logic-first-list 'tmtex-extra-methods%)) | |||
(l2 (logic-first-list 'tmtex-tmstyle%)) | (l2 (logic-first-list 'tmtex-tmstyle%)) | |||
(l3 (map as-string (logic-apply-list '(latex-tag%)))) | (l3 (map as-string (logic-apply-list '(latex-tag%)))) | |||
(l4 (map as-string (logic-apply-list '(latex-symbol%)))) | (l4 (map as-string (logic-apply-list '(latex-symbol%)))) | |||
(l5 (list-difference l3 (list-union l4 tmtex-always-expand))) | (l5 (list-difference l3 (list-union l4 tmtex-always-expand))) | |||
(l6 (map as-string (collect-user-defs st))) | (l6 (map as-string (collect-user-defs st))) | |||
End of changes. 7 change blocks. | ||||
7 lines changed or deleted | 37 lines changed or added |