Edit: I am not happy with the 3 answers my first, smaller bounty got me. So I rewrote the question to set clear rules and a proper bounty.
The solution should create two environments, originalemail and response with the following effects:
- The
originalemail-environment can be wrapped around normal LaTeX code, which might include lists, sections, etc, and that is then typeset normally, but in a way that slightly (4pt) indents all text and adds a vertical line on the left. - The
responseenvironment can be used inside theoriginalemailenvironment and results in the vertical line being broken and the contained text/code being aligned on the left without theoriginalemails indentation. Theresponsehas to be aligned to the left margin, irrespective of where in theoriginalemailit is placed (e.g., within a (nested)itemizeorenumerate).
Summary
- leave the layout of the original email in-tact (it should be possible to use sections, lists, paragraphs, floats, etc. as if it as was a plain TeX document and there were no responses and the numbering should be the same with and without respones)
- using these environments should require no editing of the code after
\begin{document}, outside theresponseenvironment. In particular any suspension or resume ofenumerateoritemizeenvironments---if required by the solution---should be automatic. - The only way in which the original layout should change is that it show vertical line (
2pt) on the left margin and ideally a slight indentation (4pt). - responses and the fragments of the original email have to break pages as normal. (if you use
parboxfor the responses they wont) - allow to insert
\replys anywhere in the the original text - bonus if the solution is nesteable (i.e. the outer
originalemailcontains an olderoriginalemailand responses)
Rules: for the bounty, you're free to build on the existing answers, i.e. @marmot's/Gonzalo Medina's TikZ approach to draw the line in the left margin, @Vinccool96's tcolorbox or my own rudimentary approach to automatically suspending and resuming lists.
Screenshot from Gmail that roughly summarizes what I need:

Input example
This is a simple example of the document I am starting with. It is a standard LaTeX document, which I wrap into \begin{originalemail}...\end{originalemail}. Next I need to add my responses to it, but this should work context-independent (i.e. without manually tracking which other environments are currently open, which is why the answer by @Vinccool96 was not accepted)
Of course you may edit the preamble in order to define the new environments.
\documentclass{article}
%you may add code here
\begin{document}
%you may add code here
\begin{originalemail}
%inside this, the only change I can make to the code may be within
% \begin{response}...\end{response}
Text text text text text text
\section{Text text text}
Text text
\begin{enumerate}
\item text
\begin{itemize}
\item text
\item text
\end{itemize}
\item text
\item text
\end{enumerate}
\end{originalemail}
\end{document}
The new enviroments should allow me to use \begin{response}my response\end{response} anywhere inside the orininalemail and achieve the desired layout break.
As pointed out by @Vinccool96, in order to break out out nested originalemails it might be neccessary to pass an argument \begin{response}[2] to indicate the number of levels it should break out of. But nesting is only a bonus.



tcolorboxinstead ofmdframed.tcolorboxis actively maintained and has an awesome manual whilemdframeddevelopment seems to have stalled a while ago. – moewe Mar 20 '19 at 16:31\embed. So are you looking to suspend the embed to provide a response and then continue the enumeration where it left off? – Steven B. Segletes Mar 20 '19 at 16:37\responseenvironment to draw a box with a white border on the left to cover up the pre-drawn line? – Willie Wong Mar 21 '19 at 13:31todonotespackage. (I.e. this package doesn't do the "bar in the left margin" thing, but might be of greater help for what you ultimately want to do. See notably inline notes.) See alsochangespackage. – ebosi Mar 28 '19 at 11:13changebarpackage. – ebosi Mar 28 '19 at 11:19changesandchangebarandtonotespackages are useful, but they all do not fully achieve what I am trying to achieve (e.g. thechange(bar|s)package does not keep the orignal numberin in the enumerates, which is important for me) – sheß Mar 28 '19 at 12:11responseknow how manyemaildepth it should get out of? You would need an entire package. – Vinccool96 Mar 31 '19 at 16:44itemizeandenumerate. It could even be in anitemize, which is in anenumerate, which is anitemize, which is in anenumerate, which is anitemize. How would it know? – Vinccool96 Mar 31 '19 at 16:58\@currenvir(https://tex.stackexchange.com/questions/18652/how-can-i-check-if-the-current-code-is-inside-a-certain-environment). – sheß Mar 31 '19 at 17:17