diff options
author | Karl Berry <karl@freefriends.org> | 2021-09-17 22:08:27 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-09-17 22:08:27 +0000 |
commit | 66b849234d54e78bbcce21445db4c6a26d72efac (patch) | |
tree | 809f15c5203cbd60d6bdff9c484654c1a9ded8bb /Master/texmf-dist/doc/support/latex2nemeth/contrib | |
parent | f3a3a20014bfba037b63c03cb338d7758a5ddf54 (diff) |
latex2nemeth (17sep21)
git-svn-id: svn://tug.org/texlive/trunk@60528 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/support/latex2nemeth/contrib')
-rw-r--r-- | Master/texmf-dist/doc/support/latex2nemeth/contrib/nemeth2odt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/support/latex2nemeth/contrib/nemeth2odt b/Master/texmf-dist/doc/support/latex2nemeth/contrib/nemeth2odt new file mode 100644 index 00000000000..9777f9322f4 --- /dev/null +++ b/Master/texmf-dist/doc/support/latex2nemeth/contrib/nemeth2odt @@ -0,0 +1,30 @@ +#!/bin/bash +#get a random name first of 8 chars +tmpdir=`cat /dev/urandom | tr -cd 'a-f0-9' | head -c 8` + +#make a folder +mkdir $tmpdir + +#get the base name of the fole to convert +file=`basename "$1" .nemeth` + +#convert nemeth from utf16 to utf8 +iconv -f utf-16 -t utf-8 "$1" > $file.txt + +#convert txt file to odt +libreoffice --headless --convert-to odt $file.txt 1>/dev/null + +# odt is setup with a bultintemplate for convertions +#from text, that uses Liberation Mono font. +#we need DejaVu Serif. We change the font and repack +#the odt file +unzip -qq -d $tmpdir $file.odt +rm -f $file.odt +find $tmpdir -type f | xargs sed -i 's/Liberation Mono/DejaVu Serif/g' +( cd $tmpdir; zip -qq -r ../$file.odt . ) + +#cleanup +/bin/rm -rf $tmpdir $file.txt + + + |