Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use the \subfloat command when compiled with TeX Live 2015 #23

Open
xyguo opened this issue Mar 16, 2017 · 3 comments
Open

Cannot use the \subfloat command when compiled with TeX Live 2015 #23

xyguo opened this issue Mar 16, 2017 · 3 comments

Comments

@xyguo
Copy link

xyguo commented Mar 16, 2017

Problem description:

When using the \subfloat to place multiple image in one figure environment, the following problem occurs:

! Undefined control sequence.
\in@ #1#2->\begingroup \def \in@@
                                  ##1#1{}\toks@ \expandafter {\in@@ #2{}{}#1...
l.7   \subfloat
               [A]{

System environment:

OS: macOS Sierra 10.12.3

$ uname -v
Darwin Kernel Version 16.4.0: Thu Dec 22 22:53:21 PST 2016; root:xnu-3789.41.3~3/RELEASE_X86_64

$ tex --version
TeX 3.14159265 (TeX Live 2015)
kpathsea version 6.2.1
Copyright 2015 D.E. Knuth.

$ xelatex --version
XeTeX 3.14159265-2.6-0.99992 (TeX Live 2015)
kpathsea version 6.2.1
Copyright 2015 SIL International, Jonathan Kew and Khaled Hosny.

Minimal example to reproduce the problem

$ ls
gbt7714-2005.bst   njuname.eps        njuthesis.cls      test_njuthesis.log
njulogo.eps              njuthesis.cfg        test_njuthesis.tex

The test_njuthesis.tex is written as follows:

\documentclass[master, macfonts, draft]{njuthesis}

\begin{document}

\begin{figure}[!htbp]
  \centering
  \subfloat[A]{
    \includegraphics[width=0.41\textwidth]{A.pdf}
  }
  \hfill
  \subfloat[B]{
    \includegraphics[width=0.41\textwidth]{B.pdf}
  }
  \caption{\small AAA \label{fig:AAA}}
\end{figure}

\end{document}

Additional info

I also post the same question on TeX Stackexchange. Hope there would be some useful answers.

@jackyangNJ
Copy link

@xyguo Hi, I have also met this problem, have you solved it?

@xyguo
Copy link
Author

xyguo commented Mar 7, 2018

@jackyangNJ No, seems that we have to modify the template file a lot to solve this problem. So at the end I use subcaption instead. Below is a example:

%%load package
\usepackage{caption}
\usepackage{subcaption}

%%example
\begin{figure}[!htbp]
  \centering
  \subcaptionbox{\footnotesize {Pos.-Acc.}}{
    \includegraphics[width=0.45\textwidth]{figures/fig-crv-bp/pose_accessory_2.pdf}
  }
  \hfill
  \subcaptionbox{\footnotesize {Pos.-Exp.}}{
    \includegraphics[width=0.45\textwidth]{figures/fig-crv-bp/pose_expression_2.pdf}
  }
  \\
  \subcaptionbox{\footnotesize {WIKI-Acc.}}{
    \includegraphics[width=0.45\textwidth]{figures/fig-crv-bp/wiki_accessory_2.pdf}
  }
  \hfill
  \subcaptionbox{\footnotesize {WIKI-Exp.}}{
    \includegraphics[width=0.45\textwidth]{figures/fig-crv-bp/wiki_expression_2.pdf}
  }
  \caption{\small XXX\label{fig:model-number-influence}}
\end{figure}

@jackyangNJ
Copy link

@xyguo Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants