I have a file containing some diaeresis marks, ̈
. I need to replace them with \textdiaeresis
, for use in TeX.
The usual commands which seem to work with other symbols always causes the output to be \\textdiaeresis
or \ extdiaeresis
, the later, where \t
is interpreted to mean "tab".
I have tried these sed
commands:
sed -i 's/\ ̈/\textdiaeresis /g' ./file.txt
sed -i 's/\ ̈/\\textdiaeresis /g' ./file.txt
sed -i 's/\ ̈/\\\textdiaeresis /g' ./file.txt
sed -i "s/\ ̈/\textdiaeresis /g" ./file.txt
sed -i "s/\ ̈/\\textdiaeresis /g" ./file.txt
sed -i "s/\ ̈/\\\textdiaeresis /g" ./file.txt
I have tried these nawk
commands:
nawk '{sub(/ ̈/,"\textdiaeresis"); print}' file.txt > file.txt2
cp file.txt2 file.txt
nawk '{sub(/ ̈/,"\\textdiaeresis"); print}' file.txt > file.txt2
cp file.txt2 file.txt
nawk '{sub(/ ̈/,"\\\textdiaeresis"); print}' file.txt > file.txt2
cp file.txt2 file.txt
How can I replace a diaeresis with this TeX code?
On Mac OS X 10.7.4, under
bash
(version 3.2.48), I find no problem withsed
(which is the Mac OS Xsed
, not the GNUsed
).The character is U+0308 COMBINING DIAERESIS; I copied the fragment assigned to
x
from the question. The Unicode standard specifies (Chapter 2, §2.11):Thus, the diaeresis in the question text should be rendered over the space. Using Firefox (14.0.1), in the shell output, the diaeresis is shown over the
.
following it, which is wrong. And in thesed
command, the diaeresis appears to be combined with the following slash, which is also wrong. Oh well! But the translation viased
looks correct to me.