From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: How do you use org for other formats Date: Mon, 3 Aug 2009 06:37:22 +0200 Message-ID: <237BE9BD-63DE-444E-964D-935DE5FD0975@gmail.com> References: <87iqhaccwf.fsf@gollum.intra.norang.ca> <4A71DD1B.5040707@gmail.com> Mime-Version: 1.0 (Apple Message framework v935.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MXpIh-0000tF-AG for emacs-orgmode@gnu.org; Mon, 03 Aug 2009 00:37:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MXpIc-0000rL-Dr for emacs-orgmode@gnu.org; Mon, 03 Aug 2009 00:37:30 -0400 Received: from [199.232.76.173] (port=33771 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXpIc-0000rF-7W for emacs-orgmode@gnu.org; Mon, 03 Aug 2009 00:37:26 -0400 Received: from mail-ew0-f211.google.com ([209.85.219.211]:49806) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MXpIb-00033a-Na for emacs-orgmode@gnu.org; Mon, 03 Aug 2009 00:37:25 -0400 Received: by ewy7 with SMTP id 7so1040643ewy.42 for ; Sun, 02 Aug 2009 21:37:24 -0700 (PDT) In-Reply-To: <4A71DD1B.5040707@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Brian van den Broek Cc: Bernt Hansen , emacs-orgmode@gnu.org, zwz On Jul 30, 2009, at 7:49 PM, Brian van den Broek wrote: > Bernt Hansen said unto the world at 30/07/09 01:13 PM: >> zwz writes: >>> I recently found the problem when I want to export the org file to >>> html and pdf. I guess there will be some people (who are also not so >>> familiar with the powerful org-mode) bothered by the same issue, >>> that >>> is, html and pdf requires different org format sometimes. >>> - I use $ y = x_1^2 + x_2^2 $ in org, it works for pdf, but not >>> for html >>> - "_" in text will introduce mess in pdf, not in html > > > >> The following test file works fine for me as far as I can tell >> ,----[ x.org ] >> | #+TITLE: x.org >> | #+AUTHOR: Bernt Hansen >> | #+EMAIL: bernt@norang.ca >> | #+DATE: 2009-07-30 Thu >> | #+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:nil skip:nil d:nil todo:t pri:nil >> tags:not-in-toc >> | #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 >> path:http://orgmode.org/org-info.js >> | #+EXPORT_SELECT_TAGS: export >> | #+EXPORT_EXCLUDE_TAGS: noexport >> | #+LINK_UP: | #+LINK_HOME: | | * Test >> | | Some math formulae: >> | | y = x_1^2 + x_2^2 >> | | y^2 = 2x^2 + 1 >> | | z_2 = x_1 + x_2 + 2 (y_1 + y_2 + r) >> `---- >> This renders HTML (C-c C-e b) [*1*] and PDF (C-c C-e d) [*2*] that >> look >> fine to me >> -Bernt >> [*1*] http://www.norang.ca/tmp/x.html >> [*2*] http://www.norang.ca/tmp/x.pdf > > > Hi all, > > I don't export from org at all, but Bernt's pdf doesn't look right > to me. Notice that in the first equation, the exponents appear as > `^2' (i.e., with the `^' character). As a heavy LaTeX user, I would > write it as `y = x_{1}^{2} + x_{2}^{2}', but trying Bernt's file > with this modification, I still had the same result (`^2' in the > output as opposed to a superscripted `2'). Org 6.28d and emacs > 22.2.1 on ubuntu 8.10. Please note that the non-LaTeX processing is only good for really trivial math in Org. The LaTeX exporter has a really hard job handling a variable with both a sub and a superscript, because it needs to insert the dollar signs to create math mode without messing up with the number of dollars. Actually, it is a small wonder that it works as well as it does, Bastien did a amazing job when he wrote the LaTeX exporter. The HTML exporter does not have this specific problem, so it handles x_1^2 OK, but anything more complex will fail as well. If you want to typeset a document with math beyond a single subscript or exponent, the much better way is to actually enclose it in LaTeX math delimiters. For LaTeX export this will work perfectly. For HTML export you need to follow Nick's advice in this thread to turn on LaTeX fragment processing with #+OPTIONS: LaTeX:t When you have installed dvipng, HTML files will then include the math formulas as small images. - Carsten