emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [feature request] Quotation marks in LaTeX export
@ 2010-01-22 23:47 Sven Bretfeld
  2010-01-24 19:22 ` Sven Bretfeld
  0 siblings, 1 reply; 7+ messages in thread
From: Sven Bretfeld @ 2010-01-22 23:47 UTC (permalink / raw)
  To: emacs-org

Hello List

Quotation marks like "these" are converted to ``these'' by
org-export-latex. It would be much better to use \enquote{these}.

The \enquote tag belongs to the powerful csquotes package. Not only does
this package chose the correct quotation mark style for the document
language as defined by babel, it also supports nested quotations, e.g.:

He said: \enquote{This a \enquote{nonsense} sentence.}

would be rendered as:

He said: "This is a `nonsense' sentence."

Using \enquote as a default translation would make things much easier
for non-English users. Is there a way to configure that? Or at least to
let org-export-latex produce German quotation marks: "`xxx"' instead of
``xxx''?

Greetings,

Sven

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [feature request] Quotation marks in LaTeX export
  2010-01-22 23:47 [feature request] Quotation marks in LaTeX export Sven Bretfeld
@ 2010-01-24 19:22 ` Sven Bretfeld
  2010-01-26  6:26   ` Scot Becker
  2010-01-26 22:03   ` Carsten Dominik
  0 siblings, 2 replies; 7+ messages in thread
From: Sven Bretfeld @ 2010-01-24 19:22 UTC (permalink / raw)
  To: Sven Bretfeld; +Cc: emacs-org

Hi

"Sven Bretfeld" <sven.bretfeld@gmx.ch> writes:

> Quotation marks like "these" are converted to ``these'' by
> org-export-latex. It would be much better to use \enquote{these}.

I have seen that org-latex.el links the quotation marks to the LANG
environment. So far only French and English are supported. I think this
is more complicated than it needs to be. Anyway, users with a French
environment also write English texts from time to time. We already have
a user-configurable, language-sensitive solution with the
csquotes-package. Why not use it?

On my system, I just changed the respective code in org-latex.el to
\enquote{}. It's working and it's easy. But it will be gone with the
next update.

Greetings,

Sven

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [feature request] Quotation marks in LaTeX export
  2010-01-24 19:22 ` Sven Bretfeld
@ 2010-01-26  6:26   ` Scot Becker
  2010-01-27  8:25     ` Carsten Dominik
  2010-01-26 22:03   ` Carsten Dominik
  1 sibling, 1 reply; 7+ messages in thread
From: Scot Becker @ 2010-01-26  6:26 UTC (permalink / raw)
  To: Sven Bretfeld; +Cc: emacs-org


[-- Attachment #1.1: Type: text/plain, Size: 1135 bytes --]

For what it's worth, I also think that an option to do this would be useful.



On Sun, Jan 24, 2010 at 7:22 PM, Sven Bretfeld <sven.bretfeld@gmx.ch> wrote:

> Hi
>
> "Sven Bretfeld" <sven.bretfeld@gmx.ch> writes:
>
> > Quotation marks like "these" are converted to ``these'' by
> > org-export-latex. It would be much better to use \enquote{these}.
>
> I have seen that org-latex.el links the quotation marks to the LANG
> environment. So far only French and English are supported. I think this
> is more complicated than it needs to be. Anyway, users with a French
> environment also write English texts from time to time. We already have
> a user-configurable, language-sensitive solution with the
> csquotes-package. Why not use it?
>
> On my system, I just changed the respective code in org-latex.el to
> \enquote{}. It's working and it's easy. But it will be gone with the
> next update.
>
> 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
>

[-- Attachment #1.2: Type: text/html, Size: 1775 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [feature request] Quotation marks in LaTeX export
  2010-01-24 19:22 ` Sven Bretfeld
  2010-01-26  6:26   ` Scot Becker
@ 2010-01-26 22:03   ` Carsten Dominik
  2010-01-27  9:29     ` Sven Bretfeld
  1 sibling, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2010-01-26 22:03 UTC (permalink / raw)
  To: Sven Bretfeld; +Cc: emacs-org

Hi Sven,

can you send me a path, preferably with an option to turn this on and  
off?

Thanks.

- Carsten

On Jan 24, 2010, at 8:22 PM, Sven Bretfeld wrote:

> Hi
>
> "Sven Bretfeld" <sven.bretfeld@gmx.ch> writes:
>
>> Quotation marks like "these" are converted to ``these'' by
>> org-export-latex. It would be much better to use \enquote{these}.
>
> I have seen that org-latex.el links the quotation marks to the LANG
> environment. So far only French and English are supported. I think  
> this
> is more complicated than it needs to be. Anyway, users with a French
> environment also write English texts from time to time. We already  
> have
> a user-configurable, language-sensitive solution with the
> csquotes-package. Why not use it?
>
> On my system, I just changed the respective code in org-latex.el to
> \enquote{}. It's working and it's easy. But it will be gone with the
> next update.
>
> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [feature request] Quotation marks in LaTeX export
  2010-01-26  6:26   ` Scot Becker
