emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Another possible error for in-line math parsing
@ 2010-10-20  5:29 Jeff Horn
  2010-10-20 16:25 ` Jeff Horn
  2010-10-21 11:25 ` Carsten Dominik
  0 siblings, 2 replies; 7+ messages in thread
From: Jeff Horn @ 2010-10-20  5:29 UTC (permalink / raw)
  To: Org-mode ml

Carsten et al,

Possible error when escaping dollar sign in inline-math. When using
the following org source:
------------------------------------------------------------------------------
Supposing $C_H=\$10$ and $C_L=\$20$.
...
$.30(\$50)+.70(\$20)=\$29$
------------------------------------------------------------------------------
The following LaTeX is produced upon publication:
------------------------------------------------------------------------------
Supposing \$C$_H$=\$10\$ and \$C$_L$=\$20\$
...
\$.30(\$50)+.70(\$20)=\$29$
------------------------------------------------------------------------------
Whereas the following LaTeX is expected:
------------------------------------------------------------------------------
Supposing $C_H=\$10$ and $C_L=\$20\$
...
$.30(\$50)+.70(\$20)=\$29$
------------------------------------------------------------------------------

Comparing the two different lines of source, I note that in the first
case the four inline math dollars are escaped when they should not be,
and two extra inline math dollars are inserted. In the second case,
all dollars are escaped correctly excepting the first inline math
dollar.

I'm obviously trying to use dollars as units in my math calculations.

Thanks for any help,

Jeff

-- 
Jeffrey Horn
Graduate Lecturer and PhD Student in Economics
George Mason University

(704) 271-4797
jhorn@gmu.edu
jrhorn424@gmail.com

http://www.failuretorefrain.com/jeff/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug: Another possible error for in-line math parsing
  2010-10-20  5:29 Bug: Another possible error for in-line math parsing Jeff Horn
@ 2010-10-20 16:25 ` Jeff Horn
  2010-10-20 20:05   ` Jeff Horn
  2010-10-21 11:25 ` Carsten Dominik
  1 sibling, 1 reply; 7+ messages in thread
From: Jeff Horn @ 2010-10-20 16:25 UTC (permalink / raw)
  To: Org-mode ml

BTW, I can confirm that this error does not occur in the block math
environment (wrapping the equations in escaped square brackets).

On Wed, Oct 20, 2010 at 1:29 AM, Jeff Horn <jrhorn424@gmail.com> wrote:
> Carsten et al,
>
> Possible error when escaping dollar sign in inline-math. When using
> the following org source:
> ------------------------------------------------------------------------------
> Supposing $C_H=\$10$ and $C_L=\$20$.
> ...
> $.30(\$50)+.70(\$20)=\$29$
> ------------------------------------------------------------------------------
> The following LaTeX is produced upon publication:
> ------------------------------------------------------------------------------
> Supposing \$C$_H$=\$10\$ and \$C$_L$=\$20\$
> ...
> \$.30(\$50)+.70(\$20)=\$29$
> ------------------------------------------------------------------------------
> Whereas the following LaTeX is expected:
> ------------------------------------------------------------------------------
> Supposing $C_H=\$10$ and $C_L=\$20\$
> ...
> $.30(\$50)+.70(\$20)=\$29$
> ------------------------------------------------------------------------------
>
> Comparing the two different lines of source, I note that in the first
> case the four inline math dollars are escaped when they should not be,
> and two extra inline math dollars are inserted. In the second case,
> all dollars are escaped correctly excepting the first inline math
> dollar.
>
> I'm obviously trying to use dollars as units in my math calculations.
>
> Thanks for any help,
>
> Jeff
>
> --
> Jeffrey Horn
> Graduate Lecturer and PhD Student in Economics
> George Mason University
>
> (704) 271-4797
> jhorn@gmu.edu
> jrhorn424@gmail.com
>
> http://www.failuretorefrain.com/jeff/
>



-- 
Jeffrey Horn
Graduate Lecturer and PhD Student in Economics
George Mason University

(704) 271-4797
jhorn@gmu.edu
jrhorn424@gmail.com

http://www.failuretorefrain.com/jeff/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug: Another possible error for in-line math parsing
  2010-10-20 16:25 ` Jeff Horn
