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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.