Graphics, Figures & Tablesdifferent text in figure (inkscape)

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
xbender
Posts: 9
Joined: Thu Aug 26, 2010 10:39 pm

different text in figure (inkscape)

Post by xbender »

Hi,

Im using the new version of Inkscape, with which I have draw a graphics and labeled them. New Inkscape allows to export the graphics itself in pdf format and the text (labels) in tex file. In this file is an inputgraphics command and bunch of put commands that put together a desired graphics with lables.

So have have something like this:

Code: Select all

\begin{figure}
\caption{text}
\input{file.pdf_tex}
\end{figure}
Now because there is a lot of text in the pdf_tex (and it can be expected that the pdf_tex file will be re-generated several times) I would like to ask if I can change the size of the text from the figure command itself. that is, can I change the size of the text which is imported with figure right in the figure environment?
I would like to avoid making any changes to the pdf_tex file as I will be overwriting it quite often and I dont want to go into it every time....

thank you for the advice
Last edited by xbender on Mon Feb 07, 2011 11:59 pm, edited 1 time in total.

Recommended reading 2024:

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

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

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

different text in figure (inkscape)

Post by frabjous »

Without seeing an example file.pdf_tex, it is hard to know. You could try:

Code: Select all

\begin{figure}
\caption{text}
\large
\input{file.pdf_tex}
\end{figure}
or similar and see if that works, but who knows? But even if you solve that problem, won't having a larger font size change what the right placement of the text would/should be?
php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

different text in figure (inkscape)

Post by php1ic »

Can you post a very simple example .pdf_tex file with lines and text, that might make it easier to help.

Without knowing the format you could try wrapping the \input{} in a "small" environment.

Code: Select all

\begin{figure}
\caption{text}
\begin{small}
\input{file.pdf_tex}
\end{small}
\end{figure}
What system are you on unix or windows?

EDIT: Beaten to the punch :-)
xbender
Posts: 9
Joined: Thu Aug 26, 2010 10:39 pm

different text in figure (inkscape)

Post by xbender »

thank you and sorry, I should have done this right the first time....here is the example of pdf and pdt_tex file...

The forum did not allow me to attach file extension "*.pdf_tex" so I had to rename it to simple tex. Please, rename the file salmon-prices.tex to salmon-prices.pdf_tex

my real code is then:

Code: Select all

\begin{figure}[h]
\caption{Price of Scottish and Norwegian salmon in the UK}
\def\svgwidth{350pt}
\input{salmons-prices.pdf_tex} 
\end{figure}
as you can see, the figures are too big to the graph and I would like to make them smaller.

thank you!

ps: neither \small nor the small environment work....
Attachments
salmons-prices.tex
(5.99 KiB) Downloaded 479 times
salmons-prices.pdf
(30.11 KiB) Downloaded 350 times
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

different text in figure (inkscape)

Post by frabjous »

Well, no offense, but you're still not doing it "right", because you still haven't provided a minimal working example -- see the Post on Avoidable Mistakes.

Maybe it would help to see a full example for the parent document, but otherwise, I don't see the problem. I did:

Code: Select all

\documentclass{article}
\usepackage{graphicx}
\usepackage{color,transparent}
\begin{document}
\begin{figure}[h]
\caption{Price of Scottish and Norwegian salmon in the UK}
\def\svgwidth{350pt}
\small
\input{salmons-prices}
\end{figure}
\end{document}
And the "\small" definitely made a difference... though not really enough of a difference, so you might consider \tiny or even smaller, e.g. (note I added the anyfontsize package):

Code: Select all

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{color,transparent}
\usepackage{anyfontsize}
\begin{document}
\begin{figure}[h]
\caption{Price of Scottish and Norwegian salmon in the UK}
\def\svgwidth{350pt}
\fontsize{4}{6}\selectfont
\input{salmons-prices}
\end{figure}
\end{document}
xbender
Posts: 9
Joined: Thu Aug 26, 2010 10:39 pm

Re: different text in figure (inkscape)

Post by xbender »

thank you, that have actually worked! (not that I would doubt it before.. :-)
You were right that using the font size even in the figure environment makes a difference...I just didnt change the font size so much that I would notice right away...using \tiny makes it really obvious.

thank you for the help! :-)
Post Reply