summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/uhrzeit/uhrzeit.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/uhrzeit/uhrzeit.sty
Initial commit
Diffstat (limited to 'macros/latex/contrib/uhrzeit/uhrzeit.sty')
-rw-r--r--macros/latex/contrib/uhrzeit/uhrzeit.sty135
1 files changed, 135 insertions, 0 deletions
diff --git a/macros/latex/contrib/uhrzeit/uhrzeit.sty b/macros/latex/contrib/uhrzeit/uhrzeit.sty
new file mode 100644
index 0000000000..fd77a10d2c
--- /dev/null
+++ b/macros/latex/contrib/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 <olaf.meltzer@gmx.de>
+%%
+%% 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" <amat@kabsi.at>
+%% 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" <leif@mathematik.uni-bielefeld.de>
+%% 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'
+