summaryrefslogtreecommitdiff
path: root/language/malayalam/bin/mal
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /language/malayalam/bin/mal
Initial commit
Diffstat (limited to 'language/malayalam/bin/mal')
-rwxr-xr-xlanguage/malayalam/bin/mal119
1 files changed, 119 insertions, 0 deletions
diff --git a/language/malayalam/bin/mal b/language/malayalam/bin/mal
new file mode 100755
index 0000000000..85dc73d311
--- /dev/null
+++ b/language/malayalam/bin/mal
@@ -0,0 +1,119 @@
+#!/bin/bash
+#
+#
+# Shell script for pre-processing Malayalam LaTeX files
+#
+# Alex A.J. <tex@alex.org.in>
+#
+#
+# 10 Nov 2007: Added support for ILDC-CDAC Fonts
+# 07 Jun 2005: Version 0.9.2
+# 21 Jan 2005: Added support for ISM
+# 26 Feb 2003: Update
+# 25 Feb 2003: Initial version
+#
+#
+#
+
+echo -e "\nUtility for pre-processing Malayalam LaTeX source files"
+echo -e "Alex A.J. <tex@alex.org.in>\n"
+
+if [ $# -eq 1 ]
+then
+ script="Rachana (new lipi)"
+ trs=mm_rch.trs
+ scr=mmr_rch.scr
+ vix=vim_rch
+elif [ $# -eq 2 ]
+then
+ case "$2" in
+ rachana)
+ script="Rachana (old lipi)"
+ trs=mm_rch.trs
+ scr=mm_rch.scr
+ vix=vim_rch
+ ;;
+ rachana2)
+ script="Rachana (new lipi)"
+ trs=mm_rch.trs
+ scr=mmr_rch.scr
+ vix=vim_rch
+ ;;
+ keli)
+ script="keli (new lipi)"
+ trs=mmr_keli.trs
+ scr=mmr_keli.scr
+ vix=vim_keli
+ ;;
+ ism)
+ script="ISM (new lipi)"
+ trs=mmr_ism.trs
+ scr=mmr_ism.scr
+ vix=vim_ism
+ ;;
+# thoolika)
+# trs=mmr_thl.trs
+# scr=mmr_thl.scr
+# ;;
+ ildc)
+ script="CDAC fonts from ILDC (new lipi)"
+ trs=mmr_ildc_cdac.trs
+ scr=mmr_ildc_cdac.scr
+ vix=vim_ildc_cdac
+ ;;
+ *)
+ echo -e "--> $2"
+ echo -e "Invalid <fontname>.\n"
+ echo -e "Available <fontname> options are:\n"
+ echo -e "\trachana - for old lipi"
+ echo -e "\trachana2 - for new lipi (default)"
+ echo -e "\tkeli"
+ echo -e "\tildc - For ILDC fonts (CDAC)"
+ echo -e "\tism - For CDAC ISM fonts\n"
+ exit 1
+ esac
+else
+ echo -e "Usage: mal <sourcefile> <fontname>\n"
+ echo -e "Available <fontname> options are:\n"
+ echo -e "\trachana - for old lipi"
+ echo -e "\trachana2 - for new lipi (default)"
+ echo -e "\tkeli"
+ echo -e "\tildc - For ILDC fonts (CDAC)"
+ echo -e "\tism - For CDAC ISM fonts\n"
+ echo -e "If <fontname> is unspecified, Rachana new lipi will be used.\n"
+ exit 0
+fi
+
+mmdir="/usr/share/malayalam/cfg" # directory for scr and trs files
+
+if [ -e "$1" ]
+then
+ echo -e "Using $script...\n"
+ mlym -t "$mmdir/$trs" -s "$mmdir/$scr" $1 2> mmerr.log
+ if [ -s "mmerr.log" ]
+ then
+ echo -e "Some error occured with the preprocessor"
+ echo -e "Error log:\n"
+ cat mmerr.log
+ echo -e "\n-----------------\nEnd of error log.\n"
+ echo -e "Log saved in mmerr.log\n"
+ exit 1
+ else
+ rm -f mmerr.log
+ echo -e "#!/bin/sh">00_mm.sh
+ echo -e "vi -s $mmdir/$vix $1 >/dev/null 2>/dev/null">>00_mm.sh
+ vi -s $mmdir/vim_tmp 00_mm.sh >/dev/null 2>/dev/null
+ sh 00_mm.sh
+ rm -f 00_mm.sh
+ echo -e "File successfully preprocessed.\n"
+ echo -e "Please run (pdf)LaTeX on the generated tex file.\n"
+ exit 0
+ fi
+else
+ echo -e "--> $1"
+ echo -e "File not found. Perhaps a mistype?\n"
+ exit 1
+fi
+
+#
+# End of file