Frederik | 4 Jul 18:54 2011
Picon

LaTex export: How to use `csquotes' and `\enquote{}'

Hi there!

I just started using org-mode - what a fantastic piece of software!

Now I wonder how to make use of one of the best LaTeX-packages out 
there: `csquotes'. I figured out how to include the package in the 
header by altering the corresponding variable, but I didn't find any 
hint how to make use of the `\enquote' command provided by `csquotes'.

I don't want my quotes to be quoted like this:
	``Das ist ein Test''
but like this:
	\enquote{Das ist ein Test}

I searched the web and found some feature requests on this list 
concerning `csquotes' but the documentation and worg don't mention this 
topic - except for http://orgmode.org/worg/org-faq.html where `csquotes' 
is included in a source code listing, but there is no further explanation.

Is there a way to use `csquotes'?

Any hints would be appreciated - Thanks & regards

--

-- 
Frederik

Thomas S. Dye | 5 Jul 01:06 2011

Re: LaTex export: How to use `csquotes' and `\enquote{}'

Aloha Frederik,

Welcome to Org-mode.

One way to use \enquote in your LaTeX export is described here:

http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-10-3

[[latex:enquote][Das ist ein Test]] will export as \enquote{Das ist ein
Test}.

hth,
Tom

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

> Hi there!
>
> I just started using org-mode - what a fantastic piece of software!
>
> Now I wonder how to make use of one of the best LaTeX-packages out
> there: `csquotes'. I figured out how to include the package in the
> header by altering the corresponding variable, but I didn't find any
> hint how to make use of the `\enquote' command provided by `csquotes'.
>
> I don't want my quotes to be quoted like this:
> 	``Das ist ein Test''
> but like this:
> 	\enquote{Das ist ein Test}
>
(Continue reading)

Frederik | 5 Jul 22:26 2011
Picon

Re: LaTex export: How to use `csquotes' and `\enquote{}'

Hey Tom!

> One way to use \enquote in your LaTeX export is described here:
>
> http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-10-3
>
> [[latex:enquote][Das ist ein Test]] will export as \enquote{Das ist ein
> Test}.

Thanks for your hint. But this is a rather cumbersome way to quote 
text... It would be handy to have " directly converted to enquote - this 
should be possible, because org-mode is obviously able to distinguish 
whether to use `` or '' at the beginning and at end of a word, respectively.

Regards.

--

-- 
Frederik

Thomas S. Dye | 6 Jul 00:56 2011

Re: LaTex export: How to use `csquotes' and `\enquote{}'


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

> Hey Tom!
>
>> One way to use \enquote in your LaTeX export is described here:
>>
>> http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-10-3
>>
>> [[latex:enquote][Das ist ein Test]] will export as \enquote{Das ist ein
>> Test}.
>
> Thanks for your hint. But this is a rather cumbersome way to quote
> text... It would be handy to have " directly converted to enquote -
> this should be possible, because org-mode is obviously able to
> distinguish whether to use `` or '' at the beginning and at end of a
> word, respectively.
>
> Regards.

Aloha Frederik,

It looks more cumbersome than it is in practice.  You can use C-c C-l to
add the link and depending on the length of the link type name, it can
be very close to the same number of keystrokes you'd need for
\enquote{}.

Please let me know if you're able to configure Org-mode to translate "
to \enquote{}.  That would be a worthwhile addition to either the LaTeX
export tutorial or Org Hacks on Worg.
(Continue reading)

Frederik | 6 Jul 08:22 2011
Picon

Re: LaTex export: How to use `csquotes' and `\enquote{}'

Hi Tom!

> It looks more cumbersome than it is in practice.  You can use C-c C-l to
> add the link and depending on the length of the link type name, it can
> be very close to the same number of keystrokes you'd need for
> \enquote{}.

