TransWikia.com

Strange space between Figure's numbers and commas (Figure. 1 , shows.....)

TeX - LaTeX Asked by user221420 on October 2, 2021

I am getting a wrong space appearing between my Figure or Table cross-references’ numbers, and my next character (word, comma, etc.), as hyphened below:

This is the code from Wiley:

documentclass[AMA,STIX1COL]{WileyNJD-v2}

articletype{Article Type}%

received{26 April 2016}
revised{6 June 2016}
accepted{6 June 2016}

raggedbottom

begin{document}


The Figure ref{fig2}

begin{figure*}
centerline{includegraphics[width=342pt,height=9pc,draft]{empty}}
caption{This is the sample figure caption.label{fig2}}
end{figure*}


end{document}

One Answer

Update: I found the command causing the issue described by user221420! In line 530 of the .cls file provided by Wiley the follwoing code modifies the custom behaviour:

renewcommand{thefigure}{arabic{figure}enspace }

enspace (adds 0.5 em) is the culprit. The same is done in line 532 for tables. Though I'm not sure if messing with this is advisable, as it seems to be intended behaviour, changing it from inside the .tex document (i.e. without touching the .cls file) is possible by placing

renewcommand{thefigure}{arabic{figure}}
DeclareCaptionLabelSeparator{enspace}{enspace}
captionsetup[figure]{labelformat=simple, labelsep=enspace, skip=10pt, labelfont=bf}

renewcommand{thetable}{arabic{figure}}
captionsetup[table]{labelformat=simple, labelsep=enspace, skip=10pt, labelfont=bf}

in the preamble. Sorry for the non-answer below, I'm new here and didn't have the necessary reputation for a comment on the reproducibility. So I made it an answer and added my own findings.

Original Post:

Opposite to Marijn, I could replicate the exact behaviour user221420 reports using his MWE (and adding some actual text after the reference call). I have the same problem in a document where I have to use WileyNJD-v2 and after a few hours of tinkering around I finally gave up as the problem seems to originate from the WileyNJD-v2.cls file itself and changing it isn't an option. I'd still like to know what exactly causes the issue, so here are my findings so far:

  • The problem is not due to the compiler. I tested Texmaker, TeXstudio and TeXworks.
  • Zoom levels and the pdf viewer don't have an effect. All internal viewers and the Adobe Acrobat Reader show the same issue.
  • Adding the label{...} function inside the caption{} or after it doesn't make a difference.
  • Ending the respective line containing label{...} with %% doesn't make a difference.
  • Ending every line in the .cls file with % doesn't make a difference

I also observed that the compiled demonstration file provided by Wiley (AMA-stix/Documents/wileyNJD-Doc.pdf under the link provided by Marijn) has the same problem (see p. 2).

Once again, changing the WileyNJD-v2.cls file isn't an option and hardcoding a negative space in there isn't either as it might mess up the publishers typesetting. However, if one could find out what exactly is causing the issue it might be possible to fix it from inside the .tex file so any helpful comments regarding this would be highly arreciated.

P.S.: I'm using MikTeX.

Answered by Armin on October 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP