all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bug in LaTeX export of org-html-entities?
@ 2010-02-26 10:24 Geralt
  2010-03-02 11:45 ` Geralt
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Geralt @ 2010-02-26 10:24 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I think there's at least one bug in the
org-export-latex-treat-backslash-char function, because it does not
correctly export entries of the org-html-entities variable that have
the form ("Rightarrow" . "⇒"). To render such entities the
function uses (member (list string-after) org-html-entities), but that
fails for these entries. Assuming that org-html-entities is an alist a
correct check would be (assoc string-after org-html-entities). But
even then I think the function is broken, because it renders these
entities with the following piece of code:
  (cond ((member (list string-after) org-html-entities)
	 ;; backslash is part of a special entity (like "\alpha")
	 (concat string-before "$\\"
		 (or (cdar (member (list string-after) org-html-entities))
		     string-after) "$"))

   ;; other cases follow here, I've omitted them

If I replace just the condition-check with the (assoc ...) version the
export of, for example, \Rightarrow works, but due to the association
of Rightarrow with rArr we should expect that it should render
\Rightarrow as "⇒" which is of course only meaningful for HTML.
So I think we need here another condition, namely
(cond ((assoc string-after org-html-entities)
       (concat string-before "$\\"
               (or (cdr (assoc string-after org-html-entities))
                   string-after) "$"))

but that's not enough we also need a new entity variable
org-latex-entities which mapps entities like \rArr to \Rightarrow, so
instead of an entry ("Rightarrow" . "⇒") we need an entry ("rArr"
. "Rightarrow") and put an entry with empty cdr in this alist for
Rightarrow: ("Rightarrow").

Can you confirm this bug? And if yes, do you have a better solution
than I to avoid the duplication of the entities variable?





Geralt.

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

* Re: Bug in LaTeX export of org-html-entities?
  2010-02-26 10:24 Bug in LaTeX export of org-html-entities? Geralt
@ 2010-03-02 11:45 ` Geralt
  2010-03-02 11:59   ` Geralt
  2010-03-04  6:39 ` Carsten Dominik
  2010-03-29 11:28 ` Carsten Dominik
  2 siblings, 1 reply; 5+ messages in thread
From: Geralt @ 2010-03-02 11:45 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

it's been a few days and still no response, am I the only one who
thinks there's something wrong with the export of the special entities
preceded by a backslash, like \Rightarrow?




Geralt.

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

* Re: Bug in LaTeX export of org-html-entities?
  2010-03-02 11:45 ` Geralt
@ 2010-03-02 11:59   ` Geralt
  0 siblings, 0 replies; 5+ messages in thread
From: Geralt @ 2010-03-02 11:59 UTC (permalink / raw)
  To: emacs-orgmode

I think I forgot to state the actual problem, cosider the following org-file:
* An example \Rightarrow foobar
  some text

The produced LaTeX code is:
% Created 2010-03-02 Tue 12:53
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{hyperref}
\providecommand{\alert}[1]{\textbf{#1}}

\title{test}
\author{}
\date{02 March 2010}

\begin{document}

\maketitle

\setcounter{tocdepth}{3}
\tableofcontents
\vspace*{1cm}
\section{An example \Rightarrow foobar}
\label{sec-1}

  some text
\end{document}



As you can see it includes \Rightarrow instead of $\Rightarrow$ and
the check in the export function to accomplish that is the first one,
but that one uses member to check for an entry of the form
("Rightarrow") in the org-html-entities list which does not exist and
even if it would exist the elisp-code to procude the LaTeX code would
call cdar on the list ("Rightarrow") which results in nil and the
second part of the or-statement is executed, i.e. it always executes
the second part of the or-statement.



Geralt.

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

* Re: Bug in LaTeX export of org-html-entities?
  2010-02-26 10:24 Bug in LaTeX export of org-html-entities? Geralt
  2010-03-02 11:45 ` Geralt
@ 2010-03-04  6:39 ` Carsten Dominik
  2010-03-29 11:28 ` Carsten Dominik
  2 siblings, 0 replies; 5+ messages in thread
From: Carsten Dominik @ 2010-03-04  6:39 UTC (permalink / raw)
  To: Geralt; +Cc: emacs-orgmode

Hi Gerald,

I confirm this bug, but I don't have a fix currently.  There is a  
revamp of the entiies code in the making, but not done yet.

- Carsten

On Feb 26, 2010, at 11:24 AM, Geralt wrote:

