[ refactor ] A use of fromMaybe.
[ Issue1241 ] Test case for --latex in sub dir.
[ issue1241 ] Fixed issue #1241, still room for refactoring