
LaTeX로 작성된 가상의 책이 있습니다. 그리고 이미 4가지 수준의 제목(부분, 장, 섹션 및 하위 섹션)으로 잘 구조화되어 있지만 예술적인 목적을 위해 섹션과 하위 섹션 대신 의도적인 텍스트 이름(예: 중앙에 있는 "***")을 지정하고 이름을 렌더링하고 싶습니다. 일반적인 방법으로 렌더링하고 싶은 장과 부분. 나는 수업을 사용 scrbook
합니다 scrreprt
.
그래서 나는 이것을 원합니다 :
\documentclass{scrreprt}% or scrbook
\begin{document}
\part{Alpha}
\chapter{Aleph}
text here
\section{name for an internal usage}
text there
\section{one more internal name}
more and more text
\chapter{Bet}
\section{adjacent section}
text
\section{another internal name}
text text text
\end{document}
다음과 같이 렌더링됩니다.
1부. 알파
1장. 알레프
여기에 문자를 보내세요
***
거기에 문자 보내
***
점점 더 많은 텍스트
제2장 베팅
텍스트
***
텍스트 텍스트 텍스트
따라서 인접한 섹션이 전혀 렌더링되지 않으면 정말 좋겠지만(내 예에서는 어떻습니까) 이것이 중요한 것은 아닙니다.
또한 저는 텍스트 렌더링에 중점을 두고 있으므로 ToC는 덜 중요하지만 섹션 및 하위 섹션에 대해 ToC가 다음 텍스트 문장의 시작 부분을 사용한다면 이상적인 솔루션이 될 것입니다.
답변1
당신이 사용할 수있는 \sectionlinesformat
. 내부 이름을 사용하여 올바른 목차를 생성합니다.
그리고 사용하면 \subsection
섹션보다 작은 크기의 점이 표시됩니다.
\documentclass{scrreprt}
\renewcommand{\sectionlinesformat}[4]{\centering ***}
\begin{document}
\part{Alpha}
\chapter{Aleph}
text here
\section{name for an internal usage}
text there
\section{one more internal name}
more and more text
\chapter{Bet}
\section{adjacent section}
text
\section{another internal name}
text text text
\subsection{Test}
\end{document}
좀 더 흥미로운 기호를 사용하는 것이 좋습니다. 다음은 패키지에서 하나를 가져옵니다 adforn
. 여기에 예가 있습니다.
\documentclass{scrreprt}
\usepackage{adforn}
\renewcommand{\sectionlinesformat}[4]{\centering\adforn{21}\quad\adforn{11}\quad\adforn{49}}
\begin{document}
\part{Alpha}
\chapter{Aleph}
text here
\section{name for an internal usage}
text there
\section{one more internal name}
more and more text
\chapter{Bet}
\section{adjacent section}
text
\section{another internal name}
text text text
\subsection{Test}
\end{document}
제안된 정말 멋진 버전:
\documentclass{scrreprt}
\usepackage{adforn}
\renewcommand{\sectionlinesformat}[4]{\centering\ifstr{#1}{section}{\adforn{21}\quad\adforn{11}\quad\adforn{49}}{***}}
\renewcommand*{\chapterformat}{\chapapp~\thechapter\autodot\enskip}
\begin{document}
\part{Alpha}
\chapter{Aleph}
text here
\section{name for an internal usage}
text there
\section{one more internal name}
more and more text
\chapter{Bet}
\section{adjacent section}
text
\section{another internal name}
text text text
\subsection{Test}
\end{document}
답변2
-macro를 변경할 수 있습니다 \sectionlinesformat
. 이는 다음과 같이 섹션 이하의 섹션화 명령에 의해 호출됩니다 \sectionlinesformat{layer}{indent}{number}{text}
.
\documentclass[]{scrreprt}
\renewcommand*{\sectionlinesformat}[4]{%
\centering\textbf{***}%
}
\begin{document}
\part{Alpha}
\chapter{Aleph}
text here
\section{name for an internal usage}
text there
\section{one more internal name}
more and more text
\chapter{Bet}
\section{adjacent section}
text
\section{another internal name}
text text text
\subsection{another internal}
\end{document}