> Hello,
>
> I think there's at least one bug in the
> org-export-latex-treat-backslash-char function, because it does not
> correctly export entries of the org-html-entities variable that have
> the form ("Rightarrow" . "⇒"). To render such entities the
> function uses (member (list string-after) org-html-entities), but that
> fails for these entries. Assuming that org-html-entities is an alist a
> correct check would be (assoc string-after org-html-entities). But
> even then I think the function is broken, because it renders these
> entities with the following piece of code:
>  (cond ((member (list string-after) org-html-entities)
> 	 ;; backslash is part of a special entity (like "\alpha")
> 	 (concat string-before "$\\"
> 		 (or (cdar (member (list string-after) org-html-entities))
> 		     string-after) "$"))
>
>   ;; other cases follow here, I've omitted them
>
> If I replace just the condition-check with the (assoc ...) version the
> export of, for example, \Rightarrow works, but due to the association
> of Rightarrow with rArr we should expect that it should render
> \Rightarrow as "⇒" which is of course only meaningful for HTML.
> So I think we need here another condition, namely
> (cond ((assoc string-after org-html-entities)
>       (concat string-before "$\\"
>               (or (cdr (assoc string-after org-html-entities))
>                   string-after) "$"))
>
> but that's not enough we also need a new entity variable
> org-latex-entities which mapps entities like \rArr to \Rightarrow, so
> instead of an entry ("Rightarrow" . "⇒") we need an entry ("rArr"
> . "Rightarrow") and put an entry with empty cdr in this alist for
> Rightarrow: ("Rightarrow").
>
> Can you confirm this bug? And if yes, do you have a better solution
> than I to avoid the duplication of the entities variable?
>
>
>
>
>
> Geralt.
>
>
> _______________________________________________
> 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] 5+ messages in thread

* Re: Bug in LaTeX export of org-html-entities?
  2010-02-26 10:24 Bug in LaTeX export of org-html-entities? Geralt
  2010-03-02 11:45 ` Geralt
  2010-03-04  6:39 ` Carsten Dominik
@ 2010-03-29 11:28 ` Carsten Dominik
  2 siblings, 0 replies; 5+ messages in thread
From: Carsten Dominik @ 2010-03-29 11:28 UTC (permalink / raw)
  To: Geralt; +Cc: emacs-orgmode

Hi Gerald,

Ulf Stegemann and myself have been working on improving this
problem.  The result of this work is in a special branch on the
git repo, called "new-entity-support".

If you have time, maybe you can check out this branch and test it,
to see if the problem you reported is indeed fixed.

- Carsten

On Feb 26, 2010, at 11:24 AM, Geralt wrote:

> Hello,
>
> I think there's at least one bug in the
> org-export-latex-treat-backslash-char function, because it does not
> correctly export entries of the org-html-entities variable that have
> the form ("Rightarrow" . "⇒"). To render such entities the
> function uses (member (list string-after) org-html-entities), but that
> fails for these entries. Assuming that org-html-entities is an alist a
> correct check would be (assoc string-after org-html-entities). But
> even then I think the function is broken, because it renders these
> entities with the following piece of code:
> (cond ((member (list string-after) org-html-entities)
> 	 ;; backslash is part of a special entity (like "\alpha")
> 	 (concat string-before "$\\"
> 		 (or (cdar (member (list string-after) org-html-entities))
> 		     string-after) "$"))
>
>  ;; other cases follow here, I've omitted them
>
> If I replace just the condition-check with the (assoc ...) version the
> export of, for example, \Rightarrow works, but due to the association
> of Rightarrow with rArr we should expect that it should render
> \Rightarrow as "⇒" which is of course only meaningful for HTML.
> So I think we need here another condition, namely
> (cond ((assoc string-after org-html-entities)
>      (concat string-before "$\\"
>              (or (cdr (assoc string-after org-html-entities))
>                  string-after) "$"))
>
> but that's not enough we also need a new entity variable
> org-latex-entities which mapps entities like \rArr to \Rightarrow, so
> instead of an entry ("Rightarrow" . "⇒") we need an entry ("rArr"
> . "Rightarrow") and put an entry with empty cdr in this alist for
> Rightarrow: ("Rightarrow").
>
> Can you confirm this bug? And if yes, do you have a better solution
> than I to avoid the duplication of the entities variable?
>
>
>
>
>
> Geralt.
>
>
> _______________________________________________
> 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] 5+ messages in thread

end of thread, other threads:[~2010-03-29 11:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-26 10:24 Bug in LaTeX export of org-html-entities? Geralt
2010-03-02 11:45 ` Geralt
2010-03-02 11:59   ` Geralt
2010-03-04  6:39 ` Carsten Dominik
2010-03-29 11:28 ` Carsten Dominik

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.