latex: replace in smaller string

for better speed and to not replace stuff in dirname
latex: clear any automatic meta fields in output