From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: Footnotes issue with LaTeX export Date: Mon, 9 Jan 2012 07:56:06 -0600 Message-ID: References: <87r4zq8fd6.fsf@gmail.com> <871ur9tkxo.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001517592c269789ac04b618c275 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:48772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkFhu-0002Rl-Ke for emacs-orgmode@gnu.org; Mon, 09 Jan 2012 08:56:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RkFho-0004qr-Nn for emacs-orgmode@gnu.org; Mon, 09 Jan 2012 08:56:14 -0500 Received: from mail-ey0-f169.google.com ([209.85.215.169]:35911) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkFho-0004ql-Ae for emacs-orgmode@gnu.org; Mon, 09 Jan 2012 08:56:08 -0500 Received: by eabm6 with SMTP id m6so2459165eab.0 for ; Mon, 09 Jan 2012 05:56:07 -0800 (PST) In-Reply-To: <871ur9tkxo.fsf@gmail.com> 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: Nicolas Goaziou Cc: emacs-orgmode --001517592c269789ac04b618c275 Content-Type: text/plain; charset=UTF-8 On Mon, Jan 9, 2012 at 1:05 AM, Nicolas Goaziou wrote: > Hello, > > John Hendy writes: > > > #+begin_src orgmode > > * Header > > > > Test paragraph where I insert a dollar amount of $100. > > > > Test paragraph where I insert a dollar amount of \$100. > > > > Test paragraph where I insert a dollar amount of 100.[fn:1] > > > > * Footnotes > > > > [fn:1] Successful; the first two give the error 'Cannot insert a footnote > > here' > > #+end_src > > Yes, that's what I thought: `org-inside-LaTeX-fragment-p' is the key. > > ,---- > |(org-inside-LaTeX-fragment-p) > | > | Test if point is inside a LaTeX fragment. > | I.e. after a \begin, \(, M-x , $, or $$, without the corresponding > closing > | sequence appearing also before point. > | Even though the matchers for math are configurable, this function assumes > | that \begin, \(, \[, and $$ are always used. Only the single dollar > | delimiters are skipped when they have been removed by customization. > | The return value is nil, or a cons cell with the delimiter and the > | position of this delimiter. > | > | This function does a reasonably good job, but can locally be fooled by > | for example currency specifications. For example it will assume being in > | inline math after "$22.34". The LaTeX fragment formatter will only > format > | fragments that are properly closed, but during editing, we have to live > | with the uncertainty caused by missing closing delimiters. This function > | looks only before point, not after. > `---- > > On purpose, Org won't insert a footnote inside a LaTeX fragment. But, > in your example, it is fooled by the currency. > > One workaround would be to remove "$" as a math delimiter from > `org-format-latex-options'. > How about another idea... would it be possible to remove "\$" as a math delimiter? I *do* use $math$ a bit, at least in this document, and have =TeX:t and LaTeX:t= in my options... thus, I'm very careful about prefixing "\" to any instances of $ and %. Removing \$ as a math delimiter or making "\" register as the "universal escape character" would also do the trick. If I removed $ as you suggest, could I use \begin{math}/\end{math} inline? I have quite a bit of inline math. Thanks! John > > > Regards, > > -- > Nicolas Goaziou > --001517592c269789ac04b618c275 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Mon, Jan 9, 2012 at 1:05 AM, Nicolas = Goaziou <n.goaz= iou@gmail.com> wrote:
Hello,

John Hendy <jw.hendy@gmail.com= > writes:

> #+begin_src orgmode
> * Header
>
> Test paragraph where I insert a dollar amount of $100.
>
> Test paragraph where I insert a dollar amount of \$100.
>
> Test paragraph where I insert a dollar amount of 100.[fn:1]
>
> * Footnotes
>
> [fn:1] Successful; the first two give the error 'Cannot insert a f= ootnote
> here'
> #+end_src

Yes, that's what I thought: `org-inside-LaTeX-fragment-p' is = the key.

,----
|(org-inside-LaTeX-fragment-p)
|
| Test if point is inside a LaTeX fragment.
| I.e. after a \begin, \(, M-x , $, or $$, without the corresponding closin= g
| sequence appearing also before point.
| Even though the matchers for math are configurable, this function assumes=
| that \begin, \(, \[, and $$ are always used. =C2=A0Only the single dollar=
| delimiters are skipped when they have been removed by customization.
| The return value is nil, or a cons cell with the delimiter and the
| position of this delimiter.
|
| This function does a reasonably good job, but can locally be fooled by | for example currency specifications. =C2=A0For example it will assume bei= ng in
| inline math after "$22.34". =C2=A0The LaTeX fragment formatter = will only format
| fragments that are properly closed, but during editing, we have to live | with the uncertainty caused by missing closing delimiters. =C2=A0This fun= ction
| looks only before point, not after.
`----

On purpose, Org won't insert a footnote inside a LaTeX fragment. =C2=A0= But,
in your example, it is fooled by the currency.

One workaround would be to remove "$" as a math delimiter from `org-format-latex-options'.

How abo= ut another idea... would it be possible to remove "\$" as a math = delimiter? I *do* use $math$ a bit, at least in this document, and have =3D= TeX:t and LaTeX:t=3D in my options... thus, I'm very careful about pref= ixing "\" to any instances of $ and %. Removing \$ as a math deli= miter or making "\" register as the "universal escape charac= ter" would also do the trick.

If I removed $ as you suggest, could I use \begin= {math}/\end{math} inline? I have quite a bit of inline math.

=

Thanks!
John
=C2=A0


Regards,

--
Nicolas Goaziou

--001517592c269789ac04b618c275--