* Re: Insert ampersand in HTML export? [not found] <20110210152542.26383056amscopub-mail@yahoo.com@dove.localdomain> @ 2011-02-11 8:34 ` Carsten Dominik 2011-02-11 16:48 ` Uriel Avalos [not found] ` <20110211114831.2a53a9ffamscopub-mail@yahoo.com@dove.localdomain> 0 siblings, 2 replies; 18+ messages in thread From: Carsten Dominik @ 2011-02-11 8:34 UTC (permalink / raw) To: Uriel Avalos; +Cc: emacs On Feb 10, 2011, at 9:25 PM, Uriel Avalos wrote: > How do you insert the actual & character in an HTML export? > > I'm trying to write a macro to insert a MATHML snippet but org-mode > converts & to &. > > How can I prevent that behavior? Hi Uriel, do you really want everyone here to construct their own test case for this? Please provide an example file with the macro definition and its use to make it as easy as possible for someone to try it out and fix it. Thanks - Carsten ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Insert ampersand in HTML export? 2011-02-11 8:34 ` Insert ampersand in HTML export? Carsten Dominik @ 2011-02-11 16:48 ` Uriel Avalos [not found] ` <20110211114831.2a53a9ffamscopub-mail@yahoo.com@dove.localdomain> 1 sibling, 0 replies; 18+ messages in thread From: Uriel Avalos @ 2011-02-11 16:48 UTC (permalink / raw) To: Carsten Dominik, emacs On Fri, 11 Feb 2011 09:34:08 +0100 Carsten Dominik <carsten.dominik@gmail.com> wrote: > > On Feb 10, 2011, at 9:25 PM, Uriel Avalos wrote: > > > How do you insert the actual & character in an HTML export? > > > > I'm trying to write a macro to insert a MATHML snippet but org-mode > > converts & to &. > > > > How can I prevent that behavior? > > Hi Uriel, > > do you really want everyone here to construct their own test case for > this? > > Please provide an example file with the macro definition and its > use to make it as easy as possible for someone to try it out and fix it. > > Thanks > > - Carsten > Look, there isn't really a "test" case. I'm just asking if this feature is available. The docs just say that & exports to & in HTML export and \$ in latex export. I'm asking if there's a way to disable that feature on a case-by-case basis i.e., I want & to export to & in HTML export for some situations. Hope that's clear enough. Here's a test macro: #+MACRO: ANG @<math>@<mrow>@<mo>&x2220;@</mo>@<mi>$1@</mi>@</mrow>@/math> This should be "angle $1". The MATML snippet works fine in a HTML file in firefox linux but the macro does not. I get this in the HTML export: <math> <mo> & #x2220; </mo> <mi> ... </mi> </mrow> </math> & gets incorrectly converted to & ^ permalink raw reply [flat|nested] 18+ messages in thread
[parent not found: <20110211114831.2a53a9ffamscopub-mail@yahoo.com@dove.localdomain>]
* Re: Insert ampersand in HTML export? [not found] ` <20110211114831.2a53a9ffamscopub-mail@yahoo.com@dove.localdomain> @ 2011-02-12 11:51 ` Bastien 2011-02-12 14:08 ` Carsten Dominik 2011-02-12 14:13 ` Carsten Dominik 1 sibling, 1 reply; 18+ messages in thread From: Bastien @ 2011-02-12 11:51 UTC (permalink / raw) To: Uriel Avalos; +Cc: emacs, Carsten Dominik Uriel Avalos <amscopub-mail@yahoo.com> writes: > & gets incorrectly converted to & It's what's expected in most cases. But I added a new variable `org-export-html-protect-char-alist' to allow fine tuning of what characters should be HTML proected. You can set this variable per buffer through #+BIND. HTH, -- Bastien ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Insert ampersand in HTML export? 2011-02-12 11:51 ` Bastien @ 2011-02-12 14:08 ` Carsten Dominik 2011-02-12 15:24 ` Bastien 0 siblings, 1 reply; 18+ messages in thread From: Carsten Dominik @ 2011-02-12 14:08 UTC (permalink / raw) To: Bastien; +Cc: emacs On Feb 12, 2011, at 12:51 PM, Bastien wrote: > Uriel Avalos <amscopub-mail@yahoo.com> writes: > >> & gets incorrectly converted to & > > It's what's expected in most cases. > > But I added a new variable `org-export-html-protect-char-alist' > to allow fine tuning of what characters should be HTML proected. Can't we just use =&= or something like this? - Carsten > > You can set this variable per buffer through #+BIND. > > HTH, > > -- > Bastien ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Insert ampersand in HTML export? 2011-02-12 14:08 ` Carsten Dominik @ 2011-02-12 15:24 ` Bastien 2011-02-12 20:51 ` Uriel Avalos [not found] ` <20110212155103.16e82a76uriavalos@yahoo.com@dove.localdomain> 0 siblings, 2 replies; 18+ messages in thread From: Bastien @ 2011-02-12 15:24 UTC (permalink / raw) To: Carsten Dominik; +Cc: emacs Hi Carsten, Carsten Dominik <carsten.dominik@gmail.com> writes: >> But I added a new variable `org-export-html-protect-char-alist' >> to allow fine tuning of what characters should be HTML proected. > > Can't we just use =&= or something like this? For now =&= will be exported as <code>&</code> Do you mean that everything within =...= should not go through `org-html-protect'? And if so, that org-export-html-protect-char-alist might not be necessary anymore? PS: Well, I thought about this but couldn't solve Uriel's problem this way... -- Bastien ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Insert ampersand in HTML export? 2011-02-12 15:24 ` Bastien @ 2011-02-12 20:51 ` Uriel Avalos [not found] ` <20110212155103.16e82a76uriavalos@yahoo.com@dove.localdomain> 1 sibling, 0 replies; 18+ messages in thread From: Uriel Avalos @ 2011-02-12 20:51 UTC (permalink / raw) To: emacs-orgmode On Sat, 12 Feb 2011 16:24:23 +0100 Bastien <bastien.guerry@wikimedia.fr> wrote: > Hi Carsten, > > Carsten Dominik <carsten.dominik@gmail.com> writes: > > >> But I added a new variable `org-export-html-protect-char-alist' > >> to allow fine tuning of what characters should be HTML proected. > > > > Can't we just use =&= or something like this? > > For now =&= will be exported as <code>&</code> > > Do you mean that everything within =...= should not go through > `org-html-protect'? > > And if so, that org-export-html-protect-char-alist might not be > necessary anymore? > > > PS: Well, I thought about this but couldn't solve Uriel's problem > this way... > > -- > Bastien > > _______________________________________________ > 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 What about some type of escape character like \&? That way \& is exported as & instead of & or \$. Would that work? org-export-html-protect-char-alist may work in my case---the MATHML macros are in a seperate #+SETUPFILE. As long as this variable doesn't "bubble up" i.e., apply to the file that calls #+SETUPFILE, then it will work. ^ permalink raw reply [flat|nested] 18+ messages in thread
[parent not found: <20110212155103.16e82a76uriavalos@yahoo.com@dove.localdomain>]
* Re: Insert ampersand in HTML export? [not found] ` <20110212155103.16e82a76uriavalos@yahoo.com@dove.localdomain> @ 2011-02-13 9:10 ` Bastien 2011-02-13 18:53 ` Uriel Avalos [not found] ` <20110213135347.58c0c882uriavalos@yahoo.com@dove.localdomain> 0 siblings, 2 replies; 18+ messages in thread From: Bastien @ 2011-02-13 9:10 UTC (permalink / raw) To: Uriel Avalos; +Cc: emacs-orgmode Hi Uriel, Uriel Avalos <uriavalos@yahoo.com> writes: > What about some type of escape character like \&? That way \& is > exported as & instead of & or \$. Would that work? Handling escape characters is quite tricky, I'd better not go that way. > org-export-html-protect-char-alist may work in my case---the MATHML > macros are in a seperate #+SETUPFILE. As long as this variable doesn't > "bubble up" i.e., apply to the file that calls #+SETUPFILE, then it > will work. Please tell me if it works. Thanks! -- Bastien ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Insert ampersand in HTML export? 2011-02-13 9:10 ` Bastien @ 2011-02-13 18:53 ` Uriel Avalos [not found] ` <20110213135347.58c0c882uriavalos@yahoo.com@dove.localdomain> 1 sibling, 0 replies; 18+ messages in thread From: Uriel Avalos @ 2011-02-13 18:53 UTC (permalink / raw) To: emacs-orgmode On Sun, 13 Feb 2011 10:10:13 +0100 Bastien <bastien.guerry@wikimedia.fr> wrote: > Hi Uriel, > > Uriel Avalos <uriavalos@yahoo.com> writes: > > > What about some type of escape character like \&? That way \& is > > exported as & instead of & or \$. Would that work? > > Handling escape characters is quite tricky, I'd better not go that way. > > > org-export-html-protect-char-alist may work in my case---the MATHML > > macros are in a seperate #+SETUPFILE. As long as this variable doesn't > > "bubble up" i.e., apply to the file that calls #+SETUPFILE, then it > > will work. > > Please tell me if it works. > > Thanks! > > -- > Bastien > > _______________________________________________ > 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 So this new variable is in the bleeding edge version of org-mode? Will download and test. Thanks ^ permalink raw reply [flat|nested] 18+ messages in thread
[parent not found: <20110213135347.58c0c882uriavalos@yahoo.com@dove.localdomain>]
* Re: Insert ampersand in HTML export? [not found] ` <20110213135347.58c0c882uriavalos@yahoo.com@dove.localdomain> @ 2011-02-14 0:04 ` Bastien 2011-02-17 2:50 ` Uriel Avalos [not found] ` <20110216215007.51a0a126uriavalos@yahoo.com@dove.localdomain> 0 siblings, 2 replies; 18+ messages in thread From: Bastien @ 2011-02-14 0:04 UTC (permalink / raw) To: Uriel Avalos; +Cc: emacs-orgmode Uriel Avalos <uriavalos@yahoo.com> writes: > So this new variable is in the bleeding edge version of org-mode? Yes it is. > Will download and test. Thanks Thanks, -- Bastien ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Insert ampersand in HTML export? 2011-02-14 0:04 ` Bastien @ 2011-02-17 2:50 ` Uriel Avalos [not found] ` <20110216215007.51a0a126uriavalos@yahoo.com@dove.localdomain> 1 sibling, 0 replies; 18+ messages in thread From: Uriel Avalos @ 2011-02-17 2:50 UTC (permalink / raw) To: Bastien; +Cc: emacs-orgmode On Mon, 14 Feb 2011 01:04:16 +0100 Bastien <bastien.guerry@wikimedia.fr> wrote: > Uriel Avalos <uriavalos@yahoo.com> writes: > > > So this new variable is in the bleeding edge version of org-mode? > > Yes it is. > > > Will download and test. Thanks > > Thanks, > > -- > Bastien > > _______________________________________________ > 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 Just installed the latest bleeding edge version of org. How do I set that variable using BIND? Recall, the goal is to export & to itself: #+BIND: org-export-html-protect-char-alist '("&" . "&") That's telling me I'm using the "wrong type argument: listp, quote" ^ permalink raw reply [flat|nested] 18+ messages in thread
[parent not found: <20110216215007.51a0a126uriavalos@yahoo.com@dove.localdomain>]
* Re: Insert ampersand in HTML export? [not found] ` <20110216215007.51a0a126uriavalos@yahoo.com@dove.localdomain> @ 2011-02-17 3:24 ` Bastien 2011-02-17 18:41 ` Uriel Avalos [not found] ` <20110217134138.059f9051amscopub-mail@yahoo.com@dove.localdomain> 0 siblings, 2 replies; 18+ messages in thread From: Bastien @ 2011-02-17 3:24 UTC (permalink / raw) To: Uriel Avalos; +Cc: emacs-orgmode Hi uriel, Uriel Avalos <uriavalos@yahoo.com> writes: > #+BIND: org-export-html-protect-char-alist '("&" . "&") > > That's telling me I'm using the "wrong type argument: listp, quote" It must be this: #+BIND: org-export-html-protect-char-alist '(("&" . "&")) The "-alist" suffix means it should be an alist -- see the Info node for Association lists in the Elisp manual. -- Bastien ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Insert ampersand in HTML export? 2011-02-17 3:24 ` Bastien @ 2011-02-17 18:41 ` Uriel Avalos [not found] ` <20110217134138.059f9051amscopub-mail@yahoo.com@dove.localdomain> 1 sibling, 0 replies; 18+ messages in thread From: Uriel Avalos @ 2011-02-17 18:41 UTC (permalink / raw) To: Bastien; +Cc: emacs-orgmode On Thu, 17 Feb 2011 04:24:58 +0100 Bastien <bastien.guerry@wikimedia.fr> wrote: > Hi uriel, > > Uriel Avalos <uriavalos@yahoo.com> writes: > > > #+BIND: org-export-html-protect-char-alist '("&" . "&") > > > > That's telling me I'm using the "wrong type argument: listp, quote" > > It must be this: > > #+BIND: org-export-html-protect-char-alist '(("&" . "&")) > > The "-alist" suffix means it should be an alist -- see the Info node for > Association lists in the Elisp manual. > > -- > Bastien > > _______________________________________________ > 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 Nope. It still doesn't work. This is my test file: #+BIND: org-export-html-protect-char-alist '(("&" . "&")) #+MACRO test & should stay as is Hello world & I get the same error when I try to export: "wrong type argument: listp, quote" ^ permalink raw reply [flat|nested] 18+ messages in thread
[parent not found: <20110217134138.059f9051amscopub-mail@yahoo.com@dove.localdomain>]
* Re: Insert ampersand in HTML export? [not found] ` <20110217134138.059f9051amscopub-mail@yahoo.com@dove.localdomain> @ 2011-02-17 21:57 ` Nick Dokos 2011-02-18 9:04 ` Bastien 0 siblings, 1 reply; 18+ messages in thread From: Nick Dokos @ 2011-02-17 21:57 UTC (permalink / raw) To: Uriel Avalos; +Cc: nicholas.dokos, emacs-orgmode, Bastien Uriel Avalos <amscopub-mail@yahoo.com> wrote: > On Thu, 17 Feb 2011 04:24:58 +0100 > Bastien <bastien.guerry@wikimedia.fr> wrote: > > > Hi uriel, > > > > Uriel Avalos <uriavalos@yahoo.com> writes: > > > > > #+BIND: org-export-html-protect-char-alist '("&" . "&") > > > > > > That's telling me I'm using the "wrong type argument: listp, quote" > > > > It must be this: > > > > #+BIND: org-export-html-protect-char-alist '(("&" . "&")) > > > > The "-alist" suffix means it should be an alist -- see the Info node for > > Association lists in the Elisp manual. > > > > -- > > Bastien > > > > _______________________________________________ > > 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 > > Nope. It still doesn't work. This is my test file: > > #+BIND: org-export-html-protect-char-alist '(("&" . "&")) > #+MACRO test & should stay as is > > Hello world & > > I get the same error when I try to export: "wrong type argument: listp, quote" > [Sent a terser reply earlier, but it never made it to the list: mail problem on my end.] Lose the quote (that will cure the emacs error) and add a header: the <title> element in HTML still gets the & treatment: --8<---------------cut here---------------start------------->8--- #+BIND: org-export-html-protect-char-alist (("&" . "&")) #+MACRO test & should stay as is * foo & bar Hello world & --8<---------------cut here---------------end--------------->8--- Nick ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Insert ampersand in HTML export? 2011-02-17 21:57 ` Nick Dokos @ 2011-02-18 9:04 ` Bastien 2011-02-22 16:21 ` Uriel Avalos 2011-02-22 16:28 ` Uriel Avalos 0 siblings, 2 replies; 18+ messages in thread From: Bastien @ 2011-02-18 9:04 UTC (permalink / raw) To: nicholas.dokos; +Cc: emacs-orgmode Nick Dokos <nicholas.dokos@hp.com> writes: > #+BIND: org-export-html-protect-char-alist (("&" . "&")) Yes, no quote needed. Thanks Nick for correcting me. -- Bastien ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Insert ampersand in HTML export? 2011-02-18 9:04 ` Bastien @ 2011-02-22 16:21 ` Uriel Avalos 2011-02-22 16:28 ` Uriel Avalos 1 sibling, 0 replies; 18+ messages in thread From: Uriel Avalos @ 2011-02-22 16:21 UTC (permalink / raw) To: Bastien; +Cc: emacs-orgmode On Fri, 18 Feb 2011 10:04:52 +0100 Bastien <bastien.guerry@wikimedia.fr> wrote: > Nick Dokos <nicholas.dokos@hp.com> writes: > > > #+BIND: org-export-html-protect-char-alist (("&" . "&")) > > Yes, no quote needed. Thanks Nick for correcting me. > > -- > Bastien OK, finally tried it out. Unfortunately, while the variable works, it doesn't stay local---if you include the file in SETUPFILE, the variable also applies to that file. Is there a way to make sure that variable stays local? Ex: macro.org #+BIND: org-export-html-protect-char-alist (("&" . "&")) #+MACRO: test & should stay as is macro-import.org ##+SETUPFILE: macro.org * Hello World This & should receive the amp treatment. But doesn't. {{{test}}} ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Insert ampersand in HTML export? 2011-02-18 9:04 ` Bastien 2011-02-22 16:21 ` Uriel Avalos @ 2011-02-22 16:28 ` Uriel Avalos 1 sibling, 0 replies; 18+ messages in thread From: Uriel Avalos @ 2011-02-22 16:28 UTC (permalink / raw) To: Bastien; +Cc: emacs-orgmode On Fri, 18 Feb 2011 10:04:52 +0100 Bastien <bastien.guerry@wikimedia.fr> wrote: > Nick Dokos <nicholas.dokos@hp.com> writes: > > > #+BIND: org-export-html-protect-char-alist (("&" . "&")) > > Yes, no quote needed. Thanks Nick for correcting me. > > -- > Bastien Also I found a bug in that version of org-mode. How do I report it or should I report it because it's a development version? There seems to be a problem with the escape character @. Anytime the preceding character is *NOT* a white space (including non-breaking space), the export breaks. This wasn't a problem before in 7.3. In 7.3, this code exports fine: point @<i>A@</i> ^ | non-breaking space It exports to: point <i>A</i> In the development version, that code snippet exports to: point @<i>A</i> not at all what's intended.... ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Insert ampersand in HTML export? [not found] ` <20110211114831.2a53a9ffamscopub-mail@yahoo.com@dove.localdomain> 2011-02-12 11:51 ` Bastien @ 2011-02-12 14:13 ` Carsten Dominik 1 sibling, 0 replies; 18+ messages in thread From: Carsten Dominik @ 2011-02-12 14:13 UTC (permalink / raw) To: Uriel Avalos; +Cc: emacs Hi Uriel, On Feb 11, 2011, at 5:48 PM, Uriel Avalos wrote: > On Fri, 11 Feb 2011 09:34:08 +0100 > Carsten Dominik <carsten.dominik@gmail.com> wrote: > >> >> On Feb 10, 2011, at 9:25 PM, Uriel Avalos wrote: >> >>> How do you insert the actual & character in an HTML export? >>> >>> I'm trying to write a macro to insert a MATHML snippet but org-mode >>> converts & to &. >>> >>> How can I prevent that behavior? >> >> Hi Uriel, >> >> do you really want everyone here to construct their own test case for >> this? >> >> Please provide an example file with the macro definition and its >> use to make it as easy as possible for someone to try it out and >> fix it. >> >> Thanks >> >> - Carsten >> > > Look, there isn't really a "test" case. I'm just asking if this > feature is available. But with a test line, it is soo much easier to understand what you are looking for even if your question itself might not be clear - as it was for me in this case. > The docs just say that & exports to & in HTML export and \$ in > latex export. > I'm asking if there's a way to disable that feature on a case-by- > case basis i.e., > I want & to export to & in HTML export for some situations. Hope > that's clear enough. > > Here's a test macro: > > #+MACRO: ANG @<math>@<mrow>@<mo>&x2220;@</mo>@<mi>$1@</mi>@</mrow>@/ > math> > > This should be "angle $1". The MATML snippet works fine in a HTML > file in firefox linux but the macro does not. I get this in the HTML > export: > > <math> <mo> & #x2220; </mo> <mi> ... </mi> </mrow> </math> > > & gets incorrectly converted to & Now I see, thank you for the example. Maybe you can use #+MACRO: ANG @<math>@<mrow>@<mo> \angle @</mo>@<mi>$1@</mi>@</mrow>@/ math> Org has a whole slew of special characters defined this way, and they translate correctly to both HTML and LaTeX. - Carsten ^ permalink raw reply [flat|nested] 18+ messages in thread
* Insert ampersand in HTML export? @ 2011-02-10 20:25 Uriel Avalos 0 siblings, 0 replies; 18+ messages in thread From: Uriel Avalos @ 2011-02-10 20:25 UTC (permalink / raw) To: emacs How do you insert the actual & character in an HTML export? I'm trying to write a macro to insert a MATHML snippet but org-mode converts & to &. How can I prevent that behavior? ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2011-02-22 16:29 UTC | newest] Thread overview: 18+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <20110210152542.26383056amscopub-mail@yahoo.com@dove.localdomain> 2011-02-11 8:34 ` Insert ampersand in HTML export? Carsten Dominik 2011-02-11 16:48 ` Uriel Avalos [not found] ` <20110211114831.2a53a9ffamscopub-mail@yahoo.com@dove.localdomain> 2011-02-12 11:51 ` Bastien 2011-02-12 14:08 ` Carsten Dominik 2011-02-12 15:24 ` Bastien 2011-02-12 20:51 ` Uriel Avalos [not found] ` <20110212155103.16e82a76uriavalos@yahoo.com@dove.localdomain> 2011-02-13 9:10 ` Bastien 2011-02-13 18:53 ` Uriel Avalos [not found] ` <20110213135347.58c0c882uriavalos@yahoo.com@dove.localdomain> 2011-02-14 0:04 ` Bastien 2011-02-17 2:50 ` Uriel Avalos [not found] ` <20110216215007.51a0a126uriavalos@yahoo.com@dove.localdomain> 2011-02-17 3:24 ` Bastien 2011-02-17 18:41 ` Uriel Avalos [not found] ` <20110217134138.059f9051amscopub-mail@yahoo.com@dove.localdomain> 2011-02-17 21:57 ` Nick Dokos 2011-02-18 9:04 ` Bastien 2011-02-22 16:21 ` Uriel Avalos 2011-02-22 16:28 ` Uriel Avalos 2011-02-12 14:13 ` Carsten Dominik 2011-02-10 20:25 Uriel Avalos
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).