emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* help debugging latex-overlays boxes
@ 2014-09-05 14:06 John Kitchin
  2014-09-05 15:10 ` Nick Dokos
  0 siblings, 1 reply; 7+ messages in thread
From: John Kitchin @ 2014-09-05 14:06 UTC (permalink / raw)
  To: emacs-orgmode

Hi All,

I am using org-mode in a course this fall with 60 students.  All of them
are using org-mode from elpa. For about 10 of them, they are unable to
toggle the latex-overlays; instead of getting the equations, they get
empty gray boxes with an error that the png file was not created.  Oddly
enough, they can export to PDF just fine. I have also checked that they
have LaTeX (TeXLive) installed, and it appears it is. I am able to
convert tex files to dvi, and then use dvipng to make a png image. But
for some reason, the toggle-latex-overlay function does not work for
them.

I am at a loss to figure out what the issue is. These are Windows
laptops that were preconfigured by the department. Almost all of them
work fine, except for this small number I cannot figure out.

Any ideas? Thanks,


-- 
-----------------------------------
John Kitchin
http://kitchingroup.cheme.cmu.edu

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

* Re: help debugging latex-overlays boxes
  2014-09-05 14:06 help debugging latex-overlays boxes John Kitchin
@ 2014-09-05 15:10 ` Nick Dokos
  2014-09-05 19:18   ` John Kitchin
  2014-09-09 13:45   ` John Kitchin
  0 siblings, 2 replies; 7+ messages in thread
From: Nick Dokos @ 2014-09-05 15:10 UTC (permalink / raw)
  To: emacs-orgmode

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> Hi All,
>
> I am using org-mode in a course this fall with 60 students.  All of them
> are using org-mode from elpa. For about 10 of them, they are unable to
> toggle the latex-overlays; instead of getting the equations, they get
> empty gray boxes with an error that the png file was not created.  Oddly
> enough, they can export to PDF just fine. I have also checked that they
> have LaTeX (TeXLive) installed, and it appears it is. I am able to
> convert tex files to dvi, and then use dvipng to make a png image. But
> for some reason, the toggle-latex-overlay function does not work for
> them.
>
> I am at a loss to figure out what the issue is. These are Windows
> laptops that were preconfigured by the department. Almost all of them
> work fine, except for this small number I cannot figure out.
>
> Any ideas? Thanks,

I would edebug-defun the function org-create-formula-image and step
through it to make sure that it goes the way you want (are you sure you
are using the dvipng method on these machines? maybe you are using the
imagemagick method but the program has not been installed?  Check the
value of org-latex-create-formula-image-program).

While you are stepping you can also check the variables in the function
and see e.g. what the output file name is.

If that goes OK, then I would edebug-defun
org-create-formula-image-with-dvipng next and check the latex input file
it produces. Make sure that things like minted which require
--shell-escape are *not* included in that input file: it's processed by
a hard-wired call to latex (without --shell-escape) , so minted will
cause a failure. If that is the case, check org-latex-packages-alist and
make sure that minted's snippet-flag is nil.

HTH,
Nick

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

* Re: help debugging latex-overlays boxes
  2014-09-05 15:10 ` Nick Dokos
@ 2014-09-05 19:18   ` John Kitchin
  2014-09-09 13:45   ` John Kitchin
  1 sibling, 0 replies; 7+ messages in thread
From: John Kitchin @ 2014-09-05 19:18 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Nick Dokos <ndokos@gmail.com> writes:

Thanks for the tips. It is possible minted is the culprit. I will give
that a try, and the other ideas too. I am sure it is using dvipng, and
that it works. It will be a nice adventure in more sophisticated
debugging ;)

> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>
>> Hi All,
>>
>> I am using org-mode in a course this fall with 60 students.  All of them
>> are using org-mode from elpa. For about 10 of them, they are unable to
>> toggle the latex-overlays; instead of getting the equations, they get
>> empty gray boxes with an error that the png file was not created.  Oddly
>> enough, they can export to PDF just fine. I have also checked that they
>> have LaTeX (TeXLive) installed, and it appears it is. I am able to
>> convert tex files to dvi, and then use dvipng to make a png image. But
>> for some reason, the toggle-latex-overlay function does not work for
>> them.
>>
>> I am at a loss to figure out what the issue is. These are Windows
>> laptops that were preconfigured by the department. Almost all of them
>> work fine, except for this small number I cannot figure out.
>>
>> Any ideas? Thanks,
>
> I would edebug-defun the function org-create-formula-image and step
> through it to make sure that it goes the way you want (are you sure you
> are using the dvipng method on these machines? maybe you are using the
> imagemagick method but the program has not been installed?  Check the
> value of org-latex-create-formula-image-program).
>
> While you are stepping you can also check the variables in the function
> and see e.g. what the output file name is.
>
> If that goes OK, then I would edebug-defun
> org-create-formula-image-with-dvipng next and check the latex input file
> it produces. Make sure that things like minted which require
> --shell-escape are *not* included in that input file: it's processed by
> a hard-wired call to latex (without --shell-escape) , so minted will
> cause a failure. If that is the case, check org-latex-packages-alist and
> make sure that minted's snippet-flag is nil.
>
> HTH,
> Nick
>
>
>

-- 
-----------------------------------
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu

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

* Re: help debugging latex-overlays boxes
  2014-09-05 15:10 ` Nick Dokos
  2014-09-05 19:18   ` John Kitchin
@ 2014-09-09 13:45   ` John Kitchin
  2014-09-09 14:43     ` John Kitchin
  2014-09-09 15:10     ` Nick Dokos
  1 sibling, 2 replies; 7+ messages in thread
