From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sven Bretfeld" Subject: Re: [feature request] Quotation marks in LaTeX export Date: 27 Jan 2010 10:29:55 +0100 Message-ID: <87pr4vzyi4.fsf@rub.de> References: <871vhhbt27.fsf@gmx.ch> <87tyube2ab.fsf@gmx.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Na4DB-0006Mu-RN for emacs-orgmode@gnu.org; Wed, 27 Jan 2010 04:29:21 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Na4D7-0006Ls-2Q for emacs-orgmode@gnu.org; Wed, 27 Jan 2010 04:29:21 -0500 Received: from [199.232.76.173] (port=47311 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Na4D6-0006Ll-Sv for emacs-orgmode@gnu.org; Wed, 27 Jan 2010 04:29:16 -0500 Received: from mx5.rz.ruhr-uni-bochum.de ([134.147.64.33]:34332) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Na4D6-0007pg-Es for emacs-orgmode@gnu.org; Wed, 27 Jan 2010 04:29:16 -0500 In-Reply-To: (Carsten Dominik's message of "Tue, 26 Jan 2010 23:03:45 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: emacs-org Hi Carsten Carsten Dominik writes: > can you send me a path, preferably with an option to turn this on and > off? For now, I only have this dummy solution in my .emacs: --8<---------------cut here---------------start------------->8--- (eval-after-load "org-latex" '(defun org-export-latex-quotation-marks () "Export quotation marks depending on language conventions." (let* ((lang (plist-get org-export-latex-options-plist :language)) (quote-rpl (if (equal lang "fr") '(("\\(\\s-\\)\"" "=C2=AB~") ("\\(\\S-\\)\"" "~=C2=BB") ("\\(\\s-\\)'" "`")) '(("\\(\\s-\\|[[(]\\)\"" "\\enquote\{") ("\\(\\S-\\)\"" "\}") ("\\(\\s-\\|(\\)'" "`"))))) (mapc (lambda(l) (goto-char (point-min)) (while (re-search-forward (car l) nil t) (let ((rpl (concat (match-string 1) (org-export-latex-protect-string (copy-sequence (cadr l)))))) (org-if-unprotected-1 (replace-match rpl t t))))) quote-rpl))) ) --8<---------------cut here---------------end--------------->8--- It's a static setup, just an altered clone of the code in org-latex.el. I have not the skills to make a switch out of this. One has to add the header \usepackage[babel]{csquotes}. So, an option has to make sure that csquotes as well as babel is loaded with the correct language settings: \usepackage[english,ngerman]{babel} in my case. If connected to babel, csquotes will also take care to pick the correct quotation marks if the language is switched in the midst of the document. Greetings Sven