Re: [Orgmode] [feature request] Quotation marks in LaTeX export
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 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 ___ 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
Re: [Orgmode] [feature request] Quotation marks in LaTeX export
Hi Carsten Carsten Dominik 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
Re: [Orgmode] [feature request] Quotation marks in LaTeX export
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" 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 ___ 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
Re: [Orgmode] [feature request] Quotation marks in LaTeX export
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 wrote: Hi "Sven Bretfeld" 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 ___ 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
Re: [Orgmode] [feature request] Quotation marks in LaTeX export
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 wrote: > Hi > > "Sven Bretfeld" 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
Re: [Orgmode] [feature request] Quotation marks in LaTeX export
Hi "Sven Bretfeld" 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
[Orgmode] [feature request] Quotation marks in LaTeX export
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 ___ 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