From: John Kitchin @ 2014-09-09 13:45 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Nick Dokos <ndokos@gmail.com> writes:

I have traced my problem. The issue is in the function
org-preview-latex-fragment. At the end of the function, where it calls
org-format-latex, the default-directory variable that is used in the
function call has a value of
"c:/Users/YUYUA~1/AppData/Local/Temp/ltxpng/mole-balance"

The YUYUA~1 is causing the problem.

I do not understand why the full path, "c:/Users/Yuyu
Yao/AppData/Local/Temp" is not showing up here. When I examine the
default-directory variable in a buffer in that directory, that is what
comes up. It is only inside the org function it gets chomped to what
looks like an old DOS format.

Anyway, latex cannot handle that path, so no dvi is produced, and no
image.

otherwise the latex file is produced, and it compiles fine with the full
path. Any ideas on how to fix that? Thanks,

> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>
>> Hi All,
>>
>> I am using org-mode in a course this fall with 60 students.  All of them
>> are using org-mode from elpa. For about 10 of them, they are unable to
>> toggle the latex-overlays; instead of getting the equations, they get
>> empty gray boxes with an error that the png file was not created.  Oddly
>> enough, they can export to PDF just fine. I have also checked that they
>> have LaTeX (TeXLive) installed, and it appears it is. I am able to
>> convert tex files to dvi, and then use dvipng to make a png image. But
>> for some reason, the toggle-latex-overlay function does not work for
>> them.
>>
>> I am at a loss to figure out what the issue is. These are Windows
>> laptops that were preconfigured by the department. Almost all of them
>> work fine, except for this small number I cannot figure out.
>>
>> Any ideas? Thanks,
>
> I would edebug-defun the function org-create-formula-image and step
> through it to make sure that it goes the way you want (are you sure you
> are using the dvipng method on these machines? maybe you are using the
> imagemagick method but the program has not been installed?  Check the
> value of org-latex-create-formula-image-program).
>
> While you are stepping you can also check the variables in the function
> and see e.g. what the output file name is.
>
> If that goes OK, then I would edebug-defun
> org-create-formula-image-with-dvipng next and check the latex input file
> it produces. Make sure that things like minted which require
> --shell-escape are *not* included in that input file: it's processed by
> a hard-wired call to latex (without --shell-escape) , so minted will
> cause a failure. If that is the case, check org-latex-packages-alist and
> make sure that minted's snippet-flag is nil.
>
> HTH,
> Nick
>
>
>

-- 
-----------------------------------
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu

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

