答案1
欢迎来到 TeX.SX!您可以尝试tcolorbox
:
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\NewTColorBox{focuscomponent}{ O{} m m }{
enhanced,
frame empty,
boxsep=13.5pt,
left=0pt,
right=0pt,
top=0pt,
bottom=0pt,
middle=0pt,
colback=white!0,
coltitle=black,
segmentation style={solid, black},
fontupper=\itshape,
fontlower=\itshape,
overlay={
\draw (interior.south east) -- (interior.south west) --
([yshift=2pt]interior.north west) --
([yshift=2pt]interior.north east);
\draw (interior.north west) -- (interior.north east);
\node[font=\itshape, anchor=base west, fill=white, inner sep=3.5pt]
at ([xshift=10pt]interior.north west) {#2};
\node[font=\itshape, anchor=base east, fill=white, inner sep=3.5pt]
at ([xshift=-10pt]interior.north east) {#3};
},
}
\NewDocumentEnvironment{focusitemize}{ }{
\begin{list}{}{
\renewcommand\makelabel[1]{\normalfont\sffamily ##1}
\setlength{\leftmargin}{3em}
\setlength{\itemindent}{0pt}
\setlength{\labelsep}{0pt}
\setlength{\labelwidth}{3em}
}
}{
\end{list}
}
\begin{document}
\begin{focuscomponent}{Name}{Frame\_Labels}
\begin{focusitemize}
\item[in] Input\_Declarations
\item[out] Output\_Declarations
\end{focusitemize}
\tcblower
Body
\end{focuscomponent}
\end{document}