1

I would like to replicate this title and abstract layout. I'm using \documentclass[a4paper, twocolumn]{article} as class.

I've tried with \flushleftenvironment, but there's no way to add a background color.

Thanks in advance to all the answers.

enter image description here Edit: Here my code

\documentclass[twocolumn]{article} 
\usepackage[]{geometry} 
\usepackage{lipsum} 
\usepackage{color}

\begin{document}

\twocolumn[
\begin{@twocolumnfalse}

    \begin{flushleft}
        \fontsize{20pt}\selectfont\color{black}\textbf{Title}
    \end{flushleft}

    \hrule

    \begin{flushleft}
        \fontsize{12pt}\selectfont\color{black}\textbf{First Author}
    \end{flushleft}         

\end{@twocolumnfalse}]

\tableofcontents

\section{Introduction}
    \lipsum[1] 
\end{document}
  • Some people take exception to questions of the form "Please draw this for me". You will get more help if you post some code showing what you have tried and give a minimal working example. – Andrew Jun 1 '16 at 9:08
  • I've add my code. Thank you for your suggestion. – Andrea Jun 1 '16 at 9:42
0

I added the color with a `\colorbox, which sets the background color. I did encounter some spacing issues with that part, which really should be addressed, as a change in font or other settings will make the abstract part look really terrible.

\documentclass[a4paper, twocolumn]{article}
\usepackage[table]{xcolor}
\usepackage{lipsum}
\usepackage{mathtools}
\usepackage{tabularx}
\usepackage{booktabs}
\begin{document}
\twocolumn[{
{\huge\bfseries Title of this article}
\medskip
\hrule

\bigskip\medskip

\textbf{First author:}

\bigskip
\hrule
\colorbox{gray!15}{%
    \parbox{\textwidth-.93em}{%
        \vskip1.5ex
        \begin{minipage}[t]{2cm}
            \bfseries Abstract:
        \end{minipage}
        \begin{minipage}[t]{\textwidth-2.5cm}
            \lipsum[2]
        \end{minipage}
        \vskip1.5ex
    }
}
\hrule
\bigskip

}]

\section{Introduction}
\lipsum[2-3]
\newpage
\begin{align*}
\intertext{The same list}
 123&=123\\ 
123+321&=444    
\end{align*}
\end{document}

enter image description here

  • Thanks runartrollet for your attempt! There are some spacing issues, as you already said, but also a bigger problem: writing the title as a header modified means that it also will appear in all the pages of the document and I don't want this. – Andrea Jun 1 '16 at 11:55
  • @Andrea Ok, easy fix, I made the edit. – Runar Jun 1 '16 at 12:01
2

In this solution based on Tikz, you have a new command \myabstract that takes a single mandatory argument which is the abstract content. The title Abstract is automatic, in the sense that if you change language in babel, it will change by itself, and the indentation of the content will change accordingly. Try commenting out the line about babel to see what I mean.

Of course, it can be changed manually with \renewcommand\abstractname{RandomTitle}

The optional argument of the abstract is the author's name.

Output

enter image description here

Code

\documentclass[a4paper, twocolumn]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{tikz}
\usepackage{calc}  
\usepackage{enumitem}
\usepackage{lipsum,adjustbox}
\usepackage{fancyhdr}

%\usepackage[spanish]{babel} % try Swedish!

\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\Huge\bfseries Title of the article}
%\fancyhead[LO,RE]{\slshape\nouppercase{\rightmark}} %these are useless without twoside option
%\fancyfoot[CE,CO]{}
%\fancyfoot[LE,RO]{}
\setlength{\headheight}{30pt}

\newcommand\myabstract[2][First author]{%
\noindent
\twocolumn[{%
\begin{tikzpicture}
    \node[fill=black!5, inner sep=3mm, outer sep=0, minimum width=\textwidth, inner ysep=2mm] (a) {%
    \begin{varwidth}{\textwidth-6.2mm}
    \begin{description}[labelsep=0pt, labelwidth=\widthof{\bfseries \abstractname:~}, leftmargin=!] \item[\abstractname:]#2\end{description}\end{varwidth}};
\draw (a.north west) -- (a.north east);
\draw (a.south west) -- (a.south east);
\node[font=\bfseries, anchor=south west, outer ysep=5mm, outer xsep=0, inner xsep=0] at (a.north west) {#1};
\end{tikzpicture}%
\vspace*{1cm}
}]%
}

\begin{document}

\myabstract{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eu convallis urna. Suspendisse potenti. Ut posuere euismod leo, eu posuere arcu vulputate quis. Praesent dictum tempus tortor, elementum gravida nisl eleifend gravida. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla iaculis arcu at risus placerat lobortis. Vestibulum ligula nulla, suscipit congue urna in, congue pellentesque quam. Proin laoreet, orci eget pharetra aliquam, risus felis lobortis justo, in fringilla diam nisi ac enim.}

\section{Introduction}
\lipsum[2-3]
\end{document}
  • I have to edit my previous comment: the result is almost perfect. The problem here is that if I want to introduce a title longer than a row, there's superposition between the title and the box of the abstract. I would like that the abstract position will be shifted accordingly to the title dimension. – Andrea Jun 1 '16 at 12:30
  • You mean the title in the header? – Alenanno Jun 1 '16 at 12:33
  • Yes the title, but that is not in the header. Anyway, the solution posted by @runartrollet also works, so I solved the problem. Thanks! – Andrea Jun 1 '16 at 12:42
  • @Andrea Yes, it's on the header, in both answers. But first of all, that's not advisable, the header shouldn't have a long title, and long titles are not the best either in any case. But most importantly, that's not something you originally asked. You asked to duplicate the image in your question. – Alenanno Jun 1 '16 at 12:44
  • I'd stick with this one, (just change the header if that is a must), this solves the problems with the lengths i mentioned, so it will bring you one thing less to worry about. +1 for tikz -solution, which I need to learn. – Runar Jun 1 '16 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.