Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.02 KB | None | 0 0
  1. date{06/06/66}
  2.  
  3. documentclass{article}
  4. usepackage{datetime}
  5. usepackage{etoolbox}
  6. usepackage{calculator}
  7.  
  8. makeatletter
  9.  
  10.  
  11. newififIsLeapYearIsLeapYearfalse
  12.  
  13. newcommand*{YearIsLeapYear}[1]{%
  14. IsLeapYearfalse%
  15. MODULO{#1}{4}{ModuloFourResult}%
  16. ifnumcomp{ModuloFourResult}{=}{0}{%
  17. MODULO{#1}{100}{ModuloOneHundredResult}%
  18. ifnumcomp{ModuloOneHundredResult}{=}{0}{%
  19. MODULO{#1}{400}{ModuloFourHundredResult}%
  20. ifnumcomp{ModuloFourHundredResult}{=}{0}{%
  21. IsLeapYeartrue%
  22. }{%
  23. IsLeapYearfalse%
  24. }%
  25. }{%
  26. IsLeapYeartrue%
  27. }}{IsLeapYearfalse}%
  28. }%
  29.  
  30.  
  31.  
  32.  
  33. newcounter{WorkSheet@@Day}%
  34. newcounter{WorkSheet@@Month}%
  35. newcounter{WorkSheet@@Year}%
  36.  
  37.  
  38.  
  39.  
  40. newcommand*{WorkSheet@@SwitchToNextMonth}{%
  41. setcounter{WorkSheet@@Day}{1}%
  42. refstepcounter{WorkSheet@@Month}%
  43. }%
  44.  
  45. newcommand*{WorkSheet@@SwitchToNextYear}{%
  46. setcounter{WorkSheet@@Day}{1}%
  47. setcounter{WorkSheet@@Month}{1}%
  48. refstepcounter{WorkSheet@@Year}%
  49. }%
  50.  
  51. newcommand*{WorkSheetDayAfterDate}[3]{%
  52. setcounter{WorkSheet@@Day}{#1}%
  53. setcounter{WorkSheet@@Month}{#2}%
  54. setcounter{WorkSheet@@Year}{#3}%
  55. %
  56. defMonthsWithThirtyOneDays{1}%
  57. defMonthsWithThirtyDays{4}%
  58. %
  59. %
  60. listadd{MonthsWithThirtyOneDays}{1}%
  61. listadd{MonthsWithThirtyOneDays}{3}%
  62. listadd{MonthsWithThirtyOneDays}{5}%
  63. listadd{MonthsWithThirtyOneDays}{7}%
  64. listadd{MonthsWithThirtyOneDays}{8}%
  65. listadd{MonthsWithThirtyOneDays}{10}%
  66. listadd{MonthsWithThirtyOneDays}{12}%
  67. %
  68. listadd{MonthsWithThirtyDays}{4}%
  69. listadd{MonthsWithThirtyDays}{6}%
  70. listadd{MonthsWithThirtyDays}{9}%
  71. listadd{MonthsWithThirtyDays}{11}%
  72. YearIsLeapYear{numbervalue{WorkSheet@@Year}}%
  73. xifinlist{numbervalue{WorkSheet@@Month}}{MonthsWithThirtyOneDays}{% It is a "long month"
  74. %
  75. ifnumcomp{value{WorkSheet@@Day}}{=}{31}{% Is the 31st day in the month!
  76. % Check for 12/31/...
  77.  
  78. ifnumcomp{value{WorkSheet@@Month}}{=}{12}{%
  79. WorkSheet@@SwitchToNextYear}{ WorkSheet@@SwitchToNextMonth}%
  80. }{refstepcounter{WorkSheet@@Day}}}{%
  81.  
  82. ifnumcomp{value{WorkSheet@@Month}}{=}{2}{% It is February
  83. ifnumcomp{value{WorkSheet@@Day}}{=}{28}{% Is the 28th of February
  84. ifIsLeapYear%
  85. refstepcounter{WorkSheet@@Day}%
  86. else%
  87. WorkSheet@@SwitchToNextMonth%
  88. fi%
  89. }{%
  90. ifIsLeapYear%
  91. ifnumcomp{value{WorkSheet@@Day}}{=}{29}{% Is the 29th of February
  92. WorkSheet@@SwitchToNextMonth}{refstepcounter{WorkSheet@@Day}}%
  93. else%
  94. refstepcounter{WorkSheet@@Day}%
  95. fi%
  96. }}{%
  97. % It is a month with 30 days!!
  98. xifinlist{numbervalue{WorkSheet@@Month}}{MonthsWithThirtyDays}{%
  99. ifnumcomp{value{WorkSheet@@Day}}{=}{30}{% Is the 30st day in the month!
  100. WorkSheet@@SwitchToNextMonth}{refstepcounter{WorkSheet@@Day}
  101.  
  102. }}}{}%
  103. }%
  104. }%
  105.  
  106.  
  107.  
  108.  
  109.  
  110. providecommand{Tomorrow}{%
  111. WorkSheetDayAfterDate{numberday}{numbermonth}{numberyear}%
  112. newdate{DateOfTomorrow}{numbervalue{WorkSheet@@Day}}{numbervalue{WorkSheet@@Month}}{numbervalue{WorkSheet@@Year}}%
  113. displaydate{DateOfTomorrow}
  114. }%
  115. makeatother
  116.  
  117.  
  118.  
  119.  
  120. begin{document}
  121. Tomorrow is Tomorrow%
  122. end{document}
  123.  
  124. documentclass{beamer}
  125. usetheme{madrid}
  126. usepackage[font=Times,timeinterval=10]{tdclock}
  127. title{Adding Current date}
  128. date{tdclock}
  129. begin{document}
  130. initclock
  131. begin{frame}
  132. maketitle
  133. end{frame}
  134. begin{frame}{Ticking clock}end{frame}
  135. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement