2

I'm trying to draw a vertical line similar to the one use in the abstract of this document, as seen below enter image description here

I didn't find any good solution so far.

3
  • tex.stackexchange.com/q/124847/108724
    – user108724
    Commented Apr 22, 2020 at 20:20
  • 1
    Welcome to TeX - LaTeX! Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem and early trials. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}.`` Commented Apr 22, 2020 at 20:49
  • @AlessandroCuttin Hi, Alessandro. I have seen that the pdf of the user is a template of Overleaf.
    – Sebastiano
    Commented Apr 22, 2020 at 20:51

1 Answer 1

5

You can use or mdframed package (or tcolorbox) to create the vertical bar. Here there is a short example. Obviously, this code is only a starting point that can be expanded: arrange colours, insert italics, line spacing, font size, etc. The font used is tgpagella:

\documentclass[a4paper,12pt]{article}
\usepackage{lipsum}
\usepackage{xcolor}
\usepackage{tgpagella}
\usepackage[T1]{fontenc}
\usepackage{mdframed}
\begin{document}
\begin{mdframed}[linewidth=1.5,linecolor=red, topline=false,rightline=false,bottomline=false]
\textbf{\textcolor{red}{Abstract}} \textit{\small \lipsum[1]}
\end{mdframed}
\end{document}

enter image description here

Addendum by comment of the user @Caladay: mdframed has differents options: you put

innertopmargin=-.1em, innerbottommargin=0em

and with the parameter -.1em (decrease) the lenght of the vertical red line. With 0em the bottom vertical red line is aligned. With -.1em it is a bit lower. However you can choose your best lenght.


\documentclass[a4paper,12pt]{article}
\usepackage{lipsum}
\usepackage{xcolor}
\usepackage{tgpagella}
\usepackage[T1]{fontenc}
\usepackage{mdframed}
\begin{document}
\begin{mdframed}[linewidth=1.5,linecolor=red, innertopmargin=-.1em, innerbottommargin=0em, topline=false, rightline=false,bottomline=false]
\textbf{\textcolor{red}{Abstract}} \textit{\small \lipsum[1]}
\end{mdframed}
\end{document}

enter image description here

7
  • Dear Sebastiano, thank you very much for your reply. I would like to be able to define how long is the line (it seems too long). Moreover I'm looking to have the abstract starting with a leftskip. I used the below code without success: ` \usepackage{lipsum} \begin{document} \lipsum[1] \begingroup \leftskip=1cm \begin{mdframed}[linewidth=1.5,linecolor=red, topline=false,rightline=false,bottomline=false] \textbf{\color{red} Abstract} :\textit{ \lipsum[1] } \end{mdframed} \endgroup \section{Introduction} \lipsum[1]`
    – Caladay
    Commented Apr 23, 2020 at 7:27
  • 1
    @Caladay Very kind Caladay I have read now your comment and I have put an addendum. You advice me for further requests and you read if my answer is clear. My best regards.
    – Sebastiano
    Commented Apr 23, 2020 at 11:59
  • Dear Sebastiano, thank you very much. It works like a charm. I added another option ( leftmargin=1em) to have it shifted to the left. Thank you very much for your help.
    – Caladay
    Commented Apr 23, 2020 at 12:42
  • 1
    @Mady Yuvi Thank you for your comment, I followed your recommendation
    – Caladay
    Commented Apr 23, 2020 at 15:20
  • 1
    @MadyYuvi ahahah...don't worry for the check mark :-))) you are very kind with me. As you are older you notice that you are increasingly more wise and, at least for me, the objective is to help. Here we are a great group and excellent users both from a human and sensitive point of view like you. Thank you.
    – Sebastiano
    Commented Apr 23, 2020 at 19:05

You must log in to answer this question.

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