emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tsd@tsdye.com (Thomas S. Dye)
To: Frederik <freak.fred@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: LaTex export: How to use `csquotes' and `\enquote{}'
Date: Thu, 07 Jul 2011 12:07:43 -1000	[thread overview]
Message-ID: <m1wrfthhhs.fsf@tsdye.com> (raw)
In-Reply-To: <iv50ci$mjn$1@dough.gmane.org> (Frederik's message of "Thu, 07 Jul 2011 21:11:14 +0200")

Frederik <freak.fred@gmail.com> writes:

> Am 06.07.2011 22:20, schrieb Nick Dokos:
>> The problem is the usual exponential growth of possibilities and how you
>> manage them: if you read the babel manual and the csquotes manual and all
>> the options that you can have, your head starts spinning (well, *my* head
>> starts spinning). I tend to think of all the possibilities and despair
>> over covering them all, whereas org-mode tends to make simplifying
>> assumptions that will cover>90% of the cases (if the simplifying
>> assumptions are good ones). I think we need such an assumption here.
>>
>> Here are some points to keep in mind while working on a patch:
>>
>> o csquotes.sty is part of the texlive-latex-extra package on Ubuntu (and
>>    probably something similar on other Linux distros and possibly MacOS X -
>>    hunoz about Windoz?)
> In the Windows-world MikTeX is quite common, as far as I know. I use
> MikTeX on Windows and it installs packages one includes directly from
> the net if they aren't already installed.
>
> IMHO the csquotes package becomes more and more important. For example
> biblatex, which will become the successor of BibTeX, relies on
> csquotes, when using a language other than English.
>
>> o the (LaTeX) babel package and csquotes have their own (different)
>>    conventions for specifying languages and dialects. In some cases, a
>>    single language can have multiple options for how to quote things.
>>    The proposal below explicitly does *not* deal with these complications.
>>
>> My initial reaction to how one would use csquotes was to use the +OPTIONS
>> line, something like this:
>>
>> #+OPTIONS: enquote:t language:fr
>>
>> The language option would trigger the inclusion of the babel package with
>> the (correct) language option (e.g. "en" ->  "english", "de" ->  "ngerman",
>> "fr" ->  "french", etc.)
>>
>> The enquote part would trigger 1) the inclusion of the csquotes package (and
>> since you specify it explicitly, it is your responsibility to make sure
>> that it be installed on your system) and 2) the translation of "foo" to
>> \enquote{foo}. Without it, "foo" goes to ``foo'' no matter what the language
>> is set to.
>>
>
> Why not use one option for babel and another for csquotes? I thought
> of something like this:
>
> #+OPTIONS: babel:english,ngerman csquotes:autostyle,german=guillemets
>
> Or is there any other reason why one would like to specify language options?
>
> 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.
>
> Regards

Aloha all,

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.

(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-\\)\"" "«~")
			  ("\\(\\S-\\)\"" "~»")
			  ("\\(\\s-\\)'" "`"))
		      '(("\\(\\s-\\|[[(]\\)\"" "``")
			("\\(\\S-\\)\"" "''")
			("\\(\\s-\\|(\\)'" "`")))))

This might provide Org-mode the flexibility needed to support csquotes,
but also leave open the possibility of supporting other packages, as
well.

Any thoughts?

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com

  reply	other threads:[~2011-07-07 22:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-04 16:54 LaTex export: How to use `csquotes' and `\enquote{}' Frederik
2011-07-04 23:06 ` Thomas S. Dye
2011-07-05 20:26   ` Frederik
2011-07-05 22:56     ` Thomas S. Dye
2011-07-06  6:22       ` Frederik
2011-07-06 14:48         ` Frederik
2011-07-06 16:37           ` Thomas S. Dye
2011-07-06 20:20             ` Nick Dokos
2011-07-07  8:02               ` Stefan Nobis
2011-07-07 15:10                 ` Nick Dokos
2011-07-07 17:22                   ` Stefan Nobis
2011-07-07 19:11               ` Frederik
2011-07-07 22:07                 ` Thomas S. Dye [this message]
2011-07-07 22:53                   ` Nick Dokos
2011-07-07 23:06                     ` Thomas S. Dye
2011-07-08  2:09                       ` Nick Dokos
2011-07-08  6:07                         ` Thomas S. Dye
2011-07-08  6:46                           ` Nick Dokos
2011-07-08  6:58                             ` Bastien
2011-07-08 15:49                         ` Frederik
2011-07-08 16:13                           ` Thomas S. Dye

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=m1wrfthhhs.fsf@tsdye.com \
    --to=tsd@tsdye.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=freak.fred@gmail.com \
    /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).