# This is -*- tcl -*- script which adds page footers of following
# format:
#
#<copyright sign> <year> Jet Infosystems
#
# and page headers with small cap'ed current section name.
#
# $Id: jet_pages_duplex,v 1.4 2002/03/04 10:11:45 tobotras Exp $

# Can't be used with page_headers (yet).

global TEItools_page_headers_in_use
if { [info exists TEItools_page_headers_in_use] } {
    puts stderr "\n*** 'jet_pages' style can't be used with 'page_headers'!\n"
    exit 1
}

rename pageLayout pageLayout_JetPages

proc pageLayout {} {

    set date [exec date +%Y]
    withNode doctree descendant element DOCDATE {
	set date "\\TEItoolsDate\{\}"
    }
    
    return "
% Page layout

\\usepackage{fancyhdr}
\\pagestyle{fancy}
\\fancyhead{}
\\fancyhead\[CO\]{\\hfil\\rightmark\\hfil}
\\fancyhead\[CE\]{\\hfil\\leftmark\\hfil}
\\fancyfoot\[LO,RE\]{\\textit{\\cyr [authorMacro 0], ${date}}}
\\fancyfoot\[LE,RO\]{\\thepage}
\\fancyfoot\[C\]{}
\\renewcommand{\\headrulewidth}{0.75pt}
\\renewcommand{\\footrulewidth}{0.75pt}
\\renewcommand{\\sectionmark}\[1\]{\\markboth{\\textsc{\\small \#1}}{\\textsc{\\small \#1}}}
\\renewcommand{\\subsectionmark}\[1\]{\\markright{\\textsc{\\small \#1}}}
\\renewcommand{\\subsubsectionmark}\[1\]{}
\\renewcommand{\\paragraphmark}\[1\]{}
\\renewcommand{\\subparagraphmark}\[1\]{}
%\\addtolength{\\headheight}{2\\baselineskip}
% 

[pageLayout_JetPages]
"
}

rename defineTitlePageStyle {}

proc defineTitlePageStyle {} {
    return "%\\thispagestyle{empty}\n"
}

rename geometryArgs {}

proc geometryArgs {} {
    global TEItools_GOST_no_head
    return "a4paper,twoside,twosideshift=0mm"
}

rename closeFront {}

proc closeFront {} {
    # for book style
    return "\n\\thispagestyle{empty}\\cleardoublepage\n\\mainmatter\n"
}
