emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Francesco Pizzolante <fpz-djc/iPCCuDYQheJpep6IedvLeJWuRmrY@public.gmane.org>
To: Carsten Dominik
	<carsten.dominik-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: mailing-list-org-mode <emacs-orgmode-mXXj517/zsQ@public.gmane.org>
Subject: Re: Exporting non utf8 org documents
Date: Mon, 22 Mar 2010 15:20:56 +0100	[thread overview]
Message-ID: <87k4t4xws7.fsf@mundaneum.com> (raw)
In-Reply-To: <0929970B-35B4-495A-A972-985AF9FF1B91-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> (Carsten Dominik's message of "Sun, 10 Jan 2010 10:20:25 +0100")

Hi Carsten,

I'm sorry for my very very late reply on this topic, but I'm just observing
problem with this.

> you can remove the code I sent you again, and instead grab the latest git
> release.
>
> Then you can also do
>
> (setq org-export-latex-inputenc-alist '(("utf8" . "utf8x")))
>
> to get utf8x instead of utf8.

I still get the utf8 encoding even if, as you said, I set this:

--8<---------------cut here---------------start------------->8---
(setq org-export-latex-inputenc-alist '(("utf8" . "utf8x")))
--8<---------------cut here---------------end--------------->8---


So, we get the following code:

--8<---------------cut here---------------start------------->8---
(defun org-export-latex-fix-inputenc ()
  "Set the codingsystem in inputenc to what the buffer is."
  (let* ((cs buffer-file-coding-system)
	 (opt (or (ignore-errors (latexenc-coding-system-to-inputenc cs))
		  "utf8")))
    (when opt
      ;; Translate if that is requested
      (setq opt (or (cdr (assoc opt org-export-latex-inputenc-alist)) opt))
      ;; find the \usepackage statement and replace the option
      (goto-char (point-min))
      (while (re-search-forward "\\\\usepackage\\[\\(AUTO\\)\\]{inputenc}"
				nil t)
	(goto-char (match-beginning 1))
	(delete-region (match-beginning 1) (match-end 1))
	(insert opt))
      (and buffer-file-name
	   (save-buffer)))))
--8<---------------cut here---------------end--------------->8---

If I print the opt variable (message opt), I can see that its value is
correctly set to utf8x.

But, the re-search-forward command always fails. In effect, if I change the
last argument from t to nil, I get the following error:

--8<---------------cut here---------------start------------->8---
while: Search failed: "\\\\usepackage\\[\\(AUTO\\)\\]{inputenc}"
--8<---------------cut here---------------end--------------->8---

I'm using an almost empty Org buffer with no option at all, so it generates a
simple article document class.

I would like to give you more input, but I don't know how to better debug
this. If you have any idea, please let me know.

Thanks a lot,
Francesco


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  parent reply	other threads:[~2010-03-22 14:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-08 16:22 Exporting non utf8 org documents Francesco Pizzolante
2010-01-04 14:16 ` Carsten Dominik
2010-01-06  8:26 ` Carsten Dominik
     [not found]   ` <6B5F0F7A-F055-435F-ADE2-846E99649B1D-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-01-08 12:36     ` Francesco Pizzolante
2010-01-08 12:39       ` Carsten Dominik
2010-01-08 12:43       ` Carsten Dominik
2010-01-10  9:20       ` Carsten Dominik
     [not found]         ` <0929970B-35B4-495A-A972-985AF9FF1B91-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-03-22 14:20           ` Francesco Pizzolante [this message]
2010-03-23  8:06             ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k4t4xws7.fsf@mundaneum.com \
    --to=fpz-djc/ipccudyqhejpep6iedvlejwurmry@public.gmane.org \
    --cc=carsten.dominik-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).