1

I am using the (very outdated) documentclass asme2ej, which produces two-column academic journal documents.

My problem is as follows: I want to print my title, switch to onecolumn style and add an abstract plus one graph on the very same first page.

Below you find my current code, which is the closest I got. However, gives me the error:

Package caption Error: No float type 'MyFigure.png' defined. ]

I experimented with \usepackage{graphicx}, but it seems to not work properly in this outdated environment.

\documentclass[twocolumn,10pt]{asme2ej}
\usepackage{epsfig}
\usepackage{multicol}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage[font=small,labelfont=bf,tableposition=top]{caption}

\title{Some title}

\begin{document}

\twocolumn[
\begin{@twocolumnfalse}
\maketitle
\section*{Executive Summary}

My Summary.

\begin{minipage}{\linewidth}
\centering
\rule{0.75\linewidth}{0.5\linewidth}
\captionof{MyFigure.png}{MyCaption}\label{fig:dummy}
\end{minipage}
\end{@twocolumnfalse}

]

This is the output I get (when changing MyFigure.png to figure to compile it).

enter image description here

Any help how to obtain my graph here would be highly appreciated. I am not sure whether the problem lies in the package I am using or in how I load the graph over captionof{}.

0

see, if the following solution work for you:

\documentclass[twocolumn,10pt]{asme2ej}
\usepackage{graphicx}
\usepackage[font=small,labelfont=bf,tableposition=top]{caption}
\usepackage{hyperref}

\title{Some title}

\usepackage{lipsum}
\begin{document}

\twocolumn[
\maketitle
\section*{Executive Summary}
My Summary.

{\lipsum[66]

 \lipsum[77]}

\begin{center}
{\includegraphics[width=0.30\textwidth]{example-image}}
\captionof{figure}{MyCaption}\label{fig:dummy}
\end{center}
]
\lipsum
\end{document}

enter image description here

as you can notice, i remove package multicol (it is not clear, why you need it, you declare that your document is twocolumn) and epsfig, which is with recent LaTeX not necessary anymore.

  • I already handed my report in, but not being able to solve the problem was really a minor annoyance. Your solution works perfectly. Apparently the use of multicol was causing the problems. Thank you very much! – XsLiar May 9 at 9:49
1

The first argument of \captionof should be the type of float, in your case figure. To insert the image, replace the black dummy rectangle width \includegraphics{example-image} (replace example-image with the filename of your image)

\documentclass[twocolumn,10pt]{asme2ej}
\usepackage{epsfig}
\usepackage{multicol}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage[font=small,labelfont=bf,tableposition=top]{caption}

\title{Some title}

\begin{document}

\twocolumn[
\begin{@twocolumnfalse}
\maketitle
\section*{Executive Summary}

My Summary.

\begin{minipage}{\linewidth}
\centering
{\includegraphics[width=0.30\textwidth]{example-image}}
\captionof{figure}{MyCaption}\label{fig:dummy}
\end{minipage}
\end{@twocolumnfalse}

]

\end{document}

enter image description here

  • Dear @jackfrost, thank you very much. This solution indeed displays the imagine finally. However, I am not able to scale it. As soon as I add option to \includegraphics, such as \includegraphics[width=0.30/textwidth]{MyFigure.png} I get the error: Argument of \Gin@ii has an extra }. \includegraphics[width=0.30/textwidth]. I do not know if packages interfer. I never had such troubles to include a picture properly. Thanks in advance. – XsLiar May 2 at 10:11
  • @XsLiar I modified the code to include the width – user187808 May 8 at 16:14

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.