From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: Re: [odt] regression in using an equation sourced via latex_header Date: Wed, 02 Nov 2011 00:40:32 +0530 Message-ID: <81hb2n64lz.fsf@gmail.com> References: <871utr7rj3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:41950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLJjZ-0008JF-FT for emacs-orgmode@gnu.org; Tue, 01 Nov 2011 15:10:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RLJjX-0005Xt-Up for emacs-orgmode@gnu.org; Tue, 01 Nov 2011 15:10:53 -0400 Received: from mail-qw0-f41.google.com ([209.85.216.41]:58646) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLJjX-0005Xd-Rl for emacs-orgmode@gnu.org; Tue, 01 Nov 2011 15:10:51 -0400 Received: by qadc11 with SMTP id c11so7237025qad.0 for ; Tue, 01 Nov 2011 12:10:51 -0700 (PDT) In-Reply-To: <871utr7rj3.fsf@gmail.com> (Myles English's message of "Tue, 01 Nov 2011 16:10:08 +0000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode Mode Myles Thanks for exercising the latex-to-mathml changes. I am happy that there is someone out there interested in and using stuff that I have spent some efforts on. > Hello, > > If I have a latex file mystyle.tex that contains: > > \newcommand{\myBigEquation}{b=23} > > and then have this in my org file: > > #+LATEX_HEADER: \usepackage{/path/to/mystyle} > > I can use it conveniently like this: > > \begin{equation} > \myBigEquation > \end{equation} > > and that exports fine to pdf but not to odt. I am fairly sure it used > to work (around 7th Oct). Can anyone confirm this? I am using the very latest version in the git. While exporting to odt using 1. dvipng - I see no issues [1] 2. mathml - You need to register your command file with -ncf argument. For example, if I put the mystyle.tex in the same directory as exported .org file and add the -ncf argument to the converter as below #+begin_src emacs-lisp (setq org-latex-to-mathml-convert-command "java -jar %j -ncf mystyle.tex -unicode -force -df %o %I ") #+end_src I see that your sample file gets exported just fine. Side Note: ========== 1. You don't have to export the whole file to see whether the latex-mathml conversion is sane. You can mark - as in marking a region - the LaTeX fragment in your org file and do a M-x org-create-math-formula. You will see something like this echoed in you *Messages* buffer. ,---- M-x org-create-math-formula | Mark set [2 times] | Mark activated | Wrote ~/tmp-myles/ltxmathml-in3272esr | Running java -jar ~/tmp-odt/mathtoweb.jar -ncf mystyle.tex -unicode -force -df ltxmathml-out3272r2x ltxmathml-in3272esr | | | | | b | = | 23 | | `---- 2. I am copy pasting the extra "stuff" that gets attached to the latex fragment before it get "latex" ed and "dvipng"ed. latex-to-mathml converter ignores *all* of the stuff that goes in org-format-latex-header, org-export-latex-default-packages-alist, org-export-latex-packages-alist, org-format-latex-header-extra variables. I think I should build an "ncf" file on the fly based on these variables and pass it to the command line converter. Since I don't know much of latex, can you or someone in the list give me pointers on what would constitute an ncf argument as expected by mathtoweb. I will make the needed changes as required. ,---- See org-create-formula-image | (with-temp-file texfile | (insert (org-splice-latex-header | org-format-latex-header | org-export-latex-default-packages-alist | org-export-latex-packages-alist t | org-format-latex-header-extra)) | (insert "\n\\begin{document}\n" string "\n\\end{document}\n") | (require 'org-latex) | (org-export-latex-fix-inputenc)) `---- ,---- temporary tex file [see LATEX-HEADER at the end] | \documentclass{article} | \usepackage[usenames]{color} | \usepackage{amsmath} | \usepackage[mathscr]{eucal} | \pagestyle{empty} % do not remove | \usepackage{pdfpages} | \usepackage[utf8]{inputenc} | \usepackage[T1]{fontenc} | % Package fixltx2e omitted | \usepackage{graphicx} | % Package longtable omitted | % Package float omitted | % Package wrapfig omitted | \usepackage{soul} | \usepackage{t1enc} | \usepackage{textcomp} | \usepackage{amssymb} | % Package hyperref omitted | \tolerance=1000 | % The settings below are copied from fullpage.sty | \setlength{\textwidth}{\paperwidth} | \addtolength{\textwidth}{-3cm} | \setlength{\oddsidemargin}{1.5cm} | \addtolength{\oddsidemargin}{-2.54cm} | \setlength{\evensidemargin}{\oddsidemargin} | \setlength{\textheight}{\paperheight} | \addtolength{\textheight}{-\headheight} | \addtolength{\textheight}{-\headsep} | \addtolength{\textheight}{-\footskip} | \addtolength{\textheight}{-3cm} | \setlength{\topmargin}{1.5cm} | \addtolength{\topmargin}{-2.54cm} | | \usepackage{jambu} | \begin{document} | \begin{equation} | \myBigEquation | \end{equation} | \end{document} `---- Footnotes: [1] LaTeX novice here. The method I used is this: Put that style file in one of the local directories and register that directory as a root with the MikTex package manager. Then use this directive: \usepackage{jambu} ps: I am on Windows using Cygwin. So getting the directory path right with escaping - what with spaces in directories - is always a hair-splitting experience for me. > Myles > > --