During normal LaTex editing I never type `\enquote{}'. Of course I type 
" and AucTeX automatically inserts `\enquote{' at the beginning of a 
word and `}' at the end of a word, depending on whether `csquotes' is 
loaded or not.

Apparently someone tried a simple hack:
http://osdir.com/ml/emacs-orgmode-gnu/2010-01/msg00681.html

When I find the time I will try this...

Thanks & Regards.

--

-- 
Frederik

Frederik | 6 Jul 16:48 2011
Picon

Re: LaTex export: How to use `csquotes' and `\enquote{}'


> Apparently someone tried a simple hack:
> http://osdir.com/ml/emacs-orgmode-gnu/2010-01/msg00681.html
>
> When I find the time I will try this...

I've tried the hack and for me this works pretty well. It's static but 
this doesn't really matter as I always stick to `csquotes'

I think it shouldn't be too difficult to implement a new variable/switch 
whether the standard behaviour or the one provided by the hack is going 
to be used. One would only have to insert an additional if-clause in the 
defun the hack alters.

Regards

--

-- 
Frederik

Thomas S. Dye | 6 Jul 18:37 2011

Re: LaTex export: How to use `csquotes' and `\enquote{}'

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

>> Apparently someone tried a simple hack:
>> http://osdir.com/ml/emacs-orgmode-gnu/2010-01/msg00681.html
>>
>> When I find the time I will try this...
>
> I've tried the hack and for me this works pretty well. It's static but
> this doesn't really matter as I always stick to `csquotes'
>
> I think it shouldn't be too difficult to implement a new
> variable/switch whether the standard behaviour or the one provided by
> the hack is going to be used. One would only have to insert an
> additional if-clause in the defun the hack alters.
>
> Regards

Yes, please do suggest a patch to support csquotes.  I've been using
LaTeX to write the American dialect of English, so haven't had a need
for the package.  As it happens, I spent some time yesterday editing by
hand an article that requires quotations in the British dialect of
English.  IIUC, csquotes would have done this work for me with the
change of a single option.

Perhaps others on the list with experience using the LaTeX babel package
can chime in here.

Thanks for an interesting set of ideas.

All the best,
(Continue reading)

Nick Dokos | 6 Jul 22:20 2011
Picon

Re: LaTex export: How to use `csquotes' and `\enquote{}'

Thomas S. Dye <tsd <at> tsdye.com> wrote:

> Frederik <freak.fred <at> gmail.com> writes:
> 
> >> Apparently someone tried a simple hack:
> >> http://osdir.com/ml/emacs-orgmode-gnu/2010-01/msg00681.html
> >>
> >> When I find the time I will try this...
> >
> > I've tried the hack and for me this works pretty well. It's static but
> > this doesn't really matter as I always stick to `csquotes'
> >
> > I think it shouldn't be too difficult to implement a new
> > variable/switch whether the standard behaviour or the one provided by
> > the hack is going to be used. One would only have to insert an
> > additional if-clause in the defun the hack alters.
> >
> > Regards
> 
> Yes, please do suggest a patch to support csquotes.  I've been using
> LaTeX to write the American dialect of English, so haven't had a need
> for the package.  As it happens, I spent some time yesterday editing by
> hand an article that requires quotations in the British dialect of
> English.  IIUC, csquotes would have done this work for me with the
> change of a single option.
> 
> Perhaps others on the list with experience using the LaTeX babel package
> can chime in here.
> 
> Thanks for an interesting set of ideas.
(Continue reading)

Stefan Nobis | 7 Jul 10:02 2011
Picon

Re: LaTex export: How to use `csquotes' and `\enquote{}'

Nick Dokos <nicholas.dokos <at> hp.com> writes:

> 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?)

On MacOS the MacTeX distribution is quite common and in this case a
complete TeXLive (including csquotes) is installed.

On Windows MikTeX is probably the defacto standard and IIRC it
supports installing packages on demand (I'm not sure wether csquotes
is included in the basic installation, but on the other hand I would
assume that a complete installation is not uncommen).

But another suggestion:

