ho-tex / oberdiek

Updating the oberdiek bundle
Other
16 stars 6 forks source link

pdftexcmd: Checksum Computation #34

Closed manuel-kuehner closed 6 years ago

manuel-kuehner commented 6 years ago

It's about the checksum computation in pdftexcmd that is apparently different for LaTeX and LuaTeX as reported in https://tex.stackexchange.com/questions/219199.

I am not an expert - I only "suffer" from the problem that seems to be a couple of years old now.

The problem seems to be Windows specific.

agrahn commented 6 years ago

Below, there is a simple test file (with zero pages output).

Run pdflatex and lulatex on it. It writes the MD5 checksum of the test file to the terminal and into the log file. The checksums should be the same for pdfLaTeX and for LuaLaTeX and be equal to the output of the md5sum Unix command.

On Windows platform the checksum calculated by LuaLaTeX is wrong, because in file texmf-dist/scripts/oberdiek/pdftexcmds.lua, in the md5sum implementation, input files are opened in text mode. They should rather be opened in binary mode. The suggested patch in https://tex.stackexchange.com/a/222272 fixes this for all platforms.

Test file:


\documentclass{article}

\usepackage{pdftexcmds}

\begin{document}

\makeatletter
\typeout{++++++++++++++ md5checksum ++++++++++++++}
\typeout{\pdf@filemdfivesum{\jobname.tex}}
\typeout{++++++++++++++ md5checksum ++++++++++++++}
\makeatother

\end{document}
davidcarlisle commented 6 years ago

yes thanks I've made the change locally, not committed yet as the build fails elsewhere in the bundle unrelated to this package (documentation failing with a biblatex change) I'll commit and push to github once that is resolved. thanks for identifying the issue here.

On 24 January 2018 at 20:54, agrahn notifications@github.com wrote:

Bellow, there is a simple test file (with zero pages output).

Run pdflatex and lulatex on it. It writes the MD5 checksum of the test file to the terminal and into the log file. The checksums should be the same for pdfLaTeX and for LuaLaTeX and be equal to the output uf the md5sum Unix command.

On Windows platform the checksum calculated by LuaLaTeX is wrong, because in file texmf-dist/scripts/oberdiek/pdftexcmds.lua, the files are opened in text mode. They should rather be opened in binary mode. The suggested patch in https://tex.stackexchange.com/a/222272 fixes this for all platforms.

Test file:

\documentclass{article} \usepackage{pdftexcmds} \begin{document} \makeatletter\typeout{++++++++++++++ md5checksum ++++++++++++++}\typeout{\pdf@filemdfivesum{\jobname.tex}}\typeout{++++++++++++++ md5checksum ++++++++++++++}\makeatother \end{document}

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ho-tex/oberdiek/issues/34#issuecomment-360270018, or mute the thread https://github.com/notifications/unsubscribe-auth/ABNcAvgdtFdrMkXLU0mpBzplU-a6R3opks5tN5ibgaJpZM4Rr4GY .

agrahn commented 6 years ago

Wow, this was really fast. Thank you, David!

manuel-kuehner commented 6 years ago

Copy and Paste: Wow, this was really fast. Thank you, David!

davidcarlisle commented 6 years ago

this is now on ctan, thanks for the report.