편집하다

편집하다

아래 그림과 같이 섹션 제목과 오른쪽 여백까지 확장되는 수평선을 어떻게 만들 수 있습니까?

여기에 이미지 설명을 입력하세요

답변1

편집하다

섹션 번호가 필요하지 않은 경우 \section*{First Section}다음과 같이 예제를 사용하거나 변경할 수 있습니다(목차가 필요한 경우 번거로울 수 있음).

\documentclass[a4paper]{article}
\usepackage{xcolor, blindtext}
\usepackage[explicit]{titlesec}

\newcommand{\sectionrule}[2][0ex]{\leaders\hbox{{\color{cyan}\rule[#1]{1pt}{#2}}}\hfill}
\titleformat{\section}{\Large\bfseries}{}{0pt}{#1\,\sectionrule[0.5ex]{1.5pt}}

\begin{document}

  \section{First Section}
  \blindtext
  
  \section{Second Section}
  \blindtext

\end{document}

5살짜리를 찾았어요버나드의 대답나는 약간만 적용했습니다.

\documentclass[a4paper]{article}
\usepackage{xcolor, blindtext}
\usepackage[explicit]{titlesec}

\newcommand{\sectionrule}[2][0ex]{\leaders\hbox{{\color{cyan}\rule[#1]{1pt}{#2}}}\hfill}
\titleformat{\section}{\Large\bfseries}{\thesection}{1em}{#1\,\sectionrule[0.5ex]{1.5pt}}

\begin{document}

  \section{First Section}
  \blindtext
  
  \section{Second Section}
  \blindtext

\end{document} 

수평선

관련 정보