![调整小页面一侧的边框](https://linux22.com/image/390844/%E8%B0%83%E6%95%B4%E5%B0%8F%E9%A1%B5%E9%9D%A2%E4%B8%80%E4%BE%A7%E7%9A%84%E8%BE%B9%E6%A1%86.png)
我有一个迷你页面,左侧是文字,右侧是图片。我想调整左侧,使文字的左右两侧留出 2cm 宽的空间,但右侧(包含图片的位置)的迷你页面应保持原样。
我的代码是:
\begin{minipage}{.4\linewidth}
\vspace{10cm}
Text on several lines. Text on several lines.
Text on several lines. Text on several lines.
Text on several lines. Text on several lines.
Text on several lines. Text on several lines.
Text on several lines. Text on several lines.
\vspace{10cm}
\end{minipage}\hfill
\begin{minipage}{.5\linewidth}
\includegraphics{image}
\end{minipage}
我怎样才能实现这个目标?
答案1
我希望我理解你的问题是正确的。一种方法是只\hspace{1cm}
在 的左侧和右侧添加。当你用所有s、s 和填充符minipage
组装一条逻辑水平线时,这种方法是有效的。\hspace
minipage
根据您的实际使用情况,也可以使用增加左右边距的引用环境。最后,您可以minipage
使用包来框选并在任意一侧添加边距adjustbox
。
\documentclass{article}
\usepackage{graphicx}
\usepackage{calc}
\usepackage{mwe}% for example text only
\begin{document}
\blindtext
\par\noindent
\hspace{1cm}%
\begin{minipage}{.4\linewidth-2cm}
\vspace{1cm}
Text on several lines. Text on several lines.
Text on several lines. Text on several lines.
Text on several lines. Text on several lines.
Text on several lines. Text on several lines.
Text on several lines. Text on several lines.
\vspace{1cm}
\end{minipage}%
\hspace{1cm}%
\begin{minipage}{.6\linewidth}
\includegraphics[width=\linewidth]{example-image}
\end{minipage}
\blindtext
\end{document}