emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: John Hendy <jw.hendy@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: TikZ to separate file (babel?) possible?
Date: Mon, 25 Oct 2010 12:53:52 -0600	[thread overview]
Message-ID: <87r5fet873.fsf@gmail.com> (raw)
In-Reply-To: <AANLkTimxRJfWkhHrGBtbwQm=hP6DbmV-m+9cjpE2n_96@mail.gmail.com> (John Hendy's message of "Mon, 25 Oct 2010 13:21:49 -0500")

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.

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")

Best -- Eric

John Hendy <jw.hendy@gmail.com> 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 <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 "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
>>>
>>>
>>

  reply	other threads:[~2010-10-25 19:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-22 20:13 TikZ to separate file (babel?) possible? John Hendy
2010-10-22 20:35 ` Erik Iverson
2010-10-22 21:25 ` Eric Schulte
2010-10-22 21:36   ` John Hendy
2010-10-22 23:11     ` Eric S Fraga
2010-10-23 17:58       ` John Hendy
2010-10-25 18:21         ` John Hendy
2010-10-25 18:53           ` Eric Schulte [this message]
2010-10-25 18:58             ` John Hendy
2010-10-26  8:17               ` Eric S Fraga
2010-10-26 14:34                 ` John Hendy
2010-10-26 21:34                   ` John Hendy
2010-10-26 23:01                     ` Eric Schulte
2010-10-28 21:43                       ` John Hendy
2010-10-28 21:52                         ` John Hendy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r5fet873.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jw.hendy@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).