From 5bde818d4507934bd514e3a8a2cba02b718928c3 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 3 Feb 2016 23:06:56 +0000 Subject: uhrzeit (2feb16) git-svn-id: svn://tug.org/texlive/trunk@39570 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/uhrzeit/uhrzeit.sty | 135 ++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/uhrzeit/uhrzeit.sty (limited to 'Master/texmf-dist/tex/latex/uhrzeit') diff --git a/Master/texmf-dist/tex/latex/uhrzeit/uhrzeit.sty b/Master/texmf-dist/tex/latex/uhrzeit/uhrzeit.sty new file mode 100644 index 00000000000..fd77a10d2cb --- /dev/null +++ b/Master/texmf-dist/tex/latex/uhrzeit/uhrzeit.sty @@ -0,0 +1,135 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{uhrzeit}[2016/02/01 v0.2c Uhrzeit-Formate] +\RequirePackage{soul} +%% +%% `uhrzeit.sty' +%% Copyright 2016 Olaf Meltzer +%% +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% 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.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Olaf Meltzer. +%% +%% This work consists of the files uhrzeit.sty, uhrzeit.tex, +%% and the derived file uhrzeit.pdf. +%% +%% +%% Author: Olaf Meltzer +%% +%% The style uses some ideas, published by +%% Leif Albers and Andreas Matthias +%% in de.comp.text.tex +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% Automatische Ausgabe der aktuellen Uhrzeit: +%% +%% Befehl Format +%% ---------------------------------------------- +%% \dtd 5.07 (eher ungebräuchlich) +%% \dtc 05:07 (international) +%% \uhri 5.07 Uhr (Duden, 22. Aufl., S. 110) +%% \uhrii 05:07 Uhr (DIN 5008) +%% \uhriii 5^07 Uhr (ehemals üblich) +%% \uhriv 05^07 Uhr (auch ehemals selten gebräuchlich) +%% +%% +%% Manuelle Eingabe von Uhrzeit oder Uhrzeitbereich +%% im früher üblichen Format: +%% +%% Befehl Format +%% ----------------------------------------- +%% \uhr{5}{07} 5^07 Uhr +%% \vonbis{5}{07}{13}{45} 5^07 -- 13^45 Uhr +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% Die Definition von '\uhr{}{}' stammt weitgehend von +%% "Andreas Matthias" +%% in de.comp.text.tex am 24.09.2000 +%% +%% Formatiert als '1^05 Uhr' +\newcommand{\uhr}[2]{#1% + \sbox\z@ T% + \vbox to\ht\z@{\hbox{\check@mathfonts + \fontsize\ssf@size\z@ + \math@fontsfalse\selectfont + \setul{.17em}{.03em}\,\ul{#2}\resetul}% + \vss}\,Uhr} + +%% Formatiert als '1^05 -- 2^15 Uhr' +\newcommand{\vonbis}[4]{#1% + \sbox\z@ T% + \vbox to\ht\z@{\hbox{\check@mathfonts + \fontsize\ssf@size\z@ + \math@fontsfalse\selectfont + \setul{.17em}{.03em}\,\ul{#2}\resetul}% + \vss}~--\,#3% + \sbox\z@ T% + \vbox to\ht\z@{\hbox{\check@mathfonts + \fontsize\ssf@size\z@ + \math@fontsfalse\selectfont + \setul{.17em}{.03em}\,\ul{#4}\resetul}% + \vss}\,Uhr} + +%% Die Definition von \mytime stammt von +%% "Leif Albers" +%% und wurde zuerst am 04.10.1999 in de.comp.text.tex gepostet. + +% Es wird der TeX-Zähler \time verwendet, der die Systemzeit +% in "Minuten seit Mitternacht" enthält. Ich mache daraus zwei +% Zähler, \myminutes und \myhours, die die Zeit in "Stunden +% und Minuten seit Mitternacht" enthalten. +\newcount\myhours % Zähler (Variable) \myhours Definieren +\newcount\myminutes % \myminutes Definieren + +% Berechnung der Stundenzahl: +% \myhours := \time DIV 60 (Division ohne Rest) +\myhours = \time +\divide \myhours by 60 + +% Berechnung der Minutenzahl: +% \myminutes := \time MOD 60 +% = \time - ( \myhours x 60 ) +\myminutes = \time +\multiply \myhours by 60 % Zur Berechnung der Minuten wird noch + % mal an "\myhours" herumgefummelt +\advance \myminutes by -\myhours% +\divide \myhours by 60 % \myhours wiederherstellen + +%% Verschiedene Formate für die automatische Zeitangabe: + +%% International, 1.05 (eher ungebräuchlich) +\newcommand{\dtd}{\the\myhours.\ifnum\myminutes<10 0\fi\the\myminutes} + +%% International, 01:05 (international) +\newcommand{\dtc}{\ifnum\myhours<10 0\fi\the\myhours:% + \ifnum\myminutes<10 0\fi\the\myminutes} + +%% Deutsch, 1.05~Uhr (Duden) +\newcommand{\uhri}{\the\myhours.\ifnum\myminutes<10 0\fi\the\myminutes\,Uhr} + +%% Deutsch, 01:05~Uhr (DIN) +\newcommand{\uhrii}{\ifnum\myhours<10 0\fi\the\myhours:% + \ifnum\myminutes<10 0\fi\the\myminutes\,Uhr} + +%% Altes Format, 1^05 Uhr (ehemals üblich) +\newcommand{\uhriii}{\expandafter\uhr{% + \expandafter\the\myhours}% + {\expandafter{\expandafter{\ifnum\myminutes<10 0\fi\the\myminutes}}}} + +%% Altes Format, 01^05 Uhr (eher ungebräuchlich) +\newcommand{\uhriv}{\expandafter\uhr{% + \expandafter{\expandafter{\ifnum\myhours<10 0\fi\the\myhours}}}% + {\expandafter{\expandafter{\ifnum\myminutes<10 0\fi\the\myminutes}}}} + +%% Ende 'uhrzeit.sty' + -- cgit v1.2.3