这是 Inkscape 和/或 LaTeX 的错误还是我遗漏了什么?

这是 Inkscape 和/或 LaTeX 的错误还是我遗漏了什么?

我想包含由inkscape透明度生成的图形。当我更改图形的宽度时,事情变得很奇怪。

您是否注意到了这一点并且有更好的方法来解决?

% This code works fine
\documentclass{article}
\usepackage{graphicx, xcolor}

\begin{document}

%\centering
%\def\svgwidth{6cm}
\input{test.pdf_tex}

\end{document}

在此处输入图片描述

% This code doesn't
\documentclass{article}
\usepackage{graphicx, xcolor}

\begin{document}

%\centering
\def\svgwidth{6cm}
\input{test.pdf_tex}

\end{document}

在此处输入图片描述

这里有一个关联到 生成的文件inkscape

这是TeX由 创建的文件inkscape

%% Creator: Inkscape inkscape 0.48.2, www.inkscape.org
%% PDF/EPS/PS + LaTeX output extension by Johan Engelen, 2010
%% Accompanies image file 'test.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}{476.22402344bp}%
    \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.41427559)%
    \put(0,0){\includegraphics[width=\unitlength]{test.pdf}}%
    \put(0.47641909,0.6172474){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$p\in M$}}}%
  \end{picture}%
\endgroup%

相关内容