
我用來tabular
製作兩列不同寬度的。理想情況下,我希望每列的標題下方都有一條水平線,對於第一列,直到列的末尾,對於第二列,直到邊距。我用過\hrule
,它遠遠超出了邊緣。這是一個片段:
\documentclass[10pt]{article}
\usepackage{geometry,array}
\geometry{verbose,tmargin=40pt,bmargin=40pt,lmargin=30pt,
rmargin=30pt}
\newcolumntype{R}{>{\raggedright}p{0.4\textwidth}}
\newcolumntype{L}{p{0.6\textwidth}}
\begin{document}
\begin{tabular}{L R}
{\subsection*{EDUCATION}}
\hrule
\vspace{2mm}
&
{\subsection*{SKILLS}}
\hrule
\vspace{2mm}
\end{tabular}
\end{document}
\hrule
我怎麼能以比使用右列中的值更好的方式實現第二個不超過右邊距的預期結果?
答案1
這是可行的,但正如我在評論中提到的,您的幾何設定不是最佳的:
\documentclass[10pt]{article}
\usepackage{geometry,array}
\usepackage{calc}
\geometry{verbose,tmargin=40pt,bmargin=40pt,lmargin=30pt,
rmargin=30pt}
\usepackage{showframe} % shows you the cut-off side margin
\begin{document}
\noindent % If the table stands alone, as it is, it will get a paragraph indent without this command.
%\tabcolsep=15pt % if you want to change the blank width in the middle
\begin{tabular}{@{}p{0.46\textwidth} >{\raggedright\arraybackslash}p{0.54\textwidth-2\tabcolsep}}
{\subsection*{EDUCATION}}
\hrule
\vspace{2mm}
&
{\subsection*{SKILLS}}
\hrule
\vspace{2mm}
\end{tabular}
\end{document}