[tex-live] Latvian support in TeXLive
Kārlis Repsons
karlis.repsons at gmail.com
Thu Oct 15 23:40:26 CEST 2009
Here I post a script I just wrote for automatic execution of the before
mentioned instructions (except for hyphenation, I don't understand about it):
(apparently it gives me all I want except for hyphenation and LV including in
official TeXLive)
#!/bin/bash
. /etc/bash/global_env_variables
latv_base_url="http://home.lanet.lv/~drikis/LaTeX-Latviski/LatvianInstall/Files/latv_base.tar.bz2"
latv_fonts_url="http://home.lanet.lv/~drikis/LaTeX-Latviski/LatvianInstall/Files/latv_fonts.tar.bz2"
if [[ $1 == "help" ]]
then
echo -e "Usage: latviskotLaTeX\nThis will automate the manual instructions
found at
\"http://home.lanet.lv/~drikis/LaTeX-Latviski/LatvianInstall/Linux/LinuxLV.html\"!"
exit 0
fi
# some script globals
tmpdir="/tmp/latviskotLaTeX "$(date)
babel_file="/usr/share/texmf-dist/tex/generic/babel/babel.sty"
fonts_file="/usr/share/texmf/web2c/updmap.cfg"
# hyphens_file="/usr/share/texmf/tex/generic/config/language.def"
g_file="/usr/share/texmf-dist/tex/latex/ucs/data/uni-1.def"
setup() {
if [[ -d "$tmpdir" ]]
then
echo "Hey, there is directory \"$tmpdir\" already, strange indeed!"
exit 1
fi
mkdir "$tmpdir" > /dev/null 2> /dev/null
if [[ $? -ne 0 ]]
then
echo "Failed to make dir. \"$tmpdir\"!"
exit 1
fi
cd "$tmpdir" > /dev/null 2> /dev/null
if [[ $? -ne 0 ]]
then
echo "Failed to switch to directory \"$tmpdir\", strange indeed!"
exit 1
fi
}
cleanup() {
cd ..
rmdir -r "$tmpdir" > /dev/null 2> /dev/null
}
fail () {
cleanup
exit 1
}
getFiles() {
wget -v -t 10 -T 30 "$latv_base_url"
if [[ $? -ne 0 ]]
then
echo "Failed to download \"$latv_base_url\"!"
fail
fi
wget -v -t 10 -T 30 "$latv_fonts_url"
if [[ $? -ne 0 ]]
then
echo "Failed to download \"$latv_fonts_url\"!"
fail
fi
}
installPacks() {
bzip2 -dc latv_base.tar.bz2 | tar -xvf - -C /usr/share/texmf
if [[ $? -ne 0 ]]
then
echo "Failed to install latv_base.tar.bz2!"
fail
fi
bzip2 -dc latv_fonts.tar.bz2 | tar -xvf - -C /usr/share/texmf
if [[ $? -ne 0 ]]
then
echo "Failed to install latv_fonts.tar.bz2!"
fail
fi
texhash
if [[ $? -ne 0 ]]
then
echo "Hell happens, you know: texhash failed!"
fail
fi
}
updateBabel() {
if [[ ! -f "$babel_file" ]]
then
echo "There is no file \"$babel_file\"!"
fail
fi
if [[ -z $(cat "$babel_file" | sed -n "/latvian\.ldf/=") ]]
then
lnum=$(cat "$babel_file" | sed -n "/latin\.ldf/=")
if [[ -n $lnum ]]
then
cat "$babel_file" | sed $[$lnum+1]"i \\\\\DeclareOption{latvian}
{\\\input{latvian.ldf}}" > lfile &&
cat lfile > "$babel_file"
if [[ $? -ne 0 ]]
then
echo "cat shitness 2"
fail
fi
else
echo "Failed, because didn't find latin.ldf in \"$babel_file\"!"
fail
fi
line=$(cat "$babel_file" | sed -n $[$lnum+1]p)
if [[ "$line" != "\\DeclareOption{latvian}{\\input{latvian.ldf}}" ]]
then
echo "Failed, because in \"$babel_file\" inserted line \"$line\"
is wrong for some sed shits!"
fail
fi
fi
}
addFonts() {
if [[ ! -f "$fonts_file" ]]
then
echo "There is no fonts file \"$fonts_file\"!"
fail
fi
cat >> "$fonts_file" << EOF
# TTF fonts for LV by Arnis Voitkans, arnis.voitkans at lu.lv
Map timesnew.map
Map arial.map
Map cournew.map
Map georgia.map
Map verdana.map
Map bookmanold.map
Map comic.map
Map gothic.map
Map cumberland.map
Map palatino.map
EOF
if [[ $? -ne 0 ]]
then
echo "Failed to update fonts file \"$fonts_file\"!"
fail
fi
updmap
if [[ $? -ne 0 ]]
then
echo "updmap failed!"
fail
fi
}
gSetup() {
if [[ ! -f "$g_file" ]]
then
echo "There is no file \"$g_file\"!"
fail
fi
if [[ -z $(cat "$g_file" | sed -n "/.*291.*v g.%%/=") ]]
then
lnum=$(cat "$g_file" | sed -n "/.*291.*/=")
if [[ -n $lnum ]]
then
cat "$g_file" |
sed "/dclc.291..dirty...leavevmode.*/c\\\\\uc at dclc{291}{default}{\\\v g}%%" >
lfile &&
cat lfile > "$g_file"
if [[ $? -ne 0 ]]
then
echo "cat shitness 1"
fail
fi
else
echo "Failed, because didn't find 291 in \"$g_file\"!"
fail
fi
line=$(cat "$g_file" | sed -n $lnum"p")
if [[ "$line" != "\\uc at dclc{291}{default}{\\v g}%%" ]]
then
echo "Failed, because in \"$g_file\" inserted line \"$line\" is
wrong for some sed shits!"
fail
fi
fi
}
setup
getFiles
installPacks
updateBabel
addFonts
gSetup
cleanup
echo "All done well."
exit 0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://tug.org/pipermail/tex-live/attachments/20091015/fdba5ac5/attachment.bin>
More information about the tex-live
mailing list