
너비가 다른 두 개의 열을 만드는 데 사용하고 있습니다 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}