diff options
author | Ludovic Courtès | 2012-05-10 23:47:01 +0200 |
---|---|---|
committer | Ludovic Courtès | 2012-05-10 23:47:01 +0200 |
commit | d266c260e569d3372fa09c121a04755e6d3c3bbb (patch) | |
tree | 82e135756eabfffa6c5a2c5f9dc6d229b4b5286e /src/guile/skribilo/engine/lout.scm | |
parent | 966f7afaf9c370be463543da21f379a85d508804 (diff) | |
download | skribilo-d266c260e569d3372fa09c121a04755e6d3c3bbb.tar.gz skribilo-d266c260e569d3372fa09c121a04755e6d3c3bbb.tar.lz skribilo-d266c260e569d3372fa09c121a04755e6d3c3bbb.zip |
info/latex/lout: Set the output port's encoding.
* src/guile/skribilo/engine/html.scm (document): Fix typo in comment.
* src/guile/skribilo/engine/info.scm (document)[guile-2]: Set the
current output port's encoding to "UTF-8".
* src/guile/skribilo/engine/latex.scm (latex-engine)[encoding]: New
custom.
(document): Set the output port's encoding to that. When that
encoding is "UTF-8", add the right \usepackage.
* src/guile/skribilo/engine/lout.scm (lout-engine)[encoding]: New
custom.
(document): Set the output encoding. Emit `@SysInclude { latin2 }'
for ISO-8859-2.
Diffstat (limited to 'src/guile/skribilo/engine/lout.scm')
-rw-r--r-- | src/guile/skribilo/engine/lout.scm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/guile/skribilo/engine/lout.scm b/src/guile/skribilo/engine/lout.scm index 93a7f5b..7ce8efa 100644 --- a/src/guile/skribilo/engine/lout.scm +++ b/src/guile/skribilo/engine/lout.scm @@ -577,6 +577,9 @@ ;; file is deduced from `document-type'. (document-include auto) + ;; Encoding of the output file. + (encoding "ISO-8859-1") + (includes "@SysInclude { tbl }\n") (initial-font "Palatino Base 10p") (initial-break @@ -1080,6 +1083,21 @@ (markup-writer 'document :options '(:title :author :ending :keywords :env) :before (lambda (n e) ;; `e' is the engine + (cond-expand + (guile-2 + ;; Make sure the output is suitably encoded. + (let ((encoding (engine-custom e 'encoding))) + (set-port-encoding! (current-output-port) encoding) + (set-port-conversion-strategy! (current-output-port) 'error) + (cond ((string-ci=? encoding "ISO-8859-2") + (display "@SysInclude { latin2 }\n")) + ((not (string-ci=? encoding "ISO-8859-1")) + (raise (condition + (&invalid-argument-error + (proc-name 'lout) + (argument encoding)))))))) + (else #t)) + (let* ((doc-type (let ((d (engine-custom e 'document-type))) (if (string? d) (begin |