Skip to Content.
Sympa Menu

texmacs-users - Re: [TeXmacs] Hide Maxima session from exported LaTeX file

Subject: mailing-list for TeXmacs Users

List archive

Re: [TeXmacs] Hide Maxima session from exported LaTeX file


Chronological Thread 
  • From: Marduk Bolaños <address@hidden>
  • To: Karl Hegbloom <address@hidden>
  • Cc: texmacs-users <address@hidden>
  • Subject: Re: [TeXmacs] Hide Maxima session from exported LaTeX file
  • Date: Sun, 14 Feb 2016 09:24:14 -0600

I finally solved it writing these functions:

(define (exclude-session t)
(if (eq? (tree-label t) 'session)
(tree "")
t))

(define (export-exclude-maxima)
(let* ((old_name (buffer-get-title (current-buffer)))
(pwd (var-eval-system "pwd"))
(strip_ex (substring old_name 0 (- (string-length old_name) 3)))
(new_name (string-append pwd "/" strip_ex "-maxima" ".tm"))
(new_url (string->url new_name))
(new_body (tree-map-children exclude-session (buffer-tree)))
(new_stm `(document
(TeXmacs ,(texmacs-version))
(style (tuple "generic"))
(body (document ,new_body))))
(new_tree (stree->tree new_stm)))
(tree-export new_tree new_url "texmacs")
(load-buffer new_name)))

I hope this helps others trying to do literate programming in
TeXmacs.

Best,
Marduk



Archive powered by MHonArc 2.6.19.

Top of Page