答案1
您可以使用tcolorbox
来获取此格式。这是一个 MWE。
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{skins,hooks}
% Only if you want to change font
\usepackage{fontspec}
\setmainfont{Roboto}
\newcommand\fancybox[3]{%
\tcbset{
mybox/.style={
enhanced,
boxsep=0mm,
opacityfill=0,
overlay={
\coordinate (X) at ([xshift=-1mm, yshift=-1.5mm]frame.north west);
\node[align=right, text=#1, text width=2.5cm, anchor=north east] at (X) {#2};
\draw[line width=0.5mm, color=#1] (frame.north west) -- (frame.south west);
}
}
}
\begin{tcolorbox}[mybox]
#3
\end{tcolorbox}
}
\definecolor{MyPink}{HTML}{7F007F}
\definecolor{MyGrey}{HTML}{838383}
\definecolor{MyGreen}{HTML}{02856B}
\begin{document}
\fancybox{MyPink}{Define Situation}{
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley
}
\noindent
\color{MyGrey}{\em It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.}
\fancybox{MyGreen}{A Numbered List}{
Some writing before list:
\begin{enumerate}
\item Contrary to popular belief, Lorem Ipsum is ..
\item Lorem Ipsum passages, and more recently
\item Lorem Ipsum has been the industry
\end{enumerate}
}
\end{document}
这将生成:
答案2
开始的想法:
\documentclass{article}
\usepackage{xcolor}
\begin{document}
{\color{magenta}
\parbox{.2\linewidth}{bla...}%
\hfill\vrule width 2pt }\hfill
\parbox[t]{.7\linewidth}{bla... }
\end{document}