* Re: help debugging latex-overlays boxes
  2014-09-09 13:45   ` John Kitchin
@ 2014-09-09 14:43     ` John Kitchin
  2014-09-09 15:10     ` Nick Dokos
  1 sibling, 0 replies; 7+ messages in thread
From: John Kitchin @ 2014-09-09 14:43 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

The issue seems to finally be the value of temporary-file-directory,
which is defined in C-source, and I think that is where the ~1 comes
from. I have a workaround solution, which is to set the
temproary-file-directory variable this way:

(setq temporary-file-directory (expand-file-name "~/../Local/Temp"))

which gives it a full path.

It is pretty odd. There are about 50 students with nominally the same
computers in this class, but this issue seems to only affect about 20%
of them!

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> Nick Dokos <ndokos@gmail.com> writes:
>
> I have traced my problem. The issue is in the function
> org-preview-latex-fragment. At the end of the function, where it calls
> org-format-latex, the default-directory variable that is used in the
> function call has a value of
> "c:/Users/YUYUA~1/AppData/Local/Temp/ltxpng/mole-balance"
>
> The YUYUA~1 is causing the problem.
>
> I do not understand why the full path, "c:/Users/Yuyu
> Yao/AppData/Local/Temp" is not showing up here. When I examine the
> default-directory variable in a buffer in that directory, that is what
> comes up. It is only inside the org function it gets chomped to what
> looks like an old DOS format.
>
> Anyway, latex cannot handle that path, so no dvi is produced, and no
> image.
>
> otherwise the latex file is produced, and it compiles fine with the full
> path. Any ideas on how to fix that? Thanks,
>
>> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>>
>>> Hi All,
>>>
>>> I am using org-mode in a course this fall with 60 students.  All of them
>>> are using org-mode from elpa. For about 10 of them, they are unable to
>>> toggle the latex-overlays; instead of getting the equations, they get
>>> empty gray boxes with an error that the png file was not created.  Oddly
>>> enough, they can export to PDF just fine. I have also checked that they
>>> have LaTeX (TeXLive) installed, and it appears it is. I am able to
>>> convert tex files to dvi, and then use dvipng to make a png image. But
>>> for some reason, the toggle-latex-overlay function does not work for
>>> them.
>>>
>>> I am at a loss to figure out what the issue is. These are Windows
>>> laptops that were preconfigured by the department. Almost all of them
>>> work fine, except for this small number I cannot figure out.
>>>
>>> Any ideas? Thanks,
>>
>> I would edebug-defun the function org-create-formula-image and step
>> through it to make sure that it goes the way you want (are you sure you
>> are using the dvipng method on these machines? maybe you are using the
>> imagemagick method but the program has not been installed?  Check the
>> value of org-latex-create-formula-image-program).
>>
>> While you are stepping you can also check the variables in the function
>> and see e.g. what the output file name is.
>>
>> If that goes OK, then I would edebug-defun
>> org-create-formula-image-with-dvipng next and check the latex input file
>> it produces. Make sure that things like minted which require
>> --shell-escape are *not* included in that input file: it's processed by
>> a hard-wired call to latex (without --shell-escape) , so minted will
>> cause a failure. If that is the case, check org-latex-packages-alist and
>> make sure that minted's snippet-flag is nil.
>>
>> HTH,
>> Nick
>>
>>
>>

-- 
-----------------------------------
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu

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

* Re: help debugging latex-overlays boxes
  2014-09-09 13:45   ` John Kitchin
  2014-09-09 14:43     ` John Kitchin
@ 2014-09-09 15:10     ` Nick Dokos
  2014-09-09 20:30       ` John Kitchin
  1 sibling, 1 reply; 7+ messages in thread
From: Nick Dokos @ 2014-09-09 15:10 UTC (permalink / raw)
  To: emacs-orgmode

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> Nick Dokos <ndokos@gmail.com> writes:
>
> I have traced my problem. The issue is in the function
> org-preview-latex-fragment. At the end of the function, where it calls
> org-format-latex, the default-directory variable that is used in the
> function call has a value of
> "c:/Users/YUYUA~1/AppData/Local/Temp/ltxpng/mole-balance"
>
> The YUYUA~1 is causing the problem.
>

My (perhaps naive) expectation would be that "YuYu Yao" would become
"YUYUYA~1", deleting the space, turning the string to upper case,
keeping the first six characters and adding the "~1" suffix. Why is the
last "Y" not there? If it *were* there, would the latex invocation
work?  I believe (quite without any evidence) that it should.

> I do not understand why the full path, "c:/Users/Yuyu
> Yao/AppData/Local/Temp" is not showing up here. When I examine the
> default-directory variable in a buffer in that directory, that is what
> comes up. It is only inside the org function it gets chomped to what
> looks like an old DOS format.
>
> Anyway, latex cannot handle that path, so no dvi is produced, and no
> image.
>
> otherwise the latex file is produced, and it compiles fine with the full
> path. Any ideas on how to fix that? Thanks,
>
>> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>>
>>> Hi All,
>>>
>>> I am using org-mode in a course this fall with 60 students.  All of them
>>> are using org-mode from elpa. For about 10 of them, they are unable to
>>> toggle the latex-overlays; instead of getting the equations, they get
>>> empty gray boxes with an error that the png file was not created.  Oddly
>>> enough, they can export to PDF just fine. I have also checked that they
>>> have LaTeX (TeXLive) installed, and it appears it is. I am able to
>>> convert tex files to dvi, and then use dvipng to make a png image. But
>>> for some reason, the toggle-latex-overlay function does not work for
>>> them.
>>>
>>> I am at a loss to figure out what the issue is. These are Windows
>>> laptops that were preconfigured by the department. Almost all of them
>>> work fine, except for this small number I cannot figure out.
>>>
>>> Any ideas? Thanks,
>>
>> I would edebug-defun the function org-create-formula-image and step
>> through it to make sure that it goes the way you want (are you sure you
>> are using the dvipng method on these machines? maybe you are using the
>> imagemagick method but the program has not been installed?  Check the
>> value of org-latex-create-formula-image-program).
>>
>> While you are stepping you can also check the variables in the function
>> and see e.g. what the output file name is.
>>
>> If that goes OK, then I would edebug-defun
>> org-create-formula-image-with-dvipng next and check the latex input file
>> it produces. Make sure that things like minted which require
>> --shell-escape are *not* included in that input file: it's processed by
>> a hard-wired call to latex (without --shell-escape) , so minted will
>> cause a failure. If that is the case, check org-latex-packages-alist and
>> make sure that minted's snippet-flag is nil.
>>

--
Nick

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

* Re: help debugging latex-overlays boxes
  2014-09-09 15:10     ` Nick Dokos
@ 2014-09-09 20:30       ` John Kitchin
  0 siblings, 0 replies; 7+ messages in thread
From: John Kitchin @ 2014-09-09 20:30 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Nick Dokos <ndokos@gmail.com> writes:

> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>
>> Nick Dokos <ndokos@gmail.com> writes:
>>
>> I have traced my problem. The issue is in the function
>> org-preview-latex-fragment. At the end of the function, where it calls
>> org-format-latex, the default-directory variable that is used in the
>> function call has a value of
>> "c:/Users/YUYUA~1/AppData/Local/Temp/ltxpng/mole-balance"
>>
>> The YUYUA~1 is causing the problem.
>>
>
> My (perhaps naive) expectation would be that "YuYu Yao" would become
> "YUYUYA~1", deleting the space, turning the string to upper case,
> keeping the first six characters and adding the "~1" suffix. Why is the
> last "Y" not there? If it *were* there, would the latex invocation
> work?  I believe (quite without any evidence) that it should.

I don't think it would work. the Space is also not the issue, as it
affects some users with no spaces. This is for some reason, like a
partial dos 8.3 filename (http://en.wikipedia.org/wiki/8.3_filename). I
still do not know why it happens, but setting the
temporary-file-directory in the init.el solves the problem, e.g.:

(setq temporary-file-directory "c:/some/full/path")

>
>> I do not understand why the full path, "c:/Users/Yuyu
>> Yao/AppData/Local/Temp" is not showing up here. When I examine the
>> default-directory variable in a buffer in that directory, that is what
>> comes up. It is only inside the org function it gets chomped to what
>> looks like an old DOS format.
>>
>> Anyway, latex cannot handle that path, so no dvi is produced, and no
>> image.
>>
>> otherwise the latex file is produced, and it compiles fine with the full
>> path. Any ideas on how to fix that? Thanks,
>>
>>> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>>>
>>>> Hi All,
>>>>
>>>> I am using org-mode in a course this fall with 60 students.  All of them
>>>> are using org-mode from elpa. For about 10 of them, they are unable to
>>>> toggle the latex-overlays; instead of getting the equations, they get
>>>> empty gray boxes with an error that the png file was not created.  Oddly
>>>> enough, they can export to PDF just fine. I have also checked that they
>>>> have LaTeX (TeXLive) installed, and it appears it is. I am able to
>>>> convert tex files to dvi, and then use dvipng to make a png image. But
>>>> for some reason, the toggle-latex-overlay function does not work for
>>>> them.
>>>>
>>>> I am at a loss to figure out what the issue is. These are Windows
>>>> laptops that were preconfigured by the department. Almost all of them
>>>> work fine, except for this small number I cannot figure out.
>>>>
>>>> Any ideas? Thanks,
>>>
>>> I would edebug-defun the function org-create-formula-image and step
>>> through it to make sure that it goes the way you want (are you sure you
>>> are using the dvipng method on these machines? maybe you are using the
>>> imagemagick method but the program has not been installed?  Check the
>>> value of org-latex-create-formula-image-program).
>>>
>>> While you are stepping you can also check the variables in the function
>>> and see e.g. what the output file name is.
>>>
>>> If that goes OK, then I would edebug-defun
>>> org-create-formula-image-with-dvipng next and check the latex input file
>>> it produces. Make sure that things like minted which require
>>> --shell-escape are *not* included in that input file: it's processed by
>>> a hard-wired call to latex (without --shell-escape) , so minted will
>>> cause a failure. If that is the case, check org-latex-packages-alist and
>>> make sure that minted's snippet-flag is nil.
>>>
>
> --
> Nick
>
>
>
>
>

-- 
-----------------------------------
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu

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

end of thread, other threads:[~2014-09-09 20:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-05 14:06 help debugging latex-overlays boxes John Kitchin
2014-09-05 15:10 ` Nick Dokos
2014-09-05 19:18   ` John Kitchin
2014-09-09 13:45   ` John Kitchin
2014-09-09 14:43     ` John Kitchin
2014-09-09 15:10     ` Nick Dokos
2014-09-09 20:30       ` John Kitchin

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