![防止人物在“独立”类中被剪掉](https://linux22.com/image/370639/%E9%98%B2%E6%AD%A2%E4%BA%BA%E7%89%A9%E5%9C%A8%E2%80%9C%E7%8B%AC%E7%AB%8B%E2%80%9D%E7%B1%BB%E4%B8%AD%E8%A2%AB%E5%89%AA%E6%8E%89.png)
我正在编写一个脚本来提取 LaTeX 生成的图像并将其保存为 PDF 文件。我遇到了图像太大的问题。这是我的 MWE:
\documentclass[varwidth]{standalone}
\usepackage{amsmath}
\begin{document}
\setlength{\unitlength}{1cm}
\begin{picture}(17,5)(-1.5,0)
\thicklines
\put(1.2,3.5){$x_7$}
\put(1.2,1){$x_7$}
\put(2,3.5){\line(2,-1){1}}
\put(2,1){\line(2,1){1}}
\put(3,1.5){\line(0,1){1.5}}
\put(3,1.5){\circle*{0.15}}
\put(3,3){\circle*{0.15}}
\put(3,3){\line(2,1){1}}
\put(3,1.5){\line(2,-1){1}}
\put(4.2,3.5){$\theta^i$}
\put(4.2,1){$\theta^j$}
\put(3.2,2.2){$\theta$}
\put(6,2.2){\bf+}
\put(8.2,3.5){$x_7$}
\put(8.2,1){$x_7$}
\put(9,3.5){\line(2,-1){1}}
\put(9,1){\line(2,1){1}}
\put(10,1.5){\line(0,1){1.5}}
\put(10,1.5){\circle*{0.15}}
\put(10,3){\circle*{0.15}}
\put(10,3){\line(1,-2){1}}
\put(10,1.5){\line(1,2){1}}
\put(11.2,3.5){$\theta^i$}
\put(11.2,1){$\theta^j$}
\put(9.6,2.2){$\theta$}
\end{picture}
\end{document}
当我用 pdflatex 编译它时,我获得了一个剪切图像:
我可以阻止它吗?
答案1
只是不要使用varwidth
,这是没有必要的。该\setlength
命令属于前言。
该命令\bf
已被弃用 25 年
\documentclass{standalone}
\usepackage{amsmath}
\setlength{\unitlength}{1cm}
\begin{document}
\begin{picture}(17,5)(-1.5,0)
\thicklines
\put(1.2,3.5){$x_7$}
\put(1.2,1){$x_7$}
\put(2,3.5){\line(2,-1){1}}
\put(2,1){\line(2,1){1}}
\put(3,1.5){\line(0,1){1.5}}
\put(3,1.5){\circle*{0.15}}
\put(3,3){\circle*{0.15}}
\put(3,3){\line(2,1){1}}
\put(3,1.5){\line(2,-1){1}}
\put(4.2,3.5){$\theta^i$}
\put(4.2,1){$\theta^j$}
\put(3.2,2.2){$\theta$}
\put(6,2.2){\textbf{+}}
\put(8.2,3.5){$x_7$}
\put(8.2,1){$x_7$}
\put(9,3.5){\line(2,-1){1}}
\put(9,1){\line(2,1){1}}
\put(10,1.5){\line(0,1){1.5}}
\put(10,1.5){\circle*{0.15}}
\put(10,3){\circle*{0.15}}
\put(10,3){\line(1,-2){1}}
\put(10,1.5){\line(1,2){1}}
\put(11.2,3.5){$\theta^i$}
\put(11.2,1){$\theta^j$}
\put(9.6,2.2){$\theta$}
\end{picture}
\end{document}