
我有一本用 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
您可以更改\sectionlinesformat
-macro,它由section和lower的分段命令調用,如下所示\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}