我想在论文右上角的标题旁边放一张图片(以黑色表示),但我做不到。这是我目前的代码:
\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}
答案1
可能最简单的方法就是创建自己的标题,而无需\maketitle
。您可以minipage
水平堆叠两个 s:一个带有标题文本,另一个带有图像。
有几件事。首先,valign=T
将图像的基线更改为顶部边缘,以便它与标题正确对齐。\linespread
增加标题和作者之间的距离。
\twocolumn
以下是我要更改的部分:
\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}
]
完整代码:
\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}