Dear kind folks,
Is there a way to get day and time in a metapost document? I can get it from shell or from the document created, but a command/macro would be preferred.
$ cat 20190906.mp verbatimtex %&latex \documentclass{minimal} \begin{document} etex beginfig(0); drawdblarrow (-60,0)--(60,0); drawdblarrow (0,60)--(0,-60); drawarrow (0,0)--(30,54); drawarrow (-60,0)--(60,0); label.bot(btex $A$ etex, (6,64)); label.bot(btex $B$ etex, (62,0)); label.bot(btex $C$ etex, (0,-62)); label.bot(btex $D$ etex, (-60,0)); label.bot(btex $E$ etex, (6,-6)); label.bot(btex $F$ etex, (32,54)); label.lft(btex $\hbox{ BELL WORK }$ etex, (-60,-24)); label.lft(btex $\hbox{ Fri Sep 6 08:55:48 CDT 2019 }$ etex, (-60,-36)); %label.bot(btex $10x - 2$ etex, (0,24)); %label.bot(btex $9x + 12 $ etex, (0,-16)); label.bot(btex $10x + 5$ etex, (28,16)); label.bot(btex $\overline{AC} \perp \overline{DB}$ etex, (-60,-48)); label.bot(btex $13x + 9$ etex, (-28,16)); label.bot(btex $m\angle AEF = $ etex, (-60,-60)); label.bot(btex $m\angle AED = $ etex, (-60,-72)); label.bot(btex $m\angle FEB = $ etex, (-60,-84)); label.lft(btex $x = $ etex, (-32,-102)); label.lft(btex $\angle AED \hbox{ and } \angle BEC \hbox{ are }$ etex, (-32,-114)); label.urt(btex $\hbox{A) vertical} $ etex, (-32,-126)); label.urt(btex $\hbox{B) supplementary} $ etex, (-32,-140)); label.urt(btex $\hbox{C) complementary} $ etex, (-32,-154)); endfig; $
We can see
%%Creator: MetaPost %%CreationDate: 2019.09.07:0852 But can we see it the document itself when viewed by gv? Or by okular/evince?
Thanks in advance,
Antonio
Sent from [ProtonMail](https://protonmail.ch), encrypted email based in Switzerland.
On Thu, 2019-09-19 at 03:01 +0000, None via users wrote:
We can see
%%Creator: MetaPost %%CreationDate: 2019.09.07:0852 But can we see it the document itself when viewed by gv? Or by okular/evince?
Try opening it those program, and see what it shows you in their file properties.
Sent from ProtonMail, encrypted email based in Switzerland.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Thursday, September 19, 2019 6:01 AM, Tim via users users@lists.fedoraproject.org wrote:
On Thu, 2019-09-19 at 03:01 +0000, None via users wrote:
We can see %%Creator: MetaPost %%CreationDate: 2019.09.07:0852 But can we see it the document itself when viewed by gv? Or by okular/evince?
Try opening it those program, and see what it shows you in their file properties.
uname -rsvp Linux 3.10.0-1062.1.1.el7.x86_64 #1 SMP Fri Sep 13 22:55:44 UTC 2019 x86_64
Boilerplate: All unexpected mail to my mailbox is automatically deleted. I will only get to see the messages that are posted to the mailing list.
Dear Sir,
I know I can get the creation date that way, but what I want is to display the day and time inline in the graphic by metaposting the document and it auto updates. I am randomizing the content; ie. changing the equations, but I am using web browser only. I found in Alan Kennington's metapost drawings for a differential geometry book and as I am learning metapost by copying/pasting code, I wanted to see if I can get the date as he gets it. From his page:
http://www.topology.org/tex/conc/mp/
We can get the source
http://www.topology.org/tex/conc/mp/ps/x/1568982300.71.40.58.214/mp1.tar.bz2
And there is a makefile to create the metapost cookbook for the pictures in the main book. He has several macros, one that I use but in TeX/LaTeX is
% Calculate the number of hours and number of minutes (24 hour format): \newcount\inthour \newcount\inthoursixty \newcount\intminute \inthour=\time \divide\inthour60 \intminute=\time \inthoursixty=\inthour \multiply\inthoursixty60 \advance\intminute-\inthoursixty
% Text representations of hours and minutes (24 hour format): \def\zmonth{\ifnum\month<10\relax0\fi\number\month} \def\zday{\ifnum\day<10\relax0\fi\number\day} \def\zhour{\ifnum\inthour<10\relax0\fi\number\inthour} \def\zminute{\ifnum\intminute<10\relax0\fi\number\intminute}
Typesetting date/time (local) of this document: {\tt \number\year-\zmonth-\zday\space\zhour:\zminute}.
I modified last line to {\tt \number\year.\zmonth.\zday:\zhour:\zminute} or \texttt{\number\year.\zmonth.\zday:\zhour:\zminute} depending on (TeX/LaTeX)ing the document. I would like to use a macro like this but in a metapost document. I am using Troy Henderson's Metapost Previewer
http://www.tlhiv.org/mppreview/
Since I am not allowed to install software on machines at work :( I am using web browser to display problems for students.
The error is as follows: <quote> ! Extra tokens will be flushed.
divide l.15 \divide \inthour60 </quote>
I would like to include the day and time inline for displaying directly on web browser. I know in advance that I can use the viewers to get the date and time, but I would probably have to use livecd/livedvd/liveusb to bypass the restrictions :( Is it possible to get the running time using a macro/set of commands like the mpdemo.pdf book?
Best Regards,
Antonio
Sent from ProtonMail, encrypted email based in Switzerland.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Thursday, September 19, 2019 6:01 AM, Tim via users users@lists.fedoraproject.org wrote:
On Thu, 2019-09-19 at 03:01 +0000, None via users wrote:
We can see %%Creator: MetaPost %%CreationDate: 2019.09.07:0852 But can we see it the document itself when viewed by gv? Or by okular/evince?
Try opening it those program, and see what it shows you in their file properties.
uname -rsvp Linux 3.10.0-1062.1.1.el7.x86_64 #1 SMP Fri Sep 13 22:55:44 UTC 2019 x86_64
Boilerplate: All unexpected mail to my mailbox is automatically deleted. I will only get to see the messages that are posted to the mailing list.
Using the LaTeX Previewer one can see how the date and time appear when one typesets the document, for instance visit page
http://www.tlhiv.org/ltxpreview/
Copy + Paste following code <code> % Calculate the number of hours and number of minutes (24 hour format): \newcount\inthour \newcount\inthoursixty \newcount\intminute \inthour=\time \divide\inthour60 \intminute=\time \inthoursixty=\inthour \multiply\inthoursixty60 \advance\intminute-\inthoursixty
% Text representations of hours and minutes (24 hour format): \def\zmonth{\ifnum\month<10\relax0\fi\number\month} \def\zday{\ifnum\day<10\relax0\fi\number\day} \def\zhour{\ifnum\inthour<10\relax0\fi\number\inthour} \def\zminute{\ifnum\intminute<10\relax0\fi\number\intminute}
%\number\year-\zmonth-\zday\space\zhour:\zminute
[ \overline{x} = \frac{1}{n}\sum_{i=1}^{n} x_{i} ] \texttt{This document was typeset at: \number\year.\zmonth.\zday:\zhour\zminute}
</code>
A formula appears and this document was typeset at: 20190920:0806
I would like to see/know if something like this can be done with a metapost document. I hope to clear some doubts if there were some.
Best Regards,
Antonio