From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [feature request] Quotation marks in LaTeX export Date: Wed, 27 Jan 2010 11:58:02 +0100 Message-ID: <402E326C-F311-40A9-B853-438630C47E72@gmail.com> References: <871vhhbt27.fsf@gmx.ch> <87tyube2ab.fsf@gmx.ch> <87pr4vzyi4.fsf@rub.de> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Na5bC-0002jr-J5 for emacs-orgmode@gnu.org; Wed, 27 Jan 2010 05:58:14 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Na5b6-0002je-QO for emacs-orgmode@gnu.org; Wed, 27 Jan 2010 05:58:12 -0500 Received: from [199.232.76.173] (port=57658 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Na5b6-0002jb-Iw for emacs-orgmode@gnu.org; Wed, 27 Jan 2010 05:58:08 -0500 Received: from mail-ew0-f224.google.com ([209.85.219.224]:57848) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Na5b6-00016c-3R for emacs-orgmode@gnu.org; Wed, 27 Jan 2010 05:58:08 -0500 Received: by ewy24 with SMTP id 24so895620ewy.26 for ; Wed, 27 Jan 2010 02:58:07 -0800 (PST) In-Reply-To: <87pr4vzyi4.fsf@rub.de> 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: Sven Bretfeld Cc: emacs-org OK, thanks, I will take a look at that. Hmmm, I also see that csquotes is not always present in =20 distributions... :( So this really has to be optional.... - Carsten On Jan 27, 2010, at 10:29 AM, Sven Bretfeld wrote: > 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-\\)\"" "=AB~") > ("\\(\\S-\\)\"" "~=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-=20 > 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 =20= > that > csquotes as well as babel is loaded with the correct language =20 > settings: > \usepackage[english,ngerman]{babel} in my case. If connected to babel, > csquotes will also take care to pick the correct quotation marks if =20= > the > language is switched in the midst of the document. > > Greetings > > Sven > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten