섹션에 따라 문서 부분 스타일 지정

섹션에 따라 문서 부분 스타일 지정

cls섹션 제목이나 섹션과 연결된 레이블을 기반으로 파일 의 섹션 스타일을 어떻게 정의할 수 있나요 ? 제목/라벨의 최소한의 하위 집합이 사용된다는 점을 아는 것 외에는 tex 파일의 내용을 제어할 수 없습니다.

예를 들어, "toppart" 내의 콘텐츠는 두 개의 열로 구성되고, "middle part" 내의 콘텐츠 글꼴 크기는 8pt로, "bottompart" 내의 콘텐츠는 글꼴 색상이 빨간색이 되기를 원합니다.

\documentclass{article}

\begin{document}

\section{toppart}\label{toppart} %%%%%%

This is stuff at the top.

\section{middlepart}\label{middlepart} %%%%%%

This is stuff in the middle.

\section{endpart}\label{endpart} %%%%%%

This is stuff at the end.

\end{document}

분명히 말하면 .로 끝나는 줄이 표시됩니다 %%%%%%.

답변1

가장 좋은 방법은 환경을 활용하는 것이라고 생각합니다. 다음은 섹션을 코딩하는 방법에 대한 예입니다 toppart.

% secprob2.tex  SE 519788 Different setting within named sections

\documentclass{article}
\usepackage{multicol}
\usepackage{lipsum}

\newenvironment{toppart}{%
  \section{toppart}\label{toppart}
  \begin{multicols}{2}}%
  {\end{multicols}}

\begin{document}
\section{Normal section}
\lipsum[1]

\begin{toppart}
\lipsum[1]
\end{toppart}

\section{Another regular section}

There is a section~\ref{toppart}.

\lipsum[1]

\end{document}

물론 환경에서 toppart다양한 섹션 제목과 레이블을 사용할 수 있도록 이를 확장할 수도 있습니다.

middlepart귀하의 섹션 과 귀하의 섹션 에 맞는 유사한 환경을 고안하는 것은 귀하의 몫입니다 endpart.

관련 정보