mts

A little thing I am hoping to integrate into this blog. It uses MediaWiki’s texvc to generate a PNG from an equation in LaTeX.

function mts {
    tex=$(texvc /tmp $1 $2 iso-9559-1 | tr -d "\0" |
          sed -r 's ^.(.{32}).* \1 ')
    if [ "$3" = 'hash' ]; then
       nm=$(print $1 | md5sum | awk '{print $1}')
    else
       nm=${2// /_}
    fi
    mv "${1}/${tex}.png.png" "${1}/${nm}.png"
}
This entry was posted in software | and tagged , Bookmark the permalink. Post a comment or leave a trackback: Trackback URL. | Edit

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*