Graphics, Figures & Tables ⇒ subfig | Weird Captions
subfig | Weird Captions
\documentclass[12pt,a4paper,twoside]{article}
\pagestyle{headings}
\usepackage{graphicx}
\usepackage[version=3]{mhchem}
\usepackage[super,square,numbers,sort&compress]{natbib}
\usepackage{textcomp}
\usepackage{subfig}
\usepackage{soul}
\usepackage{multirow}
%\usepackage{palatino}
%\usepackage[T1]{fontenc}3
\usepackage[font=sf,margin=1cm]{caption}
\bibliographystyle{unsrt}
\newcommand{\degC}{\ensuremath{^\circ}C}
Using the subfig package in my document:
\begin{figure}
\centering
\subfloat[{Altanserine}]{\label{fig:altanserin}}\includegraphics[width=208 pt]{Altanserine.png}
\subfloat[Flumazenil]{\label{fig:flumazenil}}\includegraphics[width=120 pt]{flumazenil.png}
\caption{Structures of the radioligands.}
\label{fig:Structures}
\end{figure}
Produces weird captions! Anyone know why they break?
Also: Can I make the subfig include a picture without specifying size or having it stretched to fit the page width, thus having the picture be its actual size?
- Attachments
-
- Captions.png (8.72 KiB) Viewed 2949 times
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
subfig | Weird Captions
Code: Select all
\begin{figure}[!ht]
\centering
\subfloat[Altanserine\label{fig:altanserin}]{%
\includegraphics[width=208pt]{Altanserine.png}
}
\subfloat[Flumazenil\label{fig:flumazenil}]]{%
\includegraphics[width=120pt]{flumazenil.png}
}
\caption{Structures of the radioligands.}\label{fig:structures}
\end{figure}
And next time please use the »Code« environment when posting code. This just improves the legibility of your post. Furthermore get used to providing always a minimal example which contains only the relevant code to reproduce the problem. Almost all packages that you load are irrelevant in this context.
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: subfig | Weird Captions
Sorry about not knowing of the code env. and apparently posting too much code. Isn't there a possibility of different packages interacting with eachother causing that kind of problems? That's why I posted the whole preamble.
I did look into chemfig, but it seems like a huge hassle when working with 20-22 molecules, all more intricate than the ones I showed.
No possibility of subfloat figures as their actual size?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
subfig | Weird Captions
According to my knowledge this is the most easy-to-use package at the moment. You should give it a try.Cosmio wrote:[…] I did look into chemfig, but it seems like a huge hassle when working with 20-22 molecules, all more intricate than the ones I showed. […]
Oh, I must have overlooked this point. Scale the pictures to three quarters of their original size.Cosmio wrote:[…] No possibility of subfloat figures as their actual size?
Code: Select all
\begin{figure}[!ht]
\centering
\subfloat[Altanserine\label{fig:altanserin}]{%
\includegraphics[scale=0.75]{Altanserine.png}
}
\subfloat[Flumazenil\label{fig:flumazenil}]]{%
\includegraphics[scale=0.75]{flumazenil.png}
}
\caption{Structures of the radioligands.}\label{fig:structures}
\end{figure}
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: subfig | Weird Captions
Thank you very much.