fosdem2024_bigint: improve latex escaping for dia
authorJacob Lifshay <programmerjake@gmail.com>
Tue, 30 Jan 2024 05:20:27 +0000 (21:20 -0800)
committerJacob Lifshay <programmerjake@gmail.com>
Tue, 30 Jan 2024 05:20:27 +0000 (21:20 -0800)
conferences/fosdem2024/fosdem2024_bigint/.latexmkrc
conferences/fosdem2024/fosdem2024_bigint/bigint-add-pipe.dia

index d52c4ace545262faf8d9e4b899703d9415c3c3ec..c70c723fd2be1e4f55485da69dd0bd2a73913aad 100644 (file)
@@ -5,7 +5,10 @@ sub dia2tex {
     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\"");
 }
index 7ec8fa3b6edd83e3db2daa38ae3d0f35266ca67c..9935cdc22ec9f5f9c14f6e726faeb2dfa4d25520 100644 (file)
@@ -690,7 +690,7 @@ add ops#</dia:string>
       <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"/>
@@ -1046,7 +1046,7 @@ adde ops#</dia:string>
       <dia:attribute name="text">
         <dia:composite type="text">
           <dia:attribute name="string">
-            <dia:string>#latex:\onslide&lt;1-&gt;#</dia:string>
+            <dia:string>#latexcmd:\onslide&lt;1-&gt;#</dia:string>
           </dia:attribute>
           <dia:attribute name="font">
             <dia:font family="sans" style="0" name="Helvetica"/>