1

I'm trying to place two figures side by side using subfigure and I'm getting not being able to compile the file to pdf. The error goes away once the commands for this environment are commented out (i.e. \begin{subfigure}[t]{0.3\textwidth} and \end{subfigure}) but then obviously the figures get placed one after the other. Please point out the mistakes in the code, if there are any, or an alternative solution to this.

The error message: !pdfTeX error: pdflatex (file ecrm1095): Font ecrm1095 at 600 not found ==> Fatal error occurred, no output PDF file produced!

Also, consider the fact that the subcaption package that I use for the subfigure was recently separately installed by me to the TexLive.

\documentclass[a4paper,12pt,twoside]{report}
\usepackage{amssymb,amstext,amsmath,hyperref,graphics}
\usepackage[T1]{fontenc}
\usepackage{epstopdf}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
pdfborder={0 0 0},
citecolor= blue,
linkcolor= black,
}
    \ifx\pdfoutput\undefined
    \usepackage{graphicx}
    \else
    \usepackage[pdftex]{graphicx}
    \fi
\setlength{\parskip}{0.8em}

\begin{document}

Hello World and the \it Master of Dreams!

\begin{figure}
\begin{subfigure}[t]{0.3\textwidth}
    \includegraphics[width=\linewidth]{energyplot_dt_compare}
    \caption{enrgy}
    \label{fig:E_deltat}
\end{subfigure}
\begin{subfigure}[t]{0.3\textwidth}
    \includegraphics[width=\linewidth]{energy_typical_lj}
    \caption{Energy plot of the system at T=1}
    \label{fig:typicalE}
\end{subfigure}
\end{figure}

\end{document}

Update: Taking cue from the question: [Font installed, compiles to dvi, but fails compiling to pdf. "font at 600 not found", i tried to compile directly to dvi instead of compiling to pdf (which is what I was doing before) and it compiled! But it still wouldn't compile to pdf. I tried the soultion in the question mentioned but it is not working either.

Update 2: Even though I have not found any satisfactory answer yet I found a way around, which is to not use the fontenc, instead use some package like lmodern. I owe this solution to cfr. Please refer to the answer by cfr: https://tex.stackexchange.com/a/205197/99160

closed as off-topic by user36296, Bobyandbob, Mensch, Stefan Pinnow, Phelype Oleinik Apr 14 '18 at 17:46

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    @Masroor In this case \usepackage{subcaption} I believe, that defines a subfigure environment used as in the code above. – Torbjørn T. Mar 23 '16 at 13:48
  • 1
    You are writing about an error you get, what is the exact error message? – Axel Sommerfeldt Mar 23 '16 at 17:31
  • 1
    Note that the code from \ifx\pdfoutput up to \fi is obsolete and doesn't really distinguish between pdflatex and latex. Just \usepackage{graphicx} is sufficient. The error about ecrm1095 not found means that you have a faulty installation of the TeX distribution. – egreg Mar 23 '16 at 22:50
  • 2
    Why are you installing packages yourself to TeX Live and what does that mean? subcaption is already included in TeX Live, as is cm-super. You should not need to install anything extra. And it is a Bad Idea to install packages like this manually, especially if you don't do it correctly, but even if you do. – cfr Mar 23 '16 at 22:52
  • 4
    I'm voting to close this question as solved in comments – user36296 Apr 14 '18 at 16:28

Browse other questions tagged or ask your own question.