我怎样才能画出这些类型的线条?

我怎样才能画出这些类型的线条?

在此处输入图片描述

我怎样才能画出这些类型的线条?

答案1

您的问题与这个问题非常相似:如何在乳胶中获取盒子的角落?

\documentclass{book}
\usepackage{setspace}
\usepackage[most]{tcolorbox}
\newtcolorbox{mybox}[1][]{%
  enhanced,
  opacityback=0, 
  top=10pt,
  bottom=8pt,
  code={\doublespacing},% from https://tex.stackexchange.com/a/211919/101651
  parbox=false,% from https://tex.stackexchange.com/a/228299/101651
  frame hidden,% from https://tex.stackexchange.com/a/247509/101651
  % from https://tex.stackexchange.com/a/431760/101651:
  overlay unbroken and first ={%
    \draw[thick, double] ([xshift=20pt]frame.north west) -| ([yshift=-20pt]frame.north west);
    \draw[thick, double] ([xshift=-20pt]frame.south east) -| ([yshift=20pt]frame.south east);
  }
}
\begin{document}\pagecolor{yellow!40}% from https://tex.stackexchange.com/a/25141/101651
\begin{mybox}
    Next time please add a minimal working example, that is a complete but as short as possible \LaTeX\ document which shows what you tried so far.

    Something to show indentation. Something to show indentation. Something to show indentation. Something to show indentation.
\end{mybox}
\end{document}

在此处输入图片描述

编辑: 如果只希望框中的背景颜色,请省略\pagecolor{yellow!40}opacityback=0,然后添加 colback=yellow!40

我还添加了,sharp corners因为圆角是 的默认设置tcolorbox

\documentclass{book}
\usepackage{setspace}
\usepackage[most]{tcolorbox}
\newtcolorbox{mybox}[1][]{%
  enhanced,
  top=10pt,
  bottom=8pt,
  code={\doublespacing},% from https://tex.stackexchange.com/a/211919/101651
  parbox=false,% from https://tex.stackexchange.com/a/228299/101651
  frame hidden,% from https://tex.stackexchange.com/a/247509/101651
  sharp corners,
  colback=yellow!40,
  % from https://tex.stackexchange.com/a/431760/101651:
  overlay unbroken and first ={%
    \draw[thick, double] ([xshift=20pt]frame.north west) -| ([yshift=-20pt]frame.north west);
    \draw[thick, double] ([xshift=-20pt]frame.south east) -| ([yshift=20pt]frame.south east);
  }
}
\begin{document}
\begin{mybox}
    Next time please add a minimal working example, that is a complete but as short as possible \LaTeX\ document which shows what you tried so far.

    Something to show indentation. Something to show indentation. Something to show indentation. Something to show indentation.
\end{mybox}
\end{document}

在此处输入图片描述

相关内容