我还没有找到解决办法,所以希望得到一些建议。当我尝试更改表格中的字体颜色时,字体颜色改变后,行的上方和下方会出现额外的间距。有什么办法可以解决这个问题吗?
\begin{tabular}{>{\raggedright}p{0.5cm}>{\raggedright\arraybackslash}p{9cm}}
\ding{47} & Test 1 \\
{\color{new}{\ding{47}}} & {\color{new}{Test 2}} \\
{\color{new}{\ding{47}}} & {\color{new}{Test 3}}\\
{\color{new}{\ding{47}}} & {\color{new}{Test 4}} \\
\ding{47} & Test 5\\
\end{tabular}\
正在发生的事情的图像:
答案1
改用\textcolor
:
\documentclass{article}
\usepackage{pifont}
\usepackage{array}
\usepackage{xcolor}
\colorlet{new}{red}
\begin{document}
\begin{tabular}{>{\raggedright}p{0.5cm}>{\raggedright\arraybackslash}p{9cm}}
\ding{47} & Test 1 \\
\textcolor{new}{\ding{47}} & \textcolor{new}{Test 2} \\
\textcolor{new}{\ding{47}} & \textcolor{new}{Test 3} \\
\textcolor{new}{\ding{47}} & \textcolor{new}{Test 4} \\
\ding{47} & Test 5 \\
\end{tabular}
\end{document}
或者\leavevmode
之前\color
:
\documentclass{article}
\usepackage{pifont}
\usepackage{array}
\usepackage{xcolor}
\colorlet{new}{red}
\begin{document}
\begin{tabular}{>{\raggedright}p{0.5cm}>{\raggedright\arraybackslash}p{9cm}}
\ding{47} & Test 1 \\
\leavevmode\color{new}\ding{47} & \leavevmode\color{new}Test 2 \\
\leavevmode\color{new}\ding{47} & \leavevmode\color{new}Test 3 \\
\leavevmode\color{new}\ding{47} & \leavevmode\color{new}Test 4 \\
\ding{47} & Test 5\\
\end{tabular}
\end{document}