1

Is it possible to have an vertical line which covers the second environment to mark the indent? I have no idea how to do that and would be grateful for any hint. Thanks a lot.

enter image description here

\documentclass[12pt]{scrartcl}
\usepackage{enumitem}
\begin{document}
\begin{description}
\item[A] ooo
\begin{description}
\item[1] xxx
\item[2] xxx
\end{description}
\item[B] ooo
\end{description}
\end{document}  

2 Answers 2

3

You can use tcolorboxenvironment to tcolorboxize any defined environment

\documentclass[12pt]{scrartcl}
\usepackage[most]{tcolorbox}
\usepackage{enumitem}

\newenvironment{mydesc}{%
    \begin{description}}{\end{description}}

\tcolorboxenvironment{mydesc}{blanker,
    borderline west={1mm}{-3mm}{black}}

\begin{document}
\begin{description}
\item[A] ooo
\begin{mydesc}
\item[1] xxx
\item[2] xxx
\end{mydesc}
\item[B] ooo
\end{description}
\end{document} 

enter image description here

1
  • This is really great. Thanks a lot. It works very well.
    – C.-P.
    Apr 16, 2018 at 15:37
0

Just an idea with tikz:

\documentclass[12pt]{scrartcl}
\usepackage{enumitem}
\usepackage{tikz}
\usetikzlibrary{calc}
\def\tikzmark#1{\begin{tikzpicture}[remember picture]\coordinate(#1);\end{tikzpicture}}
\makeatletter
\def\mfontsize{\f@size}
\makeatother
\begin{document}
\begin{description}
\item[A] ooo
\begin{description}
\item[1] \tikzmark{A}xxx
\item[2]\tikzmark{B} xxx
\end{description}
\item[B] ooo
\end{description}
\begin{tikzpicture}[overlay,remember picture]
\draw[ultra thick]([xshift=-1cm, yshift=\mfontsize pt]A.north west)--([xshift=-1cm,yshift=-{0.6*\mfontsize} pt]B.south west);
\end{tikzpicture}
\end{document}  

enter image description here

If you want to use something like this, we can "automate the procedure" by creating a new environment that will contain the needed code

1
  • Thanks a lot also, I did not get it working with multiple descriptions. But this may be my fault.
    – C.-P.
    Apr 16, 2018 at 15:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .