答案1
这是一个解决方案,带有一个带有 5 个参数的宏\rectonedge
。它基于leftbar
环境的修补版本,来自framed
包和geometry
包。如果需要,带有矩形的部分应该跨页:
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{gillius2}
\usepackage[showframe, verbose]{geometry}
\usepackage{lipsum, framed, xcolor, tabularx, setspace}
\makeatletter
\newenvironment{myleftbar}{%
\def\FrameCommand{\hskip-\Gm@lmargin\color{red}\vrule width\Gm@lmargin\color{black}}%
\MakeFramed {\advance\hsize-\width \FrameRestore}}%
{\endMakeFramed}
\makeatother
\newcommand\rectonedge[5]{%
\begin{myleftbar}
\noindent\begin{tabularx}{0.45\linewidth}{X@{}}
#1 \hfill #2\\[1cm]
\textbf{\LARGE#3} \\[1cm]
\textbf{\Large#4}
\end{tabularx}
\end{myleftbar}
\noindent\parbox{0.45\linewidth}{\bfseries\textcolor{red}{Description}\smallskip\\#5\vskip11pt}
\newline%
}%
\begin{document}
\sffamily
\rectonedge{text1}{text2}{TEXT3Bold}{Text4}{Nulla malesuada porttitor diam. Donec felis erat, congue non, volutpat at, tincidunt tristique,
libero. Vivamus viverra fermentum felis.}
\lipsum[2]
\end{document}