summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-06-24 23:34:59 +0000
committerKarl Berry <karl@freefriends.org>2010-06-24 23:34:59 +0000
commitf794e99605085b9f6cef922ba918d6f87cbb76f3 (patch)
tree1b9688a8fd5774f56f4c9377f6455bacfe6fd46a /Master/texmf-dist/tex
parenta239d22e4544943d4b7122d89a80e3ec80b97291 (diff)
frontespizio 1.2 (24jun10)
git-svn-id: svn://tug.org/texlive/trunk@19139 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/frontespizio/frontespizio.sty142
1 files changed, 88 insertions, 54 deletions
diff --git a/Master/texmf-dist/tex/latex/frontespizio/frontespizio.sty b/Master/texmf-dist/tex/latex/frontespizio/frontespizio.sty
index bb81afd9411..72b4172ad4d 100644
--- a/Master/texmf-dist/tex/latex/frontespizio/frontespizio.sty
+++ b/Master/texmf-dist/tex/latex/frontespizio/frontespizio.sty
@@ -6,7 +6,7 @@
%%
%% frontespizio.dtx (with options: `package')
%%
-%% Copyright 2008 Enrico Gregorio
+%% Copyright 2008-2010 Enrico Gregorio
%%
%% This program is provided under the terms of the
%% LaTeX Project Public License distributed from CTAN
@@ -17,9 +17,10 @@
%%
%% This work has the LPPL maintenance status "author-maintained".
%%
-\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{frontespizio}
- [2009/04/03 1.1 (Enrico Gregorio)]
+ [2010/06/25 1.2 (Enrico Gregorio)]
+
\def\@not@eTeX{%
\PackageError{frontespizio}
{This package requires e-TeX, I'll stop right now}
@@ -44,47 +45,47 @@
\DeclareOption{normal}{\def\front@thefont{\fontoptionnormal}}
\DeclareOption{sans}{\def\front@thefont{\fontoptionsans}}
\DeclareOption{norules}{\let\front@norules=T}
+\DeclareOption{nouppercase}{\let\front@nouppercase=T}
+\DeclareOption{noinputenc}{\let\front@noinputenc=T}
\newif\iffront@include
\DeclareOption{onlyinclude}{\front@includetrue\ExecuteOptions{nowrite}}
-\DeclareOption*{\edef\front@grfdriver{\CurrentOption}}
+\let\front@otheroptions\@empty
+\DeclareOption*{\expandafter\g@addto@macro\expandafter\front@otheroptions
+ \expandafter{\CurrentOption,}}
\ExecuteOptions{write,normal}
\ProcessOptions\relax
\RequirePackage{afterpage}
\RequirePackage{graphicx}
-\RequirePackage{eso-pic}
+\RequirePackage{atbegshi}
+\RequirePackage{environ}
\iffront@include
\newcommand{\includefront}[2][0]{%
\titlepage\null
- \AddToShipoutPicture*{\includegraphics{#2}}%
+ \AtBeginShipoutNext{\AtBeginShipoutUpperLeft{%
+ \vbox to\z@{\hbox{\includegraphics{#2}}\vss}}}
\afterpage{\thispagestyle{empty}}%
\endtitlepage
\ifx0#1\else
\null\thispagestyle{empty}\newpage\addtocounter{page}{-#1}%
\fi}
\newenvironment{frontespizio}{%
- \PackageError{frontespizio}
- {Using the `frontespizio' environment along with the%
- \MessageBreak
- `onlyinclude' option is not allowed}
- {You have called `frontespizio' with the `onlyinclude' option%
+ \PackageWarningNoLine{frontespizio}
+ {Using the `frontespizio' environment along with%
\MessageBreak
- which disallows the `frontespizio' environment, thus be%
+ the `onlyinclude' option is meaningless. The%
\MessageBreak
- prepared for a long string of errors.%
- \MessageBreak
- The best is to hit `x' now and correct your input.}%
- }{}
+ environment's content will be ignored}
+ \Collect@Body\@gobble}{}
\expandafter\endinput
\else
\RequirePackage{ifpdf}
-\def\front@ifxetex{%
- \expandafter\let
- \csname ifxetex\expandafter\endcsname
- \csname iffalse\endcsname}
-\IfFileExists{ifxetex.sty}{\RequirePackage{ifxetex}}{\front@ifxetex}
-\let\front@ifxetex\@undefined
+\RequirePackage{ifxetex}
\fi
\iffront@write
+ \ifdefined\pdfmdfivesum
+ \IfFileExists{\jobname-frn.tex}{%
+ \xdef\front@mdfiveold{\pdfmdfivesum file{\jobname-frn.tex}}}{}%
+ \fi
\newwrite\front@out
\immediate\openout\front@out=\jobname-frn.tex
\long\def\front@write#1{\immediate\write\front@out{\unexpanded{#1}}}
@@ -94,12 +95,25 @@
\let\front@expwrite\front@write
\fi
\front@write{\documentclass[titlepage]{article}}
+\ifdefined\front@noinputenc\else
+ \ifdefined\inputencodingname
+ \front@expwrite{\string\usepackage[\inputencodingname]{inputenc}}
+ \fi
+\fi
\front@write{\usepackage[a4paper,%
left=1cm,bottom=1.5cm,right=1cm,top=1cm]{geometry}}
-\ifdefined\front@grfdriver
- \def\front@temp driver=#1\@nil{\def\front@grfdriver{#1}}
- \expandafter\front@temp\front@grfdriver\@nil
- \front@expwrite{\string\usepackage[\front@grfdriver]{graphicx}}
+\ifx\front@otheroptions\@empty
+ \front@write{\usepackage{graphicx}}
+\else
+ \begingroup
+ \def\KV@errx#1{%
+ \PackageError{frontespizio}{Key #1}
+ {The only allowed key is `driver'; the given key will be ignored.%
+ \MessageBreak Type \space<return> \space to proceed.}}
+ \define@key{front}{driver}{\front@write{\usepackage[#1]{graphicx}}}
+ \edef\front@processkeys{\noexpand\setkeys{front}{\front@otheroptions}}
+ \front@processkeys
+ \endgroup
\fi
\def\front@theoptions{nowrite,infront}
\ifdefined\front@signatures
@@ -114,6 +128,9 @@
\ifdefined\front@norules
\g@addto@macro\front@theoptions{,norules}
\fi
+\ifdefined\front@nouppercase
+ \g@addto@macro\front@theoptions{,nouppercase}
+\fi
\front@expwrite{\string\usepackage[\front@theoptions]{frontespizio}}
\front@write{\nofiles}
\expandafter\front@write\expandafter{\front@thefont}
@@ -152,6 +169,9 @@
\def\@front@#1{TT\fi\@nameuse{iffront@#1}}
\iffront@write
\newcommand{\Preambolo}[1]{\front@write{#1}}
+\newenvironment{Preambolo*}
+ {\@makeother\%\@makeother\^^M\newlinechar=`\^^M
+ \Collect@Body\front@write}{}
\newcommand{\Rientro}[1]{\front@write{\Rientro{#1}}}
\newcommand{\Margini}[4]{\front@write{\Margini{#1}{#2}{#3}{#4}}}
\newcommand{\Logo}[2][1.5cm]{\front@write{\Logo[#1]{#2}}}
@@ -205,13 +225,12 @@
\define@key{filigrana}{after}[1]{\def\front@logoafter{#1}}
\newcommand{\Filigrana}[2][height=10cm]{%
\setkeys{filigrana}{#1}%
- \AddToShipoutPicture*{%
- \put(0,0){
- \parbox[b][\paperheight]{\paperwidth}{
- \vspace*{\stretch{\front@logobefore}}
- \centering
- \includegraphics[height=\front@logoheight]{#2}
- \vspace{\stretch{\front@logoafter}}
+ \AtBeginShipoutNext{\AtBeginShipoutUpperLeft{%
+ \vtop to\paperheight{\hsize=\paperwidth
+ \vspace*{\stretch{\front@logobefore}}
+ \centering
+ \includegraphics[height=\front@logoheight]{#2}
+ \vspace{\stretch{\front@logoafter}}
}}}}
\newcommand{\Universita}[1]{\def\front@univ{#1}}
\newcommand{\Istituzione}[1]{\def\front@instit{#1}\front@insttrue}
@@ -267,8 +286,13 @@
#2\\% the candidate's name
\def\next{#1}%
\unless\ifx\next\@empty
- \frontsmallfont Matricola #1\\[\frontcandidatesep]
+ \frontsmallfont {Matricola }#1\\[\frontcandidatesep]
\fi}
+\ifdefined\front@nouppercase
+ \let\front@MakeUppercase\@firstofone
+\else
+ \let\front@MakeUppercase\MakeUppercase
+ \fi
\def\preparefrontpage{%
\titlepage\front@font
\centering
@@ -292,11 +316,9 @@
\front@multiple
\else
\if\@front@{division}
- \MakeUppercase{\front@division}
+ \front@MakeUppercase{\front@division}
\else
- \MakeUppercase{\front@thefacoldip}
- DI
- \MakeUppercase{\front@facoldip}
+ \front@MakeUppercase{\front@thefacoldip\space di \front@facoldip}
\fi
\fi\\
\if\@front@{school}
@@ -423,24 +445,27 @@
{\def\front@cp{\null\thispagestyle{empty}\newpage
\advance\c@page\m@ne}}
{\let\front@cp\relax}
+\newif\if@front@message
+\def\front@message{%
+ \PackageWarningNoLine{frontespizio}
+ {Remember to compile \jobname-frn with\MessageBreak
+ \ifpdf
+ pdflatex \jobname-frn%
+ \else
+ \ifxetex
+ xelatex \jobname-frn
+ \else
+ latex \jobname-frn\MessageBreak
+ dvips -o \jobname-frn.eps \jobname-frn%
+ \fi
+ \fi\MessageBreak
+ and then rerun \ifpdf pdf\fi \ifxetex xe\fi latex}}
\def\frontespizio{%
\titlepage\null
- \IfFileExists{\jobname-frn.\front@ext}
- {\AddToShipoutPicture*{\includegraphics{\jobname-frn}}}
- {\AtEndDocument{%
- \PackageWarningNoLine{frontespizio}
- {Remember to compile \jobname-frn with\MessageBreak
- \ifpdf
- pdflatex \jobname-frn%
- \else
- \ifxetex
- xelatex \jobname-frn
- \else
- latex \jobname-frn\MessageBreak
- dvips -o \jobname-frn.eps \jobname-frn%
- \fi
- \fi\MessageBreak
- and then rerun \ifpdf pdf\fi \ifxetex xe\fi latex}}}
+ \IfFileExists{\jobname-frn.\front@ext}
+ {\AtBeginShipoutNext{\AtBeginShipoutUpperLeft{%
+ \vbox to\z@{\hbox{\includegraphics{\jobname-frn}}\vss}}}}
+ {\@front@messagetrue}%
\afterpage{\thispagestyle{empty}}%
\endtitlepage
\if@twoside\front@cp\fi
@@ -450,6 +475,15 @@
\front@write{\preparefrontpage}
\front@write{\end{document}}
\iffront@write\immediate\closeout\front@out\fi
+ \ifdefined\front@mdfiveold
+ \xdef\front@mdfivenew{\pdfmdfivesum file{\jobname-frn.tex}}%
+ \ifx\front@mdfiveold\front@mdfivenew\else
+ \@front@messagetrue
+ \fi
+ \fi
+ \if@front@message
+ \AtEndDocument{\front@message}
+ \fi
}
\endinput
%%