summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/disser/chapter.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-05-19 16:20:14 +0000
committerKarl Berry <karl@freefriends.org>2007-05-19 16:20:14 +0000
commit1e19960b463415b2fb8a096f7ce4f9b2a50410f5 (patch)
tree434820857adb1d7bb63edcb5c441d7ca8e7f33cc /Master/texmf-dist/source/latex/disser/chapter.dtx
parent9c9ebf7d3184800d2abdff96d70099836b153548 (diff)
new russian-oriented package disser (3mar07)
git-svn-id: svn://tug.org/texlive/trunk@4317 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/disser/chapter.dtx')
-rw-r--r--Master/texmf-dist/source/latex/disser/chapter.dtx237
1 files changed, 237 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/disser/chapter.dtx b/Master/texmf-dist/source/latex/disser/chapter.dtx
new file mode 100644
index 00000000000..d85b16a6c66
--- /dev/null
+++ b/Master/texmf-dist/source/latex/disser/chapter.dtx
@@ -0,0 +1,237 @@
+% \begin{macrocode}
+
+%<*chapter>
+% \end{macrocode}
+%
+% \subsection{Глава}
+%
+% Пустое определение маркера главы.
+% \begin{macrocode}
+\newcommand*\chaptermark[1]{}
+% \end{macrocode}
+% Далее идут параметры аналогичные тем, что использовались в
+% предыдущем разделе.
+% \begin{macrocode}
+\providecommand\tocprethechapter{\protect\chaptername~}
+\providecommand\tocpostthechapter{.\@postskip}
+\providecommand\tocchapterfill{\tocfill{.}}
+
+\providecommand\tocchapterfont{\bfseries}
+\providecommand\tocchapterfillfont{\normalfont}
+\providecommand\tocchapternumfont{\normalfont}
+
+\providecommand\thechapteralign{\centering}
+\providecommand\thechapterfont{\Large}
+\providecommand\prethechapter{\protect\chaptername~}
+\providecommand\postthechapter{\par\nobreak\vskip 5\p@}
+
+\providecommand\chapteralign{\centering}
+\providecommand\chapterfont{\Large\bfseries}
+\providecommand\prechapter{}
+\providecommand\postchapter{\par\nobreak\vskip 20\p@}
+
+% \end{macrocode}
+% Параметры формата заголовка Приложения.
+% \begin{macrocode}
+\providecommand\tocpretheappendix{\protect\appendixname~}
+\providecommand\tocposttheappendix{.\@postskip}
+\providecommand\tocappendixfill{\tocfill{.}}
+
+\providecommand\tocappendixfont{\bfseries}
+\providecommand\tocappendixfillfont{\normalfont}
+\providecommand\tocappendixnumfont{\normalfont}
+
+\providecommand\theappendixalign{\centering}
+\providecommand\theappendixfont{\Large}
+\providecommand\pretheappendix{\protect\appendixname~}
+\providecommand\posttheappendix{\par\nobreak\vskip 5\p@}
+
+\providecommand\appendixalign{\centering}
+\providecommand\appendixfont{\Large\bfseries}
+\providecommand\preappendix{}
+\providecommand\postappendix{\par\nobreak\vskip 20\p@}
+
+% \end{macrocode}
+% Интерфейс.
+% \begin{macrocode}
+\newcommand\chapter{%
+ \if@openright
+ \cleardoublepage
+ \else
+ \clearpage
+ \fi
+ \thispagestyle{plain}%
+ \global\@topnum\z@
+ \@afterindentfalse
+ \secdef\@chapter\@schapter
+}
+
+\def\@chapter[#1]#2{
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{chapter}%
+ {\def\\{ }\addcontentsline{toc}{chapter}{\@tocseccntformat{chapter} #1}}%
+ \else
+ {\def\\{ }\addcontentsline{toc}{chapter}{#1}}%
+ \fi
+ \chaptermark{#1}%
+% \end{macrocode}
+% Добавление вертикальных разделителей в списки рисунков и таблиц.
+% \begin{macrocode}
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{#2}]%
+ \else
+ \@makechapterhead{#2}%
+ \@afterheading
+ \fi
+}
+% \end{macrocode}
+% Формат на странице.
+% \begin{macrocode}
+\def\@makechapterhead#1{%
+ {%
+% \end{macrocode}
+% Установка нулевого абзацного отступа.
+% \begin{macrocode}
+ \parindent \z@ \raggedright \normalfont
+% \end{macrocode}
+% Постоянная часть заголовка.
+% \begin{macrocode}
+ \ifnum \c@secnumdepth >\m@ne
+ {\thechapterfont\thechapteralign\@seccntformat{chapter}}
+ \fi
+ \interlinepenalty\@M
+ \chapterfont\chapteralign\prechapter #1\postchapter
+ }
+}
+
+\def\@schapter#1{
+ \if@twocolumn
+ \@topnewpage[\@makeschapterhead{#1}]%
+ \else
+ \@makeschapterhead{#1}%
+ \@afterheading
+ \fi
+}
+
+\def\@makeschapterhead#1{%
+ {%
+ \parindent \z@ \raggedright
+ \normalfont\interlinepenalty\@M
+ \chapteralign{\chapterfont\prechapter #1\postchapter}
+ }
+}
+% \end{macrocode}
+% Команда, создающая запись в Содержании.
+% \begin{macrocode}
+\newcommand*\l@chapter[2]{%
+ \ifnum \c@tocdepth >\m@ne
+ \addpenalty{-\@highpenalty}
+ \vskip 1.0em \@plus\p@
+ \setlength\@tempdima{1.5em}
+ \begingroup
+ \parindent \z@ \rightskip \@pnumwidth
+ \parfillskip -\@pnumwidth
+ \leavevmode
+ \tocchapterfont
+ \advance\leftskip\@tempdima
+ \hskip -\leftskip
+ #1\nobreak
+ \tocchapterfillfont\tocchapterfill\hfill
+ \nobreak\hb@xt@\@pnumwidth{\hss\tocchapternumfont #2}\par
+ \penalty\@highpenalty
+ \endgroup
+ \fi
+}
+
+% \end{macrocode}
+% Команда для создания глав Приложения.
+% \begin{macrocode}
+\newcommand\appendix{
+ \setcounter{chapter}{0}
+ \setcounter{section}{0}
+
+% \end{macrocode}
+% Сохранение старых значений.
+% \begin{macrocode}
+ \let\oldtocprethechapter=\tocprethechapter
+ \let\oldtocpostthechapter=\tocpostthechapter
+ \let\oldtocchapterfill=\tocchapterfill
+
+ \let\oldtocchapterfont=\tocchapterfont
+ \let\oldtocchapterfillfont=\tocchapterfillfont
+ \let\oldtocchapternumfont=\tocchapternumfont
+
+ \let\oldthechapteralign=\thechapteralign
+ \let\oldthechapterfont=\thechapterfont
+ \let\oldprethechapter=\prethechapter
+ \let\oldpostthechapter=\postthechapter
+
+ \let\oldchapteralign=\chapteralign
+ \let\oldchapterfont=\chapterfont
+ \let\oldprechapter=\prechapter
+ \let\oldpostchapter=\postchapter
+ \let\oldthechapter=\thechapter
+
+% \end{macrocode}
+% Перезапись параметров формата главы для оформления приложений.
+% \begin{macrocode}
+ \renewcommand\tocprethechapter{\tocpretheappendix}
+ \renewcommand\tocpostthechapter{\tocposttheappendix}
+ \renewcommand\tocchapterfill{\tocappendixfill}
+
+ \renewcommand\tocchapterfont{\tocappendixfont}
+ \renewcommand\tocchapterfillfont{\tocappendixfillfont}
+ \renewcommand\tocchapternumfont{\tocappendixnumfont}
+
+ \renewcommand\thechapteralign{\theappendixalign}
+ \renewcommand\thechapterfont{\theappendixfont}
+ \renewcommand\prethechapter{\pretheappendix}
+ \renewcommand\postthechapter{\posttheappendix}
+
+ \renewcommand\chapteralign{\appendixalign}
+ \renewcommand\chapterfont{\appendixfont}
+ \renewcommand\prechapter{\preappendix}
+ \renewcommand\postchapter{\postappendix}
+
+ \gdef\thechapter{\theappendix}
+}
+
+\newcommand\noappendix{
+ \let\tocprethechapter=\oldtocprethechapter
+ \let\tocpostthechapter=\oldtocpostthechapter
+ \let\tocchapterfill=\oldtocchapterfill
+
+ \let\tocchapterfont=\oldtocchapterfont
+ \let\tocchapterfillfont=\oldtocchapterfillfont
+ \let\tocchapternumfont=\oldtocchapternumfont
+
+ \let\thechapteralign=\oldthechapteralign
+ \let\thechapterfont=\oldthechapterfont
+ \let\prethechapter=\oldprethechapter
+ \let\postthechapter=\oldpostthechapter
+
+ \let\chapteralign=\oldchapteralign
+ \let\chapterfont=\oldchapterfont
+ \let\prechapter=\oldprechapter
+ \let\postchapter=\oldpostchapter
+
+ \gdef\thechapter{\oldthechapter}
+}
+
+% \end{macrocode}
+% Команда для создания ненумеруемых глав, которые будут включены в
+% Содержание и PDF-закладки. Для того, чтобы закладка указывала именно на
+% заголовок, а не на первый абзац под ним, нужно поместить |\phantomchapter| % и |\addcontentsline| внутри аргумента |\chapter*|. Честно говоря, мне это
+% не нравится. Надо придумать что-то более простое и изящное.
+% \begin{macrocode}
+\newcommand\nchapter[1]{%
+ \chapter*{%
+ \phantomchapter\addcontentsline{toc}{chapter}{#1}%
+ #1%
+ \@mkboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}
+ }
+}
+%</chapter>
+% \end{macrocode}