From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: LaTex export: How to use `csquotes' and `\enquote{}' Date: Fri, 08 Jul 2011 02:46:59 -0400 Message-ID: <15997.1310107619@alphaville.dokosmarshall.org> References: <6663.1309983647@alphaville.americas.hpqcorp.net> <6920.1310079233@alphaville.americas.hpqcorp.net> <4521.1310090982@alphaville.dokosmarshall.org> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:49850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qf4qZ-0000iB-CS for emacs-orgmode@gnu.org; Fri, 08 Jul 2011 02:47:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qf4qT-0002KX-Lv for emacs-orgmode@gnu.org; Fri, 08 Jul 2011 02:47:30 -0400 Received: from vms173007pub.verizon.net ([206.46.173.7]:49528) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qf4qT-0002KP-8N for emacs-orgmode@gnu.org; Fri, 08 Jul 2011 02:47:25 -0400 Received: from alphaville.dokosmarshall.org ([unknown] [173.76.32.106]) by vms173007.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0LO000GXO5ICIS10@vms173007.mailsrvcs.net> for emacs-orgmode@gnu.org; Fri, 08 Jul 2011 01:47:10 -0500 (CDT) In-reply-to: Message from tsd@tsdye.com (Thomas S. Dye) of "Thu, 07 Jul 2011 20:07:14 -1000." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Thomas S. Dye" Cc: Frederik , nicholas.dokos@hp.com, emacs-orgmode@gnu.org Thomas S. Dye wrote: > Hi Nick, > > Nick Dokos writes: > > > Thomas S. Dye wrote: > > > >> Hi Nick, > >> > >> Good point. > >> > >> How about three new variables, org-export-latex-open-double-quotes, > >> org-export-latex-close-double-quotes, and org-export-latex-single-quote? > >> > >> The regexp stuff could stay as hard code and the user would only be able > >> to mess up what actually ends up being exported. > >> > > > > That's a pretty good idea: simple implementation, no extra options, set-and-forget > > and it only affects the latex exporter. > > > > Tom, you win the jackpot: you'll have the patch ready by tomorrow? > > > > Nick > > > > I think we're still a bit short of the jackpot, or at least I am. I > don't understand why (equal lang "fr") requires a different regexp in > the first list. Do you? > > Is the different regexp needed for "fr" text when using csquotes? Or is > this difference handled by csquotes, too? > I believe it is just a hack - I mentioned it in an earlier post and I think it can safely go away: csquotes will take care of it very nicely. > That said, "tomorrow" is a congenial deadline, so long as you're willing > to stick to it for the next few days, at least. > Sounds good: there's always tomorrow. BTW, since you are doing the hard work here, I'll volunteer to write a section for the LaTeX tutorial (but if you prefer to write it, I will defer). Nick > All the best, > Tom > > >> All the best, > >> Tom > >> =20 > >> Nick Dokos writes: > >> > >> > Responses to Frederik and Tom inline. > >> > > >> > Frederik writes: > >> > > >> >> Why not use one option for babel and another for csquotes? I thought > >> >> of something like this: > >> >> > >> >> #+OPTIONS: babel:english,ngerman csquotes:autostyle,german=3Dguillemets > >> >> > >> > > >> > I did suggest different options, one controlling babel and the other > >> > controlling csquotes. The problem with the above is that it is very > >> > LaTeX-specific: the options and their values have no meaning outside of > >> > that. I think that we should strive to use more generic options that > >> > would at least be usable by other export engines. > >> > > >> >> Or is there any other reason why one would like to specify language opti= > >> ons? > >> >> > >> >> Sadly I don't have the skills to suggest a patch... > >> >> > >> >> I definitely see Nick's point: simplicity is one of the most important > >> >> features of org-mode. So a possible decision not to support csquotes > >> >> is absolutely understandable. > >> > > >> > I'll be very surprised if there is no support for csquotes within a couple > >> > of weeks (maybe within a couple of days :-) ) The question is "what form > >> > will it take?" > >> > > >> > > >> > Thomas S. Dye wrote: > >> > > >> >> I'm wondering if a simpler solution than Nick's might be to replace the > >> >> lists at the end of this code snippet with a variable, say > >> >> org-export-latex-quote-mechanism. Initially, the variable would be set > >> >> to the second list. If the user wanted something different, then the > >> >> user would be responsible for setting the variable to the different > >> >> quoting mechanism, whether it be \enquote{ or something else. The user > >> >> would also be responsible for making sure the LaTeX packages needed to > >> >> support the quoting mechanism were loaded and functional. > >> >>=20 > >> >> (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-\\|[[(]\\)\"" "``") > >> >> ("\\(\\S-\\)\"" "''") > >> >> ("\\(\\s-\\|(\\)'" "`"))))) > >> >>=20 > >> >> This might provide Org-mode the flexibility needed to support csquotes, > >> >> but also leave open the possibility of supporting other packages, as > >> >> well. > >> >>=20 > >> > > >> > Maybe - this is the kind of mechanism that is used for > >> > org-export-latex-classes for example, so there is definitely > >> > precedent. OTOH, the lists above look like hen scratchings (or line > >> > noise if you prefer, or -- I'll get in trouble for this -- Perl > >> > code :-)), so it would be easy to get things wrong if you have to > >> > cut-and-paste-and-edit which I think one would have to do to customize > >> > it: it's OK to expect *one* developer to get it right, but it's not > >> > OK to expect 100 users to get it right. > >> > > >> > So it might be simpler to implement, but I'm not sure it might be > >> > simpler to use. I've supported using existing mechanisms to implement > >> > new behavior before and not disturbing the existing structure too much > >> > (e.g. the revtex stuff that Sebastian Hoffert was (is?) working on). > >> > But if it leads to e.g. an implementation that befuddles users, then > >> > you end up with a flood of questions on the ML. So it's a balancing > >> > act. > >> > > >> > BTW, you mention the possibility of supporting other packages. I didn't > >> > find anything useful in the TeX FAQ but if there are "csquotes-like" > >> > packages that people commonly (or perhaps uncommonly) use then a survey > >> > of their capabilities might indicate the best way to go. > >> > > >> > Nick > >> > >> --=20 > >> Thomas S. Dye > >> http://www.tsdye.com > >> > > > > -- > Thomas S. Dye > http://www.tsdye.com >