1

I just stumbled upon this weird problem using siunitx. I'm doing my report (mandatory in IEEE style), and it seem the micro prefix is giving me this strange t, inside a tabular environment. I specified in the preamble how I wanted the \per option to be like, as a division line.

On W10 through texstudio and XeLaTeX

\begin{table}[h]
    \renewcommand{\arraystretch}{1.3}
    \caption{the caption}
    \label{tab:ref-of-my-table}
    \centering
    \begin{tabular}{ll*{1}{S}l}
        \toprule
        {A} &   {B} & {Value} & {Unit}\\
        \midrule
        AA  &   & 0.46  & \unit{\volt} \\
        BB  &   & 0.6 & \unit{\volt} \\
        EE  &   & 115 & \unit{\uA \per  \volt \squared} \\
        GG  &   & 40  & \unit{\micro \ampere \per  \volt \squared} \\
        Slew rate   &   &   & \\
        Voltage swing IN    &   &   &    \\
        Voltage swing OUT   &   &   &    \\
        \bottomrule
    \end{tabular}
\end{table}

and the output is

enter image description here

The document and preamble

\documentclass[conference,a4paper,10pt,twocolumn,twoside]{IEEEtran}
%\IEEEoverridecommandlockouts
% The preceding line is only needed to identify funding in the first footnote. If that is unneeded, please comment it out.
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\interdisplaylinepenalty=2500       % IEEE 2 col break multiline equations
\usepackage{algorithmic}
\usepackage[italian]{babel}
    \usepackage{subcaption} % 
    \usepackage{float}
    \usepackage{subfloat}
    \usepackage{placeins}   % 
\usepackage{graphicx}
\graphicspath{./images}
\usepackage{stfloats}
\usepackage{tikz}
\usepackage[european]{circuitikz}
\usetikzlibrary{matrix,calc}
\usepackage{siunitx}
    \sisetup{
        inter-unit-product =\ensuremath{{}\cdot{}},
        display-per-mode = fraction ,
        inline-per-mode = symbol,       %% Division is "/"
        table-number-alignment = center,
        table-figures-integer = 1,
        table-figures-decimal = 2,
    }
\usepackage{textcomp}
\usepackage[T1]{fontenc}
\usepackage{pifont}
\usepackage{multirow}
\usepackage{threeparttable}
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\newcommand{\tabitem}{~~\llap{\textbullet}~~}

\begin{document}

%% Some IEEE set up, title, author, abstract %% Usual template stuff for IEEEtran type of document

\section{my first section}

%% Some paragraphs about my report

%% The table in question \begin{table}[h] \renewcommand{\arraystretch}{1.3} \caption{the caption} \label{tab:ref-of-my-table} \centering \begin{tabular}{ll*{1}{S}l} \toprule {A} & {B} & {Value} & {Unit}\ \midrule AA & & 0.46 & \unit{\volt} \ BB & & 0.6 & \unit{\volt} \ EE & & 115 & \unit{\uA \per \volt \squared} \ GG & & 40 & \unit{\micro \ampere \per \volt \squared} \ Slew rate & & & \ Voltage swing IN & & & \ Voltage swing OUT & & & \ \bottomrule \end{tabular} \end{table}

%% bib file still need to be imported

\end{document}

