From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: [PATCH] org-preview-latex-fragment not working with #+latex_header:\input{} Date: Sat, 21 Apr 2012 01:07:39 +0200 Message-ID: <87zka6gfyc.fsf@altern.org> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:50350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLMuP-0000AB-MQ for emacs-orgmode@gnu.org; Fri, 20 Apr 2012 19:06:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SLMuN-0006yR-9K for emacs-orgmode@gnu.org; Fri, 20 Apr 2012 19:06:33 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:40543) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLMuN-0006xx-0U for emacs-orgmode@gnu.org; Fri, 20 Apr 2012 19:06:31 -0400 Received: by wibhj13 with SMTP id hj13so864864wib.12 for ; Fri, 20 Apr 2012 16:06:29 -0700 (PDT) In-Reply-To: (Benjamin Motz's message of "Fri, 20 Apr 2012 19:28:43 +0200") 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: Benjamin Motz Cc: emacs-orgmode@gnu.org Hi Benjamin, Benjamin Motz 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