summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/technica/txntitle.sty
blob: c5bb719e84c89c5e70aa31c4911882985d6bae0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
\NeedsTeXFormat{LaTeX2e}[1994/11/04]
\ProvidesPackage{txntitle} [2006/10/15 Technica]
%
% The code in this package comes from parts of version 2.X of the
% package "titlesec" by Javier Bezos. The current version of "titlesec"
% is available on CTAN at tex-archive/macros/latex/contrib/titlesec                   
%
% The package is NOT a replacement for "titlesec". 
%
% Copyright  Gianfranco Boggio-Togna 2006
%
% This program may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version~1.2
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.2 or later is part of all distributions of LaTeX  
% version 1999/12/01 or later.
%
% This program consists of the file txntitle.sty
%
% This macro is a straight copy of |\ttl@setmarks| in \texttt{ttlps.def}
% with just one difference:\\
%      |\protect\@namedef{#2title}{\@nameuse{#2title}}|\\
% replaces\\
%      |\protect\@namedef{#2title}{}|
\def \TXNt@ttl@setmarks #1#2{%
  \expandafter\def\csname#1mark\endcsname##1{%
    \expandafter\gdef\csname#1title\endcsname{##1}%
    \ttl@setifthe{#1}%
    \def\ttl@marks{%
      \protect\@namedef{#1title}{##1}%
      \protect\@namedef{#2title}{\@nameuse{#2title}}%
      \protect\@namedef{the#1}{\@nameuse{the#1}}%
      \protect\@namedef{the#2}{}%
      \protect\@namedef{ifthe#1}{\@nameuse{ifthe#1}}%
      \protect\@namedef{ifthe#2}{\protect\@secondoftwo}%
      \ttl@moremarks}%
    \ttl@markboth{#1}}%
  \expandafter\def\csname#2mark\endcsname##1{%
    \expandafter\gdef\csname#2title\endcsname{##1}%
    \ttl@setifthe{#2}%
    \def\ttl@marks{%
      \protect\@namedef{#1title}{\@nameuse{#1title}}%
      \protect\@namedef{#2title}{##1}%
      \protect\@namedef{the#1}{\@nameuse{the#1}}%
      \protect\@namedef{the#2}{\@nameuse{the#2}}%
      \protect\@namedef{ifthe#1}{\@nameuse{ifthe#1}}%
      \protect\@namedef{ifthe#2}{\@nameuse{ifthe#2}}%
      \ttl@moremarks}%
    \ttl@markboth{#1}}%
}
\def \TXNt@set@numerus@marks {%
  \protected@xdef\ttl@prevmarks{\ttl@marks}%
  \csname \TXN@section@name mark\expandafter\endcsname
    \expandafter {\TXN@section@headline}%
  \gdef\ttl@prevmarks{\ttl@marks}%
  \csname \TXN@section@name mark\expandafter\endcsname
    \expandafter {\TXN@section@headline}%
}