[gedit-list] Making an external tool to Metapost compiling
- From: Denis LE FUR <dlefur gmail com>
- To: gedit-list gnome org
- Subject: [gedit-list] Making an external tool to Metapost compiling
- Date: Sat, 4 Jul 2009 18:23:26 -0300
Hello,
I try to make an external tool that compile a metapost file and show the n creates figures in a file name mproof.pdf.
The problem is the variable number of figures ... This code works as far as 6 figures, which is fine normally.
I am very bad in bash stuff. I need some help to improve this tool.
-----------------------------------------------------------
#!/bin/sh
# [Gedit Tool]
# Comment=Mpost
# Name=Mpost
# Shortcut=F12
# Applicability=all
# Input=nothing
# Output=output-panel
xdotool key "ctrl+s"
mpost "$GEDIT_CURRENT_DOCUMENT_NAME"
i="$GEDIT_CURRENT_DOCUMENT_NAME"
j=${i%.*}
if [ -f "$j.6" ]; then
tex mproof "$j.1" "$j.2" "$j.3" "$j.4" "$j.5" "$j.6"
elif [ -f "$j.5" ];
then
tex mproof "$j.1" "$j.2" "$j.3" "$j.4" "$j.5"
elif [ -f "$j.4" ]; then
tex mproof "$j.1" "$j.2" "$j.3" "$j.4"
elif [ -f "$j.3" ]; then
tex mproof "$j.1" "$j.2" "$j.3"
elif [ -f "$j.2" ]; then
tex mproof "$j.1" "$j.2"
elif [ -f "$j.2" ]; then
tex mproof "$j.1" "$j.2"
else
tex mproof "$j.1"
fi
dvips -ta4 mproof.dvi -o
ps2pdf
mproof.psevince mproof.pdf&
-----------------------------------------------------------------------------------------
Thank you
--
Denis LE FUR
dlefur gmail comhttp://mathsp.tuxfamily.org/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]