system("dia -n -t pgf-tex -e \"$_[0].dia-tex\" \"$_[0].dia\"");
# replace labels with text `latex:\something` by the latex command `\something`
my $sed_cmd = substr(<<'EOS', 0, -1); # remove trailing newline
-sed -i 's/^\\node\[[^\]*\] at ([-0-9.]\+\\du,[-0-9.]\+\\du){latex:\\ensuremath{\\backslash}\(.*\)};$/\\\1/'
+sed -i 's/^\\node\[[^\]*\] at ([-0-9.]\+\\du,[-0-9.]\+\\du){latexcmd:\(.*\)};$/latex:\1/
+s/latex:\\ensuremath{\\backslash}/\\/g
+s/latex:\\\([$_{}]\)/\1/g
+'
EOS
system("$sed_cmd \"$_[0].dia-tex\"");
}
<dia:attribute name="text">
<dia:composite type="text">
<dia:attribute name="string">
- <dia:string>#latex:\pause#</dia:string>
+ <dia:string>#latexcmd:\pause#</dia:string>
</dia:attribute>
<dia:attribute name="font">
<dia:font family="sans" style="0" name="Helvetica"/>
<dia:attribute name="text">
<dia:composite type="text">
<dia:attribute name="string">
- <dia:string>#latex:\onslide<1->#</dia:string>
+ <dia:string>#latexcmd:\onslide<1->#</dia:string>
</dia:attribute>
<dia:attribute name="font">
<dia:font family="sans" style="0" name="Helvetica"/>