Always use \enquote for quotations in the exported text. In the
preambel of the document either include csquotes or provide a simple
macro enquote like the very simple

  \newcommand{\enquote}[1]{``#1''}

Maybe a bit more hackery might be needed for some special cases, but
with this approach it would be quite easy to change quotations styles
later on.

BTW: IMHO babel and csquotes should be considered standard packages
for all non-US texts (and even for US texts they have some
(Continue reading)

Nick Dokos | 7 Jul 17:10 2011
Picon

Re: LaTex export: How to use `csquotes' and `\enquote{}'

Stefan Nobis <stefan-ml <at> snobis.de> wrote:

> Nick Dokos <nicholas.dokos <at> hp.com> writes:
> 
> > 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?)
> 
> On MacOS the MacTeX distribution is quite common and in this case a
> complete TeXLive (including csquotes) is installed.
> 
> On Windows MikTeX is probably the defacto standard and IIRC it
> supports installing packages on demand (I'm not sure wether csquotes
> is included in the basic installation, but on the other hand I would
> assume that a complete installation is not uncommen).
> 

OK, that's good.

> But another suggestion:
> 
> Always use \enquote for quotations in the exported text. In the
> preambel of the document either include csquotes or provide a simple
> macro enquote like the very simple
> 
>   \newcommand{\enquote}[1]{``#1''}
> 
> Maybe a bit more hackery might be needed for some special cases, but
(Continue reading)

Stefan Nobis | 7 Jul 19:22 2011
Picon

Re: LaTex export: How to use `csquotes' and `\enquote{}'

Nick Dokos <nicholas.dokos <at> hp.com> writes:

> I'd worry a bit about adding the newcommand in the preamble during
> org processing: what would happen if I tried to use csquotes then?

It should be either the newcommand or else use csquotes. Mixing both
would be no good idea.

--
Until the next mail...,
Stefan.
Frederik | 7 Jul 21:11 2011
Picon

Re: LaTex export: How to use `csquotes' and `\enquote{}'

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:
>
(Continue reading)

Thomas S. Dye | 8 Jul 00:07 2011

Re: LaTex export: How to use `csquotes' and `\enquote{}'

Frederik <freak.fred <at> 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
(Continue reading)

Nick Dokos | 8 Jul 00:53 2011
Picon

Re: LaTex export: How to use `csquotes' and `\enquote{}'

Responses to Frederik and Tom inline.

Frederik <freak.fred <at> gmail.com> 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=guillemets
>

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 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.

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 <tsd <at> tsdye.com> wrote:

(Continue reading)

Thomas S. Dye | 8 Jul 01:06 2011

Re: LaTex export: How to use `csquotes' and `\enquote{}'

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.

All the best,
Tom

Nick Dokos <nicholas.dokos <at> hp.com> writes:

> Responses to Frederik and Tom inline.
>
> Frederik <freak.fred <at> gmail.com> 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=guillemets
>>
>
> 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.
(Continue reading)

Nick Dokos | 8 Jul 04:09 2011
Picon

Re: LaTex export: How to use `csquotes' and `\enquote{}'

Thomas S. Dye <tsd <at> tsdye.com> 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

> All the best,
> Tom
> =20
> Nick Dokos <nicholas.dokos <at> hp.com> writes:
> 
> > Responses to Frederik and Tom inline.
> >
> > Frederik <freak.fred <at> gmail.com> writes:
> >
> >> Why not use one option for babel and another for csquotes? I thought
(Continue reading)

Thomas S. Dye | 8 Jul 08:07 2011

Re: LaTex export: How to use `csquotes' and `\enquote{}'

Hi Nick,

Nick Dokos <nicholas.dokos <at> hp.com> writes:

> Thomas S. Dye <tsd <at> tsdye.com> 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
(Continue reading)

Nick Dokos | 8 Jul 08:46 2011
Picon

Re: LaTex export: How to use `csquotes' and `\enquote{}'

Thomas S. Dye <tsd <at> tsdye.com> wrote:

> Hi Nick,
> 
> Nick Dokos <nicholas.dokos <at> hp.com> writes:
> 
> > Thomas S. Dye <tsd <at> tsdye.com> 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?  
(Continue reading)

Bastien | 8 Jul 08:58 2011

Re: LaTex export: How to use `csquotes' and `\enquote{}'

Hi Nick and Tom,

Nick Dokos <nicholas.dokos <at> hp.com> writes:

> 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).

I'm following this thread and waiting for the patch -- would be nice 
to apply it before 7.6.1 (this WE), which will go to Emacs.

Good luck!

--

-- 
 Bastien

Frederik | 8 Jul 17:49 2011
Picon

Re: LaTex export: How to use `csquotes' and `\enquote{}'

Am 08.07.2011 04:09, schrieb Nick Dokos:
> Thomas S. Dye<tsd <at> tsdye.com>  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 agree with Nick - simple and clean.

What would be the purpose of the variable 
`org-export-latex-single-quote'? If you intend to support \enquote*{, 
then perhaps there should be an additional variable for the single 
closing quote (which would be `}' again...)

Then you'd have four variables:
(Continue reading)

Thomas S. Dye | 8 Jul 18:13 2011

Re: LaTex export: How to use `csquotes' and `\enquote{}'

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

> Am 08.07.2011 04:09, schrieb Nick Dokos:
>> Thomas S. Dye<tsd <at> tsdye.com>  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 agree with Nick - simple and clean.
>
> What would be the purpose of the variable
> org-export-latex-single-quote'? If you intend to support \enquote*{,
> then perhaps there should be an additional variable for the single
> closing quote (which would be `}' again...)
(Continue reading)


Gmane