emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Sven Bretfeld <sven.bretfeld@gmx.ch>
Cc: emacs-org <emacs-orgmode@gnu.org>
Subject: Re: [feature request] Quotation marks in LaTeX export
Date: Wed, 27 Jan 2010 11:58:02 +0100	[thread overview]
Message-ID: <402E326C-F311-40A9-B853-438630C47E72@gmail.com> (raw)
In-Reply-To: <87pr4vzyi4.fsf@rub.de>

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

      reply	other threads:[~2010-01-27 10:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

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=402E326C-F311-40A9-B853-438630C47E72@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=sven.bretfeld@gmx.ch \
    /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).