“圖片”環境產生的裁切圖形

“圖片”環境產生的裁切圖形

我在 MWE 得到了這篇文章:

\documentclass[11pt]{article}
\usepackage{amsmath}

\begin{document}
My equation
\begin{equation*}
  \setlength{\unitlength}{1cm}
  \fbox{\begin{picture}(17,5)(-1.5,0)
      \thicklines
      \put(3.2,3){$x_5$}
      \put(3.2,1){$x_6$}
      \put(4,3){\line(1,-1){1}}
      \put(4,1){\line(1,1){1}}
      \put(5,2){\circle*{0.15}}
      \put(5,2){\line(1,0){2}}
      \put(5.9,1.5){$x_9$}
      \put(7,2){\circle*{0.15}}
      \put(7,2){\line(1,1){1}}
      \put(7.6,2.2){$x_8$}
      \put(8,3){\line(2,1){1}}
      \put(8,3){\line(2,-1){1}}
      \put(8,3){\circle*{0.15}}
      \put(9.3,3.5){$x_9$}
      \put(9.3,2.3){$x_7$}
      \put(7,2){\line(2,-1){2}}
      \put(9.3,0.9){$x_7$}
  \end{picture}}
\end{equation*}

\end{document}

這產生了這個佈局(垂直紅線來自 xdvi 檢視器): 在此輸入影像描述

我的問題是:如何裁剪圖形(刪除周圍的多餘空間)?

答案1

在此輸入影像描述

圖片的大小是在環境選項中指定的,你的17讓它尺寸過大

\documentclass[11pt]{article}
\usepackage{amsmath}

\begin{document}
My equation
\begin{equation*}
  \setlength{\unitlength}{1cm}
  \fbox{\begin{picture}(7,3.5)(3,0.5)
      \thicklines
      \put(3.2,3){$x_5$}
      \put(3.2,1){$x_6$}
      \put(4,3){\line(1,-1){1}}
      \put(4,1){\line(1,1){1}}
      \put(5,2){\circle*{0.15}}
      \put(5,2){\line(1,0){2}}
      \put(5.9,1.5){$x_9$}
      \put(7,2){\circle*{0.15}}
      \put(7,2){\line(1,1){1}}
      \put(7.6,2.2){$x_8$}
      \put(8,3){\line(2,1){1}}
      \put(8,3){\line(2,-1){1}}
      \put(8,3){\circle*{0.15}}
      \put(9.3,3.5){$x_9$}
      \put(9.3,2.3){$x_7$}
      \put(7,2){\line(2,-1){2}}
      \put(9.3,0.9){$x_7$}
  \end{picture}}
\end{equation*}

\end{document} 

相關內容