Simplify code, minor issues

Refactor bash constructions. Fix minor issues: check for non-LaTeX documents; strip comments before any processing; solve the conflict of JHEP3 with \ifpdf; solve conflicts of hyperref's options with breakurl; remove geometry's option [pass].