@ 2010-01-27  8:25     ` Carsten Dominik
  0 siblings, 0 replies; 7+ messages in thread
From: Carsten Dominik @ 2010-01-27  8:25 UTC (permalink / raw)
  To: Scot Becker; +Cc: emacs-org


On Jan 26, 2010, at 7:26 AM, Scot Becker wrote:

> For what it's worth, I also think that an option to do this would be  
> useful.

Hi Scott, it is worth a lot - more often that not a
second voice like this is what is making the difference...

- Carsten

>
>
>
> On Sun, Jan 24, 2010 at 7:22 PM, Sven Bretfeld  
> <sven.bretfeld@gmx.ch> wrote:
> Hi
>
> "Sven Bretfeld" <sven.bretfeld@gmx.ch> writes:
>
> > Quotation marks like "these" are converted to ``these'' by
> > org-export-latex. It would be much better to use \enquote{these}.
>
> I have seen that org-latex.el links the quotation marks to the LANG
> environment. So far only French and English are supported. I think  
> this
> is more complicated than it needs to be. Anyway, users with a French
> environment also write English texts from time to time. We already  
> have
> a user-configurable, language-sensitive solution with the
> csquotes-package. Why not use it?
>
> On my system, I just changed the respective code in org-latex.el to
> \enquote{}. It's working and it's easy. But it will be gone with the
> next update.
>
> 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
>
> _______________________________________________
> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [feature request] Quotation marks in LaTeX export
  2010-01-26 22:03   ` Carsten Dominik
@ 2010-01-27  9:29     ` Sven Bretfeld
  2010-01-27 10:58       ` Carsten Dominik
  0 siblings, 1 reply; 7+ messages in thread
From: Sven Bretfeld @ 2010-01-27  9:29 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-org

Hi Carsten

Carsten Dominik <carsten.dominik@gmail.com> 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-\\)\"" "«~")
			  ("\\(\\S-\\)\"" "~»")
			  ("\\(\\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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [feature request] Quotation marks in LaTeX export
  2010-01-27  9:29     ` Sven Bretfeld
@ 2010-01-27 10:58       ` Carsten Dominik
  0 siblings, 0 replies; 7+ messages in thread
From: Carsten Dominik @ 2010-01-27 10:58 UTC (permalink / raw)
  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  
distributions... :(

So this really has to be optional....

- Carsten

On Jan 27, 2010, at 10:29 AM, Sven Bretfeld wrote:

> Hi Carsten
>
> Carsten Dominik <carsten.dominik@gmail.com> 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-\\)\"" "«~")
> 			  ("\\(\\S-\\)\"" "~»")
> 			  ("\\(\\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
>
>
> _______________________________________________
> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-01-27 10:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-22 23:47 [feature request] Quotation marks in LaTeX export Sven Bretfeld
2010-01-24 19:22 ` Sven Bretfeld
2010-01-26  6:26   ` Scot Becker
2010-01-27  8:25     ` Carsten Dominik
2010-01-26 22:03   ` Carsten Dominik
2010-01-27  9:29     ` Sven Bretfeld
2010-01-27 10:58       ` Carsten Dominik

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