Quantcast
Channel: change font for content of table - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 3

Answer by Werner for change font for content of table

$
0
0

This utilizes Can I change all math output to use monospaced text? to add the appropriate \everymath command to your \@floatboxreset patch:

enter image description here

\documentclass{article}\usepackage{etoolbox}\makeatletter\appto\@floatboxreset{%  \ifx\@captype\andy@table    \ttfamily    % https://tex.stackexchange.com/q/119879/5764    \everymath{\mathtt{\xdef\tmp{\fam\the\fam\relax}\aftergroup\tmp}}%   \fi}\def\andy@table{table}\makeatother\begin{document}\begin{table}  \begin{tabular}{ l *{3}{c} }    \hline& treat x time & treat x time x female & treat x time x female       \\    \hline    (Intercept) & $-0.03$          & $0.01$           & $-0.83^{*}$       \\& $[-0.16;\ 0.10]$ & $[-0.13;\ 0.15]$ & $[-0.93;\ -0.73]$ \\    v1          & $-0.06$          & $-0.06$          & $-0.07$           \\& $[-0.23;\ 0.11]$ & $[-0.23;\ 0.11]$ & $[-0.18;\ 0.05]$  \\    v2          & $0.05$           & $-0.03$          &                   \\& $[-0.04;\ 0.15]$ & $[-0.16;\ 0.11]$ &                   \\    \hline    \multicolumn{4}{l}{\scriptsize{$^*$ 0 outside the confidence interval. Fixed effect of time treated as factor.}}  \end{tabular}\end{table}\end{document}

Unfortunately the spacing around a unary minus is not consistent. For example, see $a - b$ $-b$ $[-b]$ ${-}b$:

enter image description here

You may have to use the {-} to force a unary minus where needed.


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>