emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* unexpected appearance of x^2 in pdf file
@ 2013-05-10 17:25 Paul Stansell
  2013-05-10 19:03 ` Nick Dokos
  2013-05-12  7:59 ` Nicolas Goaziou
  0 siblings, 2 replies; 8+ messages in thread
From: Paul Stansell @ 2013-05-10 17:25 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 624 bytes --]

Dear list,

I may be under a misapprehension, but I expected the pdf output
(created by C-c C-e l p) from the attached org file to show similar
results for both lines.  Instead, however, the simple

  x^2

outside of the verbatim environment puts the caret above the 2 even
though I have set

  #+OPTIONS: ^:nil

This seems to be because org-mode exports x^2 as x\^2 in the tex file.
 I think exporting it as x\^{}2 would give a better result.  Is there
another way to get the appearance I'm looking for without using the
verbatim environment?

Thanks for your advice,

Paul

PS. I'm using Emacs 24.2.1 with Org mode 8.0.2.

[-- Attachment #2: caret_symbol.org --]
[-- Type: application/octet-stream, Size: 67 bytes --]

#+OPTIONS: ^:nil toc:nil

x^2

\begin{verbatim}
x^2
\end{verbatim}

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

* Re: unexpected appearance of x^2 in pdf file
  2013-05-10 17:25 unexpected appearance of x^2 in pdf file Paul Stansell
@ 2013-05-10 19:03 ` Nick Dokos
  2013-05-12  7:59 ` Nicolas Goaziou
  1 sibling, 0 replies; 8+ messages in thread
From: Nick Dokos @ 2013-05-10 19:03 UTC (permalink / raw)
  To: emacs-orgmode

Paul Stansell <paulstansell@gmail.com> writes:


> I may be under a misapprehension, but I expected the pdf output
> (created by C-c C-e l p) from the attached org file to show similar
> results for both lines.  Instead, however, the simple
>
>   x^2
>

Try

    =x^2=  or ~x^2~

instead?

> outside of the verbatim environment puts the caret above the 2 even
> though I have set
>
>   #+OPTIONS: ^:nil
>
> This seems to be because org-mode exports x^2 as x\^2 in the tex file.
>  I think exporting it as x\^{}2 would give a better result.  Is there
> another way to get the appearance I'm looking for without using the
> verbatim environment?
>
> Thanks for your advice,
>
> Paul
>
> PS. I'm using Emacs 24.2.1 with Org mode 8.0.2.
>
> #+OPTIONS: ^:nil toc:nil
>
> x^2
>
> \begin{verbatim}
> x^2
> \end{verbatim}

-- 
Nick

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

* Re: unexpected appearance of x^2 in pdf file
  2013-05-10 17:25 unexpected appearance of x^2 in pdf file Paul Stansell
  2013-05-10 19:03 ` Nick Dokos
@ 2013-05-12  7:59 ` Nicolas Goaziou
  2013-05-12  9:07   ` Paul Stansell
  1 sibling, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2013-05-12  7:59 UTC (permalink / raw)
  To: Paul Stansell; +Cc: emacs-orgmode

Hello,

Paul Stansell <paulstansell@gmail.com> writes:

> I may be under a misapprehension, but I expected the pdf output
> (created by C-c C-e l p) from the attached org file to show similar
> results for both lines.  Instead, however, the simple
>
>   x^2
>
> outside of the verbatim environment puts the caret above the 2 even
> though I have set
>
>   #+OPTIONS: ^:nil
>
> This seems to be because org-mode exports x^2 as x\^2 in the tex file.
>  I think exporting it as x\^{}2 would give a better result.

This should be now fixed. Thank you for reporting this.


Regards,

-- 
Nicolas Goaziou

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

* Re: unexpected appearance of x^2 in pdf file
  2013-05-12  7:59 ` Nicolas Goaziou
@ 2013-05-12  9:07   ` Paul Stansell
  2013-05-12 13:07     ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Stansell @ 2013-05-12  9:07 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 434 bytes --]

Hi Nicolas,

Thanks for fixing that last problem, that's great!

I've also come across a couple of other unexpected results exporting
other latex equations to pdf.  Examples are given in the attached org
file.  Both are quite trivial with easy work-arounds.  In both cases,
because the embedded png equations (displayed by C-c C-x C-l) are
formatted correctly, the problem in the exported pdf file might go
unnoticed.

Regards,

Paul

[-- Attachment #2: equation_line_breaks.org --]
[-- Type: application/octet-stream, Size: 223 bytes --]

#+OPTIONS: toc:nil

* 

\[ x = y 
         +1 \]

\[ x = y 
         + 1 \]

* 

\[ x = \begin{array}{cc}
      y & u \\
      z & v
\end{array} \]

\[ x = 
   \begin{array}{cc}
      y & u \\
      z & v
   \end{array} \]

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

* Re: unexpected appearance of x^2 in pdf file
  2013-05-12  9:07   ` Paul Stansell
@ 2013-05-12 13:07     ` Nicolas Goaziou
  2013-05-12 14:12       ` Paul Stansell
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2013-05-12 13:07 UTC (permalink / raw)
  To: Paul Stansell; +Cc: emacs-orgmode

Hello,

Paul Stansell <paulstansell@gmail.com> writes:

> I've also come across a couple of other unexpected results exporting
> other latex equations to pdf.  Examples are given in the attached org
> file.  Both are quite trivial with easy work-arounds.  In both cases,
> because the embedded png equations (displayed by C-c C-x C-l) are
> formatted correctly, the problem in the exported pdf file might go
> unnoticed.

> \[ x = y 
>          +1 \]
>
> \[ x = y 
>          + 1 \]

This is to be expected. In the second case, the second line defines
a list item, which has precedence over any LaTeX snippet.

> \[ x = \begin{array}{cc}
>       y & u \\
>       z & v
> \end{array} \]
>
> \[ x = 
>    \begin{array}{cc}
>       y & u \\
>       z & v
>    \end{array} \]

I think this is because of a limitation on the number of lines a LaTeX
snippet can span across (IIRC, 3 is the maximum).

In both cases, I suggest to use LaTeX environments instead:

  \begin{equation*}
  x = y
  + 1
  \end{equation*}

and

  \begin{equation*}
  x =
  \begin{array}{cc}
    y & u \\
    z & v
  \end{array}
  \end{equation*}


Regards,

-- 
Nicolas Goaziou

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

* Re: unexpected appearance of x^2 in pdf file
  2013-05-12 13:07     ` Nicolas Goaziou
@ 2013-05-12 14:12       ` Paul Stansell
  2013-05-12 15:19         ` Nicolas Goaziou
  2013-05-13 14:33         ` Nicolas Richard
  0 siblings, 2 replies; 8+ messages in thread
From: Paul Stansell @ 2013-05-12 14:12 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas,

>> \[ x = y
>>          +1 \]
>>
>> \[ x = y
>>          + 1 \]
>
> This is to be expected. In the second case, the second line defines
> a list item, which has precedence over any LaTeX snippet.

Okay, I realised it was switching to the itemise environment, but I
didn't know it took precedence over the latex environment.

>> \[ x = \begin{array}{cc}
>>       y & u \\
>>       z & v
>> \end{array} \]
>>
>> \[ x =
>>    \begin{array}{cc}
>>       y & u \\
>>       z & v
>>    \end{array} \]
>
> I think this is because of a limitation on the number of lines a LaTeX
> snippet can span across (IIRC, 3 is the maximum).

Maybe, but I see the same problem with the following two line example

\[ x =
   \begin{array}{cc} z & v  \end{array} \]

> In both cases, I suggest to use LaTeX environments instead:
>
>   \begin{equation*}
>   x = y
>   + 1
>   \end{equation*}

Yes, I tried that, but as I understand it I need to
\usepackage{amsmath} to access the latex equation* environment.  But
then I get an error about "Command \iint already defined."  I tried
the solution described at
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=alreadydef, but it
didn't work for me.

Anyway, never mind, these are all quite trivial points.

Thanks very much for your help,

Paul

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

* Re: unexpected appearance of x^2 in pdf file
  2013-05-12 14:12       ` Paul Stansell
@ 2013-05-12 15:19         ` Nicolas Goaziou
  2013-05-13 14:33         ` Nicolas Richard
  1 sibling, 0 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2013-05-12 15:19 UTC (permalink / raw)
  To: Paul Stansell; +Cc: emacs-orgmode

>>> \[ x = y
>>>          +1 \]
>>>
>>> \[ x = y
>>>          + 1 \]
>>
>> This is to be expected. In the second case, the second line defines
>> a list item, which has precedence over any LaTeX snippet.
>
> Okay, I realised it was switching to the itemise environment, but I
> didn't know it took precedence over the latex environment.

Technically, this is a latex fragment, not a latex environment (which is
what I suggested to use). The difference is that the former is inline
(i.e. it is contained in a paragraph) whereas the latter isn't.
Non-inline elements always have precedence over inline ones.

>>> \[ x = \begin{array}{cc}
>>>       y & u \\
>>>       z & v
>>> \end{array} \]
>>>
>>> \[ x =
>>>    \begin{array}{cc}
>>>       y & u \\
>>>       z & v
>>>    \end{array} \]
>>
>> I think this is because of a limitation on the number of lines a LaTeX
>> snippet can span across (IIRC, 3 is the maximum).
>
> Maybe, but I see the same problem with the following two line example
>
> \[ x =
>    \begin{array}{cc} z & v  \end{array} \]

I see. This should be fixed. Thanks for insisting.

>> In both cases, I suggest to use LaTeX environments instead:
>>
>>   \begin{equation*}
>>   x = y
>>   + 1
>>   \end{equation*}
>
> Yes, I tried that, but as I understand it I need to
> \usepackage{amsmath} to access the latex equation* environment.  But
> then I get an error about "Command \iint already defined."  I tried
> the solution described at
> http://www.tex.ac.uk/cgi-bin/texfaq2html?label=alreadydef, but it
> didn't work for me.

A package is conflicting with "amsmath", probably "wasysym". Try to add
"nointegrals" option to "wasysym" in `org-latex-default-packages-alist'.


Regards,

-- 
Nicolas Goaziou

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

* Re: unexpected appearance of x^2 in pdf file
  2013-05-12 14:12       ` Paul Stansell
  2013-05-12 15:19         ` Nicolas Goaziou
@ 2013-05-13 14:33         ` Nicolas Richard
  1 sibling, 0 replies; 8+ messages in thread
From: Nicolas Richard @ 2013-05-13 14:33 UTC (permalink / raw)
  To: Paul Stansell; +Cc: emacs-orgmode, Nicolas Goaziou

Paul Stansell <paulstansell@gmail.com> writes:
> Yes, I tried that, but as I understand it I need to
> \usepackage{amsmath} to access the latex equation* environment. 

Usually amsmath is good to have (and Nicolas answered on how to include
it), but if you wish to avoid it for some reason, the {displaymath}
environment does the same thing.

-- 
N.

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

end of thread, other threads:[~2013-05-13 14:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-10 17:25 unexpected appearance of x^2 in pdf file Paul Stansell
2013-05-10 19:03 ` Nick Dokos
2013-05-12  7:59 ` Nicolas Goaziou
2013-05-12  9:07   ` Paul Stansell
2013-05-12 13:07     ` Nicolas Goaziou
2013-05-12 14:12       ` Paul Stansell
2013-05-12 15:19         ` Nicolas Goaziou
2013-05-13 14:33         ` Nicolas Richard

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).