I am working on my Bachelor Thesis using LaTeX. I'm trying to put several pictures in the same figure using the subfig-package. I am using the following code to do so:
\begin{figure}[bth]
\centering
\subfloat[Versuch 1.1]{\includegraphics[height=6cm]{./bilder/Versuch1_1}}
\subfloat[Versuch 1.2]{\includegraphics[height=6cm]{./bilder/Versuch1_2}}
\subfloat[Versuch 1.3]{\includegraphics[height=6cm]{./bilder/Versuch1_3}}
\subfloat[Versuch 1.4]{\includegraphics[heigth=6cm]{./bilder/Versuch1_4}}
\caption{\textbf{Aufnahmen der Versuchsreihe 1.} Die Abbildung zeigt die Aufnahmen der Versuche~1.1 bis 1.4. Die Anordnung der LED-Spots relativ zur Kamera ist wie folgt: (a) Gegenlicht mit einem LED-Spot; (b) Frontlicht mit einem LED-Spot; (c) Seitenlicht mit zwei LED-Spots; (d) Frontlicht mit zwei LED-Spots.}
\label{fig:sdqlogo}
\end{figure}
I included the subfig-package in the preamble. My problem now is that LaTeX tells me the PDFLaTeX-process is exited with errors but does NOT show any error messages in the Log-file. I tried to deleting all of the .aux,... files and it still doesn't work.
Maybe someone can help me. I would really appreciate it!
Thanks in advance.
Judith
Last edited by Stefan Kottwitz on Tue Aug 22, 2017 7:08 pm, edited 1 time in total.
Thanks for your answer. That was a really bad spelling and copy-paste error! I am still getting the same result though after I made the changes. Even if I use width to set the size of the picture. LaTex still tells me there are errors but the log-file shows no errors.
After fixing "height", the code should run without errors. It does when I test it. You can test yourself, just copy&paste and try or click on "Open in Overleaf":
\documentclass{book}
\usepackage{subfig}
\usepackage[demo]{graphicx}
\begin{document}
\begin{figure}[bth]
\centering
\subfloat[Versuch 1.1]{\includegraphics[height=6cm]{./bilder/Versuch1_1}}
\subfloat[Versuch 1.2]{\includegraphics[height=6cm]{./bilder/Versuch1_2}}
\subfloat[Versuch 1.3]{\includegraphics[height=6cm]{./bilder/Versuch1_3}}
\subfloat[Versuch 1.4]{\includegraphics[height=6cm]{./bilder/Versuch1_4}}
\caption{\textbf{Aufnahmen der Versuchsreihe 1.} Die Abbildung zeigt die Aufnahmen der Versuche~1.1 bis 1.4. Die Anordnung der LED-Spots relativ zur Kamera ist wie folgt: (a) Gegenlicht mit einem LED-Spot; (b) Frontlicht mit einem LED-Spot; (c) Seitenlicht mit zwei LED-Spots; (d) Frontlicht mit zwei LED-Spots.}
\label{fig:sdqlogo}
\end{figure}
\end{document}
So, make sure that the .log file is actually the current one made by LaTeX. If LaTeX exits with errors, the errors are in the .log file. You can post the log file here, as attachment to a post. The "Attachments" link is below the text edit field, when writing a post.
Actually there is an error message. The last thing in the .log file:
!pdfTeX error: pdflatex (file ./bilder/Versuch1_1.jpg): reading JPEG image failed
(no JPEG header found)
==> Fatal error occurred, no output PDF file produced!
Check if Versuch1_1.jpg is indeed a jpg file, or if it's a bmp or png file just saved with the wrong file name extension jpg. Open it with a graphic editor, save it as jpg again (lossless compression) or as png.
Either the image is broken, as Thomas said, or it's just in another format. For example, somebody could "convert" an unsupported format into a supported format by changing the file name extension to jpg, but that would be wrong. A conversion needs graphics software such as the free GIMP or ImageMagick or Paint.net, to name a few examples.