如何獲得下劃線的標題

如何獲得下劃線的標題

我想得到下劃線的部分標題,看起來像“專業經驗”和“教育”下的行例子。我更願意在不切換到簡歷文檔類別的情況下執行此操作。

另外,如果有一種方法可以在居中文本下方添加線寬下劃線,然後在該下劃線下方居中放置一些較小的文本,那就太好了。 (因此,就像在姓名下劃線然後在下劃線下添加聯絡資訊一樣。)

答案1

我已經修改了給定的回复在開頭帶有短文字的整行下劃線但有一個小限制,部分標題應小於線寬。

\documentclass{article}
\usepackage{calc}  %% Needed for calculating remaining length. 
\usepackage{lipsum}

\newlength{\remaining}
\newcommand{\titleline}[1]{%
\setlength{\remaining}{\textwidth-\widthof{\textsc{#1}}}
\noindent\underline{\textsc{#1}\hspace*{\remaining}}\par}
\begin{document}

\titleline{Section Underlined}

\lipsum

\titleline{In case if I use a bigger line as a section title this command may behave weirdly }


\end{document}

MWE 會有更好的幫助。

答案2

我認為您在這裡同時問兩個問題。然而,關於主要部分你可以做:

\documentclass{article}
\usepackage{lipsum}

\newcommand\myresumesection[1]{%
  \section*{\MakeUppercase{#1}}
  \raisebox{2em}[0pt][0pt]{\rule{\textwidth}{.5pt}}
}

\begin{document}
\myresumesection{Professional experience}

\lipsum[1]
\end{document}

解決方案渲染

相關內容