3

I'm doing my draws using inkscape, but when put them in LaTeX, the text appears randomly. The following picture is the draw that I made in inkscape

Draw from inkscape

The code that I use to put it in LaTeX is:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{graphicx}
\begin{document}

\def\svgwidth{0.4\textwidth}
\input{Paletas.pdf_tex}

\end{document}

And the result is this

Paletas LaTeX

I tried to change the width, but the text still being away from the center.

Anyone can help me??

EDIT: I'm uploading the code of Paletas.pdf_tex

%% Creator: Inkscape 0.91_64bit, www.inkscape.org
%% PDF/EPS/PS + LaTeX output extension by Johan Engelen, 2010
%% Accompanies image file 'Paletas.pdf' (pdf, eps, ps)
%%
%% To include the image in your LaTeX document, write
%%   \input{<filename>.pdf_tex}
%%  instead of
%%   \includegraphics{<filename>.pdf}
%% To scale the image, write
%%   \def\svgwidth{<desired width>}
%%   \input{<filename>.pdf_tex}
%%  instead of
%%   \includegraphics[width=<desired width>]{<filename>.pdf}
%%
%% Images with a different path to the parent latex file can
%% be accessed with the `import' package (which may need to be
%% installed) using
%%   \usepackage{import}
%% in the preamble, and then including the image with
%%   \import{<path to file>}{<filename>.pdf_tex}
%% Alternatively, one can specify
%%   \graphicspath{{<path to file>/}}
%% 
%% For more information, please see info/svg-inkscape on CTAN:
%%   http://tug.ctan.org/tex-archive/info/svg-inkscape
%%
\begingroup%
  \makeatletter%
  \providecommand\color[2][]{%
    \errmessage{(Inkscape) Color is used for the text in Inkscape, but the package 'color.sty' is not loaded}%
    \renewcommand\color[2][]{}%
  }%
  \providecommand\transparent[1]{%
    \errmessage{(Inkscape) Transparency is used (non-zero) for the text in Inkscape, but the package 'transparent.sty' is not loaded}%
    \renewcommand\transparent[1]{}%
  }%
  \providecommand\rotatebox[2]{#2}%
  \ifx\svgwidth\undefined%
    \setlength{\unitlength}{258.49033203bp}%
    \ifx\svgscale\undefined%
      \relax%
    \else%
      \setlength{\unitlength}{\unitlength * \real{\svgscale}}%
    \fi%
  \else%
    \setlength{\unitlength}{\svgwidth}%
  \fi%
  \global\let\svgwidth\undefined%
  \global\let\svgscale\undefined%
  \makeatother%
  \begin{picture}(1,1.7028689)%
    \put(0,0){\includegraphics[width=\unitlength,page=1]{Paletas.pdf}}%
    \put(-0.00468465,0.01184764){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$L_{1}=4,3\ cm$}}}%
    \put(0.18499846,0.2154351){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$i=1$}}}%
    \put(0.18499846,0.60902075){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$i=2$}}}%
    \put(0.18499846,1.0026064){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$i=3$}}}%
    \put(0.18499846,1.39619206){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$i=4$}}}%
    \put(0.59258631,0.21557111){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$b=1,6\ cm$}}}%
  \end{picture}%
\endgroup%
4
  • Well, you forgot to upload Paletas.pdf_tex.
    – Johannes_B
    Commented Aug 2, 2016 at 8:18
  • \put(-0.00468465,0.01184764){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$L_{1}=4,3\ cm$}}}% See that line? Change the very first value from minus point something to point one. Play with the value a bit.
    – Johannes_B
    Commented Aug 2, 2016 at 11:54
  • 1
    Is the text $L_{1}= ... $ [and the rest] set as Align center (i.e. centered text) in Inkscape? Can't test now.
    – alwaysask
    Commented Aug 2, 2016 at 13:05
  • Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. Commented Sep 26, 2017 at 16:46

1 Answer 1

6

Thanks to @Johannes_B and @alwaysask. I tried the @alwaysask's way. I went to the inkscape file, and centered the text using the distribution tool, but I used the center text option from text controls (Shift+Ctrl+T), and it works

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .