emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Exporting non utf8 org documents


From: Carsten Dominik
Subject: Re: [Orgmode] Exporting non utf8 org documents
Date: Fri, 8 Jan 2010 13:43:25 +0100


On Jan 8, 2010, at 1:36 PM, Francesco Pizzolante wrote:

Hi Carsten,

here is a possible solution:

Please get the latest git version of org-mode. Then put the following code
into
.emacs:

   (defun my-org-export-latex-fix-inputenc ()
     "Set the codingsystem in inputenc to what the buffer is."
     (let* ((cs buffer-file-coding-system)
            (opt (latexenc-coding-system-to-inputenc cs)))
       (when opt
         (goto-char (point-min))
         (while (re-search-forward "\\\\usepackage\\[\\(.*?\\)\\]
{inputenc}"
                                   nil t)
           (goto-char (match-beginning 1))
           (delete-region (match-beginning 1) (match-end 1))
           (insert opt))
         (save-buffer))))

   (eval-after-load "org-latex"
     '(add-hook 'org-export-latex-after-save-hook
                'my-org-export-latex-fix-inputenc))

Let me know how it goes.....

Thanks for your solution.

I've tested with both latin1 and utf8 Org buffers and I get the correct
encoding passed to LaTeX in both cases.

Regarding the utf8 encoding, I had a remark in my first message, which was:

In addition, Org should use the `utf8x' option (instead of `utf8') which
enables to handle unbreakable spaces (useful in french).

Could you change that too?


In, fact, you can change it in the code I sent you:

Add

   (if (equal opt "utf8") (setq opt "utf8x"))


wight before

   (when opt


I am still thinking about if and how I can add this in a stable
way to the default code....

- Carsten

- Carsten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]