Re: [O] [odt] equation labels
>> On Wed, 02 Nov 2011 23:51:31 +0530, Jambunathan K said: >> >> There is (git from a couple of days ago) a problem with referring >> >> to equations containing an underscore in the label, I am fairly >> >> sure it was allowed before, e.g.: >> >> >> >> #+LABEL: Equation:new_eq \begin{equation} x=\sqrt{b} \end{equation} >> >> >> >> Referring to an equation with an underscore: \ref{Equation:new_eq} >> >> >> >> I get a libreoffice popup: >> >> >> >> "Read Error. Format error discovered in the file in sub-document >> >> content.xmlat 2236,92(row,col)." >> >> >> OK - phew (although I may not be out of the woods yet). It seems >> that the underscore in the link is interpreted as a subscript: >> >> , | ... | Referring to an equation with an underscore: >> eq"/> ` > Nick, Thanks for debugging this and isolating the root cause. > Myles, I have pushed a fix few minutes ago. Hope things are OK now. References work fine now, Thanks. Myles
Re: [O] [odt] equation labels
>> >> There is (git from a couple of days ago) a problem with referring >> >> to equations containing an underscore in the label, I am fairly >> >> sure it was allowed before, e.g.: >> >> >> >> #+LABEL: Equation:new_eq \begin{equation} x=\sqrt{b} \end{equation} >> >> >> >> Referring to an equation with an underscore: \ref{Equation:new_eq} >> >> >> >> I get a libreoffice popup: >> >> >> >> "Read Error. Format error discovered in the file in sub-document >> >> content.xmlat 2236,92(row,col)." >> >> > OK - phew (although I may not be out of the woods yet). It seems that the > underscore in the link is interpreted as a subscript: > > , > | ... > | Referring to an equation with an underscore: | text:ref-name="Equation:new | text:style-name="OrgSubscript">eq"/> > ` Nick, Thanks for debugging this and isolating the root cause. Myles, I have pushed a fix few minutes ago. Hope things are OK now. --
Re: [O] [odt] equation labels
Myles English wrote: > > Nick, > > >> On Wed, 02 Nov 2011 09:38:20 -0400, Nick Dokos said: > > > Myles English wrote: > >> > >> There is (git from a couple of days ago) a problem with referring > >> to equations containing an underscore in the label, I am fairly > >> sure it was allowed before, e.g.: > >> > >> #+LABEL: Equation:new_eq \begin{equation} x=\sqrt{b} \end{equation} > >> > >> Referring to an equation with an underscore: \ref{Equation:new_eq} > >> > >> I get a libreoffice popup: > >> > >> "Read Error. Format error discovered in the file in sub-document > >> content.xmlat 2236,92(row,col)." > >> > > > I can reproduce that and it may be a consequence of a change that I > > introduced at the top level export engine about six months ago. Let > > me take a look. > > > Nick > > I may be mistaken but I think it became broken more recently, circa 7th > Oct. > OK - phew (although I may not be out of the woods yet). It seems that the underscore in the link is interpreted as a subscript: , | ... | Referring to an equation with an underscore: eq"/> ` Thanks, Nick
Re: [O] [odt] equation labels
Nick, >> On Wed, 02 Nov 2011 09:38:20 -0400, Nick Dokos said: > Myles English wrote: >> >> There is (git from a couple of days ago) a problem with referring >> to equations containing an underscore in the label, I am fairly >> sure it was allowed before, e.g.: >> >> #+LABEL: Equation:new_eq \begin{equation} x=\sqrt{b} \end{equation} >> >> Referring to an equation with an underscore: \ref{Equation:new_eq} >> >> I get a libreoffice popup: >> >> "Read Error. Format error discovered in the file in sub-document >> content.xmlat 2236,92(row,col)." >> > I can reproduce that and it may be a consequence of a change that I > introduced at the top level export engine about six months ago. Let > me take a look. > Nick I may be mistaken but I think it became broken more recently, circa 7th Oct. Myles
Re: [O] [odt] equation labels
Myles English wrote: > > There is (git from a couple of days ago) a problem with referring to > equations containing an underscore in the label, I am fairly sure it was > allowed before, e.g.: > > #+LABEL: Equation:new_eq > \begin{equation} > x=\sqrt{b} > \end{equation} > > Referring to an equation with an underscore: \ref{Equation:new_eq} > > I get a libreoffice popup: > > "Read Error. Format error discovered in the file in sub-document > content.xmlat 2236,92(row,col)." > I can reproduce that and it may be a consequence of a change that I introduced at the top level export engine about six months ago. Let me take a look. Nick
Re: [O] [odt] equation labels
Jambunathan, >> On Wed, 02 Nov 2011 01:09:41 +0530, Jambunathan K said: > Myles > (I have read the followup post to this set of questions) > Myles English writes: On Mon, 31 Oct 2011 03:41:18 +0530, Jambunathan K said: >> >> > Myles English writes: >> I have found >> that Equations become labelled as Figures in the >> version I am >> using: >> >> >> >> emacs 23.3.1 org-mode from git commit 71f1c1be (Oct 26) The test >> >> equations in latex-mathml.org in this message: >> >> >> >> >> http://lists.gnu.org/archive/html/emacs-orgmode/2011-09/msg00198.html >> >> >> >> are labelled as "Equation" in the odt files but when I export it >> >> fresh I get "Figure". >> >> > This was a regression. I pushed a fix few moments ago. Could you >> > please pull again? >> >> Thanks for the push, there are three things I notice now: >> >> 1) my document won't open and causes libreoffice to crash! I get: >> "terminate called after throwing an instance of what(): >> vector::_M_default_append" on the command line > 1. You are using custom styles for your latex fragment > 2. latex-to-mathml converter - as it stands today - assumes the > latex fragment is completed in and of itself and doesn't honor the > style settings. > Putting 1 and 2 together, I am assuming that the XML created by the > ODT emitter contains garbage which is causing LibreOffice to be > confused. In my observation, ill-formed XML triggers "file is > corrupt and should I repair the file?" from LibreOffice. A crash > seems strange to me. There is (git from a couple of days ago) a problem with referring to equations containing an underscore in the label, I am fairly sure it was allowed before, e.g.: --8<---cut here---start->8--- #+LABEL: Equation:new_eq \begin{equation} x=\sqrt{b} \end{equation} Referring to an equation with an underscore: \ref{Equation:new_eq} --8<---cut here---end--->8--- I get a libreoffice popup: "Read Error. Format error discovered in the file in sub-document content.xmlat 2236,92(row,col)." I think it was many of these errors that caused the crash. > 1. http://article.gmane.org/gmane.emacs.orgmode/48714 - Above link > has my note on -ncf option to mathtoweb > 2. http://orgmode.org/worg/org-faq.html - Above link has a note on > how to debug corrupt odt files. (Hint: search for corrupt) >> 2) the first equation in latex-mathml.org is not numbered, I would >> expect this if it was using a begin{equation*} environment but not >> a begin{equation}. > Currently the odt exporter doesn't peek in to the latex fragment and > infer what manner of equation it is. This is something that I could > take up ... > , | (defvar org-latex-regexps | '(("begin" "^[ > \t]*\\(begin{\\([a-zA-Z0-9\\*]+\\)[^\000]+?end{\\2}\\)" 1 t) > | ;; ("$" "\\([ (]\\|^\\)\\(\\(\\([$]\\)\\([^ > \r\n,.$].*?\\(\n.*?\\)\\{0,5\\}[^ \r\n,.$]\\)\\4\\)\\)\\([ > .,?;:'\")]\\|$\\)" 2 nil) | ;; \000 in the following regex is needed > for org-inside-LaTeX-fragment-p | ("$1" "\\([^$]\\|^\\)\\(\\$[^ > \r\n,;.$]\\$\\)\\([- .,?;:'\")\000]\\|$\\)" 2 nil) | ("$" > "\\([^$]\\|^\\)\\(\\(\\$\\([^ > \r\n,;.$][^$\n\r]*?\\(\n[^$\n\r]*?\\)\\{0,2\\}[^ > \r\n,.$]\\)\\$\\)\\)\\([- .,?;:'\")\000]\\|$\\)" 2 nil) | ("\\(" > "([^\000]*?)" 0 nil) | ("\\[" "\\[[^\000]*?\\]" 0 > nil) | ("$$" "\\$\\$[^\000]*?\\$\\$" 0 nil)) | "Regular expressions > for matching embedded LaTeX.") ` Crikey! That's quite a regexp. I think the only consideration is whether you want it to be consistent with pdf export. Taking consistency to an extreme could lead to a new #+begin_equation block (<-- I haven't thought this through at all). Having said that I am happy with the way it works at the moment. >> 3) the second equation looks a bit like this: >> >> x=root(b) (1) Radicals >> >> but I would have expected something like: >> >> x=root(b) Equation 1.: Radicals >> >> Is there a new variable that I need to set to get (e.g.) "Equation >> 1."? > Being a non-latex user, I am not familiar with what the usual > practice is. If the latter option is how captioned equations are > normally typeset I can take it up. Can you confirm that the > expectations above are *not* your own but that of *any* user? Actually I have changed my mind, it does look better like that, it is just that is was different behaviour to what happened before. Myles
Re: [O] [odt] equation labels
>> 2) the first equation in latex-mathml.org is not numbered, I would >>expect this if it was using a begin{equation*} environment but not a >>begin{equation}. > > Currently the odt exporter doesn't peek in to the latex fragment and > infer what manner of equation it is. This is something that I could take > up ... As thing stand today, to produce a numbered equation just attach #+LABEL: to it. This is how odt exporter determines when a formula is numbered or not. --
Re: [O] [odt] equation labels
Myles (I have read the followup post to this set of questions) Myles English writes: >>> On Mon, 31 Oct 2011 03:41:18 +0530, Jambunathan K said: > > > Myles English writes: > >> I have found that Equations become labelled as Figures in the > >> version I am using: > >> > >> emacs 23.3.1 org-mode from git commit 71f1c1be (Oct 26) The test > >> equations in latex-mathml.org in this message: > >> > >> http://lists.gnu.org/archive/html/emacs-orgmode/2011-09/msg00198.html > >> > >> are labelled as "Equation" in the odt files but when I export it > >> fresh I get "Figure". > > > This was a regression. I pushed a fix few moments ago. Could you > > please pull again? > > Thanks for the push, there are three things I notice now: > > 1) my document won't open and causes libreoffice to crash! I get: >"terminate called after throwing an instance of > what(): vector::_M_default_append" on the command line 1. You are using custom styles for your latex fragment 2. latex-to-mathml converter - as it stands today - assumes the latex fragment is completed in and of itself and doesn't honor the style settings. Putting 1 and 2 together, I am assuming that the XML created by the ODT emitter contains garbage which is causing LibreOffice to be confused. In my observation, ill-formed XML triggers "file is corrupt and should I repair the file?" from LibreOffice. A crash seems strange to me. 1. http://article.gmane.org/gmane.emacs.orgmode/48714 - Above link has my note on -ncf option to mathtoweb 2. http://orgmode.org/worg/org-faq.html - Above link has a note on how to debug corrupt odt files. (Hint: search for corrupt) > 2) the first equation in latex-mathml.org is not numbered, I would >expect this if it was using a begin{equation*} environment but not a >begin{equation}. Currently the odt exporter doesn't peek in to the latex fragment and infer what manner of equation it is. This is something that I could take up ... , | (defvar org-latex-regexps | '(("begin" "^[ \t]*\\(begin{\\([a-zA-Z0-9\\*]+\\)[^\000]+?end{\\2}\\)" 1 t) | ;; ("$" "\\([ (]\\|^\\)\\(\\(\\([$]\\)\\([^ \r\n,.$].*?\\(\n.*?\\)\\{0,5\\}[^ \r\n,.$]\\)\\4\\)\\)\\([ .,?;:'\")]\\|$\\)" 2 nil) | ;; \000 in the following regex is needed for org-inside-LaTeX-fragment-p | ("$1" "\\([^$]\\|^\\)\\(\\$[^ \r\n,;.$]\\$\\)\\([- .,?;:'\")\000]\\|$\\)" 2 nil) | ("$" "\\([^$]\\|^\\)\\(\\(\\$\\([^ \r\n,;.$][^$\n\r]*?\\(\n[^$\n\r]*?\\)\\{0,2\\}[^ \r\n,.$]\\)\\$\\)\\)\\([- .,?;:'\")\000]\\|$\\)" 2 nil) | ("\\(" "([^\000]*?)" 0 nil) | ("\\[" "\\[[^\000]*?\\]" 0 nil) | ("$$" "\\$\\$[^\000]*?\\$\\$" 0 nil)) | "Regular expressions for matching embedded LaTeX.") ` > 3) the second equation looks a bit like this: > >x=root(b) (1) >Radicals > >but I would have expected something like: > >x=root(b) >Equation 1.: Radicals > > Is there a new variable that I need to set to get (e.g.) "Equation > 1."? Being a non-latex user, I am not familiar with what the usual practice is. If the latter option is how captioned equations are normally typeset I can take it up. Can you confirm that the expectations above are *not* your own but that of *any* user? > Just to be explicit, the test file latex-mathml.org I am referring to > contains: > > #+TITLE: latex-mathml.org > #+AUTHOR:Jambunathan K > #+EMAIL: address@hidden > #+DATE: 2011-09-09 Fri > #+DESCRIPTION: > #+KEYWORDS: > #+LANGUAGE: en > #+OPTIONS: H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t > #+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc > > #+EXPORT_SELECT_TAGS: export > #+EXPORT_EXCLUDE_TAGS: noexport > #+LINK_UP: > #+LINK_HOME: > #+XSLT: > > * LaTeX Fragments > > ** LaTeX Fragment1 > # See org-format-latex-options > > There is a equation down below. > >\begin{equation} > e = \frac{1}{2}mv^2 >\end{equation} > > ** LaTeX Fragment2 > > #+CAPTION: Radicals > #+LABEL: Equation:1 >\begin{equation} >x=\sqrt{b} >\end{equation} > >If $a^2=b$ and \( b=2 \), then the solution must be either $$ >a=+\sqrt{2} $$ or \[ a=-\sqrt{2} \]. > > > Myles > > --
Re: [O] [odt] equation labels
>> On Mon, 31 Oct 2011 11:54:35 +, Myles English said: >> On Mon, 31 Oct 2011 03:41:18 +0530, Jambunathan K said: >> Myles English writes: >>> I have found that Equations become labelled as Figures in the >>> version I am using: >>> >>> emacs 23.3.1 org-mode from git commit 71f1c1be (Oct 26) The test >>> equations in latex-mathml.org in this message: >>> >>> http://lists.gnu.org/archive/html/emacs-orgmode/2011-09/msg00198.html >>> >>> are labelled as "Equation" in the odt files but when I export it >>> fresh I get "Figure". >> This was a regression. I pushed a fix few moments ago. Could you >> please pull again? > Thanks for the push, there are three things I notice now: > 1) my document won't open and causes libreoffice to crash! I get: > "terminate called after throwing an instance of what(): > vector::_M_default_append" on the command line > 2) the first equation in latex-mathml.org is not numbered, I would > expect this if it was using a begin{equation*} environment but not a > begin{equation}. > 3) the second equation looks a bit like this: >x=root(b) (1) Radicals >but I would have expected something like: >x=root(b) Equation 1.: Radicals Alright, points 2 and 3 are cleared up by me understanding that the asterisk in \begin{equation*} has no visible effect, and that instead of having "Equation 1.:" in the caption below the formula, there is a "(1)" on the RHS. Point 1 is entirely my own problem. Myles
Re: [O] [odt] equation labels
>> On Mon, 31 Oct 2011 03:41:18 +0530, Jambunathan K said: > Myles English writes: >> I have found that Equations become labelled as Figures in the >> version I am using: >> >> emacs 23.3.1 org-mode from git commit 71f1c1be (Oct 26) The test >> equations in latex-mathml.org in this message: >> >> http://lists.gnu.org/archive/html/emacs-orgmode/2011-09/msg00198.html >> >> are labelled as "Equation" in the odt files but when I export it >> fresh I get "Figure". > This was a regression. I pushed a fix few moments ago. Could you > please pull again? Thanks for the push, there are three things I notice now: 1) my document won't open and causes libreoffice to crash! I get: "terminate called after throwing an instance of what(): vector::_M_default_append" on the command line 2) the first equation in latex-mathml.org is not numbered, I would expect this if it was using a begin{equation*} environment but not a begin{equation}. 3) the second equation looks a bit like this: x=root(b) (1) Radicals but I would have expected something like: x=root(b) Equation 1.: Radicals Is there a new variable that I need to set to get (e.g.) "Equation 1."? Just to be explicit, the test file latex-mathml.org I am referring to contains: #+TITLE: latex-mathml.org #+AUTHOR:Jambunathan K #+EMAIL: address@hidden #+DATE: 2011-09-09 Fri #+DESCRIPTION: #+KEYWORDS: #+LANGUAGE: en #+OPTIONS: H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t #+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport #+LINK_UP: #+LINK_HOME: #+XSLT: * LaTeX Fragments ** LaTeX Fragment1 # See org-format-latex-options There is a equation down below. \begin{equation} e = \frac{1}{2}mv^2 \end{equation} ** LaTeX Fragment2 #+CAPTION: Radicals #+LABEL: Equation:1 \begin{equation} x=\sqrt{b} \end{equation} If $a^2=b$ and \( b=2 \), then the solution must be either $$ a=+\sqrt{2} $$ or \[ a=-\sqrt{2} \]. Myles
Re: [O] [odt] equation labels
Myles English writes: > Hello {Jambunathan}, > > I have found that Equations become labelled as Figures in the version I > am using: > > emacs 23.3.1 > org-mode from git commit 71f1c1be (Oct 26) > The test equations in latex-mathml.org in this message: > > http://lists.gnu.org/archive/html/emacs-orgmode/2011-09/msg00198.html > > are labelled as "Equation" in the odt files but when I export it fresh I get > "Figure". This was a regression. I pushed a fix few moments ago. Could you please pull again? > (?I'm not sure if it is the most recent version of contrib/org-odt as > the README.org says "This release is is as good as org-20110613" etc) I have not updated README.org for a while and please ignore whatever it claims. You are using the right version of odt. So no worries. > Thank you for the recent MathML stuff by the way. > > Myles > > --
[O] [odt] equation labels
Hello {Jambunathan}, I have found that Equations become labelled as Figures in the version I am using: emacs 23.3.1 org-mode from git commit 71f1c1be (Oct 26) (?I'm not sure if it is the most recent version of contrib/org-odt as the README.org says "This release is is as good as org-20110613" etc) The test equations in latex-mathml.org in this message: http://lists.gnu.org/archive/html/emacs-orgmode/2011-09/msg00198.html are labelled as "Equation" in the odt files but when I export it fresh I get "Figure". Thank you for the recent MathML stuff by the way. Myles
Re: [O] [odt] equation labels
Myles Subsequent to our last interaction I added support LaTeX to MathML conversion[1] and also enhanced the support for how the equations are numbered. You may want to look at all three posts in this thread. http://www.mail-archive.com/emacs-orgmode@gnu.org/msg46437.html Any feedback or comment is welcome. TIA, Jambunathan K. Footnotes: [1] The patch is pending and has not hit the git repo yet --
Re: [O] [odt] equation labels
Myles > I your previous post you asked for my org file but I think that it is > superseded by your attachment? The example I used is from my own unit test file. > When I have finished this report I am working on I'll cut it down and > offer it as an example if you like. Sure, I would very much want to receive a copy of your file with equations. I will be adding support for LaTeX->MathML in another few days time and I need some real life equations to assess the suitability of mathtoweb converter and prototype my changes [1]. Using mathml for equations will also ensure that the equations are first class citizens in the document and "scale" with the document settings. Jambunathan K. Footnotes: [1] Bonus points if your file has all manners of equations - equations that flow with the text AND equations that are rendered as paragraph. ODT exporter might have to tweak the "anchoring - character? or paragraph?" properties of the resulting embedded object depending on what manner of equation it is. --
Re: [O] [odt] equation labels
Myles English writes: >>> On Wed, 31 Aug 2011 12:09:58 +0100, Myles English said: > > >> I have added support for honoring captions, label and attributes > >> for images that are dervied from latex fragments. Checkout the git > >> repo and let me know if there are any rough edges that need to be > >> ironed out. > > > Thank you! I have just got around to trying this out and it works > > great. The only issue now is that the resolution of the pngs is low > > and looks terrible. I vaguely remember changing it deep in my latex > > installation somewhere. > > Actually there is an old (2006) thread including a patch about a file > option to change the resolution: > > http://lists.gnu.org/archive/html/emacs-orgmode/2006-09/msg00010.html INCREASING the `:html-scale' scale property in `org-format-latex-options' will INCREASE the `-D' option by same factor. I believe the above setting together with a "suitable" value of #+ATTR_ODT: (:scale xxx) will achieve the required balance. If you have lots of equations then applying #+ATTR_ODT option to each of the images is a bit cumbersome. In that case you can tweak `org-export-odt-pixels-per-inch' (The default value of this variable is same as `display-pixels-per-inch' variable of Emacs session). HALVING this variable will DOUBLE the size of all images uniformly. Note for posterity: 1. ODT expects that the image size be specified in cms or inches. I believe image files have no "physical" dimensions associated with them but only pixel size. Mapping from pixels to cms or inches is again determined by display properties (ie, the same image will appear in different physical dimensions on different monitors.) 2. On my Netbook, MS Paint uses a pixels-per-inch of 96.0 while Emacs' display-pixels-per-inch reports a value of 72.0 Image sizes are a grey area to me. If there is an expert out there willing to educate me I am all ears. Jambunathan K. > But I don't think it was applied and I am not sure how it would fit in > the current scheme. Can anyone advise? > > Myles > > > --
Re: [O] [odt] equation labels
>> On Wed, 31 Aug 2011 12:09:58 +0100, Myles English said: >> I have added support for honoring captions, label and attributes >> for images that are dervied from latex fragments. Checkout the git >> repo and let me know if there are any rough edges that need to be >> ironed out. > Thank you! I have just got around to trying this out and it works > great. The only issue now is that the resolution of the pngs is low > and looks terrible. I vaguely remember changing it deep in my latex > installation somewhere. Actually there is an old (2006) thread including a patch about a file option to change the resolution: http://lists.gnu.org/archive/html/emacs-orgmode/2006-09/msg00010.html But I don't think it was applied and I am not sure how it would fit in the current scheme. Can anyone advise? Myles
Re: [O] [odt] equation labels
On Wed, Aug 31, 2011 at 1:09 PM, Myles English wrote: > I your previous post you asked for my org file but I think that it is > superseded by your attachment? When I have finished this report I am > working on I'll cut it down and offer it as an example if you like. Examples like these are always a welcome addition to Worg. :) -- Suvayu Open source is the future. It sets us free.
Re: [O] [odt] equation labels
Jambunathan, >> On Sun, 28 Aug 2011 03:32:10 +0530, Jambunathan K said: > Myles >> Does anyone know how to cause a label such as "Figure 1." in the >> odt (for the resulting png), and set the caption for an equation >> such as: >> >> #+CAPTION: some caption #+LABEL: eqn:psychrometric >> \begin{equation*} \label{eq:psychrometric} \capillaryPressure = >> ln(RH)\cdot \dens_w\frac{RT}{M_w} \end{equation*} Sorry for the red herring: the equation above would never have worked without mystyle.sty whose content includes: \newcommand{\pressure}{p} \newcommand{\capillaryPressure}{{\pressure_{c}}} \newcommand{\dens_w}{\rho_w} and is included by: #+LATEX_HEADER: \usepackage{/home/myles/path/to/report/mystyle} > I have added support for honoring captions, label and attributes for > images that are dervied from latex fragments. Checkout the git repo > and let me know if there are any rough edges that need to be ironed > out. Thank you! I have just got around to trying this out and it works great. The only issue now is that the resolution of the pngs is low and looks terrible. I vaguely remember changing it deep in my latex installation somewhere. > Note that the odt exporter treats Labels and their references in a > special way. > For example, if the label is defined as follows, > #+LABEL: Equation:1 > Equation is considered as a "Category" [1] and "1" is considered as > sequence number. So this "category:seq-no" is the recommended form > of labels for odt export. Note that the seq-no found in Org file > need not be sequential. The odt exporter will faithfully reproduce > the seqnos as seen Org file to the odt file. You can auto-generate > the "right" seqnos by using Tools->Update->Update All. > If you are averse to launching the gui for updating of indices you > can do a odt->odt (yes, odt->odt) conversion for sanitizing of > indices [2]. > It is also worth noting that the attached file uses the as yet > undocumented > #+ATTR_ODT: (:scale 2) > to scale the image to twice the original size. > Jambunathan K. I your previous post you asked for my org file but I think that it is superseded by your attachment? When I have finished this report I am working on I'll cut it down and offer it as an example if you like. Myles
Re: [O] [odt] equation labels
Myles > Does anyone know how to cause a label such as "Figure 1." in the odt > (for the resulting png), and set the caption for an equation such as: > > #+CAPTION: some caption > #+LABEL: eqn:psychrometric > \begin{equation*} > \label{eq:psychrometric} > \capillaryPressure = ln(RH)\cdot \dens_w\frac{RT}{M_w} > \end{equation*} > > ? > > The orgmode manual says that captions and labels are for images and > tables so unless there is a special trick I would probably try to wrap > the latex in something first, for dvipng to return the png to org, to > apply the CAPTION to, before exporting to odt. > > Extra points for making it "Equation 1." instead of "Figure 1.". I have added support for honoring captions, label and attributes for images that are dervied from latex fragments. Checkout the git repo and let me know if there are any rough edges that need to be ironed out. Note that the odt exporter treats Labels and their references in a special way. For example, if the label is defined as follows, #+LABEL: Equation:1 Equation is considered as a "Category" [1] and "1" is considered as sequence number. So this "category:seq-no" is the recommended form of labels for odt export. Note that the seq-no found in Org file need not be sequential. The odt exporter will faithfully reproduce the seqnos as seen Org file to the odt file. You can auto-generate the "right" seqnos by using Tools->Update->Update All. If you are averse to launching the gui for updating of indices you can do a odt->odt (yes, odt->odt) conversion for sanitizing of indices [2]. It is also worth noting that the attached file uses the as yet undocumented #+ATTR_ODT: (:scale 2) to scale the image to twice the original size. Jambunathan K. > Thanks, > > Myles > > Footnotes: [1] Other "Categories" could be Illustration, Table, Text etc. [2] I have never used unoconv myself. But the source code does update indices of the input document before further conversion. -- #+TITLE: eqns.org #+AUTHOR:Jambunathan K #+EMAIL: kjambunat...@gmail.com #+DATE: 2011-08-26 Fri #+DESCRIPTION: #+KEYWORDS: #+LANGUAGE: en #+OPTIONS: H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t #+OPTIONS: TeX:t LaTeX:dvipng skip:nil d:nil todo:t pri:nil tags:not-in-toc #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport #+LINK_UP: #+LINK_HOME: #+XSLT: * Equations There is a equation down below. #+CAPTION: Kinetic Energy #+LABEL: Equation:1 #+ATTR_ODT: (:scale 2) \begin{equation*} e = \frac{1}{2}mv^2 \end{equation*} #+CAPTION: Kinetic Energy #+LABEL: Equation:2 #+ATTR_ODT: (:scale 0.5) \begin{equation*} e = \frac{1}{2}mv^2 \end{equation*} eqns.odt Description: eqns.odt
Re: [O] [odt] equation labels
Hello Myles > \begin{equation*} > \label{eq:psychrometric} > \capillaryPressure = ln(RH)\cdot \dens_w\frac{RT}{M_w} > \end{equation*} dvipng refuses to produce png tex snippet above. I am not at all familiar with latex. I am not sure what is wrong. If you have a good number of equations in your orgfile can you share it with me? I can use it as a real-life example and cook up a preliminary latex->mathml support using mathtoweb. Do you have any quick opinions on mathtoweb? See my earlier post http://lists.gnu.org/archive/html/emacs-orgmode/2011-03/msg01755.html Regarding your captions request, I will cook up something. But I would like to fold it as part of latex->mathml work. Let's see. Jambunathan K.
[O] [odt] equation labels
Hello, I am using the excellent org-odt, so thanks to Jambunathan K, and everyone who has ever contributed to orgmode. This may be quite simple so I am asking before making an minimal example. Does anyone know how to cause a label such as "Figure 1." in the odt (for the resulting png), and set the caption for an equation such as: #+CAPTION: some caption #+LABEL: eqn:psychrometric \begin{equation*} \label{eq:psychrometric} \capillaryPressure = ln(RH)\cdot \dens_w\frac{RT}{M_w} \end{equation*} ? The orgmode manual says that captions and labels are for images and tables so unless there is a special trick I would probably try to wrap the latex in something first, for dvipng to return the png to org, to apply the CAPTION to, before exporting to odt. Extra points for making it "Equation 1." instead of "Figure 1.". Thanks, Myles