From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Lomov Subject: Re: [PATCH] org-preview-latex-fragment not working with #+latex_header:\input{} Date: Sat, 21 Apr 2012 08:58:59 +0900 Message-ID: <20120420235859.GA1360@smoon> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:37587) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLNjI-0003ij-Ok for emacs-orgmode@gnu.org; Fri, 20 Apr 2012 19:59:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SLNjG-0008As-U6 for emacs-orgmode@gnu.org; Fri, 20 Apr 2012 19:59:08 -0400 Received: from mail-lpp01m010-f41.google.com ([209.85.215.41]:39817) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLNjG-0008Am-KA for emacs-orgmode@gnu.org; Fri, 20 Apr 2012 19:59:06 -0400 Received: by lagz14 with SMTP id z14so8814612lag.0 for ; Fri, 20 Apr 2012 16:59:03 -0700 (PDT) Content-Disposition: inline In-Reply-To: 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: emacs-orgmode@gnu.org 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