=======================================================
-> Update <-
After a half day trial and error, it's safe to say that this is caused by the
"famous" error Error: Float(s) lost.
I have been reading on this site, but it seems that the only way was to take it out of the mini-figure thing. No other useful work around at the moment.
=======================================================
Code:
\documentclass[12pt,a4paper]{report}
\usepackage{amsmath,amsthm,enumerate}
\usepackage{graphicx,subfigure}% for pictures
\graphicspath{{Pictures/}} % Specifies the directory where pictures are stored
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Example and Solution
\usepackage[most]{tcolorbox}
\NewTColorBox[auto counter, number within=section]{example}{+O{}}{%
enhanced,
breakable,
coltitle=black,
fonttitle=\bfseries,
title={Example~\thetcbcounter:},
attach title to upper=\quad,
before lower={\textbf{Solution~\thetcbcounter:\quad}},
%lowerbox=invisible,
bicolor,
colback=black!5!white,
colbacklower=black!3!white,
#1}
%\tcbset{student/.style={lowerbox=invisible}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\pdfoptionpdfminorversion 6
\begin{document}
\begin{example}
Figure~\ref{fig:conti_pdf_cdf} gives the probability density function $f(x)$ and its cumulative function $F(x)$.
\begin{figure}[!hp]
\centering
\subfigure[$f(x)$]{\includegraphics[scale=0.6]{15-1.pdf}} %1.5 version
\\[2ex]
\subfigure[$F(x)$]{\includegraphics[scale=0.6]{15-2.pdf}}
\caption{Illustration of $f(x)$ and $F(x)$ for a (continuous) piecewise function}
\label{fig:conti_pdf_cdf}
\end{figure}
\tcblower
Figure~\ref{fig:conti_pdf_cdf} gives the probability density function $f(x)$ and its cumulative function $F(x)$.
\begin{figure}[!hp]
\centering
\subfigure[$f(x)$]{\includegraphics[scale=0.6]{14-1.pdf}} %1.4 version
\\[2ex]
\subfigure[$F(x)$]{\includegraphics[scale=0.6]{14-2.pdf}}
\caption{Illustration of $f(x)$ and $F(x)$ for a (continuous) piecewise function}
\label{fig:conti_pdf_cdf}
\end{figure}
\begin{center}
\includegraphics[scale=0.4]{chap3_eg1.pdf} % 1.4 version
\end{center}
\end{example}
\end{document}
If I compile it without the example environment, it works fine.
If I then add the example environment, it does not compile (no graph for the 1.4 or 1.5 version PDF). Ignoring the warning, only the {chap3_eg1.pdf} shows in the final PDF.
Would there be any specific things (in the PDF) that is causing latex not to compile the PDF? Both 1.4 and 1.5 version is the same file. I used Acrobat to convert between versions.
So any solution?
=======================================================
OLD post
Sorry about the messy title. I will try to make it simple.
In the first instance, I was trying to implement implement this solution (see comments). So I used
\NewTColorBox[auto counter]{exercise}{+O{}}{%
enhanced, breakable,
coltitle=black,
fonttitle=\bfseries,
title={Exercise~\thetcbcounter:},
attach title to upper=\quad,
before lower={\textbf{Solution~\thetcbcounter:\quad}},
#1}
I got an error.
! pdfTeX error (setup): \pdfminorversion cannot be changed after data is written to the PDF file.
No PDF file was produced. It worked fine after I did
% \pdfoptionpdfminorversion 6
With a different .tex file, I got this error and I found the lost PDFs (version 1.5)
! LaTeX Error: Float(s) lost.
They were coded using
\begin{figure}[!hp]
\centering
\subfigure[$f(x)$]{\includegraphics[scale=0.6]{chap3_eg3_den.pdf}}
\\[2ex]
\subfigure[$F(x)$]{\includegraphics[scale=0.6]{chap3_eg3_cum.pdf}}
\caption{Illustration of $f(x)$ and $F(x)$ for a (continuous) piecewise function}
\label{fig:conti_pdf_cdf}
\end{figure}
Did some research, says something to do with figures in figures or \marginpar. But looking at my code, I don't think it is this case here.
I have other PDF (also 1.5) that works fine.
I guess my question really is - What's causing it?
The packages?
The Floats (subfigure)? Or
The PDFVersion thing??

example-imageinstead of the pdfs and see if you still get an error? – Troy Jun 05 '18 at 13:15example-image. I have even tried using.jpg. I think there is just something clashing withexampleenvironment was introduced. But weirdly, if I take out the whole environment, it compiles fine, even mixed versions of PDFs. – Chen Stats Yu Jun 05 '18 at 13:43exampleenvironment. I have been reading on this https://tex.stackexchange.com/questions/79185/how-to-find-the-lost-text-part-when-having-floats-lost-error but was not able to find any useful workarounds. Thanks. – Chen Stats Yu Jun 05 '18 at 14:18