Tikzpicture/图形移位

Tikzpicture/图形移位

我在 Inkscape 中创建了一个图形并将其导出到 TeX。我使用贝塞尔曲线绘制曲线。当我将其导入到我的文本中时,文本和图片之间有一个空白,因为一些贝塞尔点超出了图片范围。(参见示例中的负点)

Text
\begin{figure}[htbp]
    \centering
    \begin{tikzpicture}[y=0.80pt,x=0.80pt,yscale=-1, inner sep=0pt, outer sep=0pt]
    \path[draw=black,line join=miter,line cap=butt,line width=0.680pt]
    (40,52) -- (40,311) -- (550,311) --
    (550,52) -- cycle;
    \path[draw=black,dash pattern=on 0.68pt off 0.68pt,line join=miter,line
    cap=butt,miter limit=4.00,line width=0.680pt] (274,311) .. controls
    (402,-3) and (355,-59) .. (495,311);
    \end{tikzpicture}
\end{figure}

有没有办法将整个图片移到这些负值附近,并将空白处与我的文本重叠?如果我将控件减小到正值,曲线对我来说就没用了。

答案1

\fbox{] 仅用于显示实际图像大小。请注意,可以使用同一个矩形进行绘制和裁剪。

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
  \fbox{%
    \begin{tikzpicture}[y=0.80pt,x=0.80pt,yscale=-1, inner sep=0pt, outer sep=0pt]
    \draw[line width=0.680pt,use as bounding box] (40,52) rectangle (550,311);
    \path[draw=black,dash pattern=on 0.68pt off 0.68pt,line join=miter,line
    cap=butt,miter limit=4.00,line width=0.680pt] (274,311) .. controls
    (402,-3) and (355,-59) .. (495,311);
    \end{tikzpicture}%
  }
\end{document}

有界曲线

答案2

你看不清\clip这个数字。

\documentclass{article}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{here}

\begin{document}
Text
\begin{figure}[H]
    \centering
    \begin{tikzpicture}[y=0.80pt,x=0.80pt,yscale=-1, inner sep=0pt, outer sep=0pt]
    \clip[draw] (40,52) rectangle (550,311);
    %\path[draw=black,line join=miter,line cap=butt,line width=0.680pt]
    (40,52) -- (40,311) -- (550,311) --
    (550,52) -- cycle;
    \path[draw=black,dash pattern=on 0.68pt off 0.68pt,line join=miter,line
    cap=butt,miter limit=4.00,line width=0.680pt] (274,311) .. controls
    (402,-3) and (355,-59) .. (495,311);
    \end{tikzpicture}
\end{figure}
text

\end{document}

在此处输入图片描述

相关内容