@ 2010-10-20 20:05   ` Jeff Horn
  0 siblings, 0 replies; 7+ messages in thread
From: Jeff Horn @ 2010-10-20 20:05 UTC (permalink / raw)
  To: Org-mode ml

Additionally, the following source from org-mode:

`$.30(50)+.70(20)=29$`

Is not converted at all by MathJax.

Org-mode version 7.01trans, recent git pull from earlier this week.
Aquamacs on Snow Leopard.

On Wed, Oct 20, 2010 at 12:25 PM, Jeff Horn <jrhorn424@gmail.com> wrote:
> BTW, I can confirm that this error does not occur in the block math
> environment (wrapping the equations in escaped square brackets).
>
> On Wed, Oct 20, 2010 at 1:29 AM, Jeff Horn <jrhorn424@gmail.com> wrote:
>> Carsten et al,
>>
>> Possible error when escaping dollar sign in inline-math. When using
>> the following org source:
>> ------------------------------------------------------------------------------
>> Supposing $C_H=\$10$ and $C_L=\$20$.
>> ...
>> $.30(\$50)+.70(\$20)=\$29$
>> ------------------------------------------------------------------------------
>> The following LaTeX is produced upon publication:
>> ------------------------------------------------------------------------------
>> Supposing \$C$_H$=\$10\$ and \$C$_L$=\$20\$
>> ...
>> \$.30(\$50)+.70(\$20)=\$29$
>> ------------------------------------------------------------------------------
>> Whereas the following LaTeX is expected:
>> ------------------------------------------------------------------------------
>> Supposing $C_H=\$10$ and $C_L=\$20\$
>> ...
>> $.30(\$50)+.70(\$20)=\$29$
>> ------------------------------------------------------------------------------
>>
>> Comparing the two different lines of source, I note that in the first
>> case the four inline math dollars are escaped when they should not be,
>> and two extra inline math dollars are inserted. In the second case,
>> all dollars are escaped correctly excepting the first inline math
>> dollar.
>>
>> I'm obviously trying to use dollars as units in my math calculations.
>>
>> Thanks for any help,
>>
>> Jeff
>>
>> --
>> Jeffrey Horn
>> Graduate Lecturer and PhD Student in Economics
>> George Mason University
>>
>> (704) 271-4797
>> jhorn@gmu.edu
>> jrhorn424@gmail.com
>>
>> http://www.failuretorefrain.com/jeff/
>>
>
>
>
> --
> Jeffrey Horn
> Graduate Lecturer and PhD Student in Economics
> George Mason University
>
> (704) 271-4797
> jhorn@gmu.edu
> jrhorn424@gmail.com
>
> http://www.failuretorefrain.com/jeff/
>



-- 
Jeffrey Horn
Graduate Lecturer and PhD Student in Economics
George Mason University

(704) 271-4797
jhorn@gmu.edu
jrhorn424@gmail.com

http://www.failuretorefrain.com/jeff/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug: Another possible error for in-line math parsing
  2010-10-20  5:29 Bug: Another possible error for in-line math parsing Jeff Horn
  2010-10-20 16:25 ` Jeff Horn
@ 2010-10-21 11:25 ` Carsten Dominik
  2010-10-21 17:52   ` Jeff Horn
  1 sibling, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2010-10-21 11:25 UTC (permalink / raw)
  To: Jeff Horn; +Cc: Org-mode ml

Hi Jeff,
On Oct 20, 2010, at 7:29 AM, Jeff Horn wrote:

> Carsten et al,
>
> Possible error when escaping dollar sign in inline-math. When using
> the following org source:
> ------------------------------------------------------------------------------
> Supposing $C_H=\$10$ and $C_L=\$20$.
> ...
> $.30(\$50)+.70(\$20)=\$29$

Org-mode will never be a perfect TeX scanner, and this is really hard.
Help yourself and Org by using \( and \) as math delimiters when you  
wish to include dollar characters inside....

HTH

- Carsten

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug: Another possible error for in-line math parsing
  2010-10-21 11:25 ` Carsten Dominik
@ 2010-10-21 17:52   ` Jeff Horn
  2010-10-21 20:25     ` Carsten Dominik
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff Horn @ 2010-10-21 17:52 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Org-mode ml

> Org-mode will never be a perfect TeX scanner, and this is really hard.
> Help yourself and Org by using \( and \) as math delimiters when you wish to
> include dollar characters inside....

Ten-four. I'll try it when I get some time to go back and edit my
source files. Wonky use of dollar signs in math doesn't explain why
the following source doesn't work, though:

> Additionally, the following source from org-mode:
>
> `$.30(50)+.70(20)=29$`
>
> Is not converted at all by MathJax.
>
> Org-mode version 7.01trans, recent git pull from earlier this week.
> Aquamacs on Snow Leopard.

Thanks for the tip, though!

-- 
Jeffrey Horn
Graduate Lecturer and PhD Student in Economics
George Mason University

(704) 271-4797
jhorn@gmu.edu
jrhorn424@gmail.com

http://www.failuretorefrain.com/jeff/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug: Another possible error for in-line math parsing
  2010-10-21 17:52   ` Jeff Horn
@ 2010-10-21 20:25     ` Carsten Dominik
  2010-10-22 10:09       ` Eric S Fraga
  0 siblings, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2010-10-21 20:25 UTC (permalink / raw)
  To: Jeff Horn; +Cc: Org-mode ml


On Oct 21, 2010, at 7:52 PM, Jeff Horn wrote:

>> Org-mode will never be a perfect TeX scanner, and this is really  
>> hard.
>> Help yourself and Org by using \( and \) as math delimiters when  
>> you wish to
>> include dollar characters inside....
>
> Ten-four.

What does that mean?

> I'll try it when I get some time to go back and edit my
> source files. Wonky use of dollar signs in math doesn't explain why
> the following source doesn't work, though:
>
>> Additionally, the following source from org-mode:
>>
>> `$.30(50)+.70(20)=29$`

The reason here is that $.30 looks too much like currency, and
Org tries hard to detect cases where is dollar in text is meant to
be currency and not math.  Here it fails, and also here you can use
\(...\).  In fact, using dollar makes parsing TeX *a lot* harder
in general.

HTH

- Carsten

>>
>> Is not converted at all by MathJax.
>>
>> Org-mode version 7.01trans, recent git pull from earlier this week.
>> Aquamacs on Snow Leopard.
>
> Thanks for the tip, though!
>
> -- 
> Jeffrey Horn
> Graduate Lecturer and PhD Student in Economics
> George Mason University
>
> (704) 271-4797
> jhorn@gmu.edu
> jrhorn424@gmail.com
>
> http://www.failuretorefrain.com/jeff/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug: Another possible error for in-line math parsing
  2010-10-21 20:25     ` Carsten Dominik
@ 2010-10-22 10:09       ` Eric S Fraga
  0 siblings, 0 replies; 7+ messages in thread
From: Eric S Fraga @ 2010-10-22 10:09 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Jeff Horn, Org-mode ml

On Thu, 21 Oct 2010 22:25:14 +0200, Carsten Dominik <carsten.dominik@gmail.com> wrote:
> 
> 
> On Oct 21, 2010, at 7:52 PM, Jeff Horn wrote:
> 
> >> Org-mode will never be a perfect TeX scanner, and this is really
> >> hard.
> >> Help yourself and Org by using \( and \) as math delimiters when
> >> you wish to
> >> include dollar characters inside....
> >
> > Ten-four.
> 
> What does that mean?

:-)  

this is an expression from CB (citizen's band) radio days and means
"thanks" or "okay" or a combination of the two.  There's a whole
lexicon of 10-xx terms for fast communication over CB radio.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-10-22 10:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-20  5:29 Bug: Another possible error for in-line math parsing Jeff Horn
2010-10-20 16:25 ` Jeff Horn
2010-10-20 20:05   ` Jeff Horn
2010-10-21 11:25 ` Carsten Dominik
2010-10-21 17:52   ` Jeff Horn
2010-10-21 20:25     ` Carsten Dominik
2010-10-22 10:09       ` Eric S Fraga

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).