![防止颜色框缩进文本](https://linux22.com/image/479448/%E9%98%B2%E6%AD%A2%E9%A2%9C%E8%89%B2%E6%A1%86%E7%BC%A9%E8%BF%9B%E6%96%87%E6%9C%AC.png)
我有一个表格,其中第一列的条目与页面左侧对齐。我在其中一个条目周围有一个颜色框,这导致文本略微缩进。有什么方法可以防止这种情况发生吗?
显示问题的图片:
我使用的标记:
\documentclass[letterpaper,11pt]{article}
\usepackage{kpfonts}
\setlength{\parskip}{\baselineskip}%
\setlength{\parindent}{0pt}%
\usepackage{xcolor}
\definecolor{smokyblack}{rgb}{0.06, 0.05, 0.03}
\definecolor{mygrey}{rgb}{0.1, 0.14, 0.12}
\definecolor{darkjunglegreen}{rgb}{0.0, 0.26, 0.15}
\usepackage[
top = 0.608cm,
bottom = 1.1cm,
left = 1.20cm,
right = 1.10cm]{geometry}
\usepackage{titlesec}
\makeatletter
\newcommand\semiLarge{\@setfontsize\semiLarge{13.22}{17.38}}
\begin{document}
\sloppy
\begin{tabular*}{\linewidth}{@{}l@{\extracolsep{\fill}}r@{}}
\textbf{\LARGE \textcolor{mygrey}{REAL NAME}} & \large{[email protected]}\\
\colorbox{mygrey!11}{\textbf{\semiLarge \textcolor{smokyblack}{Employed Professional}}} & \large{555-555-5555 - New York, NY}
\end{tabular*}
\end{document}
答案1
\colorbox
xcolor 中的宏添加了边框\fboxsep
(实际上它使用了\fbox
)。这补偿了多余的水平空间。
\documentclass[letterpaper,11pt]{article}
\usepackage{kpfonts}
\setlength{\parskip}{\baselineskip}%
\setlength{\parindent}{0pt}%
\usepackage{xcolor}
\definecolor{smokyblack}{rgb}{0.06, 0.05, 0.03}
\definecolor{mygrey}{rgb}{0.1, 0.14, 0.12}
\definecolor{darkjunglegreen}{rgb}{0.0, 0.26, 0.15}
\usepackage[
top = 0.608cm,
bottom = 1.1cm,
left = 1.20cm,
right = 1.10cm]{geometry}
\usepackage{titlesec}
\makeatletter
\newcommand\semiLarge{\@setfontsize\semiLarge{13.22}{17.38}}
\begin{document}
\sloppy
\begin{tabular*}{\linewidth}{@{}l@{\extracolsep{\fill}}r@{}}
\textbf{\LARGE \textcolor{mygrey}{REAL NAME}} & \large{[email protected]}\\
\hspace{-\fboxsep}\colorbox{mygrey!11}{\textbf{\semiLarge \textcolor{smokyblack}{Employed Professional}}} & \large{555-555-5555 - New York, NY}
\end{tabular*}
\end{document}