Last active
February 8, 2017 08:32
-
-
Save koppor/16659c4ef9ab7d088b2bc6eef420762e to your computer and use it in GitHub Desktop.
Prevent division by zero at pax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{scrartcl} | |
\usepackage{graphicx} | |
\usepackage{pax} | |
\makeatletter | |
\def\PAX@viewport#1 #2 #3 #4\\{% | |
\PAX@defaultbp\PAX@vllx{#1}% | |
\PAX@defaultbp\PAX@vlly{#2}% | |
\PAX@defaultbp\PAX@vurx{#3}% | |
\PAX@defaultbp\PAX@vury{#4}% | |
\edef\PAX@page@llx{\the\dimexpr\PAX@page@llx+\PAX@vllx\relax}% | |
\edef\PAX@page@lly{\the\dimexpr\PAX@page@lly+\PAX@vlly\relax}% | |
\edef\PAX@page@urx{\the\dimexpr\PAX@page@llx+\PAX@vurx\relax}% FIXED | |
\edef\PAX@page@ury{\the\dimexpr\PAX@page@lly+\PAX@vury\relax}% | |
} | |
\makeatother | |
\begin{document} | |
\includegraphics[page=1, viewport=0 0 21cm 23.628cm]{pax-include.pdf} | |
\end{document} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{scrartcl} | |
\usepackage{hyperref} | |
\begin{document} | |
\section{Section} | |
\label{sec} | |
This is Section~\ref{sec}. | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When including a pdf with
viewport
, pdflatex gives following error:One can reproduce the issue with following commands:
When using the above fix, the example compiles fine.
Thank to Heiko Oberdiek for the fix.