答案1
我确信有更奇特的方法tcolorbox
,但是在这里,我提供xyminipage
环境来指定内容所在字段的 xy 尺寸和(可选)颜色。
已编辑以提供\xyminipagemargin
支持\headerrule
,并\sffamily
模仿 OP 的问题。
\documentclass{standalone}
\usepackage{xcolor,graphicx}
\newenvironment{xyminipage}[3][white]
{%
\begin{minipage}{#2}%
\begin{minipage}[t]{0pt}%
\textcolor{#1}{\rule[-\dimexpr#3-\baselineskip]{#2}{#3}}%
\end{minipage}%
\hspace{\xyminipagemargin}%
\begin{minipage}[t]{\dimexpr#2-2\xyminipagemargin}%
\sffamily\ignorespaces
}{%
\end{minipage}%
\hspace{\xyminipagemargin}%
\end{minipage}%
\ignorespacesafterend
}
\newcommand\mylinebreak{\\[-.9pt]}
\newlength\xyminipagemargin
\setlength\xyminipagemargin{15pt}
\newcommand\headerrule[1]{\sbox0{#1}#1\par\hspace{-\xyminipagemargin}%
\rule[3pt]{\dimexpr\xyminipagemargin+\wd0}{2.5pt}\par}
\begin{document}\noindent
\begin{minipage}{7in}% THIS IS YOUR PDF WIDTH
\begin{xyminipage}[green!50!black]{4in}{3in}
\color{white}
\headerrule{This is my content}
It does not take the full height
\end{xyminipage}
\begin{xyminipage}[black!70]{3in}{3in}
\color{white}
\headerrule{This is my right-box content}
It also does not take the full height
\vspace{1in}
But if it is a different height, the box heights still match.
\end{xyminipage}
\mylinebreak
\includegraphics[width=7in,height=2in]{example-image}
\mylinebreak
\begin{xyminipage}[cyan!10]{7in}{1in}
\headerrule{This is my otherwise very longish titled content}
It does not take the full height
\end{xyminipage}
\end{minipage}
\end{document}
答案2
它看起来像一本小册子或一份演示文稿。您应该使用 latex 包 beamer。TikZ 用于绘制图表和插图,您可以将其包含在其他 Latex 类中,如文章、报告、演示文稿、海报等。在发布的示例中,我认为不需要绘制任何东西。您只需以视觉上吸引人的方式排列文本和图形即可。
比默非常完美。您一定会喜欢这个输出。
永不离开$\LaTeX$ 梦幻之地