0

I would like to put an image (rapresented in black) at top right of the paper beside the title, but i'm not able to do it. That's my code so far:

\documentclass[12pt]{article}
\usepackage{etoolbox}       % \patchcmd
\usepackage[margin=1.5cm]{geometry} 
\usepackage[english]{babel}
\usepackage{graphicx}
% \usepackage{multicol}
\usepackage{xcolor} 
\usepackage{framed} 
\usepackage{blindtext}

\definecolor{acsyellow}{RGB}{255,241,204}
\colorlet{shadecolor}{acsyellow}

\setlength{\parindent}{0mm}
\setlength{\parskip}{0.5\baselineskip plus 6pt minus 3pt}

\renewenvironment{abstract}{
    \list{}{
        \setlength\leftmargin{0.3cm}%
        \setlength\rightmargin{\leftmargin}%
    }%
    \item\relax}{\par\endlist}

\title{Title}
\author{...}
\date{}

\renewcommand{\familydefault}{\sfdefault} 


\begin{document}
\twocolumn[%
    \vspace*{-2em}%\vspace{-\topskip}%
    \maketitle
    {%
        \begin{shaded}
        \begin{abstract}
            \textbf{Abstract}. \blindtext[2]
        \end{abstract}
        \end{shaded}%
    }%
    \vspace{\baselineskip}%
]

\Blinddocument
\end{document}

enter image description here

1 Answer 1

1

Probably the easiest way would be to build your own title without \maketitle. You could just stack two minipages horizontally: one with a text of your title and the other with an image.

There are a couple of things. First, valign=T changes a baseline of an image to top edge so it is correctly aligned with the title. \linespread increases distance between the title and an author.

Here's the snippet of the \twocolumn I would change:

\twocolumn[%
  % \vspace*{-2em}%\vspace{-\topskip}%
  % \maketitle
  {%
    \begin{minipage}[t]{0.7\linewidth}
      \linespread{1.6}\selectfont
      {%
        \vspace{0pt}%
        \LARGE Not So Short Article Title}
      \par
      {%
        \large Aaaaa Bbbbb}
    \end{minipage}%
    \begin{minipage}[t]{0.3\linewidth}
      \includegraphics[width=\linewidth,height=1.5cm,valign=T]{example-image-duck}
    \end{minipage}
    
    \begin{shaded}
      \begin{abstract}
        \textbf{Abstract}. \blindtext[2]
      \end{abstract}
    \end{shaded}}\vspace{\baselineskip}
]

The full code:

\documentclass[12pt]{article}
\usepackage{etoolbox}       % \patchcmd
\usepackage[margin=1.5cm]{geometry} 
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
% \usepackage{multicol}
\usepackage{xcolor}
\usepackage{framed}
\usepackage{blindtext}

\definecolor{acsyellow}{RGB}{255,241,204}
\colorlet{shadecolor}{acsyellow}

\setlength{\parindent}{0mm}
\setlength{\parskip}{0.5\baselineskip plus 6pt minus 3pt}

\renewenvironment{abstract}{
    \list{}{
        \setlength\leftmargin{0.3cm}%
        \setlength\rightmargin{\leftmargin}%
    }%
    \item\relax}{\par\endlist}

\title{Title}
\author{...}
\date{}

\renewcommand{\familydefault}{\sfdefault} 


\begin{document}
\twocolumn[%
  % \vspace*{-2em}%\vspace{-\topskip}%
  % \maketitle
  {%
    \begin{minipage}[t]{0.7\linewidth}
      \linespread{1.6}\selectfont
      {%
        \vspace{0pt}%
        \LARGE Not So Short Article Title}
      \par
      {%
        \large Aaaaa Bbbbb}
    \end{minipage}%
    \begin{minipage}[t]{0.3\linewidth}
      \includegraphics[width=\linewidth,height=1.5cm,valign=T]{example-image-duck}
    \end{minipage}
    
    \begin{shaded}
      \begin{abstract}
        \textbf{Abstract}. \blindtext[2]
      \end{abstract}
    \end{shaded}}\vspace{\baselineskip}
]

\Blinddocument
\end{document}

enter image description here

You must log in to answer this question.

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