I tried adding figure environment inside the abstract area but it generates an error. How do I add a graphical abstract as well as a textual one?
[Tex/LaTex] How to put in a graphical abstract
abstractarticlefloats
Related Solutions
You can copy the following code as a file long2.sty
, place it in your document folder, and then use it as shown below:
%%
%% This is file `long2.sty'.
%%
%% Author: Tomas "tohecz" Hejda <tohecz@gmail.com>
%%
%% Licenced under LaTeX-Project Public License version 1.3 or newer.
%%
\NeedsTeXFormat{LaTeX2e}[1995/06/01]
\ProvidesPackage{long2}[2012/08/19 v0.1 long2: breakable one-column preamble in a two-column document]
\newlength\longtwo@top
\newlength\longtwo@bottom
\newsavebox\longtwo@box
\def\longtwo@repeat{%
\longtwo@column[{\@twocolumnfalse
\ifdim\ht\longtwo@box>1.00\textheight%1
\begingroup
\vbadness10000
\setbox0\vsplit\longtwo@box to 1.00\textheight%1
\setbox1\vbox{\unvbox\longtwo@box}
\global\setbox\longtwo@box\vbox{\unvbox1}
\setbox2\vbox to \textheight{%
\unvbox0
}
\ht2=0.9\textheight
\box2
\endgroup
\else
\ifdim\ht\longtwo@box>0.84\textheight
\global\let\longtwo@repeat\clearpage
\else
\global\let\longtwo@repeat\relax
\fi
\unvbox\longtwo@box
\vspace{15pt plus 15pt}
\fi
}]%
\longtwo@repeat
}
\long\def\longtwo@[#1]{%
\begingroup
\let\longtwo@column\twocolumn
\let\longtwo@mkttl\maketitle
\def\maketitle{
\begingroup
\let\newpage\relax
\longtwo@mkttl
\endgroup
}
\longtwo@column[{\@twocolumnfalse
\global\setbox\longtwo@box\vbox{#1}%
\ifdim\ht\longtwo@box>\textheight
\begingroup
\vbadness10000
\setbox0\vsplit\longtwo@box to 1.00\textheight%1
\setbox1\vbox{\unvbox\longtwo@box}%
\global\setbox\longtwo@box\vbox{\unvbox1}%
\setbox2\vbox to \textheight{%
\unvbox0
}
\ht2=0.9\textheight
\box2
\endgroup
\else
\ifdim\ht\longtwo@box>0.87\textheight
\global\let\longtwo@repeat\clearpage
\else
\global\let\longtwo@repeat\relax
\fi
\unvbox\longtwo@box
\fi
}]%
\longtwo@repeat
\endgroup
}
\def\longtwocolumn{\@ifnextchar[\longtwo@\twocolumn}
\endinput
%%
%% End of file `long2.sty'.
%%
The document can then look like this (package lipsum
and command \lipsum[x-y]
are only used to produce some dummy text):
\documentclass[twocolumn]{article}
\usepackage{long2}
\usepackage{lipsum}
\parskip0pt plus 8pt
\title{My title}
\author{My the first}
\begin{document}
\longtwocolumn[{
\maketitle
\begin{abstract}
\lipsum[1-8]
\end{abstract}
\lipsum[9-15]
}]
\lipsum[16-25]
\end{document}
PS: I'm considering making it a package (after I add some features), that's why I posted a complete package file ;)
PPS: Brief introduction of the idea: We store the whole one-column part in a box, then we check whether the box is larger than a page. If yes, we \vsplit
it, output the first part, and call \longtwo@repeat
on the rest, which does the same again.
Within report
, the abstract
environment is set using within a titlepage
, which defaults to putting the content on its own page. So you have to insert the ToC-writing piece using some patching (supported via etoolbox
).
\documentclass{report}
\usepackage[paper=a6paper]{geometry}% Just for this example
\usepackage{lipsum,etoolbox}% http://ctan.org/pkg/{lipsum,etoolbox}
% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\patchcmd{\abstract}{\titlepage}{\titlepage% Insert ToC-writing after starting a titlepage
\addcontentsline{toc}{chapter}{Abstract}}{}{}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\begin{document}
\title{My Title}
\author{My Name}
\maketitle
\tableofcontents
\begin{abstract}
\lipsum[1]
\end{abstract}
\chapter{A chapter}
\end{document}
I've written the ToC-entry as a chapter
, just so the formatting seems consistent
\addcontentsline{toc}{chapter}{Abstract}
However, that can be changed to whatever you like.
Another way would be to write the ToC-entry within the abstract
environment - this ensures that it falls on the same page as the Abstract:
\begin{abstract}
\addcontentsline{toc}{chapter}{Abstract}
...
\end{abstract}
Best Answer
You can just use
\includegraphics
without thefigure
environment. Here's an example:See Top-aligning imported graphics for an explanation about the
\vtop
stuff.