為什麼 cms 會出現在輸出?

為什麼 cms 會出現在輸出?

在此輸入影像描述

\usepackage{float}
\usepackage{bigstrut}
\usepackage{makecell}



\renewcommand\theadalign{bc}
\renewcommand\theadfont{\sfdefault}

\renewcommand\theadgape{\Gape[4pt]}
\renewcommand\cellgape{\Gape[4pt]}



\begin{table}[H]
  \centering
  \caption{Add caption}
    \begin{tabular}{r r}
    \hline
    \rowcolor{LightCyan}
    \thead{Emax/V \\ $\Delta$= $\pm$ 0 V}  & V2 (V) \bigstrut\\
    \hline
    1   & 2 \bigstrut\\
\end{tabular}
\end{table}

答案1

想必你想要

\renewcommand\theadfont{\sffamily}

並不是

\renewcommand\theadfont{\sfdefault}

\sfdefault保存字體名稱/標識符(此處cmss),要實際使用無襯線,您需要\sffamily.

沒有cmss的程式碼輸出

\documentclass{article}
\usepackage{float}
\usepackage{bigstrut}
\usepackage{makecell}
\usepackage[table,svgnames]{xcolor}
\usepackage{siunitx} % for typesetting units and numbers with units

\renewcommand\theadalign{bc}
\renewcommand\theadfont{\sffamily}
\renewcommand\theadgape{\Gape[4pt]}
\renewcommand\cellgape{\Gape[4pt]}

\begin{document}
\begin{table}[H]
  \centering
  \caption{Add caption}
    \begin{tabular}{r r}
    \hline
    \rowcolor{LightCyan}
    \thead{Emax/V \\ $\Delta= \pm 0$\,V}  & V2 (V) \bigstrut\\
    \thead{Emax/V \\ $\Delta= \SI[detect-family]{+-0}{\volt}$}  & V2 (V) \bigstrut\\ % siunitx-alternative
    \hline
    1   & 2 \bigstrut\\
\end{tabular}
\end{table}
\end{document}

相關內容