如何得到更纖薄的 \textbar?

如何得到更纖薄的 \textbar?

\textbar在標題中使用它來將頁碼與部分分開。

\thepage\hspace{0.5ex}\textbar\hspace{1ex}\thesection\sectiontitle

但我想減薄其厚度\textbar並將其設置為 0.15ex(以匹配頭尺的寬度)。必須\textbar比頁碼和章節標題高一點(\textbar已經是這樣了)。

答案1

我會\textbar使用\scalebox{<factor>}[1]來自graphicx

在此輸入影像描述

\documentclass{article}
\usepackage{titleps,lipsum,graphicx}
\newcommand{\newtextbar}[1][.7]{\scalebox{#1}[1]{\textbar}}
\newpagestyle{main}{
  \setheadrule{0.15ex}
  \sethead{}{\thepage\hspace{0.5ex}\textbar{} \newtextbar\hspace{1ex}\thesection{} \sectiontitle}{}
}
\pagestyle{main}
\begin{document}

\section{A section}
\lipsum[1-5]

\end{document}

\newtextbar具有 70% 的寬度\textbar(預設),儘管您可以調整預設值和實際使用的\newtextbar[<factor>].因子 > 1 會使其變厚,而因子 < 1 則會使其變薄。

相關內容