I'm writing a scientific article using CAS bundle from Elsevier, which is a double-column format.
This how my document looks.
\documentclass[a4paper,fleqn]{cas-dc}
\usepackage[numbers]{natbib}
\usepackage{microtype}
\usepackage{amsmath,amssymb,amsthm,bm}
\usepackage{graphicx}
\usepackage[colorlinks]{hyperref}
\usepackage{url}
\usepackage{subcaption}
\usepackage{notoccite}
\usepackage{float}
\usepackage{stfloats}
\usepackage{caption}
\begin{document}
\section{chapter1}
........ my text
\section{chapter2}
........ my text
\begin{figure}
\centering
\includegraphics[width=\linewidth]{fig1.jpg}
\label{fig1}
\caption{This is my problem area, can't have long text}
\end{figure}
........ my text
\end{document}
The issue that I'm facing is a little strange because when the caption length of the figure exceeds one line, it throws me this pdfTeX error (font expansion): auto expansion is only possible with scalable fonts
.
However, I found that removing the microtype
package allows me to have a long caption without any errors but the alignment in the rest of the document gets messed up. Based on the answers from previous posts related to this error, I tried to use \usepackage[T1]{fontenc}
, \usepackage{lmodern}
, and several options in microtype package (like protrusion
, expansion
, and final
). None of these helps to fix my problem.
I need to have a long figure caption while maintaining the alignment of the rest of my document. I'd really appreciate if someone could help me figure this out.
\documentclass
line, and including a sample image with a caption that throws the error you mention.