我有一张表格,我正在尝试调整间距,以便最右边的列尽可能地移到页面的右侧,以与拉伸页面宽度的水平规则对齐(自动插入每个新部分标题)。
我使用的标记是:
\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}}
\titleformat{\section}
{\normalfont\Large\bfseries}{\thesection}
{1em}{}[\color{darkjunglegreen}{\titlerule[2pt]}]
\titlespacing\section{0pt}{1pt plus 4pt minus 2pt}{-3pt plus 2pt minus 2pt}
\newcommand{\forceindent}{\leavevmode{\parindent=1.5em\indent}}
\begin{document}
\sloppy
\begin{tabular*}{7.5in}{@{}l@{\extracolsep{\fill}}r}
\colorbox{white}{\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}
\vspace{0.1mm}
\end{tabular*}
\section*{Career Summary}
\end{document}
我还制作了一幅图像来演示事物如何没有对齐以及它们应该在的位置。
我不明白为什么在页面的右侧,底部的条目(包含 NY)比其上方的电子邮件地址更靠左?
我希望两者都尽可能地符合水平规则,类似于左侧条目与左侧条目一致。
改变这些表条目间距的正确方法是什么?
答案1
您可能对以下内容更满意,我已将设置tabular*
为与文本宽度一样宽,并通过添加删除了右侧的额外小水平空白@{}
(就像您在表格左侧所做的那样):
\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}}
\titleformat{\section}
{\normalfont\Large\bfseries}{\thesection}
{1em}{}[\color{darkjunglegreen}{\titlerule[2pt]}]
\titlespacing\section{0pt}{1pt plus 4pt minus 2pt}{-3pt plus 2pt minus 2pt}
\newcommand{\forceindent}{\leavevmode{\parindent=1.5em\indent}}
\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*}
\section*{Career Summary}
\end{document}