From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: TikZ to separate file (babel?) possible? Date: Thu, 28 Oct 2010 16:43:44 -0500 Message-ID: References: <87lj5px6m5.fsf@gmail.com> <87aam5bz6y.wl%ucecesf@ucl.ac.uk> <87r5fet873.fsf@gmail.com> <87eibdz7tf.wl%ucecesf@ucl.ac.uk> <87vd4o7e3i.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0113677204==" Return-path: Received: from [140.186.70.92] (port=35941 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PBaGD-0000Jb-4J for emacs-orgmode@gnu.org; Thu, 28 Oct 2010 17:43:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PBaGB-0007LG-BF for emacs-orgmode@gnu.org; Thu, 28 Oct 2010 17:43:49 -0400 Received: from mail-bw0-f41.google.com ([209.85.214.41]:52839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PBaGA-0007L0-Sq for emacs-orgmode@gnu.org; Thu, 28 Oct 2010 17:43:47 -0400 Received: by bwz16 with SMTP id 16so2010076bwz.0 for ; Thu, 28 Oct 2010 14:43:45 -0700 (PDT) In-Reply-To: <87vd4o7e3i.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: emacs-orgmode --===============0113677204== Content-Type: multipart/alternative; boundary=001636c5b8857b072b0493b43c98 --001636c5b8857b072b0493b43c98 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Oct 26, 2010 at 6:01 PM, Eric Schulte wrote: > Hi, > > First my previously pasted :exports code will throw errors on > interactive evaluation (i.e. when not exporting), this alternative > should be more robust. > > :exports (if (and (boundp 'latexp) latexp) "code" "results") > > As for placing latex headers in a latex code block, I don't believe that > is currently possible. I do agree it would be nice for latex code > blocks to inherit latex headers from the containing Org-mode buffer but > that would be a non-trivial piece of development, which I just don't > have time for at the moment. > > I've just added a :headers argument which should allow changing things > like fonts that need to take place in the headers portion of the latex > file. See the following examples, passing both a single header and a > list of headers. > --8<---------------cut here---------------start------------->8--- > #+begin_src latex :headers \usepackage{lmodern} :file name1.pdf > Eric Schulte > #+end_src > > #+results: > [[file:name1.pdf]] > > #+begin_src latex :headers '("\\usepackage{mathpazo}" > "\\usepackage{fullpage}") :file name2.pdf > Eric Schulte > #+end_src > > #+results: > [[file:name2.pdf]] > --8<---------------cut here---------------end--------------->8--- > > Please pull this down and let me know if it works for you. > > Just pulled, make clean && make && make doc && make install. Tried it and I get the default font for the first and Palatino for the second, but the lmodern is not appearing to change what's going on. I tried what usually works for me: \renewcommand{\rmdefault}{cmss} and this did not work to make it sans serif. Am I doing something wrong? Thanks, John > Best -- Eric > > John Hendy writes: > > > Maybe it would just be easier if someone attached a .org file that > functions > > as you think would work well -- with both the document and the babel/TikZ > > export having the same sans-serif font. Perhaps then I could simply C-e p > > the document and C-c C-c the babel block myself to examine how it > behaves? > > > > I was not able to get the conditional :export code provided to work. > > > > Thanks, > > John > > > > On Tue, Oct 26, 2010 at 9:34 AM, John Hendy wrote: > > > >> On Tue, Oct 26, 2010 at 3:17 AM, Eric S Fraga > wrote: > >> > >>> On Mon, 25 Oct 2010 13:58:41 -0500, John Hendy > >>> wrote: > >>> > > >>> > [1 ] > >>> > > >>> > [2 ] > >>> > On Mon, Oct 25, 2010 at 1:53 PM, Eric Schulte < > schulte.eric@gmail.com> > >>> wrote: > >>> > > >>> > Hi John, > >>> > > >>> > In the case you describe I would export the *code* of the tikz > latex > >>> > block rather than the file resulting from evaluating the block. > >>> > > >>> > Code = raw LaTeX/TikZ code? If so, I don't really care about that. i > >>> just want the graphic. > >>> > >>> Yes but the point is that, if I understand the processes involved > >>> correctly, the export and babel routes each generate different latex > >>> code. Babel does *not* look at the document wide settings whereas > >>> export does. This is why Eric is suggesting you export the babel code > >>> so that it is interpreted by the latex document that results from > >>> exporting the whole org document. Otherwise, make sure the settings > >>> you want are within the latex source code block? > >>> > >> > >> That makes more sense, though if I export the code into the larger LaTeX > >> document, I'm left where I started, I believe. An 8.5x11 exported PDF > with > >> my diagram in the middle of it. > >> > >> If it's just getting the right code into the babel block, that's helpful > to > >> know. Perhaps the easiest way to put it is this: what is the best path > to > >> obtain the following: > >> > >> - a single pdf output of my TikZ diagram, cropped to fit the diagram > >> - the font used in the TikZ diagram that I desire (preferably from the > doc) > >> > >> Again, my use-case is one in which I have daily notes or a paper with a > >> diagram but also would like to preserve the diagram for reuse. With > babel, > >> it appears this should be possible -- I can both export normally and > have > >> the graphic in the paper or send the TikZ section alone to export and > use > >> the graphic in a presentation or elsewhere. > >> > >> I wondered about what you said re. putting the settings in the latex > source > >> code block, and I was actually fiddling around with that yesterday. My > font > >> is simply set like so (present in the examples I posted earlier): > >> > >> #+latex_header: \usepackage{lmodern} > >> #+latex_header: \renewcommand{\rmdefault}{cmss} > >> > >> But I tried putting variations of this in the babel block (without the > >> #+latex_header part, of course) with no success. > >> > >> These didn't work for me: > >> > >> #+begin_src latex :file flow-chart.pdf :packages '(("" "tikz")) :border > 1em > >> \usepackage{lmodern} > >> \renewcommand{\rmdefault}{cmss} > >> > >> or > >> > >> #+begin_src latex :file flow-chart.pdf :packages '(("" "tikz" > "lmodern")) > >> :border 1em > >> \renewcommand{\rmdefault}{cmss} > >> > >> or > >> > >> #+begin_src latex :file flow-chart.pdf :packages '(("" "tikz lmodern")) > >> :border 1em > >> \renewcommand{\rmdefault}{cmss} > >> > >> I haven't found anything at ob-doc-latex covering how to pass package > >> arguments or include LaTeX settings directly in the babel block. My > attempts > >> at the renewcommand end up with "cmss" ending up in my TIkZ graphic > >> somewhere... > >> > >> > >> Thanks for persisting with me! > >> John > >> > >> > >> > >> > >> > >>> -- > >>> Eric S Fraga > >>> GnuPG: 8F5C 279D 3907 E14A 5C29 570D C891 93D8 FFFC F67D > >>> > >>> > >> > --001636c5b8857b072b0493b43c98 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Tue, Oct 26, 2010 at 6:01 PM, Eric Schulte <schulte.eric@= gmail.com> wrote:
Hi,

