3
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[ansinew]{inputenc}
... 
\newwrite\outfile
\immediate\openout\outfile=\jobname.txt
% aßbc is a replacement for a long german text-block, with many ß inside
\immediate\write\outfile{ "aßbc"}
\immediate\closeout\outfile

produces as file content:

"a\T1\ss bc"

but I want the string

"aßbc"

yes, I can replace \T1\ss with ß in a postprocess-step, but I like to know how to do it from LaTeX

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
ifrh
  • 199

1 Answers1

2

You can try with

\immediate\write\outfile{\unexpanded{"aßbc"}}

which, in my experiment with ansinew coding, writes out byte "DF for the es-zet, which corresponds to the entry

\DeclareInputText{223}{\ss}

in ansinew.def.

egreg
  • 1,121,712
  • What if the string with es-zet becomes generated by some macros? – ifrh Aug 07 '15 at 14:44
  • 1
    @sporack You're out of luck, I'm afraid. Do you really need the literal ß or just \ss is good? – egreg Aug 07 '15 at 14:49
  • Well at the end the (pdf)latex-run should produce an additional \jobname.txt file, which is an input-file for a later run of
    exiftool(-k).exe" -@ jobname.txt -charset Latin
    therefor in the written output I want no TeX-Code anymore :-)
    – ifrh Sep 14 '15 at 11:12