Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using template from sigchi http://www.sigchi.org/publications/chipubform/sigchi-papers-latex-template/view

I'm having problem with subfloats. I have three figures and they look like this:

chch IMAGE1 chch IMAGE2 chch IMAGE3 

Here is a screenshot:

enter image description here

Here is my code:

\begin{figure*}
\centering
\subfloat[A]
    {\includegraphics[width=2.0inch]{images/MEMS3D}
    \label{WIIMOTESENSOR}}
\subfloat[B]
    {\includegraphics[width=2.0inch]{images/raymond}
    \label{SPACESENSOR}}
\subfloat[C]
    {\includegraphics[width=2.0inch]{images/raymond}
    \label{SPACESENSOR2}}
    \caption{Gyro}
    \label{SENSORS}
\end{figure*}

Thanks!

share|improve this question
    
Full minimal example please. There is no \subfloat supported by that template in an unmodified version. Also plase use, say, \rule{4cm}{4cm} as your images, we don't have the same iamges as you do. –  daleif Jun 26 '13 at 14:17
    
@JLDiaz, good catch. –  daleif Jun 26 '13 at 14:29
1  
Welcome to TeX.SX! You can have a look on our our starter page to familiarize yourself further with our format. –  Claudio Fiandrino Jun 26 '13 at 14:29
    
@JLDiaz Thank you !!! that was the problem... I knew it was in, but for some reason I was typying inch ... thanks!!!! –  Blues76 Jun 26 '13 at 14:36
1  
@JLDiaz I think you should make an answer: TL is no longer available as a close option anyway, but I think that is a good answer. and generally applicable \includegraphics[width=2ptarmigan]{bird} wuld be another example. –  David Carlisle Jun 26 '13 at 19:40

1 Answer 1

up vote 2 down vote accepted

The problem was caused for the word inch as unit. The correct keyword is in.

TeX parser expects units at some places after numeric tokens, and it scans the next characters to determine if the units are pt, in, mm, cm, and so on. As soon as it succesfully parses those two letters it considers the token complete, and subsequent characters are considered part of the next token. So, for example:

\vskip 1inch

Would produce a vertical space of 1in, followed by the letters ch, which would cause TeX to start a new paragraph. The same problem appears if \setlength is used.

In your particular case, the \subfloat macro evaluates twice the argument (presumably the first time to box it and measure its dimensions, and the second time to actually typeset it). This explains why ch appears repeated as in chch.

Of course the same problem will happen with any other of TeX units, but I find difficult to make a similar mistake with the others. No one would write centimeters instead of cm, and anyway in this case TeX would produce an error, because the two first letters (ce) do not succesfully parse into any of TeX units. Other cases such as cms look unlikely.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.