| 1 |
%% |
| 2 |
%% This is file `texdate.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% texdate.dtx (with options: `package') |
| 8 |
%% This is a generated file. |
| 9 |
%% |
| 10 |
%% This document is copyright 2018 by Donald P. Goodman, and is |
| 11 |
%% released publicly under the LaTeX Project Public License. The |
| 12 |
%% distribution and modification of this work is constrained by the |
| 13 |
%% conditions of that license. See |
| 14 |
%% http://www.latex-project.org/lppl.txt |
| 15 |
%% for the text of the license. This document is released |
| 16 |
%% under version 1.3(c) of that license, and this work may be distributed |
| 17 |
%% or modified under the terms of that license or, at your option, any |
| 18 |
%% later version. |
| 19 |
%% |
| 20 |
%% This work has the LPPL maintenance status 'maintained'. |
| 21 |
%% |
| 22 |
%% The Current Maintainer of this work is Donald P. Goodman |
| 23 |
%% ([email protected]). |
| 24 |
%% |
| 25 |
%% This work consists of texdate.dtx, texdate.ins, and |
| 26 |
%% derived files texdate.sty and texdate.pdf. |
| 27 |
|
| 28 |
\NeedsTeXFormat{LaTeX2e}[1999/12/01] |
| 29 |
\ProvidesPackage{texdate}[2018/12/08 v2.0 Print and manipulate dates in plain TeX] |
| 30 |
\RequirePackage{modulus}% |
| 31 |
\RequirePackage{padcount}% |
| 32 |
\RequirePackage{iflang}% |
| 33 |
\newcount\texd@loopi\texd@loopi=0% |
| 34 |
\newcount\texd@mon\texd@mon=0% |
| 35 |
\newcount\texd@dow\texd@dow=0% |
| 36 |
\newcount\texd@dom\texd@dom=0% |
| 37 |
\newcount\texd@yr\texd@yr=\year% |
| 38 |
\newcount\texd@rdom\texd@rdom=\texd@dom\advance\texd@rdom by1% |
| 39 |
\newcount\texd@rmon% |
| 40 |
%% taken from dayofweek.tex, by Martin Minow of DEC; |
| 41 |
%% included in TeXLive |
| 42 |
\newcount\texd@dow% Gets day of the week |
| 43 |
\newcount\texd@leap% Leap year fingaler |
| 44 |
\newcount\texd@x% Temp register |
| 45 |
\newcount\texd@y% Another temp register |
| 46 |
\def\texd@nextdow#1#2#3{% |
| 47 |
\global\texd@leap=#2% |
| 48 |
\global\advance\texd@leap by-14% |
| 49 |
\global\divide\texd@leap by12% |
| 50 |
\global\advance\texd@leap by#3% |
| 51 |
\global\texd@dow=#2% |
| 52 |
\global\advance\texd@dow by10% |
| 53 |
\global\texd@y=\texd@dow% |
| 54 |
\global\divide\texd@y by13% |
| 55 |
\global\multiply\texd@y by12% |
| 56 |
\global\advance\texd@dow by-\texd@y% |
| 57 |
\global\multiply\texd@dow by13% |
| 58 |
\global\advance\texd@dow by-1% |
| 59 |
\global\divide\texd@dow by5% |
| 60 |
\global\advance\texd@dow by#1% |
| 61 |
\global\advance\texd@dow by77% |
| 62 |
\global\texd@x=\texd@leap% |
| 63 |
\global\texd@y=\texd@x% |
| 64 |
\global\divide\texd@y by100% |
| 65 |
\global\multiply\texd@y by100% |
| 66 |
\global\advance\texd@x by-\texd@y% |
| 67 |
\global\multiply\texd@x by5% |
| 68 |
\global\divide\texd@x by4% |
| 69 |
\global\advance\texd@dow by\texd@x% |
| 70 |
\global\texd@x=\texd@leap% |
| 71 |
\global\divide\texd@x by400% |
| 72 |
\global\advance\texd@dow by\texd@x% |
| 73 |
\global\texd@x=\texd@leap% |
| 74 |
\global\divide\texd@x by100% |
| 75 |
\global\multiply\texd@x by2% |
| 76 |
\global\advance\texd@dow by-\texd@x% |
| 77 |
\global\texd@x=\texd@dow% |
| 78 |
\global\divide\texd@x by7% |
| 79 |
\global\multiply\texd@x by7% |
| 80 |
\global\advance\texd@dow by-\texd@x% |
| 81 |
} |
| 82 |
%% end taken from dayofweek.tex, by Martin Minow of DEC; |
| 83 |
%% included in TeXLive |
| 84 |
\def\texd@leapyear{% |
| 85 |
}% |
| 86 |
\def\texd@downame{% |
| 87 |
\ifcase\texd@dow |
| 88 |
\texd@firstdayname% |
| 89 |
\or% |
| 90 |
\texd@seconddayname% |
| 91 |
\or% |
| 92 |
\texd@thirddayname% |
| 93 |
\or% |
| 94 |
\texd@fourthdayname% |
| 95 |
\or% |
| 96 |
\texd@fifthdayname% |
| 97 |
\or% |
| 98 |
\texd@sixthdayname% |
| 99 |
\or% |
| 100 |
\texd@seventhdayname% |
| 101 |
\fi% |
| 102 |
}% |
| 103 |
\def\texd@shdowname{% |
| 104 |
\ifcase\texd@dow |
| 105 |
\texd@firstdayshname% |
| 106 |
\or% |
| 107 |
\texd@seconddayshname% |
| 108 |
\or% |
| 109 |
\texd@thirddayshname% |
| 110 |
\or% |
| 111 |
\texd@fourthdayshname% |
| 112 |
\or% |
| 113 |
\texd@fifthdayshname% |
| 114 |
\or% |
| 115 |
\texd@sixthdayshname% |
| 116 |
\or% |
| 117 |
\texd@seventhdayshname% |
| 118 |
\fi% |
| 119 |
}% |
| 120 |
\def\texd@nextmonth{% |
| 121 |
\ifnum\texd@mon<11\global\advance\texd@mon by1\fi% |
| 122 |
\ifnum\texd@mon=11\global\texd@mon=0\fi% |
| 123 |
}% |
| 124 |
\def\texd@lastmonth{% |
| 125 |
\ifnum\texd@mon=0% |
| 126 |
\global\texd@mon=11% |
| 127 |
\global\advance\texd@yr by-1% |
| 128 |
\fi% |
| 129 |
\ifnum\texd@mon>0\global\advance\texd@mon by-1\fi% |
| 130 |
}% |
| 131 |
\def\texd@nextdate{% |
| 132 |
\ifnum\texd@mon=11% |
| 133 |
\ifnum\texd@dom=30% |
| 134 |
\global\advance\texd@yr by1% |
| 135 |
\global\texd@mon=0% |
| 136 |
\global\texd@dom=0% |
| 137 |
\fi% |
| 138 |
\ifnum\texd@dom<30% |
| 139 |
\global\advance\texd@dom by1% |
| 140 |
\fi% |
| 141 |
\else\ifnum\texd@mon=10% |
| 142 |
\ifnum\texd@dom=29% |
| 143 |
\global\advance\texd@mon by1%% |
| 144 |
\global\texd@dom=0% |
| 145 |
\fi% |
| 146 |
\ifnum\texd@dom<29% |
| 147 |
\global\advance\texd@dom by1% |
| 148 |
\fi% |
| 149 |
\else\ifnum\texd@mon=9% |
| 150 |
\ifnum\texd@dom=30% |
| 151 |
\global\advance\texd@mon by1%% |
| 152 |
\global\texd@dom=0% |
| 153 |
\fi% |
| 154 |
\ifnum\texd@dom<30% |
| 155 |
\global\advance\texd@dom by1% |
| 156 |
\fi% |
| 157 |
\else\ifnum\texd@mon=8% |
| 158 |
\ifnum\texd@dom=29% |
| 159 |
\global\advance\texd@mon by1%% |
| 160 |
\global\texd@dom=0% |
| 161 |
\fi% |
| 162 |
\ifnum\texd@dom<29% |
| 163 |
\global\advance\texd@dom by1% |
| 164 |
\fi% |
| 165 |
\else\ifnum\texd@mon=7% |
| 166 |
\ifnum\texd@dom=30% |
| 167 |
\global\advance\texd@mon by1%% |
| 168 |
\global\texd@dom=0% |
| 169 |
\fi% |
| 170 |
\ifnum\texd@dom<30% |
| 171 |
\global\advance\texd@dom by1% |
| 172 |
\fi% |
| 173 |
\else\ifnum\texd@mon=6% |
| 174 |
\ifnum\texd@dom=30% |
| 175 |
\global\advance\texd@mon by1%% |
| 176 |
\global\texd@dom=0% |
| 177 |
\fi% |
| 178 |
\ifnum\texd@dom<30% |
| 179 |
\global\advance\texd@dom by1% |
| 180 |
\fi% |
| 181 |
\else\ifnum\texd@mon=5% |
| 182 |
\ifnum\texd@dom=29% |
| 183 |
\global\advance\texd@mon by1%% |
| 184 |
\global\texd@dom=0% |
| 185 |
\fi% |
| 186 |
\ifnum\texd@dom<29% |
| 187 |
\global\advance\texd@dom by1% |
| 188 |
\fi% |
| 189 |
\else\ifnum\texd@mon=4% |
| 190 |
\ifnum\texd@dom=30% |
| 191 |
\global\advance\texd@mon by1%% |
| 192 |
\global\texd@dom=0% |
| 193 |
\fi% |
| 194 |
\ifnum\texd@dom<30% |
| 195 |
\global\advance\texd@dom by1% |
| 196 |
\fi% |
| 197 |
\else\ifnum\texd@mon=3% |
| 198 |
\ifnum\texd@dom=29% |
| 199 |
\global\advance\texd@mon by1%% |
| 200 |
\global\texd@dom=0% |
| 201 |
\fi% |
| 202 |
\ifnum\texd@dom<29% |
| 203 |
\global\advance\texd@dom by1% |
| 204 |
\fi% |
| 205 |
\else\ifnum\texd@mon=2% |
| 206 |
\ifnum\texd@dom=30% |
| 207 |
\global\advance\texd@mon by1%% |
| 208 |
\global\texd@dom=0% |
| 209 |
\fi |
| 210 |
\ifnum\texd@dom<30% |
| 211 |
\global\advance\texd@dom by1% |
| 212 |
\fi% |
| 213 |
\else\ifnum\texd@mon=1% |
| 214 |
\ifnum\texd@leapyear=0% |
| 215 |
\ifnum\texd@dom=27% |
| 216 |
\global\advance\texd@mon by1% |
| 217 |
\global\texd@dom=0% |
| 218 |
\fi |
| 219 |
\ifnum\texd@dom<27% |
| 220 |
\global\advance\texd@dom by1% |
| 221 |
\fi% |
| 222 |
\else\ifnum\texd@leapyear=1% |
| 223 |
\ifnum\texd@dom=28% |
| 224 |
\global\advance\texd@mon by1% |
| 225 |
\global\texd@dom=0% |
| 226 |
\fi% |
| 227 |
\ifnum\texd@dom<28% |
| 228 |
\global\advance\texd@dom by1% |
| 229 |
\fi% |
| 230 |
\fi\fi% |
| 231 |
\else\ifnum\texd@mon=0% |
| 232 |
\ifnum\texd@dom=30% |
| 233 |
\global\advance\texd@mon by1%% |
| 234 |
\global\texd@dom=0% |
| 235 |
\fi% |
| 236 |
\ifnum\texd@dom<30% |
| 237 |
\global\advance\texd@dom by1% |
| 238 |
\fi% |
| 239 |
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi% |
| 240 |
\global\texd@rdom=\texd@dom\global\advance\texd@rdom by1% |
| 241 |
\global\texd@rmon=\texd@mon\global\advance\texd@rmon by1% |
| 242 |
\texd@setjnum% |
| 243 |
\texd@nextdow{\the\texd@rdom}{\the\texd@rmon}{\the\texd@yr}% |
| 244 |
}% |
| 245 |
\def\texd@lastdate{% |
| 246 |
\global\advance\texd@dom by-1% |
| 247 |
\ifnum\texd@dom=0% |
| 248 |
\global\advance\texd@mon by-1% |
| 249 |
\ifnum\texd@mon=11% |
| 250 |
\global\texd@dom=30% |
| 251 |
\fi% |
| 252 |
\ifnum\texd@mon=0% |
| 253 |
\global\texd@mon=11% |
| 254 |
\global\advance\texd@yr by-1% |
| 255 |
\global\texd@dom=30% |
| 256 |
\fi% |
| 257 |
\ifnum\texd@mon=10% |
| 258 |
\global\texd@dom=29% |
| 259 |
\fi% |
| 260 |
\ifnum\texd@mon=9% |
| 261 |
\global\texd@dom=30% |
| 262 |
\fi% |
| 263 |
\ifnum\texd@mon=8% |
| 264 |
\global\texd@dom=29% |
| 265 |
\fi% |
| 266 |
\ifnum\texd@mon=7% |
| 267 |
\global\texd@dom=30% |
| 268 |
\fi% |
| 269 |
\ifnum\texd@mon=6% |
| 270 |
\global\texd@dom=30% |
| 271 |
\fi% |
| 272 |
\ifnum\texd@mon=5% |
| 273 |
\global\texd@dom=29% |
| 274 |
\fi% |
| 275 |
\ifnum\texd@mon=4% |
| 276 |
\global\texd@dom=30% |
| 277 |
\fi% |
| 278 |
\ifnum\texd@mon=3% |
| 279 |
\global\texd@dom=29% |
| 280 |
\fi% |
| 281 |
\ifnum\texd@mon=2% |
| 282 |
\global\texd@dom=30% |
| 283 |
\fi% |
| 284 |
\ifnum\texd@mon=1% |
| 285 |
\ifnum\texd@leapyear=0% |
| 286 |
\global\texd@dom=27% |
| 287 |
\else\ifnum\texd@leapyear=1% |
| 288 |
\global\texd@dom=28% |
| 289 |
\fi\fi% |
| 290 |
\fi% |
| 291 |
\ifnum\texd@mon=0% |
| 292 |
\global\texd@dom=30% |
| 293 |
\fi% |
| 294 |
\fi% |
| 295 |
\global\texd@rdom=\texd@dom\global\advance\texd@rdom by1% |
| 296 |
\global\texd@rmon=\texd@mon\global\advance\texd@rmon by1% |
| 297 |
\texd@setjnum% |
| 298 |
\texd@nextdow{\the\texd@rdom}{\the\texd@rmon}{\the\texd@yr}% |
| 299 |
}% |
| 300 |
\def\texd@setrdom{\global\texd@rdom=\texd@dom\global\advance\texd@rdom by1}% |
| 301 |
\def\texd@setrmon{\global\texd@rmon=\texd@mon\global\advance\texd@rmon by1}% |
| 302 |
\newcount\texd@leapyear\texd@leapyear=0% |
| 303 |
\def\texd@isleapyear{% |
| 304 |
\global\texd@leapyear=0% |
| 305 |
\modulo{\texd@yr}{4}% |
| 306 |
\ifnum\remainder=0% |
| 307 |
\modulo{\texd@yr}{100}% |
| 308 |
\ifnum\remainder=0% |
| 309 |
\global\texd@leapyear=0% |
| 310 |
\fi\ifnum\remainder>0% |
| 311 |
\global\texd@leapyear=1% |
| 312 |
\fi% |
| 313 |
\fi% |
| 314 |
}% |
| 315 |
\def\texd@monthname{% |
| 316 |
\ifnum\texd@mon=0% |
| 317 |
\texd@firstmon% |
| 318 |
\fi% |
| 319 |
\ifnum\texd@mon=1% |
| 320 |
\texd@secondmon% |
| 321 |
\fi% |
| 322 |
\ifnum\texd@mon=2% |
| 323 |
\texd@thirdmon% |
| 324 |
\fi% |
| 325 |
\ifnum\texd@mon=3% |
| 326 |
\texd@fourthmon% |
| 327 |
\fi% |
| 328 |
\ifnum\texd@mon=4% |
| 329 |
\texd@fifthmon% |
| 330 |
\fi% |
| 331 |
\ifnum\texd@mon=5% |
| 332 |
\texd@sixthmon% |
| 333 |
\fi% |
| 334 |
\ifnum\texd@mon=6% |
| 335 |
\texd@seventhmon% |
| 336 |
\fi% |
| 337 |
\ifnum\texd@mon=7% |
| 338 |
\texd@eighthmon% |
| 339 |
\fi% |
| 340 |
\ifnum\texd@mon=8% |
| 341 |
\texd@ninthmon% |
| 342 |
\fi% |
| 343 |
\ifnum\texd@mon=9% |
| 344 |
\texd@tenthmon% |
| 345 |
\fi% |
| 346 |
\ifnum\texd@mon=10% |
| 347 |
\texd@eleventhmon% |
| 348 |
\fi% |
| 349 |
\ifnum\texd@mon=11% |
| 350 |
\texd@twelfthmon% |
| 351 |
\fi% |
| 352 |
}% |
| 353 |
\def\texd@shmonthname{% |
| 354 |
\ifnum\texd@mon=0% |
| 355 |
\texd@firstshmon% |
| 356 |
\fi% |
| 357 |
\ifnum\texd@mon=1% |
| 358 |
\texd@secondshmon% |
| 359 |
\fi% |
| 360 |
\ifnum\texd@mon=2% |
| 361 |
\texd@thirdshmon% |
| 362 |
\fi% |
| 363 |
\ifnum\texd@mon=3% |
| 364 |
\texd@fourthshmon% |
| 365 |
\fi% |
| 366 |
\ifnum\texd@mon=4% |
| 367 |
\texd@fifthshmon% |
| 368 |
\fi% |
| 369 |
\ifnum\texd@mon=5% |
| 370 |
\texd@sixthshmon% |
| 371 |
\fi% |
| 372 |
\ifnum\texd@mon=6% |
| 373 |
\texd@seventhshmon% |
| 374 |
\fi% |
| 375 |
\ifnum\texd@mon=7% |
| 376 |
\texd@eighthshmon% |
| 377 |
\fi% |
| 378 |
\ifnum\texd@mon=8% |
| 379 |
\texd@ninthshmon% |
| 380 |
\fi% |
| 381 |
\ifnum\texd@mon=9% |
| 382 |
\texd@tenthshmon% |
| 383 |
\fi% |
| 384 |
\ifnum\texd@mon=10% |
| 385 |
\texd@eleventhshmon% |
| 386 |
\fi% |
| 387 |
\ifnum\texd@mon=11% |
| 388 |
\texd@twelfthshmon% |
| 389 |
\fi% |
| 390 |
}% |
| 391 |
\def\advancebydays#1{% |
| 392 |
\texd@loopi=0% |
| 393 |
\loop% |
| 394 |
\ifnum\texd@loopi<#1% |
| 395 |
\texd@nextdate% |
| 396 |
\advance\texd@loopi by1% |
| 397 |
\repeat% |
| 398 |
}% |
| 399 |
\def\regressbydays#1{% |
| 400 |
\texd@loopi=0% |
| 401 |
\loop% |
| 402 |
\ifnum\texd@loopi<#1% |
| 403 |
\texd@lastdate% |
| 404 |
\advance\texd@loopi by1% |
| 405 |
\repeat% |
| 406 |
}% |
| 407 |
\newcount\texd@loopj% |
| 408 |
\def\advancebyweeks#1{% |
| 409 |
\texd@loopi=0% |
| 410 |
\texd@loopj=#1% |
| 411 |
\multiply\texd@loopj by7% |
| 412 |
\loop% |
| 413 |
\ifnum\texd@loopi<\texd@loopj% |
| 414 |
\texd@nextdate% |
| 415 |
\advance\texd@loopi by1% |
| 416 |
\repeat% |
| 417 |
}% |
| 418 |
\def\regressbyweeks#1{% |
| 419 |
\texd@loopi=0% |
| 420 |
\texd@loopj=#1% |
| 421 |
\multiply\texd@loopj by7% |
| 422 |
\loop% |
| 423 |
\ifnum\texd@loopi<\texd@loopj% |
| 424 |
\texd@lastdate% |
| 425 |
\advance\texd@loopi by1% |
| 426 |
\repeat% |
| 427 |
}% |
| 428 |
\def\advancebymonths#1{% |
| 429 |
\texd@loopi=0% |
| 430 |
\loop% |
| 431 |
\ifnum\texd@loopi<#1% |
| 432 |
\texd@nextmonth% |
| 433 |
\advance\texd@loopi by1% |
| 434 |
\repeat% |
| 435 |
\texd@setrmon% |
| 436 |
\initdate{\the\texd@yr}{\the\texd@rmon}{\the\texd@rdom}% |
| 437 |
}% |
| 438 |
\def\regressbymonths#1{% |
| 439 |
\texd@loopi=0% |
| 440 |
\loop% |
| 441 |
\ifnum\texd@loopi<#1% |
| 442 |
\texd@lastmonth% |
| 443 |
\advance\texd@loopi by1% |
| 444 |
\repeat% |
| 445 |
\texd@setrmon% |
| 446 |
\initdate{\the\texd@yr}{\the\texd@rmon}{\the\texd@rdom}% |
| 447 |
}% |
| 448 |
\def\printdate{% |
| 449 |
\texd@dateformat% |
| 450 |
}% |
| 451 |
\def\printfdate#1{% |
| 452 |
\texd@formatdateformat{#1}% |
| 453 |
}% |
| 454 |
\def\texd@expandloop#1{% |
| 455 |
\texd@xloop#1\relax |
| 456 |
} |
| 457 |
\def\texdatenumformat#1{#1} |
| 458 |
\def\texd@xloop#1{% |
| 459 |
\ifx\relax#1% |
| 460 |
\else% |
| 461 |
\ifx#1d% |
| 462 |
\setpadnum{2}\setpadchar{0}% |
| 463 |
\padnum{\texdatenumformat{\the\texd@rdom}}% |
| 464 |
\else\ifx#1e% |
| 465 |
\setpadnum{2}\setpadchar{\hskip1ex}% |
| 466 |
\padnum{\texdatenumformat{\the\texd@rdom}}% |
| 467 |
\else\ifx#1a% |
| 468 |
\texd@shdowname% |
| 469 |
\else\ifx#1A% |
| 470 |
\texd@downame% |
| 471 |
\else\ifx#1b% |
| 472 |
\texd@shmonthname% |
| 473 |
\else\ifx#1h% |
| 474 |
\texd@shmonthname% |
| 475 |
\else\ifx#1B% |
| 476 |
\texd@monthname% |
| 477 |
\else\ifx#1w% |
| 478 |
\the\texd@dow% |
| 479 |
\else\ifx#1u% |
| 480 |
\ifnum\texd@dow>0\leavevmode\texdatenumformat{\the\texd@dow}\fi% |
| 481 |
\ifnum\texd@dow=0 7\fi% |
| 482 |
\else\ifx#1Y% |
| 483 |
\setpadnum{2}\setpadchar{0}% |
| 484 |
\padnum{\texdatenumformat{\the\texd@yr}}% |
| 485 |
\else\ifx#1m% |
| 486 |
\texd@setrmon% |
| 487 |
\setpadnum{2}\setpadchar{0}% |
| 488 |
\leavevmode\padnum{\texdatenumformat{\the\texd@rmon}}% |
| 489 |
\else\ifx#1j% |
| 490 |
\texd@setjnum% |
| 491 |
\setpadnum{3}\setpadchar{0}% |
| 492 |
\leavevmode\padnum{\texdatenumformat{\the\texd@jnum}}% |
| 493 |
\else\ifx#1C% |
| 494 |
\quotient{\texd@yr}{100}% |
| 495 |
\leavevmode\texdatenumformat{\the\intquotient}% |
| 496 |
\else\ifx#1y% |
| 497 |
\modulo{\texd@yr}{100}% |
| 498 |
\leavevmode\texdatenumformat{\the\remainder}% |
| 499 |
\else\ifx#1U% |
| 500 |
\quotient{\texd@jnum}{7} |
| 501 |
\setpadnum{2}\setpadchar{0}% |
| 502 |
\leavevmode\padnum{\texdatenumformat{\the\intquotient}}% |
| 503 |
\else\ifx#1V% |
| 504 |
\quotient{\texd@jnum}{7} |
| 505 |
\ifnum\texd@dow>0\advance\intquotient by1\fi% |
| 506 |
\setpadnum{2}\setpadchar{0}% |
| 507 |
\leavevmode\padnum{\texdatenumformat{\the\intquotient}}% |
| 508 |
\else\ifx#1W% |
| 509 |
\quotient{\texd@jnum}{7} |
| 510 |
\ifnum\texd@dow=0\advance\intquotient by-1\fi% |
| 511 |
\setpadnum{2}\setpadchar{0}% |
| 512 |
\leavevmode\padnum{\texdatenumformat{\the\intquotient}}% |
| 513 |
\else% |
| 514 |
#1% |
| 515 |
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi% |
| 516 |
\expandafter\texd@xloop% |
| 517 |
\fi% |
| 518 |
}% |
| 519 |
\def\texd@dateformat{% |
| 520 |
\expandafter\expandafter\texd@expandloop{\setdateformat}% |
| 521 |
}% |
| 522 |
\def\texd@formatdateformat#1{% |
| 523 |
\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\texd@expandloop{\csname texd@df#1\endcsname}% |
| 524 |
}% |
| 525 |
\def\setdateformat{A{ }(a),\ B\ (b){ }d,\ Y} |
| 526 |
\def\nameddateformat#1#2{% |
| 527 |
\expandafter\def\csname texd@df#1\endcsname{#2}% |
| 528 |
}% |
| 529 |
\nameddateformat{american}{B\ d,\ Y} |
| 530 |
\nameddateformat{shamerican}{m/d/Y} |
| 531 |
\nameddateformat{ISO}{Ymd} |
| 532 |
\nameddateformat{ISOext}{Y-m-d} |
| 533 |
\nameddateformat{shbritish}{d/m/Y} |
| 534 |
\nameddateformat{shbritishdots}{d.m.Y} |
| 535 |
\nameddateformat{british}{d\ B\ Y} |
| 536 |
\nameddateformat{d}{d} |
| 537 |
\nameddateformat{e}{e} |
| 538 |
\nameddateformat{B}{B} |
| 539 |
\nameddateformat{b}{b} |
| 540 |
\nameddateformat{h}{h} |
| 541 |
\nameddateformat{m}{m} |
| 542 |
\nameddateformat{A}{A} |
| 543 |
\nameddateformat{a}{a} |
| 544 |
\nameddateformat{w}{w} |
| 545 |
\nameddateformat{u}{u} |
| 546 |
\nameddateformat{Y}{Y} |
| 547 |
\nameddateformat{j}{j} |
| 548 |
\nameddateformat{C}{C} |
| 549 |
\nameddateformat{y}{y} |
| 550 |
\nameddateformat{U}{U} |
| 551 |
\nameddateformat{V}{V} |
| 552 |
\nameddateformat{W}{W} |
| 553 |
\def\initcurrdate{% |
| 554 |
\global\texd@mon=\month% |
| 555 |
\global\advance\texd@mon by-1% |
| 556 |
\global\texd@dom=\day% |
| 557 |
\global\advance\texd@dom by-1% |
| 558 |
\global\texd@yr=\year% |
| 559 |
\texd@isleapyear% |
| 560 |
\texd@setrdom% |
| 561 |
\texd@setrmon% |
| 562 |
\texd@setjnum% |
| 563 |
\texd@nextdow{\the\texd@rdom}{\the\texd@rmon}{\the\texd@yr}% |
| 564 |
}% |
| 565 |
\def\initdate#1#2#3{% |
| 566 |
\global\texd@yr=#1% |
| 567 |
\global\texd@mon=#2% |
| 568 |
\global\advance\texd@mon by-1% |
| 569 |
\global\texd@dom=#3% |
| 570 |
\global\advance\texd@dom by-1% |
| 571 |
\global\texd@setrdom% |
| 572 |
\global\texd@setrmon% |
| 573 |
\texd@setjnum% |
| 574 |
\texd@isleapyear% |
| 575 |
\texd@nextdow{\the\texd@rdom}{\the\texd@rmon}{\the\texd@yr}% |
| 576 |
}% |
| 577 |
\def\savedate#1{% |
| 578 |
\expandafter\edef\csname savedate#1\endcsname{\initdate{\the\texd@yr}{\the\texd@rmon}{\the\texd@rdom}}% |
| 579 |
}% |
| 580 |
\def\restoredate#1{% |
| 581 |
\csname savedate#1\endcsname% |
| 582 |
}% |
| 583 |
\newcount\texd@looptmp\texd@looptmp=0% |
| 584 |
\def\texdcal#1#2{% |
| 585 |
\global\texd@mon=#2% |
| 586 |
\global\advance\texd@mon by-1% |
| 587 |
\global\texd@yr=#1% |
| 588 |
\global\texd@dom=0% |
| 589 |
\texd@setrmon\texd@setrdom% |
| 590 |
\initdate{\the\texd@yr}{\the\texd@rmon}{\the\texd@rdom}% |
| 591 |
\def\setdateformat{B\ Y}% |
| 592 |
\begin{tabular}{rrrrrrr} |
| 593 |
\multicolumn{7}{c}{\printdate} \\ |
| 594 |
\loop\ifnum\texd@dow>0\texd@lastdate\repeat% |
| 595 |
\def\setdateformat{d}% |
| 596 |
\ifnum\texd@dom>8 {} \fi\ifnum\texd@dom<8\leavevmode\printdate\fi& |
| 597 |
\def\setdateformat{d}\advancebydays{1}% |
| 598 |
\ifnum\texd@dom>8 {} \fi\ifnum\texd@dom<8\leavevmode\printdate\fi& |
| 599 |
\def\setdateformat{d}\advancebydays{1}% |
| 600 |
\ifnum\texd@dom>8 {} \fi\ifnum\texd@dom<8\leavevmode\printdate\fi& |
| 601 |
\def\setdateformat{d}\advancebydays{1}% |
| 602 |
\ifnum\texd@dom>8 {} \fi\ifnum\texd@dom<8\leavevmode\printdate\fi& |
| 603 |
\def\setdateformat{d}\advancebydays{1}% |
| 604 |
\ifnum\texd@dom>8 {} \fi\ifnum\texd@dom<8\leavevmode\printdate\fi& |
| 605 |
\def\setdateformat{d}\advancebydays{1}% |
| 606 |
\ifnum\texd@dom>8 {} \fi\ifnum\texd@dom<8\leavevmode\printdate\fi& |
| 607 |
\def\setdateformat{d}\advancebydays{1}% |
| 608 |
\ifnum\texd@dom>8 {} \fi\ifnum\texd@dom<8\leavevmode\printdate\fi\\ |
| 609 |
\def\setdateformat{d}\advancebydays{1}\printdate & |
| 610 |
\def\setdateformat{d}\advancebydays{1}\printdate & |
| 611 |
\def\setdateformat{d}\advancebydays{1}\printdate & |
| 612 |
\def\setdateformat{d}\advancebydays{1}\printdate & |
| 613 |
\def\setdateformat{d}\advancebydays{1}\printdate & |
| 614 |
\def\setdateformat{d}\advancebydays{1}\printdate & |
| 615 |
\def\setdateformat{d}\advancebydays{1}\printdate \\ |
| 616 |
\def\setdateformat{d}\advancebydays{1}\printdate & |
| 617 |
\def\setdateformat{d}\advancebydays{1}\printdate & |
| 618 |
\def\setdateformat{d}\advancebydays{1}\printdate & |
| 619 |
\def\setdateformat{d}\advancebydays{1}\printdate & |
| 620 |
\def\setdateformat{d}\advancebydays{1}\printdate & |
| 621 |
\def\setdateformat{d}\advancebydays{1}\printdate & |
| 622 |
\def\setdateformat{d}\advancebydays{1}\printdate \\ |
| 623 |
\def\setdateformat{d}\advancebydays{1}\printdate & |
| 624 |
\def\setdateformat{d}\advancebydays{1}\printdate & |
| 625 |
\def\setdateformat{d}\advancebydays{1}\printdate & |
| 626 |
\def\setdateformat{d}\advancebydays{1}\printdate & |
| 627 |
\def\setdateformat{d}\advancebydays{1}\printdate & |
| 628 |
\def\setdateformat{d}\advancebydays{1}\printdate & |
| 629 |
\def\setdateformat{d}\advancebydays{1}\printdate \\ |
| 630 |
\def\setdateformat{d}\advancebydays{1}% |
| 631 |
\ifnum\texd@dom<14 {} \fi\ifnum\texd@dom>14\leavevmode\printdate\fi& |
| 632 |
\def\setdateformat{d}\advancebydays{1}% |
| 633 |
\ifnum\texd@dom<14 {} \fi\ifnum\texd@dom>14\leavevmode\printdate\fi& |
| 634 |
\def\setdateformat{d}\advancebydays{1}% |
| 635 |
\ifnum\texd@dom<14 {} \fi\ifnum\texd@dom>14\leavevmode\printdate\fi& |
| 636 |
\def\setdateformat{d}\advancebydays{1}% |
| 637 |
\ifnum\texd@dom<14 {} \fi\ifnum\texd@dom>14\leavevmode\printdate\fi& |
| 638 |
\def\setdateformat{d}\advancebydays{1}% |
| 639 |
\ifnum\texd@dom<14 {} \fi\ifnum\texd@dom>14\leavevmode\printdate\fi& |
| 640 |
\def\setdateformat{d}\advancebydays{1}% |
| 641 |
\ifnum\texd@dom<14 {} \fi\ifnum\texd@dom>14\leavevmode\printdate\fi& |
| 642 |
\def\setdateformat{d}\advancebydays{1}% |
| 643 |
\ifnum\texd@dom<14 {} \fi\ifnum\texd@dom>14\leavevmode\printdate\fi\\ |
| 644 |
\def\setdateformat{d}\advancebydays{1}% |
| 645 |
\ifnum\texd@dom<14 {} \fi\ifnum\texd@dom>14\leavevmode\printdate\fi& |
| 646 |
\def\setdateformat{d}\advancebydays{1}% |
| 647 |
\ifnum\texd@dom<14 {} \fi\ifnum\texd@dom>14\leavevmode\printdate\fi& |
| 648 |
\def\setdateformat{d}\advancebydays{1}% |
| 649 |
\ifnum\texd@dom<14 {} \fi\ifnum\texd@dom>14\leavevmode\printdate\fi& |
| 650 |
\def\setdateformat{d}\advancebydays{1}% |
| 651 |
\ifnum\texd@dom<14 {} \fi\ifnum\texd@dom>14\leavevmode\printdate\fi& |
| 652 |
\def\setdateformat{d}\advancebydays{1}% |
| 653 |
\ifnum\texd@dom<14 {} \fi\ifnum\texd@dom>14\leavevmode\printdate\fi& |
| 654 |
\def\setdateformat{d}\advancebydays{1}% |
| 655 |
\ifnum\texd@dom<14 {} \fi\ifnum\texd@dom>14\leavevmode\printdate\fi& |
| 656 |
\def\setdateformat{d}\advancebydays{1}% |
| 657 |
\ifnum\texd@dom<14 {} \fi\ifnum\texd@dom>14\leavevmode\printdate\fi\\ |
| 658 |
\end{tabular} |
| 659 |
}% |
| 660 |
\def\texdcalyear#1{% |
| 661 |
\texd@yr=#1% |
| 662 |
\texd@mon=0% |
| 663 |
\texd@dom=0% |
| 664 |
\texd@setrmon% |
| 665 |
\texd@setrdom% |
| 666 |
{\tabcolsep=3pt% |
| 667 |
\begin{tabular}{ccc} |
| 668 |
\texdcal{#1}{1} & \texdcal{#1}{2} & \texdcal{#1}{3} \\ |
| 669 |
\texdcal{#1}{4} & \texdcal{#1}{5} & \texdcal{#1}{6} \\ |
| 670 |
\texdcal{#1}{7} & \texdcal{#1}{8} & \texdcal{#1}{9} \\ |
| 671 |
\texdcal{#1}{10} & \texdcal{#1}{11} & \texdcal{#1}{12} \\ |
| 672 |
\end{tabular} |
| 673 |
}% |
| 674 |
}% |
| 675 |
\newcount\texd@jnum\texd@jnum=0% |
| 676 |
\def\texd@setjnum{% |
| 677 |
\texd@jnum=0% |
| 678 |
\ifnum\texd@mon>0\global\advance\texd@jnum by31\fi% |
| 679 |
\ifnum\texd@mon>1% |
| 680 |
\global\advance\texd@jnum by28% |
| 681 |
\fi% |
| 682 |
\ifnum\texd@mon>2\global\advance\texd@jnum by31\fi% |
| 683 |
\ifnum\texd@mon>3\global\advance\texd@jnum by30\fi% |
| 684 |
\ifnum\texd@mon>4\global\advance\texd@jnum by31\fi% |
| 685 |
\ifnum\texd@mon>5\global\advance\texd@jnum by30\fi% |
| 686 |
\ifnum\texd@mon>6\global\advance\texd@jnum by31\fi% |
| 687 |
\ifnum\texd@mon>7\global\advance\texd@jnum by31\fi% |
| 688 |
\ifnum\texd@mon>8\global\advance\texd@jnum by30\fi% |
| 689 |
\ifnum\texd@mon>9\global\advance\texd@jnum by31\fi% |
| 690 |
\ifnum\texd@mon>10\global\advance\texd@jnum by30\fi% |
| 691 |
\global\advance\texd@jnum by\the\texd@dom% |
| 692 |
\global\advance\texd@jnum by1% |
| 693 |
}% |
| 694 |
\def\texd@firstmon{January}% |
| 695 |
\def\texd@firstshmon{Jan}% |
| 696 |
\def\texd@secondmon{February}% |
| 697 |
\def\texd@secondshmon{Feb}% |
| 698 |
\def\texd@thirdmon{March}% |
| 699 |
\def\texd@thirdshmon{Mar}% |
| 700 |
\def\texd@fourthmon{April}% |
| 701 |
\def\texd@fourthshmon{Apr}% |
| 702 |
\def\texd@fifthmon{May}% |
| 703 |
\def\texd@fifthshmon{May}% |
| 704 |
\def\texd@sixthmon{June}% |
| 705 |
\def\texd@sixthshmon{Jun}% |
| 706 |
\def\texd@seventhmon{July}% |
| 707 |
\def\texd@seventhshmon{Jul}% |
| 708 |
\def\texd@eighthmon{August}% |
| 709 |
\def\texd@eighthshmon{Aug}% |
| 710 |
\def\texd@ninthmon{September}% |
| 711 |
\def\texd@ninthshmon{Sep}% |
| 712 |
\def\texd@tenthmon{October}% |
| 713 |
\def\texd@tenthshmon{Oct}% |
| 714 |
\def\texd@eleventhmon{November}% |
| 715 |
\def\texd@eleventhshmon{Nov}% |
| 716 |
\def\texd@twelfthmon{December}% |
| 717 |
\def\texd@twelfthshmon{Dec}% |
| 718 |
\def\texd@firstdayname{Sunday}% |
| 719 |
\def\texd@firstdayshname{Sun}% |
| 720 |
\def\texd@seconddayname{Monday}% |
| 721 |
\def\texd@seconddayshname{Mon}% |
| 722 |
\def\texd@thirddayname{Tuesday}% |
| 723 |
\def\texd@thirddayshname{Tue}% |
| 724 |
\def\texd@fourthdayname{Wednesday}% |
| 725 |
\def\texd@fourthdayshname{Wed}% |
| 726 |
\def\texd@fifthdayname{Thursday}% |
| 727 |
\def\texd@fifthdayshname{Thu}% |
| 728 |
\def\texd@sixthdayname{Friday}% |
| 729 |
\def\texd@sixthdayshname{Fri}% |
| 730 |
\def\texd@seventhdayname{Saturday}% |
| 731 |
\def\texd@seventhdayshname{Sat}% |
| 732 |
\AtBeginDocument{% |
| 733 |
\IfLanguageName{spanish}{% |
| 734 |
\def\texd@firstmon{enero}% |
| 735 |
\def\texd@firstshmon{ene}% |
| 736 |
\def\texd@secondmon{febrero}% |
| 737 |
\def\texd@secondshmon{feb}% |
| 738 |
\def\texd@thirdmon{marzo}% |
| 739 |
\def\texd@thirdshmon{mar}% |
| 740 |
\def\texd@fourthmon{abril}% |
| 741 |
\def\texd@fourthshmon{abr}% |
| 742 |
\def\texd@fifthmon{mayo}% |
| 743 |
\def\texd@fifthshmon{may}% |
| 744 |
\def\texd@sixthmon{junio}% |
| 745 |
\def\texd@sixthshmon{jun}% |
| 746 |
\def\texd@seventhmon{julio}% |
| 747 |
\def\texd@seventhshmon{jul}% |
| 748 |
\def\texd@eighthmon{agosto}% |
| 749 |
\def\texd@eighthshmon{ago}% |
| 750 |
\def\texd@ninthmon{septiembre}% |
| 751 |
\def\texd@ninthshmon{sep}% |
| 752 |
\def\texd@tenthmon{octubre}% |
| 753 |
\def\texd@tenthshmon{oct}% |
| 754 |
\def\texd@eleventhmon{noviembre}% |
| 755 |
\def\texd@eleventhshmon{nov}% |
| 756 |
\def\texd@twelfthmon{diciembre}% |
| 757 |
\def\texd@twelfthshmon{dic}% |
| 758 |
\def\texd@firstdayname{domingo}% |
| 759 |
\def\texd@firstdayshname{dom}% |
| 760 |
\def\texd@seconddayname{lunes}% |
| 761 |
\def\texd@seconddayshname{lun}% |
| 762 |
\def\texd@thirddayname{martes}% |
| 763 |
\def\texd@thirddayshname{mar}% |
| 764 |
\def\texd@fourthdayname{miercoles}% |
| 765 |
\def\texd@fourthdayshname{mie}% |
| 766 |
\def\texd@fifthdayname{jueves}% |
| 767 |
\def\texd@fifthdayshname{jue}% |
| 768 |
\def\texd@sixthdayname{viernes}% |
| 769 |
\def\texd@sixthdayshname{vie}% |
| 770 |
\def\texd@seventhdayname{sabado}% |
| 771 |
\def\texd@seventhdayshname{sab}% |
| 772 |
}{}% |
| 773 |
\IfLanguageName{french}{% |
| 774 |
\def\texd@firstmon{janvier}% |
| 775 |
\def\texd@firstshmon{janv}% |
| 776 |
\def\texd@secondmon{février}% |
| 777 |
\def\texd@secondshmon{févr}% |
| 778 |
\def\texd@thirdmon{mars}% |
| 779 |
\def\texd@thirdshmon{mars}% |
| 780 |
\def\texd@fourthmon{avril}% |
| 781 |
\def\texd@fourthshmon{avr}% |
| 782 |
\def\texd@fifthmon{mai}% |
| 783 |
\def\texd@fifthshmon{mai}% |
| 784 |
\def\texd@sixthmon{juin}% |
| 785 |
\def\texd@sixthshmon{juin}% |
| 786 |
\def\texd@seventhmon{juil}% |
| 787 |
\def\texd@seventhshmon{juil}% |
| 788 |
\def\texd@eighthmon{août}% |
| 789 |
\def\texd@eighthshmon{août}% |
| 790 |
\def\texd@ninthmon{septembre}% |
| 791 |
\def\texd@ninthshmon{sept}% |
| 792 |
\def\texd@tenthmon{octobre}% |
| 793 |
\def\texd@tenthshmon{oct}% |
| 794 |
\def\texd@eleventhmon{novembre}% |
| 795 |
\def\texd@eleventhshmon{nov}% |
| 796 |
\def\texd@twelfthmon{décembre}% |
| 797 |
\def\texd@twelfthshmon{déc}% |
| 798 |
\def\texd@firstdayname{dimanche}% |
| 799 |
\def\texd@firstdayshname{dim}% |
| 800 |
\def\texd@seconddayname{lundi}% |
| 801 |
\def\texd@seconddayshname{lun}% |
| 802 |
\def\texd@thirddayname{mardi}% |
| 803 |
\def\texd@thirddayshname{mar}% |
| 804 |
\def\texd@fourthdayname{mercredi}% |
| 805 |
\def\texd@fourthdayshname{mer}% |
| 806 |
\def\texd@fifthdayname{jeudi}% |
| 807 |
\def\texd@fifthdayshname{jeu}% |
| 808 |
\def\texd@sixthdayname{vendredi}% |
| 809 |
\def\texd@sixthdayshname{ven}% |
| 810 |
\def\texd@seventhdayname{samedi}% |
| 811 |
\def\texd@seventhdayshname{sam}% |
| 812 |
}{}% |
| 813 |
\IfLanguageName{german}{% |
| 814 |
\def\texd@firstmon{Januar}% |
| 815 |
\def\texd@firstshmon{Jan}% |
| 816 |
\def\texd@secondmon{Februar}% |
| 817 |
\def\texd@secondshmon{Feb}% |
| 818 |
\def\texd@thirdmon{März}% |
| 819 |
\def\texd@thirdshmon{März}% |
| 820 |
\def\texd@fourthmon{April}% |
| 821 |
\def\texd@fourthshmon{Apr}% |
| 822 |
\def\texd@fifthmon{Mai}% |
| 823 |
\def\texd@fifthshmon{Mai}% |
| 824 |
\def\texd@sixthmon{Juni}% |
| 825 |
\def\texd@sixthshmon{Juni}% |
| 826 |
\def\texd@seventhmon{Juli}% |
| 827 |
\def\texd@seventhshmon{Juli}% |
| 828 |
\def\texd@eighthmon{August}% |
| 829 |
\def\texd@eighthshmon{Aug}% |
| 830 |
\def\texd@ninthmon{September}% |
| 831 |
\def\texd@ninthshmon{Sept}% |
| 832 |
\def\texd@tenthmon{Oktober}% |
| 833 |
\def\texd@tenthshmon{Okt}% |
| 834 |
\def\texd@eleventhmon{November}% |
| 835 |
\def\texd@eleventhshmon{Nov}% |
| 836 |
\def\texd@twelfthmon{Dezember}% |
| 837 |
\def\texd@twelfthshmon{Dez}% |
| 838 |
\def\texd@firstdayname{Sonntag}% |
| 839 |
\def\texd@firstdayshname{So}% |
| 840 |
\def\texd@seconddayname{Montag}% |
| 841 |
\def\texd@seconddayshname{Mo}% |
| 842 |
\def\texd@thirddayname{Dienstag}% |
| 843 |
\def\texd@thirddayshname{Di}% |
| 844 |
\def\texd@fourthdayname{Mittwoch}% |
| 845 |
\def\texd@fourthdayshname{Mi}% |
| 846 |
\def\texd@fifthdayname{Donnerstag}% |
| 847 |
\def\texd@fifthdayshname{Do}% |
| 848 |
\def\texd@sixthdayname{Freitag}% |
| 849 |
\def\texd@sixthdayshname{Fr}% |
| 850 |
\def\texd@seventhdayname{Samstag}% |
| 851 |
\def\texd@seventhdayshname{Sa}% |
| 852 |
}{}% |
| 853 |
}% |
| 854 |
\endinput |
| 855 |
%% |
| 856 |
%% End of file `texdate.sty'. |