izuzak / atom-pdf-view

Support for viewing PDF files in Atom.
https://atom.io/packages/pdf-view
MIT License
106 stars 30 forks source link

Tall mathematical symbols render incorrectly. #131

Open frxstrem opened 8 years ago

frxstrem commented 8 years ago

I often use this plugin to compile LaTeX documents which contain often a lot of mathematical equations. Often, when these contain tall symbols, such as integrals or square roots, these are displayed as much taller than they should. When I open the PDF files in other viewers (such as Google Chrome or my system's default PDF viewer), they don't produce the same behavior.

screenshot from 2016-04-02 19-54-17

This is the PDF file I used in the above screenshot: test.pdf

This is the LaTeX code I used to produce the PDF file:

\documentclass[11pt,a4paper]{article}
\usepackage{amsmath}

\begin{document}
\begin{align}
  \phi(k) &= \frac{1}{\sqrt{2\pi}} \int_{-\infty}^\infty \Psi(x,0) e^{-i k x} dx \\
  &= \frac{1}{\sqrt{2\pi}} \int_{-\infty}^\infty \sqrt{a} e^{-a|x|} e^{-i k x} dx \\
  &= \sqrt{\frac{2a}{\pi}} \int_{0}^{\infty} e^{- a x - i k x} dx
\end{align}
\end{document}

If it's relevant, I'm using Atom 1.6.0 on Linux.

izuzak commented 8 years ago

Thanks for opening an issue :bow:.

That's strange -- I'm having trouble reproducing this on OSX and Atom 1.6.2 -- here's a side-by-side view of pdf-view and pdf.js in Chrome (the library pdf-view uses to render pdfs):

screen shot 2016-04-03 at 15 26 05

Both look fine to me. It might be a Linux issue, but there's nothing Linux-specific in pdf-view -- it just uses the pdf.js library to render pdfs.

Perhaps this is a problem in pdf.js and has been fixed in one of the more recent versions of the library. If someone wants to try updating pdf-view to use a more recent version of pdf.js and see if that helps -- I'd be happy to review a pull request.

mgab commented 8 years ago

In a Debian 8 machine I can reproduce it, both with pdf-view 0.50.0 (with Atom 1.8.0) and Firefox 47.0.1. I also realized that zooming in and out to the pdf alters the level of distortion of the tall symbols, so that for certain zoom levels it looks alright. On the other hand, the very same file displays well in evince and chromium regardless of the zoom.

izuzak commented 8 years ago

Thanks for adding a comment here, @mgab :bow:

I've added the "bug" label on this issue. If someone wants to look into this and propose a PR -- I'd be happy to review it.