First my previously pasted :exports code will throw errors on
interactive evaluation (i.e. when not exporting), this alternative
should be more robust.

=A0:exports (if (and (boundp 'latexp) latexp) "code" "re= sults")

As for placing latex headers in a latex code block, I don't believe tha= t
is currently possible. =A0I do agree it would be nice for latex code
blocks to inherit latex headers from the containing Org-mode buffer but
that would be a non-trivial piece of development, which I just don't have time for at the moment.

I've just added a :headers argument which should allow changing things<= br> like fonts that need to take place in the headers portion of the latex
file. =A0See the following examples, passing both a single header and a
list of headers.
=A0--8<---------------cut here----= -----------start------------->8---
#+begin_src latex :headers \usepackage{lmodern} :file name1.pdf
=A0Eric Schulte
#+end_src

#+results:
[[file:name1.pdf]]

#+begin_src latex :headers '("\\usepackage{mathpazo}" "\= \usepackage{fullpage}") :file name2.pdf
=A0Eric Schulte
#+end_src

#+results:
[[file:name2.pdf]]
--8<---------------cut here---------------end--------------->8---

Please pull this down and let me know if it works for you.


Just pulled, make clean && mak= e && make doc && make install. Tried it and I get the defau= lt font for the first and Palatino for the second, but the lmodern is not a= ppearing to change what's going on. I tried what usually works for me:<= /div>

\renewcommand{\rmdefault}{cmss}

and this did not work to make it sans serif. Am I doing something wrong?<= /div>


Thanks,
John

=A0
Best -- Eric

John Hendy <jw.hendy@gmail.com= > writes:

> Maybe it would just be easier if someone attached a .org file that fun= ctions
> as you think would work well -- with both the document and the babel/T= ikZ
> export having the same sans-serif font. Perhaps then I could simply C-= e p
> the document and C-c C-c the babel block myself to examine how it beha= ves?
>
> I was not able to get the conditional :export code provided to work. >
> Thanks,
> John
>
> On Tue, Oct 26, 2010 at 9:34 AM, John Hendy <jw.hendy@gmail.com> wrote:
>
>> On Tue, Oct 26, 2010 at 3:17 AM, Eric S Fraga <ucecesf@ucl.ac.uk> wrote:
>>
>>> On Mon, 25 Oct 2010 13:58:41 -0500, John Hendy <jw.hendy@gmail.com>
>>> wrote:
>>> >
>>> > [1 =A0<text/plain; ISO-8859-1 (7bit)>]
>>> >
>>> > [2 =A0<text/html; ISO-8859-1 (quoted-printable)>] >>> > On Mon, Oct 25, 2010 at 1:53 PM, Eric Schulte <schulte.eric@gmail.com>
>>> wrote:
>>> >
>>> > =A0 =A0 Hi John,
>>> >
>>> > =A0 =A0 In the case you describe I would export the *code= * of the tikz latex
>>> > =A0 =A0 block rather than the file resulting from evaluat= ing the block.
>>> >
>>> > Code =3D raw LaTeX/TikZ code? If so, I don't really c= are about that. i
>>> just want the graphic.
>>>
>>> Yes but the point is that, if I understand the processes invol= ved
>>> correctly, the export and babel routes each generate different= latex
>>> code. =A0Babel does *not* look at the document wide settings w= hereas
>>> export does. =A0This is why Eric is suggesting you export the = babel code
>>> so that it is interpreted by the latex document that results f= rom
>>> exporting the whole org document. =A0Otherwise, make sure the = settings
>>> you want are within the latex source code block?
>>>
>>
>> That makes more sense, though if I export the code into the larger= LaTeX
>> document, I'm left where I started, I believe. An 8.5x11 expor= ted PDF with
>> my diagram in the middle of it.
>>
>> If it's just getting the right code into the babel block, that= 's helpful to
>> know. Perhaps the easiest way to put it is this: what is the best = path to
>> obtain the following:
>>
>> - a single pdf output of my TikZ diagram, cropped to fit the diagr= am
>> - the font used in the TikZ diagram that I desire (preferably from= the doc)
>>
>> Again, my use-case is one in which I have daily notes or a paper w= ith a
>> diagram but also would like to preserve the diagram for reuse. Wit= h babel,
>> it appears this should be possible -- I can both export normally a= nd have
>> the graphic in the paper or send the TikZ section alone to export = and use
>> the graphic in a presentation or elsewhere.
>>
>> I wondered about what you said re. putting the settings in the lat= ex source
>> code block, and I was actually fiddling around with that yesterday= . My font
>> is simply set like so (present in the examples I posted earlier):<= br> >>
>> #+latex_header: \usepackage{lmodern}
>> #+latex_header: \renewcommand{\rmdefault}{cmss}
>>
>> But I tried putting variations of this in the babel block (without= the
>> #+latex_header part, of course) with no success.
>>
>> These didn't work for me:
>>
>> #+begin_src latex :file flow-chart.pdf :packages '(("&quo= t; "tikz")) :border 1em
>> \usepackage{lmodern}
>> \renewcommand{\rmdefault}{cmss}
>>
>> or
>>
>> #+begin_src latex :file flow-chart.pdf :packages '(("&quo= t; "tikz" "lmodern"))
>> :border 1em
>> \renewcommand{\rmdefault}{cmss}
>>
>> or
>>
>> #+begin_src latex :file flow-chart.pdf :packages '(("&quo= t; "tikz lmodern"))
>> :border 1em
>> \renewcommand{\rmdefault}{cmss}
>>
>> I haven't found anything at ob-doc-latex covering how to pass = package
>> arguments or include LaTeX settings directly in the babel block. M= y attempts
>> at the renewcommand end up with "cmss" ending up in my T= IkZ graphic
>> somewhere...
>>
>>
>> Thanks for persisting with me!
>> John
>>
>>
>>
>>
>>
>>> --
>>> Eric S Fraga
>>> GnuPG: 8F5C 279D 3907 E14A 5C29 =A0570D C891 93D8 FFFC F67D >>>
>>>
>>

--001636c5b8857b072b0493b43c98-- --===============0113677204== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0113677204==--