![](https://secure.gravatar.com/avatar/4ef22a1266a5927ed03d35e073127820.jpg?s=120&d=mm&r=g)
I would like to have reproducible PDF output from ConTeXt documents. I
tried the suggestions at https://tex.stackexchange.com/a/313605/146025
but they did not work. The PDF output has information like
"ConTeXt.Time", "CreateDate", etc., which depend on the time the source
was processed at. How do I suppress such temporal information, that is
not supplied by the author, from the PDF output?
Here are my two attempts:
----------------------------------------------------------------------
$ cat example.tex
\pdfinfoomitdate=1
\pdftrailerid{}
\starttext
Hello, world!
\stoptext
$ ( context example.tex && cp example.pdf a && sleep 1 && \
context example.tex && cp example.pdf b ) > /dev/null && \
md5sum a b
6a4ac7122bb502062e7ea87be52df166 a
cac1ab3160003526e49da135d77e4eda b
----------------------------------------------------------------------
----------------------------------------------------------------------
$ cat example.tex
\pdfvariable suppressoptionalinfo \numexpr
0
+ 1 % PTEX.FullBanner
+ 2 % PTEX.FileName
+ 4 % PTEX.PageNumber
+ 8 % PTEX.InfoDict
+ 16 % Creator
+ 32 % CreationDate
+ 64 % ModDate
+ 128 % Producer
+ 256 % Trapped
+ 512 % ID
\relax
\starttext
Hello, world!
\stoptext
$ ( context example.tex && cp example.pdf a && sleep 1 && \
context example.tex && cp example.pdf b ) > /dev/null && \
md5sum a b
2116aeec2b5bed2bfd02d16332700758 a
3204a1a127f139da8d960037a8ba0690 b
----------------------------------------------------------------------
Here is the reason I want reproducible builds. I keep the source of my
ConTeXt documents under version control. I also keep their PDF output
under version control because I often find, several years after a
document was written, that I don't have the supporting files needed to
process it; in such a case, until I get the missing supporting files, I
can at least view the PDF output. Now, even when the source has not
changed, if I run context on it, the PDF output changes, and the version
control system reports the PDF file as modified. In such a situation, I
have to register the change in the version control system, or revert the
PDF file to its version. I would like to avoid this extra work.
Thanks and regards,
Raghu.
--
N. Raghavendra
![](https://secure.gravatar.com/avatar/5955e8e90611e77ccbfc7721b6112027.jpg?s=120&d=mm&r=g)
On 11/11/2017 08:39 AM, N. Raghavendra wrote:
I would like to have reproducible PDF output from ConTeXt documents. I tried the suggestions at https://tex.stackexchange.com/a/313605/146025 but they did not work. The PDF output has information like "ConTeXt.Time", "CreateDate", etc., which depend on the time the source was processed at. How do I suppress such temporal information, that is not supplied by the author, from the PDF output?
Hi Raghu, "contextjit --nodates" is your friend here. No \pdf* commands are required. I hope it helps, Pablo
Here are my two attempts:
---------------------------------------------------------------------- $ cat example.tex
\pdfinfoomitdate=1 \pdftrailerid{}
\starttext
Hello, world!
\stoptext
$ ( context example.tex && cp example.pdf a && sleep 1 && \ context example.tex && cp example.pdf b ) > /dev/null && \ md5sum a b
6a4ac7122bb502062e7ea87be52df166 a cac1ab3160003526e49da135d77e4eda b ----------------------------------------------------------------------
---------------------------------------------------------------------- $ cat example.tex
\pdfvariable suppressoptionalinfo \numexpr 0 + 1 % PTEX.FullBanner + 2 % PTEX.FileName + 4 % PTEX.PageNumber + 8 % PTEX.InfoDict + 16 % Creator + 32 % CreationDate + 64 % ModDate + 128 % Producer + 256 % Trapped + 512 % ID \relax
\starttext
Hello, world!
\stoptext
$ ( context example.tex && cp example.pdf a && sleep 1 && \ context example.tex && cp example.pdf b ) > /dev/null && \ md5sum a b
2116aeec2b5bed2bfd02d16332700758 a 3204a1a127f139da8d960037a8ba0690 b ----------------------------------------------------------------------
Here is the reason I want reproducible builds. I keep the source of my ConTeXt documents under version control. I also keep their PDF output under version control because I often find, several years after a document was written, that I don't have the supporting files needed to process it; in such a case, until I get the missing supporting files, I can at least view the PDF output. Now, even when the source has not changed, if I run context on it, the PDF output changes, and the version control system reports the PDF file as modified. In such a situation, I have to register the change in the version control system, or revert the PDF file to its version. I would like to avoid this extra work.
Thanks and regards, Raghu.
-- N. Raghavendra
, http://www.retrotexts.net/ Harish-Chandra Research Institute, http://www.hri.res.in/ ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
![](https://secure.gravatar.com/avatar/4ef22a1266a5927ed03d35e073127820.jpg?s=120&d=mm&r=g)
At 2017-11-11T14:37:33+01:00, Pablo Rodriguez wrote:
"contextjit --nodates" is your friend here.
No \pdf* commands are required.
I hope it helps,
Dear Pablo,
Thanks for the answer. It works.
----------------------------------------------------------------------
$ cat example.tex
\starttext
Hello, world!
\stoptext
$ ( context --nodates example.tex && cp example.pdf a && sleep 1 && \
context --nodates example.tex && cp example.pdf b ) > /dev/null && \
md5sum a b
74497066154ebb4df7978719127f1a93 a
74497066154ebb4df7978719127f1a93 b
----------------------------------------------------------------------
Incidentally, is it common to use the contextjit command instead of
context? The only hint I found at the Wiki is at
http://wiki.contextgarden.net/Running_Mark_IV#Experimental_speedup which
says that the jit flag leads to quicker processing of the source.
Regards,
Raghu.
--
N. Raghavendra
![](https://secure.gravatar.com/avatar/5955e8e90611e77ccbfc7721b6112027.jpg?s=120&d=mm&r=g)
On 11/11/2017 08:08 PM, N. Raghavendra wrote: [...]
$ ( context --nodates example.tex && cp example.pdf a && sleep 1 && \ context --nodates example.tex && cp example.pdf b ) > /dev/null && \ md5sum a b
I checked it with sha256sum ;-).
Incidentally, is it common to use the contextjit command instead of context? The only hint I found at the Wiki is at http://wiki.contextgarden.net/Running_Mark_IV#Experimental_speedup which says that the jit flag leads to quicker processing of the source.
I always use contextjit instead of context, because it’s faster. Other than speed, I think there is no other difference. Pablo -- http://www.ousia.tk
![](https://secure.gravatar.com/avatar/4ef22a1266a5927ed03d35e073127820.jpg?s=120&d=mm&r=g)
At 2017-11-11T21:06:22+01:00, Pablo Rodriguez wrote:
I checked it with sha256sum ;-).
And, why not!
I always use contextjit instead of context, because it’s faster.
Other than speed, I think there is no other difference.
That's good to know. I'll try it out.
Regards,
Raghu.
--
N. Raghavendra
![](https://secure.gravatar.com/avatar/e5aa6984b53b8925e405ebbdbc051ad9.jpg?s=120&d=mm&r=g)
Am 2017-11-11 um 21:06 schrieb Pablo Rodriguez
I always use contextjit instead of context, because it’s faster.
Other than speed, I think there is no other difference.
Sometimes it has its own bugs, like at the moment (at least in last week’s beta) with Lua code. Sometimes ConTeXtJIT couldn’t find my fonts, where ConTeXt could (maybe an old, solved problem). Greetlings, Hraban --- http://www.fiee.net http://wiki.contextgarden.net GPG Key ID 1C9B22FD
![](https://secure.gravatar.com/avatar/6e50a7aa57f5569d881f204f124d96ef.jpg?s=120&d=mm&r=g)
On Sun, 12 Nov 2017 09:37:33 +0100
Henning Hraban Ramm
Am 2017-11-11 um 21:06 schrieb Pablo Rodriguez
: I always use contextjit instead of context, because it’s faster.
Other than speed, I think there is no other difference.
Sometimes it has its own bugs, like at the moment (at least in last week’s beta) with Lua code. Sometimes ConTeXtJIT couldn’t find my fonts, where ConTeXt could (maybe an old, solved problem).
And luajittex is not *always* faster, as Hans has shown us many times at meetings, although it is usually faster, I believe. It all depends on what type of operations one is processing. Note, as well, that luajittex is not available on all platforms for now. Luajit cannot be compiled for certain processors (one example is powerpc). Alan
participants (4)
-
Alan Braslau
-
Henning Hraban Ramm
-
N. Raghavendra
-
Pablo Rodriguez