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

  • Did you remember to put something like \usepackage{subfig} in header? – Masroor Mar 23 '16 at 13:45
  • 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
  • @Masroor I have used the subcaption package, which is a recent and more general package, as Torbjorn pointed out. – lordnuuk Mar 23 '16 at 16:12
  • 1
    You are writing about an error you get, what is the exact error message? –  Mar 23 '16 at 17:31
  • @AxelSommerfeldt The exact error message: !pdfTeX error: pdflatex (file ecrm1095): Font ecrm1095 at 600 not found ==> Fatal error occurred, no output PDF file produced! – lordnuuk Mar 23 '16 at 20:27
  • 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
  • 1
    The error has nothing to do with sub floats. If it goes away when you comment out that environment, it is pure coincidence. The message is telling you that you do not have Computer Modern Roman available in that size in the T1 font encoding. The standard solution is to install cm-super or use an alternative font. (Or not use T1, but that's not recommended.) – cfr 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
  • @cfr Thanks! how did you reach here?! I just referred to your answer below. I don't think I had subcaption since I didn't do a complete TeXLive installation, due to hard drive memory constraints. I just did kpsewhich cm-super.sty and it seems it is also missing. Any how, for time being I have used lmodern. Thanks anyway! – lordnuuk Mar 23 '16 at 23:05
  • @cfr But something that puzzles me is, how come this error didn't crop up before, since I have been using the [T1]{fontend} for a while? Has it got something to do with the subcaption trying to access something from fontenc, font for caption for example? – lordnuuk Mar 23 '16 at 23:10
  • 1
    You should use tlmgr to install additions. I agree with @egreg. Something is broken in your TeX installation. cm-super doesn't provide cm-super.sty. It is an extended set of Computer Modern fonts. I'm guessing, though I'm not certain, that the difference subcaption makes is in the size of font used. If so, however, something is badly broken somewhere. – cfr Mar 23 '16 at 23:43
  • Thanks for the info! something might be broken, but right now everything seem to be working alright. I wouldn't be troubleshooting now as I'm already behind on my ms thesis, for which I'm using the LaTeX. Maybe after submission I'll go for troubleshooting. – lordnuuk Mar 24 '16 at 10:36
  • 4
    I'm voting to close this question as solved in comments – samcarter_is_at_topanswers.xyz Apr 14 '18 at 16:28

0 Answers0