From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: TikZ to separate file (babel?) possible? Date: Mon, 25 Oct 2010 13:58:41 -0500 Message-ID: References: <87lj5px6m5.fsf@gmail.com> <87aam5bz6y.wl%ucecesf@ucl.ac.uk> <87r5fet873.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0600971668==" Return-path: Received: from [140.186.70.92] (port=56032 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PASKZ-00039K-6Z for emacs-orgmode@gnu.org; Mon, 25 Oct 2010 15:03:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PASFn-0006wO-BO for emacs-orgmode@gnu.org; Mon, 25 Oct 2010 14:58:44 -0400 Received: from mail-gx0-f169.google.com ([209.85.161.169]:59226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PASFn-0006wI-3G for emacs-orgmode@gnu.org; Mon, 25 Oct 2010 14:58:43 -0400 Received: by gxk2 with SMTP id 2so189gxk.0 for ; Mon, 25 Oct 2010 11:58:42 -0700 (PDT) In-Reply-To: <87r5fet873.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 --===============0600971668== Content-Type: multipart/alternative; boundary=001636c5a40da99649049375943c --001636c5a40da99649049375943c Content-Type: text/plain; charset=ISO-8859-1 On Mon, Oct 25, 2010 at 1:53 PM, Eric Schulte 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. > This is possible by adding the following header argument to the code > block which will evaluate the latex block when the export target is not > latex and will just export the code when the target is latex. > > :exports (if latexp "code" "results") > When trying C-c C-c after adding this, I get "Symbol's value as variable is void: latexp" in the minibuffer. Also, does this assist with my font issue? My main question is how to get the document font to apply to my babel block. At present, the code shown above for file_2.org is *perfect* in its behavior (I get a perfectly cropped PDF of my diagram) except for it not being the right font. I just need to know to set the font for the TikZ babel output. Thanks for the assistance, John > > Best -- Eric > > John Hendy writes: > > > Followup question. I have an existing diagram I had already exported to > PDF > > via LaTeX, taken a screenshot of, and used in a presentation. I tried the > > same diagram with the new method and am having issues with the font. The > > original org file is like this: > > > > *---( File_1.org -> embedded LaTeX )---* > > #+latex_header: \usepackage{tikz} > \usetikzlibrary{shapes,positioning,arrows} > > #+latex_header: \usepackage[hmargin=2.5cm,vmargin=2.5cm]{geometry} > > #+latex_header: \usepackage{lmodern} > > #+latex_header: \renewcommand{\rmdefault}{cmss} > > > > * Section > > > > #+begin_latex > > > > +++ TikZ code is here +++ > > > > #+end_latex > > > > *---( End File_1.org )---* > > > > > > My file using this new method is like this: > > > > *---( File_2.org -> exports TikZ to separate PDF via babel/LaTeX )---* > > #+latex_header: \usepackage{tikz} > \usetikzlibrary{shapes,positioning,arrows} > > #+latex_header: \usepackage[hmargin=2.5cm,vmargin=2.5cm]{geometry} > > #+latex_header: \usepackage{lmodern} > > #+latex_header: \renewcommand{\rmdefault}{cmss} > > > > * Section > > > > #+begin_src latex :file flow-chart.pdf :packages '(("" "tikz")) :border > 1em > > > > +++ TikZ code is here +++ > > > > #+end_src > > > > *---( End File_2.org )---* > > > > > > In my first file, the entire font is latin modern (sans-serif). Header, > > title, author, *and* all TikZ diagram text. > > > > In the second, only the header is (if I export the whole thing), but not > the > > text in my TikZ nodes. Why is the babel block ignoring the document font > > setting? > > > > > > Thanks, > > John > > > > > > On Sat, Oct 23, 2010 at 12:58 PM, John Hendy wrote: > > > >> Thanks, Eric F. Got the preview package going and this is *exactly* what > I > >> would have been looking for. > >> > >> Eric S: yes, ImageMagick will take care of the rest :) > >> > >> > >> Thanks all! > >> John > >> > >> On Fri, Oct 22, 2010 at 6:11 PM, Eric S Fraga > wrote: > >> > >>> On Fri, 22 Oct 2010 16:36:10 -0500, John Hendy > >>> wrote: > >>> > >>> > This is fantastic. Honestly, I had no idea that one could use LaTeX > with > >>> > babel! This is just perfect. I was googling around for "export tikz > pgf > >>> jpg" > >>> > and things like that with no luck. This will do perfectly. > >>> > >>> For completeness (and the mailing list archive), if you need to do > >>> this directly in latex, you will want to use the minimal document > >>> class and the preview package. Check out examples on the tikz > >>> examples web site [1]. The preview package is what babel uses. > >>> > >>> Footnotes: > >>> [1] http://www.texample.net/tikz/examples/ > >>> > >>> > >>> -- > >>> Eric S Fraga > >>> GnuPG: 8F5C 279D 3907 E14A 5C29 570D C891 93D8 FFFC F67D > >>> > >>> > >> > --001636c5a40da99649049375943c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
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 =3D raw LaTeX/TikZ code? If so, I= don't really care about that. i just want the graphic.
=A0
This is possible by adding the following header argument to the code
block which will evaluate the latex block when the export target is not
latex and will just export the code when the target is latex.

