
私は 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
。内部名を使用して正しい toc が生成されます。
使用すると、\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
パッケージから 1 つ取得したものです。例を示します。
\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
、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}