summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/upmethodology/upmethodology-p-common.sty
blob: 3beb327f31a428b2bf29508f9ddd0d10260a29e0 (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
% Copyright (c) 2009 Stephane GALLAND <galland@arakhne.org>
% 
% This program is free library; you can redistribute it and/or modify
% it under the terms of the GNU Lesser General Public License as
% published by the Free Software Foundation; either version 3 of the
% License, or any later version.
%
% This library is distributed in the hope that it will be useful, but
% WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
% Lesser General Public License for more details.
%
% You should have received a copy of the GNU Lesser General Public
% License along with this library; see the file COPYING.  If not,
% write to the Free Software Foundation, Inc., 59 Temple Place - Suite
% 330, Boston, MA 02111-1307, USA.
%
% Creation date: 2009-10-30
% Modifications (lastest first):
%    2012-09-21   Move \copyright from upmethodology-fmt.sty
%    2009-11-03   \If* macros are marked with \long
%    2009-11-02   Add internal commands for footnotes.
%

\global\edef\upm@package@private@doctype@ver{2012/09/21}

\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{upmethodology-p-doctype}[\upm@package@private@doctype@ver]

\RequirePackage{ifthen}
\RequirePackage{xspace}
\RequirePackage{color}

%----------------------------------------
% ARAKHNE.ORG MACRO
%----------------------------------------
\providecommand{\arakhneorg}{{\begingroup%
	{\usefont{T1}{pzc}{m}{it}\selectfont Arakhn\^e}%
	{\usefont{T1}{phv}{bc}{sc}\selectfont\tiny.org}\endgroup}\xspace}

%----------------------------------------
% CURRENT LANGUAGE
%----------------------------------------
\def\upmcurrentlang{english}

%----------------------------------------
% TEST MACROS
%----------------------------------------
\long\def\Ifnotempty#1{\ifthenelse{\equal{#1}{\@empty}}{}}
\long\def\Ifempty#1#2{\ifthenelse{\equal{#1}{\@empty}}{#2}{}}
\long\def\Ifelseempty#1#2#3{\ifthenelse{\equal{#1}{\@empty}}{#2}{#3}}

%----------------------------------------
% DOCUMENT TYPE
%----------------------------------------
\newif\ifupmbookformat
\newif\ifupmreportformat
\newif\ifupmarticleformat

\upmbookformatfalse
\upmreportformattrue
\upmarticleformatfalse

%----------------------------------------
% PDF COLORS
%----------------------------------------
\newcommand{\setpdfcolor}[1]{}

%----------------------------------------
% CREATE COMMAND WITH ID AS NAME
%----------------------------------------
\def\upm@protect#1{\upm@p@protect #1\relax}
\def\upm@p@protect#1#2\relax{%
	\ifx\relax #1%
		\relax
	\else%
		\string #1%
		\ifx\relax #2%
			\relax
		\else
			\upm@p@protect #2\relax%
		\fi
	\fi}

\def\upm@namedef#1#2{%
	\@namedef{\upm@protect{#1}}{#2}%
}

\def\upm@nameuse#1{%
	\@nameuse{\upm@protect{#1}}%
}

\def\upm@nameundef#1{%
	\expandafter\let\csname\upm@protect{#1}\endcsname\relax%
}

\def\upm@ifdefinedname#1#2#3{%
	\expandafter\ifx\csname\upm@protect{#1}\endcsname\relax%
		#3%
	\else%
		#2%
	\fi%
}

%----------------------------------------
% GET THE REFERENCE ID WITHOUT \REF
%----------------------------------------
\gdef\upm@getref#1{%
  \expandafter\ifx\csname r@#1\endcsname\relax
    \nfss@text{\reset@font\bfseries ??}%
  \else
    \expandafter\expandafter\expandafter\@car\csname r@#1\endcsname\@nil
  \fi
}

\gdef\upm@getpageref@filter#1#2#3#4#5{#2}

\gdef\upm@getpageref#1{%
  \expandafter\ifx\csname r@#1\endcsname\relax
    \nfss@text{\reset@font\bfseries ??}%
  \else%
    \protected@xdef\upm@p@tmp@tmp{\protect\upm@getpageref@filter\csname r@#1\endcsname}%
    \upm@p@tmp@tmp%
    \global\let\upm@p@tmp@tmp\relax%
  \fi
}

%----------------------------------------
% INTERNAL COMMAND FOR TEXT SUPPER/SUB SCRIPT
%----------------------------------------

\let\upm@textsuperscript\textsuperscript

\def\upm@textsubscript#1{%
  {\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}}


%----------------------------------------
% SYMBOLS
%----------------------------------------
\let\upm@format@copyright\copyright
\renewcommand{\copyright}{\upm@format@copyright\xspace}

\endinput