我有一个表格,其中第一列的条目与页面左侧对齐。我在其中一个条目周围有一个颜色框,这导致文本略微缩进。有什么方法可以防止这种情况发生吗?
显示问题的图片:
我使用的标记:
\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}