PDF export: handle deeply nested latex commands and skip characters when replacing temporary gap_marks