Fr3d
  • 141
  • 1
    I tried to reproduce with \documentclass{IEEEtran} but that worked fine and shows μ characters. So please edit your question with the full code that produces the wrong output. – Marijn Apr 16 '23 at 19:35
  • 1
    Put the full code. – Fr3d Apr 16 '23 at 19:39
  • Also for me your code worked fine and shows μ characters. It is perfect. – Sebastiano Apr 16 '23 at 19:41
  • That's really weird...... I've also cleaned the auxiliary files anr recompiled, still that weird shaped t – Fr3d Apr 16 '23 at 19:42
  • 2
    You shouldn't use \usepackage[T1]{fontenc} with XeLaTeX, remove that and the output is fine. – Marijn Apr 16 '23 at 19:44
  • Yep, now the \mu is showing, but the abstract is not in bold anymore. Thanks – Fr3d Apr 16 '23 at 19:48
  • That is a known issue with IEEEtran on XeLaTeX and LuaLaTeX, see https://tex.stackexchange.com/questions/495490/text-not-bold-in-ieeetran-paper-lualatex-debian-linux. A solution is to load the fonts via fontspec instead of via a package, so remove also textcomp and pifont and use something like \usepackage{fontspec} \usepackage{unicode-math} \setmainfont{TeX Gyre Termes} \setmathfont{TeX Gyre Termes Math} to get a Times New Roman variant (TeX Gyre in this case, if you don't have that font installed then there are a few other options like Liberation Serif or FreeSerif). – Marijn Apr 16 '23 at 20:10

1 Answers1

4

With XeLaTeX, you should not use fontenc and textcomp.

If you want to comply with the standard Times font of IEEEtran, you can load newtx.

Also subcaption is not compatible with IEEEtran and you should not load it. The subfloat package does not do “subfloats” in the same sense as subcaption. If you really need subfloats, do

\usepackage[caption=false]{subfig}

The consequence of loading caption (or subcaption) is that captions will not be in the IEEEtran style.

With the corrections:

\documentclass[conference,a4paper,10pt,twocolumn,twoside]{IEEEtran}
%\IEEEoverridecommandlockouts
% The preceding line is only needed to identify funding in the first footnote. If that is unneeded, please comment it out.
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage[italian]{babel}
%\usepackage{subcaption} % not compatible with IEEEtran
%\usepackage{float} % useless
%\usepackage{subfloat} % do you really need it?
%\usepackage{placeins} % useless in two-column format
\usepackage{graphicx}
\graphicspath{./images}
\usepackage{stfloats}
\usepackage{tikz}
\usepackage[european]{circuitikz}
\usetikzlibrary{matrix,calc}
\usepackage{siunitx}
%\usepackage{textcomp}
%\usepackage[T1]{fontenc}
%\usepackage{pifont}
\usepackage{multirow}
\usepackage{threeparttable}
\usepackage{booktabs}% http://ctan.org/pkg/booktabs

\usepackage{newtx}

\sisetup{ inter-unit-product =\ensuremath{{}\cdot{}}, display-per-mode = fraction , inline-per-mode = symbol, %% Division is "/" table-number-alignment = center, table-figures-integer = 1, table-figures-decimal = 2, }

\newcommand{\tabitem}{\llap{\textbullet}}

\interdisplaylinepenalty=2500 % IEEE 2 col break multiline equations

\begin{document}

%% Some IEEE set up, title, author, abstract %% Usual template stuff for IEEEtran type of document

\section{my first section}

%% Some paragraphs about my report

%% The table in question \begin{table}[htp] \renewcommand{\arraystretch}{1.3} \caption{the caption} \label{tab:ref-of-my-table} \centering \begin{tabular}{ll*{1}{S}l} \toprule {A} & {B} & {Value} & {Unit}\ \midrule AA & & 0.46 & \unit{\volt} \ BB & & 0.6 & \unit{\volt} \ EE & & 115 & \unit{\uA \per \volt \squared} \ GG & & 40 & \unit{\micro \ampere \per \volt \squared} \ Slew rate & & & \ Voltage swing IN & & & \ Voltage swing OUT & & & \ \bottomrule \end{tabular} \end{table}

%% bib file still need to be imported

\end{document}

enter image description here

egreg
  • 1,121,712
  • You are my hero. Is there somewhere a quick guide about the priority of packages declaration, and compatibility between latex compiler and/or document class?? – Fr3d Apr 17 '23 at 07:14
  • 2
    @Fr3d The general rule is to load only the packages you really need in the document. Custom classes such as IEEEtran often are incompatible with caption and you'll find a warning about an unsupported class in the log file. – egreg Apr 17 '23 at 09:13