mailing-list for TeXmacs Users

Text archives Help


Re: export to pdf and html and latex


Chronological Thread 
  • From: vincent douce <address@hidden>
  • To: texmacs-users <address@hidden>
  • Subject: Re: export to pdf and html and latex
  • Date: Sat, 27 Nov 2021 16:05:36 +0100

hi Jeroen
thanks a LOT
that's something i needed since a so long time…
i've modifiyed a bit :
* first, to cancel the confirmation message
* secondly to have something that exports to everything (M-e-a)
i imagine that to have the same for latex export, i just need to replace html
by tex ?
thanks
Vincent

(define (propose-html-name)
(with name (propose-name-buffer)
(if (string-ends? name ".tm")
(string-append (string-drop-right name 3) ".html"))))

(define (export-to-proposed-html)
(let ((html-name (propose-html-name)))
((buffer-exporter "html") html-name));)
)

(kbd-map ("M-e h" (export-to-proposed-html)))

;-----------------

(kbd-map ("M-e a" (export-to-proposed-html) (export-to-proposed-pdf)))


> Le 20 nov. 2021 à 17:47, Jeroen Wouters <address@hidden> a écrit :
>
> Hi Vincent,
>
> Re a: the shortcut still works for me. Did you change anything to my-
> init-texmacs.scm? Other erroneous commands could prevent my-init-
> texmacs.scm from reaching the point where you define this shortcut.
>
> If you can, start TeXmacs from the terminal and look for error
> messages. You could also try temporarily removing everything else from
> my-init-texmacs.scm (after backing it up!) and see if that helps.
>
> Re b: the below is what I use for html.
>
> Best wishes,
> Jeroen
>
> (define (propose-html-name)
> (with name (propose-name-buffer)
> (if (string-ends? name ".tm")
> (string-append (string-drop-right name 3) ".html"))))
>
> (define (export-to-proposed-html)
> (let ((html-name (propose-html-name)))
> (if (url-test? html-name "f")
> (user-confirm "File already exists. Really overwrite?" #f
> (lambda (answ)
> (when answ ((buffer-exporter "html") html-name))))
> ((buffer-exporter "html") html-name))))
>
> (kbd-map
> ("M-e h" (export-to-proposed-html)))
>
> On Sat, 2021-11-20 at 16:52 +0100, vincent douce wrote:
>> hi
>> a) i dont understand why my [very very] useful cmd+E+P does nt work any
>> longer (see end of the mail)
>> b) also, i would find very useful to have [the same or another] short
>> to export to html or tex
>> i apologize for not knowing how to search the way to write such code
>> something equivalent to "wrapped-print-to-file" but for html ,
>> Vincent
>>
>>
>> ---------------------------------------
>>
>> (define (propose-pdf-name)
>> (with name (propose-name-buffer)
>> (if (string-ends? name ".tm")
>> (string-append (string-drop-right name 3) ".pdf"))))
>>
>> (define (export-to-proposed-pdf)
>> (let ((pdf-name (propose-pdf-name)))
>> (wrapped-print-to-file pdf-name)))
>>
>> (kbd-map
>> ("M-e p" (export-to-proposed-pdf)))
>>
>




Archive powered by MHonArc 2.6.19.

Top of page