Email-style reply layout: Vertical line in left margin, except for reply environment












2















I have a long LaTeX document, with nested enumerations and sections. It is important that I keep the numbering, structures as they are, but I want to insert replies that are visually different from the original text. I also would like to achieve this without excessive fiddling in the original code, but instead simply introduce a new reply command or environment.



To be easily understood by people it would be great if the reply layout would imitate email reply layout, i.e., add a vertical line (or a ">") on the left margin to all original content, but keep it blank whenever the reply is used.



I was able to achieve the opposite with mdframed, but I cannot simply switch this around as this would break the orignal text's lists and sectioning.



documentclass{article}
newcommand{response}[1]{
begin{mdframed}[ linewidth=2pt,
topline=false,
rightline=false,
bottomline=false
,linecolor=black, innerleftmargin =0cm, leftmargin=-2pt, innerrightmargin=0cm]
mdseries
{#1}
end{mdframed}}


usepackage{mdframed}
begin{document}
Some text, with pictures, lists, sections
begin{enumerate}
item Some text, with pictures, lists, sections
response{answer1}
item Some text, with pictures, lists, sections
response{answer2}
end{enumerate}
Some text, with pictures, lists, sections
response{this is my answer}
Some text, with pictures, lists, sections
section{section}
subsection{subsection1}
Some text, with pictures, lists, sections
subsection{subsection2}
Some text, with pictures, lists, sections
subsection{subsection3}
Some text, with pictures, lists, sections
response{I also have an answer here}
end{document}


enter image description here










share|improve this question




















  • 1





    Maybe related: tex.stackexchange.com/questions/68251/…

    – Steven B. Segletes
    yesterday






  • 2





    Not a solution, but if you are looking into this I would try to use tcolorbox instead of mdframed. tcolorbox is actively maintained and has an awesome manual while mdframed development seems to have stalled a while ago.

    – moewe
    yesterday











  • @Steven B. Segletes, Certainly related, but different, because it does not allow me to insert replies wherever I want. I can't write embed{ text begin{enumerate} item item1 } response.

    – sheß
    yesterday






  • 2





    @sheß Could you clarify? One can indeed put enumerations inside the 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
    yesterday






  • 1





    What if you just draw a line on the left margin (using a suitably prepared background image perhaps), and use your defined response environment to draw a box with a white border on the left to cover up the pre-drawn line?

    – Willie Wong
    15 hours ago
















2















I have a long LaTeX document, with nested enumerations and sections. It is important that I keep the numbering, structures as they are, but I want to insert replies that are visually different from the original text. I also would like to achieve this without excessive fiddling in the original code, but instead simply introduce a new reply command or environment.



To be easily understood by people it would be great if the reply layout would imitate email reply layout, i.e., add a vertical line (or a ">") on the left margin to all original content, but keep it blank whenever the reply is used.



I was able to achieve the opposite with mdframed, but I cannot simply switch this around as this would break the orignal text's lists and sectioning.



documentclass{article}
newcommand{response}[1]{
begin{mdframed}[ linewidth=2pt,
topline=false,
rightline=false,
bottomline=false
,linecolor=black, innerleftmargin =0cm, leftmargin=-2pt, innerrightmargin=0cm]
mdseries
{#1}
end{mdframed}}


usepackage{mdframed}
begin{document}
Some text, with pictures, lists, sections
begin{enumerate}
item Some text, with pictures, lists, sections
response{answer1}
item Some text, with pictures, lists, sections
response{answer2}
end{enumerate}
Some text, with pictures, lists, sections
response{this is my answer}
Some text, with pictures, lists, sections
section{section}
subsection{subsection1}
Some text, with pictures, lists, sections
subsection{subsection2}
Some text, with pictures, lists, sections
subsection{subsection3}
Some text, with pictures, lists, sections
response{I also have an answer here}
end{document}


enter image description here










share|improve this question




















  • 1





    Maybe related: tex.stackexchange.com/questions/68251/…

    – Steven B. Segletes
    yesterday






  • 2





    Not a solution, but if you are looking into this I would try to use tcolorbox instead of mdframed. tcolorbox is actively maintained and has an awesome manual while mdframed development seems to have stalled a while ago.

    – moewe
    yesterday











  • @Steven B. Segletes, Certainly related, but different, because it does not allow me to insert replies wherever I want. I can't write embed{ text begin{enumerate} item item1 } response.

    – sheß
    yesterday






  • 2





    @sheß Could you clarify? One can indeed put enumerations inside the 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
    yesterday






  • 1





    What if you just draw a line on the left margin (using a suitably prepared background image perhaps), and use your defined response environment to draw a box with a white border on the left to cover up the pre-drawn line?

    – Willie Wong
    15 hours ago














2












2








2


1






I have a long LaTeX document, with nested enumerations and sections. It is important that I keep the numbering, structures as they are, but I want to insert replies that are visually different from the original text. I also would like to achieve this without excessive fiddling in the original code, but instead simply introduce a new reply command or environment.



To be easily understood by people it would be great if the reply layout would imitate email reply layout, i.e., add a vertical line (or a ">") on the left margin to all original content, but keep it blank whenever the reply is used.



I was able to achieve the opposite with mdframed, but I cannot simply switch this around as this would break the orignal text's lists and sectioning.



documentclass{article}
newcommand{response}[1]{
begin{mdframed}[ linewidth=2pt,
topline=false,
rightline=false,
bottomline=false
,linecolor=black, innerleftmargin =0cm, leftmargin=-2pt, innerrightmargin=0cm]
mdseries
{#1}
end{mdframed}}


usepackage{mdframed}
begin{document}
Some text, with pictures, lists, sections
begin{enumerate}
item Some text, with pictures, lists, sections
response{answer1}
item Some text, with pictures, lists, sections
response{answer2}
end{enumerate}
Some text, with pictures, lists, sections
response{this is my answer}
Some text, with pictures, lists, sections
section{section}
subsection{subsection1}
Some text, with pictures, lists, sections
subsection{subsection2}
Some text, with pictures, lists, sections
subsection{subsection3}
Some text, with pictures, lists, sections
response{I also have an answer here}
end{document}


enter image description here










share|improve this question
















I have a long LaTeX document, with nested enumerations and sections. It is important that I keep the numbering, structures as they are, but I want to insert replies that are visually different from the original text. I also would like to achieve this without excessive fiddling in the original code, but instead simply introduce a new reply command or environment.



To be easily understood by people it would be great if the reply layout would imitate email reply layout, i.e., add a vertical line (or a ">") on the left margin to all original content, but keep it blank whenever the reply is used.



I was able to achieve the opposite with mdframed, but I cannot simply switch this around as this would break the orignal text's lists and sectioning.



documentclass{article}
newcommand{response}[1]{
begin{mdframed}[ linewidth=2pt,
topline=false,
rightline=false,
bottomline=false
,linecolor=black, innerleftmargin =0cm, leftmargin=-2pt, innerrightmargin=0cm]
mdseries
{#1}
end{mdframed}}


usepackage{mdframed}
begin{document}
Some text, with pictures, lists, sections
begin{enumerate}
item Some text, with pictures, lists, sections
response{answer1}
item Some text, with pictures, lists, sections
response{answer2}
end{enumerate}
Some text, with pictures, lists, sections
response{this is my answer}
Some text, with pictures, lists, sections
section{section}
subsection{subsection1}
Some text, with pictures, lists, sections
subsection{subsection2}
Some text, with pictures, lists, sections
subsection{subsection3}
Some text, with pictures, lists, sections
response{I also have an answer here}
end{document}


enter image description here







marginpar layout






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 hours ago







sheß

















asked yesterday









sheßsheß

2,21311435




2,21311435








  • 1





    Maybe related: tex.stackexchange.com/questions/68251/…

    – Steven B. Segletes
    yesterday






  • 2





    Not a solution, but if you are looking into this I would try to use tcolorbox instead of mdframed. tcolorbox is actively maintained and has an awesome manual while mdframed development seems to have stalled a while ago.

    – moewe
    yesterday











  • @Steven B. Segletes, Certainly related, but different, because it does not allow me to insert replies wherever I want. I can't write embed{ text begin{enumerate} item item1 } response.

    – sheß
    yesterday






  • 2





    @sheß Could you clarify? One can indeed put enumerations inside the 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
    yesterday






  • 1





    What if you just draw a line on the left margin (using a suitably prepared background image perhaps), and use your defined response environment to draw a box with a white border on the left to cover up the pre-drawn line?

    – Willie Wong
    15 hours ago














  • 1





    Maybe related: tex.stackexchange.com/questions/68251/…

    – Steven B. Segletes
    yesterday






  • 2





    Not a solution, but if you are looking into this I would try to use tcolorbox instead of mdframed. tcolorbox is actively maintained and has an awesome manual while mdframed development seems to have stalled a while ago.

    – moewe
    yesterday











  • @Steven B. Segletes, Certainly related, but different, because it does not allow me to insert replies wherever I want. I can't write embed{ text begin{enumerate} item item1 } response.

    – sheß
    yesterday






  • 2





    @sheß Could you clarify? One can indeed put enumerations inside the 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
    yesterday






  • 1





    What if you just draw a line on the left margin (using a suitably prepared background image perhaps), and use your defined response environment to draw a box with a white border on the left to cover up the pre-drawn line?

    – Willie Wong
    15 hours ago








1




1





Maybe related: tex.stackexchange.com/questions/68251/…

– Steven B. Segletes
yesterday





Maybe related: tex.stackexchange.com/questions/68251/…

– Steven B. Segletes
yesterday




2




2





Not a solution, but if you are looking into this I would try to use tcolorbox instead of mdframed. tcolorbox is actively maintained and has an awesome manual while mdframed development seems to have stalled a while ago.

– moewe
yesterday





Not a solution, but if you are looking into this I would try to use tcolorbox instead of mdframed. tcolorbox is actively maintained and has an awesome manual while mdframed development seems to have stalled a while ago.

– moewe
yesterday













@Steven B. Segletes, Certainly related, but different, because it does not allow me to insert replies wherever I want. I can't write embed{ text begin{enumerate} item item1 } response.

– sheß
yesterday





@Steven B. Segletes, Certainly related, but different, because it does not allow me to insert replies wherever I want. I can't write embed{ text begin{enumerate} item item1 } response.

– sheß
yesterday




2




2





@sheß Could you clarify? One can indeed put enumerations inside the 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
yesterday





@sheß Could you clarify? One can indeed put enumerations inside the 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
yesterday




1




1





What if you just draw a line on the left margin (using a suitably prepared background image perhaps), and use your defined response environment to draw a box with a white border on the left to cover up the pre-drawn line?

– Willie Wong
15 hours ago





What if you just draw a line on the left margin (using a suitably prepared background image perhaps), and use your defined response environment to draw a box with a white border on the left to cover up the pre-drawn line?

– Willie Wong
15 hours ago










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480526%2femail-style-reply-layout-vertical-line-in-left-margin-except-for-reply-environ%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480526%2femail-style-reply-layout-vertical-line-in-left-margin-except-for-reply-environ%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

Calculate evaluation metrics using cross_val_predict sklearn

Insert data from modal to MySQL (multiple modal on website)