答案1
我们可以在不使用 TikZ 和任何 LaTeX 包的情况下完成此操作。这里使用了\pdfliteral
原始的 from :pdftex
\def\vingl#1{\pdfliteral{q #1 .4 w 0 -15 m 0 -4 l 0 0 0 0 4 0 c 15 0 l S Q}}
\def\corners#1{\vbox{\hbox{\vingl{}}\smallskip
\leftskip=1em \rightskip=1em
\noindent #1\par
\hbox to\hsize{\hss\vingl{-1 0 0 -1 0 0 cm}}}}
\corners{%
content content conten conten content content content content conten content content content content content content conten content content content content content content content content content content content content content content content content content content content content content
}
\bye
在 XeTeX 中,声明\def\pdfliteral#1{\special{pdf:literal #1}}
,在 LuaTeX 中,声明\def\pdfliteral{\pdfextension literal}
。
答案2
您可以使用该tcolorbox
包:
\documentclass{article}
\usepackage{tikz}
\usepackage[most]{tcolorbox}
\newtcolorbox{test}{enhanced, interior hidden, frame code={
\draw[rounded corners] (interior.north west)++ (0,-0.5) -- ++(0,0.5) -- ++(0.5,0) ;
\draw[rounded corners] (interior.south east)++ (0,0.5) -- ++(0,-0.5) -- ++(-0.5,0) ;
}}
\begin{document}
\begin{test}
content content content content content content content content content content content content content content content content content content content content content content content content content content content content
\end{test}
\end{document}