Our Computer Notes

Recent site activity

Latex‎ > ‎

How to fix the margin problems when creating a PDF in Ubuntu

There is a known issue when you are editing a tex document and after that you want to create a PDF from this document. The problem is that the generated PDF presents very small top margins. So, to solve this issue, here is the tip:

  1. Compile you tex document (ex: latex mytex.tex)
  2. Convert the dvi to ps (ex: dvips mytex.dvi)
  3. Convert the ps to pdf using the following command: ps2pdf -sPAPERSIZE=a4 mytex.ps mytex.pdf
The -sPAPERSIZE=a4 parameter solves that issue.