Я написал небольшой макрос под названием unclip.
Используется со всеми строчными буквами, он заканчивает список, записывает заданное содержимое и возобновляет список.В верхнем регистре U он собирает номер перечисления перед записью содержимого и восстанавливает его при возобновлении списка.
\newcommand{\unclip}[2][enumerate]{\end{#1}#2\begin{#1}}%
\makeatletter
\newcommand{\Unclip}[2][enumerate]{%
\@ifundefined{c@saveenum@\romannumeral\@enumdepth}% create temporary counter
{\newcounter{saveenum@\romannumeral\@enumdepth}}{}%
\setcounter{saveenum@\romannumeral\@enumdepth}% store item number
{\value{enum\romannumeral\@enumdepth}}%
\end{#1}#2\begin{#1}% end list, write content, resume
\setcounter{enum\romannumeral\@enumdepth}% restore item number
{\value{saveenum@\romannumeral\@enumdepth}}}%
\makeatother
Вы можете сложить его для нескольких уровней.Имейте в виду, что это может привести к ошибке, если вы сложите ее, если вы не используете \ item [] после каждого внутреннего вызова.Он все равно будет скомпилирован.
Обширный пример:
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\newcommand{\unclip}[2][enumerate]{\end{#1}#2\begin{#1}}%
\makeatletter
\newcommand{\Unclip}[2][enumerate]{%
\@ifundefined{c@saveenum@\romannumeral\@enumdepth}% create temporary counter
{\newcounter{saveenum@\romannumeral\@enumdepth}}{}%
\setcounter{saveenum@\romannumeral\@enumdepth}% store item number
{\value{enum\romannumeral\@enumdepth}}%
\end{#1}#2\begin{#1}% end list, write content, resume
\setcounter{enum\romannumeral\@enumdepth}% restore item number
{\value{saveenum@\romannumeral\@enumdepth}}}%
\makeatother
\begin{document}
\begin{itemize}
\item TestItem A
\begin{description}
\item[preparation] No Item-number yet, so only smallercase unclip
\item[test] and action:
\unclip[description]{This should be below \textit{TestItem A}}
\item[Test] And now inside a enumeration:
\begin{enumerate}
\item One
\item Two
\Unclip{This should be under \textit{Test}}
\item Three
\Unclip{But now we are stacking, by calling
\textbackslash Unclip\{\textbackslash unclip[description]\{text\}\}
\unclip[description]{so this should be under \textit{TestItem A}
\\Be aware it will raise an error, eventhough it works fine.
\unclip[itemize]{And while you can have text in front of an inner unclip,
doing it the other way round would seriously fuck up your layout.}}}
\item Four
\begin{enumerate}
\item Unus
\item Duo
\item Tres
\Unclip{Yes, you can \Unclip{unclip multiple
\unclip[description]{levels just fine.
\unclip[itemize]{Still works. :-)}}}}
\item Quattuor
\Unclip{\Unclip{\unclip[description]{\unclip[itemize]{By the way:}
\item[]You can get rid of the errors,}\item[and] stack it back in}
\item[] by using \textbackslash item[] after the inner unclips}
\item Quinque
\item \dots
\end{enumerate}
\end{enumerate}
\end{description}
\item TestItem B
\end{itemize}
\end{document}
Надеюсь, это поможет.Приветствия.