* [PATCH] org-preview-latex-fragment not working with #+latex_header:\input{}
@ 2012-04-20 17:28 Benjamin Motz
2012-04-20 23:07 ` Bastien
2012-04-20 23:58 ` Vladimir Lomov
0 siblings, 2 replies; 4+ messages in thread
From: Benjamin Motz @ 2012-04-20 17:28 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 749 bytes --]
Bug:
#+latex_header:\input{commands.tex} is not considered in
org-preview-latex-fragment. Reason: the fragment is generated in /tmp
from where the file commands.tex can not be found. In my case,
commands.tex contains essential latex-code for displaying the
latex-fragment, so I consider this to be a bug.
I have set the environment variable TEXINPUTS in
(org-create-formula-image) to work around this bug (see patch).
However, this is the first time that I have written something like a
patch and furthermore I'm not at all familiar with lisp-programming. So
could you please have a look at my solution and tell me if it's complete
crap and how it could be done better?!
If it's no crap, I presume it should be submitted.
Thank you, Benjamin
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: texinputs.patch --]
[-- Type: text/x-diff, Size: 329 bytes --]
diff --git a/org.el b/org.el.orig
index 4f5bef0..b1c15fb 100644
--- a/org.el
+++ b/org.el.orig
@@ -17040,7 +17040,6 @@ inspection."
(condition-case nil
(progn
(cd tmpdir)
- (setenv "TEXINPUTS" concat(default-directory ":.:"))
(call-process "latex" nil nil nil texfile))
(error nil))
(cd dir))
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] org-preview-latex-fragment not working with #+latex_header:\input{}
2012-04-20 17:28 [PATCH] org-preview-latex-fragment not working with #+latex_header:\input{} Benjamin Motz
@ 2012-04-20 23:07 ` Bastien
2012-04-21 10:32 ` Achim Gratz
2012-04-20 23:58 ` Vladimir Lomov
1 sibling, 1 reply; 4+ messages in thread
From: Bastien @ 2012-04-20 23:07 UTC (permalink / raw)
To: Benjamin Motz; +Cc: emacs-orgmode
Hi Benjamin,
Benjamin Motz <b.motz@uni-muenster.de> writes:
> #+latex_header:\input{commands.tex} is not considered in
> org-preview-latex-fragment. Reason: the fragment is generated in /tmp
> from where the file commands.tex can not be found. In my case,
> commands.tex contains essential latex-code for displaying the
> latex-fragment, so I consider this to be a bug.
Did you try \input{/home/absolute/path/commands.tex} ?
> I have set the environment variable TEXINPUTS in
> (org-create-formula-image) to work around this bug (see patch).
>
> However, this is the first time that I have written something like a
> patch and furthermore I'm not at all familiar with lisp-programming. So
> could you please have a look at my solution and tell me if it's complete
> crap and how it could be done better?!
It complete crap and it could be done better :)
> If it's no crap, I presume it should be submitted.
Setting TEXINPUTS while creating formulas makes sense to me, so I'll be
glad to have a patch for this.
Some comments:
> Thank you, Benjamin
>
> diff --git a/org.el b/org.el.orig
The diff says you are comparing org.el and org.el.orig (the original
file). With this method, it's easy to have the comparison done the
wrong way.
The *really really* simple method is to use git and Emacs >=23.4.
~$ git clone git://orgmode.org/org-mode.git
Then open the .el file you want to edit. When you're done editing,
simply `C-x v ='. It will open a new buffer with the patch.
HTH,
--
Bastien
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] org-preview-latex-fragment not working with #+latex_header:\input{}
2012-04-20 23:07 ` Bastien
@ 2012-04-21 10:32 ` Achim Gratz
0 siblings, 0 replies; 4+ messages in thread
From: Achim Gratz @ 2012-04-21 10:32 UTC (permalink / raw)
To: emacs-orgmode
Bastien writes:
> Setting TEXINPUTS while creating formulas makes sense to me, so I'll be
> glad to have a patch for this.
Actually, setting TEXINPUTS is fraught with peril and just setting it
without checking if it already exists is risking to break some setups.
If anything there should be a defcustom or better hook function to allow
alteration of the environment (ostensibly not just for TEXINPUTS) before
org calls external processes.
Regards,
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
Wavetables for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] org-preview-latex-fragment not working with #+latex_header:\input{}
2012-04-20 17:28 [PATCH] org-preview-latex-fragment not working with #+latex_header:\input{} Benjamin Motz
2012-04-20 23:07 ` Bastien
@ 2012-04-20 23:58 ` Vladimir Lomov
1 sibling, 0 replies; 4+ messages in thread
From: Vladimir Lomov @ 2012-04-20 23:58 UTC (permalink / raw)
To: emacs-orgmode
Hello,
** Benjamin Motz [2012-04-20 19:28:43 +0200]:
> Bug:
> #+latex_header:\input{commands.tex} is not considered in
> org-preview-latex-fragment. Reason: the fragment is generated in /tmp
> from where the file commands.tex can not be found. In my case,
> commands.tex contains essential latex-code for displaying the
> latex-fragment, so I consider this to be a bug.
IMHO, you doing it in wrong way, I presume you are using some Linux:
create ~/texmf/tex/latex/ben
and put there your `commands.tex', then `\input{commands.tex}' will pick
up that file.
Of course it is true for LaTeX, if you use plain TeX use
`~/texmf/tex/plain/ben' directorythen.
> I have set the environment variable TEXINPUTS in
> (org-create-formula-image) to work around this bug (see patch).
Don't do it. If it is Ok to use in isolated environment and only once
the TEXINPUTS variable it is bad practice.
> However, this is the first time that I have written something like a
> patch and furthermore I'm not at all familiar with lisp-programming. So
> could you please have a look at my solution and tell me if it's complete
> crap and how it could be done better?!
> If it's no crap, I presume it should be submitted.
> Thank you, Benjamin
> diff --git a/org.el b/org.el.orig
> index 4f5bef0..b1c15fb 100644
> --- a/org.el
> +++ b/org.el.orig
> @@ -17040,7 +17040,6 @@ inspection."
> (condition-case nil
> (progn
> (cd tmpdir)
> - (setenv "TEXINPUTS" concat(default-directory ":.:"))
> (call-process "latex" nil nil nil texfile))
> (error nil))
> (cd dir))
P.S. I'm using org with latex math code and all works fine (I'm using very
customized setup but it works very well).
---
WBR, Vladimir Lomov
--
I knew her before she was a virgin.
-- Oscar Levant, on Doris Day
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-04-21 10:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-20 17:28 [PATCH] org-preview-latex-fragment not working with #+latex_header:\input{} Benjamin Motz
2012-04-20 23:07 ` Bastien
2012-04-21 10:32 ` Achim Gratz
2012-04-20 23:58 ` Vladimir Lomov
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).