![用盒子包装照片](https://linux22.com/image/427274/%E7%94%A8%E7%9B%92%E5%AD%90%E5%8C%85%E8%A3%85%E7%85%A7%E7%89%87.png)
\documentclass{article}
\usepackage{graphicx}
\usepackage{fancybox}
\graphicspath{ {d:/pics/} }
\begin{document}
\begin{figure}
\fbox{\centerline{\includegraphics[scale=0.25]{example-image-a}}}
\caption{Picture 1}
\vspace{1in}
\shadowbox{\centerline{\includegraphics[scale=0.25]{example-image-a}}}
\caption{Picture 2}
\end{figure}
\end{document}
我正在尝试用盒子包裹图片。我想知道如何改变盒子本身的大小。
答案1
您好,欢迎来到 Tex。对于第一个,我推荐framebox(){}
。对于 shadowbox,只需删除\centerline
并在 之后添加 \centering \begin{figure}
。参见下面的代码。这就是您想要的吗?
\documentclass{article}
\usepackage{graphicx}
\usepackage{fancybox}
\graphicspath{ {d:/pics/} }
\begin{document}
\begin{figure}
\centering
\framebox(90,70){{\includegraphics[scale=0.25]{example-image-a}}}
\caption{Picture 1}
\vspace{1in}
\shadowbox{{\includegraphics[scale=0.25]{example-image-a}}}
\caption{Picture 2}
\end{figure}
\end{document}