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.

Caladay
  • 65
  • 1
  • 5

1 Answers1

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

Sebastiano
  • 54,118
  • 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 Apr 23 '20 at 07: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 Apr 23 '20 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 Apr 23 '20 at 12:42
  • @Caladay If the suggestion gave by Sebastiano suits with your requirement, then you have to click the tick mark, this is the best way you show your tribute ....please... – MadyYuvi Apr 23 '20 at 14:07
  • 1
    @Mady Yuvi Thank you for your comment, I followed your recommendation – Caladay Apr 23 '20 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 Apr 23 '20 at 19:05
  • @Caladay Very very good :-) for the use of leftmargin=1em. – Sebastiano Apr 23 '20 at 19:05