[Orgmode] Bug: LaTeX fragments export to invalid XHTML
This is the sample file: * Hello world \begin{align*} x=\frac{-b^2\pm\sqrt{b^2-4ac}}{2a} \end{align*} When you validate the resulting HTML file at the w3c site (http://validator.w3.org/check), it fails the check. If you recall, when org-export-with-latex-fragments is set to dvipng, it produces PNG images with the ALT attribute equal to the corresponding LaTeX equation. In this case, the resulting IMG tag is: img src=filenameofPNG alt=\begin{align*}x=\frac{-b^2\pm\sqrt{b^2-4ac}}{2a}\end{align*}/ Apparently, you can't have unescaped (ampersands) in an ALT tag. Thus, the resulting HTML file fails to validate. ___ 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] { in Latex fragments
Hi there, In my org-mode document, I have a special sequence to switch to a Japanese font defined as \J. When using this, I have to do something like {\J (Japanese characters here}. However, when I run the org-mode export, the braces { and } are escaped as \{ and \} and thus loosing their function. Is there some switch to prevent this from happening? I would much rather write \{ myself in the few cases where I in fact need it. Any help appreciated, Chris ___ 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] { in Latex fragments
Christian Wittern cwitt...@gmail.com writes: In my org-mode document, I have a special sequence to switch to a Japanese font defined as \J. When using this, I have to do something like {\J (Japanese characters here}. However, when I run the org-mode export, the braces { and } are escaped as \{ and \} and thus loosing their function. yes. but why don't you change the sequence? I mean: from: hello {\J ウ} to hello [\J ウ ] or: (\J ウ) [] and () are not escaped cheers, Giovanni ___ 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] { in Latex fragments
Or what about \J{japanese characters here}? I do the same with Hebrew, \heb{לִפְנֵי יְהוָה} and (without claiming to have done extensive testing), it seems to work. Org mode is set up to let arbitrary macros of the format \mymacro{data} pass through to LaTeX. You might not even have to change your definitions. Scot On Wed, Aug 25, 2010 at 9:21 AM, Giovanni Ridolfi giovanni.rido...@yahoo.it wrote: Christian Wittern cwitt...@gmail.com writes: In my org-mode document, I have a special sequence to switch to a Japanese font defined as \J. When using this, I have to do something like {\J (Japanese characters here}. However, when I run the org-mode export, the braces { and } are escaped as \{ and \} and thus loosing their function. yes. but why don't you change the sequence? I mean: from: hello {\J ウ} to hello [\J ウ ] or: (\J ウ) [] and () are not escaped cheers, Giovanni ___ 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] { in Latex fragments
On Wed, 25 Aug 2010 10:21:43 +0200, Giovanni Ridolfi giovanni.rido...@yahoo.it wrote: Christian Wittern cwitt...@gmail.com writes: In my org-mode document, I have a special sequence to switch to a Japanese font defined as \J. When using this, I have to do something like {\J (Japanese characters here}. However, when I run the org-mode export, the braces { and } are escaped as \{ and \} and thus loosing their function. yes. but why don't you change the sequence? I mean: from: hello {\J ウ} to hello [\J ウ ] or: (\J ウ) [] and () are not escaped cheers, Giovanni I think because the {}'s define a scope in latex and so the \J only affects text surrounded by the {}. For Christian, what about \J{ text } instead as org is careful to let this type of construct go through unchanged, if I understand correctly. This does depend on how you have defined J but possibly a slight redefinition would work (\newcommand{\J}[1]{ #1}). HTH, eric -- MC . -.. --- - ..-. .-. .- --. .- .- - ..- -.-. .-.. .- -.-. ..- -.- NL Professor Eric S Fraga, UCL, http://www.homepages.ucl.ac.uk/~ucecesf/ PG Fingerprint: 8F5C 279D 3907 E14A 5C29 570D C891 93D8 FFFC F67D BF ++[+[]-]++..-.++.--. ___ 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] { in Latex fragments
Christian Wittern, on the road On Aug 25, 2010, at 17:39, Eric S Fraga ucec...@ucl.ac.uk wrote: to hello [\J ウ ] or: (\J ウ) [] and () are not escaped cheers, Giovanni I think because the {}'s define a scope in latex and so the \J only affects text surrounded by the {}. Exactly. For Christian, what about \J{ text } instead as org is careful to let this type of construct go through unchanged, if I understand correctly. This does depend on how you have defined J but possibly a slight redefinition would work (\newcommand{\J}[1]{ #1}). I had tried this first, but somehow the font was not switched back. But now, looking at your example, I think it might have been because of a missing space. I will give it a try. Thanks a lot, Christian ___ 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] configure latex fragments preview
Hi Nick, :scale is use to change the -D dpi setting, which also changes the image size. - Carsten On Sep 14, 2009, at 8:39 PM, Nick Dokos wrote: Nicolas Goaziou n.goaz...@gmail.com wrote: This is some minor annoyance, but I would like to find a solution for it anyway. The preview image of a latex fragment produced by C-c C-x C-l is so small that I sometimes find it hard to read. In order to solve that situation, I modified org-format-latex- header so that the template for the preview starts with \documentclass[17pt]{extarticle}. Though, I find it not quite satisfying as there is little control on that size (I would like it to be a bit less than 17pt). Thus my question (eventually) : is it possible to play with dvipng options like scale or dpi directly, without modifying org.el ? And if it doesn't exist, could a variable be introduced to fine- tune it ? As a last note, I think there is a Latex only way to solve all of this, but I wouldn't like to depends on too much latex packages or tricks. The call to dvipng in org.el looks like this: , | ... | (call-process dvipng nil nil nil | -fg fg -bg bg | -D dpi | ;;-x scale -y scale | -T tight | -o pngfile | dvifile) | ... ` Try modifying it to this: , | ... | (call-process dvipng nil nil nil | -fg fg -bg bg | -D dpi | ;;-x scale -y scale | -x 2074 | -T tight | -o pngfile | dvifile) ` The dvipng man page suggests values for the -x option: , |-x num |Set the x magnification ratio to num/1000. Overrides the magnification specified in the |DVI file. Must be between 10 and 10. It is recommended that you use standard mag‐ |step values (1095, 1200, 1440, 1728, 2074, 2488, 2986, and so on) to help reduce the |total number of PK files generated. num may be a real number, not an integer, for |increased precision. ` Note the commented out -x/-y options in org.el: afaict, there is no -y option, but perhaps Carsten can reintroduce the -x option, and then use scale to set it properly (although the value of scale will need to be, ahem, scaled). If so, then you 'd be able to get what you want by customizing org-format-latex-options: , | org-format-latex-options is a variable defined in `org.el'. | Its value is | (:foreground default :background default :scale 1.0 :html- foreground Black :html-background Transparent :html-scale 1.0 :matchers | (begin $1 $ $$ \\( \\[)) | | | Documentation: | Options for creating images from LaTeX fragments. | This is a property list with the following properties: | :foreground the foreground color for images embedded in Emacs, e.g. Black. | `default' means use the foreground of the default face. | :background the background color, or Transparent. | `default' means use the background of the default face. | :scale a scaling factor for the size of the images. | :html-foreground, :html-background, :html-scale | the same numbers for HTML export. | :matchersa list indicating which matchers should be used to | find LaTeX fragments. Valid members of this list are: | begin find environments | $1 find single characters surrounded by $.$ | $ find math expressions surrounded by $...$ | $$ find math expressions surrounded by $$$$ | \( find math expressions surrounded by \(...\) | \ [find math expressions surrounded by \ [...\] | | You can customize this variable. ` HTH, Nick ___ Emacs-orgmode mailing list Remember: 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 Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] configure latex fragments preview
Hi Nick, :scale is use to change the -D dpi setting, which also changes the image size. - Carsten On Sep 14, 2009, at 8:39 PM, Nick Dokos wrote: Nicolas Goaziou n.goaz...@gmail.com wrote: This is some minor annoyance, but I would like to find a solution for it anyway. The preview image of a latex fragment produced by C-c C-x C-l is so small that I sometimes find it hard to read. In order to solve that situation, I modified org-format-latex- header so that the template for the preview starts with \documentclass[17pt]{extarticle}. Though, I find it not quite satisfying as there is little control on that size (I would like it to be a bit less than 17pt). Thus my question (eventually) : is it possible to play with dvipng options like scale or dpi directly, without modifying org.el ? And if it doesn't exist, could a variable be introduced to fine- tune it ? As a last note, I think there is a Latex only way to solve all of this, but I wouldn't like to depends on too much latex packages or tricks. The call to dvipng in org.el looks like this: , | ... | (call-process dvipng nil nil nil | -fg fg -bg bg | -D dpi | ;;-x scale -y scale | -T tight | -o pngfile | dvifile) | ... ` Try modifying it to this: , | ... | (call-process dvipng nil nil nil | -fg fg -bg bg | -D dpi | ;;-x scale -y scale | -x 2074 | -T tight | -o pngfile | dvifile) ` The dvipng man page suggests values for the -x option: , |-x num |Set the x magnification ratio to num/1000. Overrides the magnification specified in the |DVI file. Must be between 10 and 10. It is recommended that you use standard mag‐ |step values (1095, 1200, 1440, 1728, 2074, 2488, 2986, and so on) to help reduce the |total number of PK files generated. num may be a real number, not an integer, for |increased precision. ` Note the commented out -x/-y options in org.el: afaict, there is no -y option, but perhaps Carsten can reintroduce the -x option, and then use scale to set it properly (although the value of scale will need to be, ahem, scaled). If so, then you 'd be able to get what you want by customizing org-format-latex-options: , | org-format-latex-options is a variable defined in `org.el'. | Its value is | (:foreground default :background default :scale 1.0 :html- foreground Black :html-background Transparent :html-scale 1.0 :matchers | (begin $1 $ $$ \\( \\[)) | | | Documentation: | Options for creating images from LaTeX fragments. | This is a property list with the following properties: | :foreground the foreground color for images embedded in Emacs, e.g. Black. | `default' means use the foreground of the default face. | :background the background color, or Transparent. | `default' means use the background of the default face. | :scale a scaling factor for the size of the images. | :html-foreground, :html-background, :html-scale | the same numbers for HTML export. | :matchersa list indicating which matchers should be used to | find LaTeX fragments. Valid members of this list are: | begin find environments | $1 find single characters surrounded by $.$ | $ find math expressions surrounded by $...$ | $$ find math expressions surrounded by $$$$ | \( find math expressions surrounded by \(...\) | \ [find math expressions surrounded by \ [...\] | | You can customize this variable. ` HTH, Nick ___ Emacs-orgmode mailing list Remember: 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 Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] configure latex fragments preview
Hello, This is some minor annoyance, but I would like to find a solution for it anyway. The preview image of a latex fragment produced by C-c C-x C-l is so small that I sometimes find it hard to read. In order to solve that situation, I modified org-format-latex-header so that the template for the preview starts with \documentclass[17pt]{extarticle}. Though, I find it not quite satisfying as there is little control on that size (I would like it to be a bit less than 17pt). Thus my question (eventually) : is it possible to play with dvipng options like scale or dpi directly, without modifying org.el ? And if it doesn't exist, could a variable be introduced to fine-tune it ? As a last note, I think there is a Latex only way to solve all of this, but I wouldn't like to depends on too much latex packages or tricks. Regards, -- Nicolas Goaziou ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] configure latex fragments preview
Nicolas Goaziou n.goaz...@gmail.com wrote: This is some minor annoyance, but I would like to find a solution for it anyway. The preview image of a latex fragment produced by C-c C-x C-l is so small that I sometimes find it hard to read. In order to solve that situation, I modified org-format-latex-header so that the template for the preview starts with \documentclass[17pt]{extarticle}. Though, I find it not quite satisfying as there is little control on that size (I would like it to be a bit less than 17pt). Thus my question (eventually) : is it possible to play with dvipng options like scale or dpi directly, without modifying org.el ? And if it doesn't exist, could a variable be introduced to fine-tune it ? As a last note, I think there is a Latex only way to solve all of this, but I wouldn't like to depends on too much latex packages or tricks. The call to dvipng in org.el looks like this: , | ... | (call-process dvipng nil nil nil | -fg fg -bg bg | -D dpi | ;;-x scale -y scale | -T tight | -o pngfile | dvifile) | ... ` Try modifying it to this: , | ... | (call-process dvipng nil nil nil | -fg fg -bg bg | -D dpi | ;;-x scale -y scale | -x 2074 | -T tight | -o pngfile | dvifile) ` The dvipng man page suggests values for the -x option: , |-x num |Set the x magnification ratio to num/1000. Overrides the magnification specified in the |DVI file. Must be between 10 and 10. It is recommended that you use standard mag‐ |step values (1095, 1200, 1440, 1728, 2074, 2488, 2986, and so on) to help reduce the |total number of PK files generated. num may be a real number, not an integer, for |increased precision. ` Note the commented out -x/-y options in org.el: afaict, there is no -y option, but perhaps Carsten can reintroduce the -x option, and then use scale to set it properly (although the value of scale will need to be, ahem, scaled). If so, then you 'd be able to get what you want by customizing org-format-latex-options: , | org-format-latex-options is a variable defined in `org.el'. | Its value is | (:foreground default :background default :scale 1.0 :html-foreground Black :html-background Transparent :html-scale 1.0 :matchers | (begin $1 $ $$ \\( \\[)) | | | Documentation: | Options for creating images from LaTeX fragments. | This is a property list with the following properties: | :foreground the foreground color for images embedded in Emacs, e.g. Black. | `default' means use the foreground of the default face. | :background the background color, or Transparent. | `default' means use the background of the default face. | :scale a scaling factor for the size of the images. | :html-foreground, :html-background, :html-scale | the same numbers for HTML export. | :matchersa list indicating which matchers should be used to | find LaTeX fragments. Valid members of this list are: | begin find environments | $1 find single characters surrounded by $.$ | $ find math expressions surrounded by $...$ | $$ find math expressions surrounded by $$$$ | \( find math expressions surrounded by \(...\) | \ [find math expressions surrounded by \ [...\] | | You can customize this variable. ` HTH, Nick ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode