Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

To input figures directly from Inkscape I write this in a figure environment

\centering
\def\svgwidth{0.5\columnwidth}
\input{name.pdf_tex}

However, I would like to be able to just use a macro instead where the desired width is a variable, but I'm not sure how to do this?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted
\newcommand\myimg[2]{%
\centering
\def\svgwidth{#1}%
\input{#2}}



\myimg{0.5\columnwidth}{name.pdf_tex}
share|improve this answer
    
Thanks, exactly what I was looking for. –  Anders Oct 17 '12 at 14:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.