Graphics, Figures & Tablestikz vs. psfrag

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
theo moore
Posts: 72
Joined: Thu Jan 15, 2009 3:16 pm

tikz vs. psfrag

Post by theo moore »

I like how psfrag will automatically use the correct font size for annotating eps pictures within latex document. If it is not the correct size, you can easily adjust it like so,

Code: Select all

\begin{figure}
  \psfrag{x}[cl][cl][0.85]{$\Re(z)$}
  \psfrag{y}[Bc][Bc][0.85]{$\Im(z)$}
  \includegraphics[width=5cm]{figurehere}};
\end{figure}
so here I'm using 85% of the document size.

Problem: I've decided to consistently use PDF files instead of EPS files for my publishing. Going between the two formats is a headache and causes many artifacts. So I've started using tikz to annotate. For example,

Code: Select all

\begin{tikzpicture}[scale=1.0, domain=-2:2]

\node(0,0){\includegraphics[height=3.5cm]{picturehere}};
\draw (0.1,1.9) node{$y$};
\draw (1.10,1.08) node{$x$};
\end{tikzpicture}
Now that's all fine and good. The problem is that I no longer have consistent font sizes in my document. (For example, currently, the x-y labels are much too large).

Question 1: (Manual fix) How do I adjust the size of a label of a node in tikz?

Later Edit: You can do this just by node[scale=0.8]{$x$}

Question 2: (Automatic fix) Is there an easy way to ensure that the fonts of generated tikz pictures remains consistent in the diagram? (i.e. so they are all of the same size as the document's default).

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

theo moore
Posts: 72
Joined: Thu Jan 15, 2009 3:16 pm

Re: tikz vs. psfrag

Post by theo moore »

I was wondering if someone had a fix for Question 2? That is, I want to ensure uniformity of diagram annotations in all figures across my document.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

tikz vs. psfrag

Post by localghost »

I would do the whole picture with pgf/tikZ. Looks like you have some kind of diagram where you want to put labels for the axes.


Best regards
Thorsten
theo moore
Posts: 72
Joined: Thu Jan 15, 2009 3:16 pm

tikz vs. psfrag

Post by theo moore »

localghost wrote:I would do the whole picture with pgf/tikZ. Looks like you have some kind of diagram where you want to put labels for the axes.


Best regards
Thorsten
Unfortunately, I decided that it's not realistic to aspire to create all the diagrams in my manuscript with tikz as it was much too time consuming. I'd rather do the broad bits with Inkscape or Illustrator, then use tikz for the annotation and final touches.

You may ask: Why not use Inkscape/Illustrator to create EPS graphics, then annotate using psfrag (which ensures document-sized fonts). The problem here is that a lot of my graphics will then require conversion from PDF to EPS. I've found that these conversion processes are more trouble than they're worth. Therefore, I've decided that I would like a workflow which begins in PDF and ends in PDF (hence, the use of TikZ to annotate)

Personally, I would like to know how book publishers/editors ensure uniformity across their book.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

tikz vs. psfrag

Post by localghost »

In this case it may be better to use the overpic package. You can find the manuals attached to a post in another topic [1]. I think this should do.

[1] View topic: Overlaying text on figure
Post Reply