7

If I use qrcode with amsart I get extra vertical spacings in the resulting qrcode.

\documentclass{amsart}
\usepackage{qrcode}
\begin{document}
\qrcode{http://www.ctan.org}
\end{document}

enter image description here

Am I doing something wrong?

gerald
  • 185

2 Answers2

10

The amsart class sets \lineskiplimit to 1pt, but qrcode.sty (wrongly) assumes it is 0pt.

Fix it by adding the expected setting in the appropriate places, when qrcode uses a minipage for printing the QR code.

\documentclass{amsart}
\usepackage{qrcode}
\usepackage{etoolbox}

\makeatletter
\patchcmd\qr@printmatrix
  {\baselineskip}
  {\lineskiplimit=0pt\baselineskip}
  {}{}
\patchcmd\qr@printsavedbinarymatrix
  {\baselineskip}
  {\lineskiplimit=0pt\baselineskip}
  {}{}
\makeatother

\begin{document}

\qrcode{http://www.ctan.org}

\end{document}
egreg
  • 1,121,712
1

There exists a competitive package qrcode.tex to the LaTeX package qrcode.sty. The qrcode.tex is designed for plain TeX but it can be used in LaTeX too because it is based only on TeX primitives.

You can compare

\documentclass{amsart}
\usepackage{qrcode}
\begin{document}
\qrcode{http://www.ctan.org}
\end{document}

which gives wrong result with

\documentclass{amsart}
\input qrcode
\begin{document}
\qrcode{http://www.ctan.org}
\end{document}

which gives correct result.

wipet
  • 74,238