fix pandoc compile to file

A work-around that shareboard calls `escapeshell()` when output, which
cannot accept "$" in file, while for TeX output the sign is required.