=A0:exports (if latexp "code" "results")

When trying C-c C-c after adding this, I get "S= ymbol's value as variable is void: latexp" in the minibuffer.

Also, does this assist with my font issue? My main ques= tion is how to get the document font to apply to my babel block. At present= , the code shown above for file_2.org is = perfect=A0in its behavior (I get a perfectly cropped PDF of my diagr= am) except for it not being the right font. I just need to know to set the = font for the TikZ babel output.


Thanks for the assistance,
Joh= n
=A0

Best -- Eric

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

> Followup question. I have an existing diagram I had already exported t= o PDF
> via LaTeX, taken a screenshot of, and used in a presentation. I tried = the
> same diagram with the new method and am having issues with the font. T= he
> original org file is like this:
>
> *---( File_1.org -> embedded LaTeX )---*
> #+latex_header: \usepackage{tikz} \usetikzlibrary{shapes,positioning,a= rrows}
> #+latex_header: \usepackage[hmargin=3D2.5cm,vmargin=3D2.5cm]{geometry}=
> #+latex_header: \usepackage{lmodern}
> #+latex_header: \renewcommand{\rmdefault}{cmss}
>
> * Section
>
> #+begin_latex
>
> +++ TikZ code is here +++
>
> #+end_latex
>
> *---( End File_1.org )---*
>
>
> My file using this new method is like this:
>
> *---( File_2.org -> exports TikZ to separate PDF via babel/LaTeX )-= --*
> #+latex_header: \usepackage{tikz} \usetikzlibrary{shapes,positioning,a= rrows}
> #+latex_header: \usepackage[hmargin=3D2.5cm,vmargin=3D2.5cm]{geometry}=
> #+latex_header: \usepackage{lmodern}
> #+latex_header: \renewcommand{\rmdefault}{cmss}
>
> * Section
>
> #+begin_src latex :file flow-chart.pdf :packages '(("" &= quot;tikz")) :border 1em
>
> +++ TikZ code is here +++
>
> #+end_src
>
> *---( End File_2.org )---*
>
>
> In my first file, the entire font is latin modern (sans-serif). Header= ,
> title, author, *and* all TikZ diagram text.
>
> In the second, only the header is (if I export the whole thing), but n= ot the
> text in my TikZ nodes. Why is the babel block ignoring the document fo= nt
> setting?
>
>
> Thanks,
> John
>
>
> On Sat, Oct 23, 2010 at 12:58 PM, John Hendy <jw.hendy@gmail.com> wrote:
>
>> Thanks, Eric F. Got the preview package going and this is *exactly= * what I
>> would have been looking for.
>>
>> Eric S: yes, ImageMagick will take care of the rest :)
>>
>>
>> Thanks all!
>> John
>>
>> On Fri, Oct 22, 2010 at 6:11 PM, Eric S Fraga <ucecesf@ucl.ac.uk> wrote:
>>
>>> On Fri, 22 Oct 2010 16:36:10 -0500, John Hendy <jw.hendy@gmail.com>
>>> wrote:
>>>
>>> > This is fantastic. Honestly, I had no idea that one could= use LaTeX with
>>> > babel! This is just perfect. I was googling around for &q= uot;export tikz pgf
>>> jpg"
>>> > and things like that with no luck. This will do perfectly= .
>>>
>>> For completeness (and the mailing list archive), if you need t= o do
>>> this directly in latex, you will want to use the minimal docum= ent
>>> class and the preview package. =A0Check out examples on the ti= kz
>>> examples web site [1]. =A0The preview package is what babel us= es.
>>>
>>> Footnotes:
>>> [1] =A0http://www.texample.net/tikz/examples/
>>>
>>>
>>> --
>>> Eric S Fraga
>>> GnuPG: 8F5C 279D 3907 E14A 5C29 =A0570D C891 93D8 FFFC F67D >>>
>>>
>>

--001636c5a40da99649049375943c-- --===============0600971668== 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 --===============0600971668==--