Subject: mailing-list for TeXmacs Users
List archive
From : Corcelle <address@hidden>- To: address@hidden
- Subject: Re: [TeXmacs] Nouveau plugin TeXgraph.
- Date: Sun, 30 Nov 2008 00:31:14 +0100
Hello me,
I just wrote a plugin for TeXgraph. This software makes it possible to create graphs which will be used inside LaTeX (you can find this really good software in French at http://texgraph.tuxfamily.org/index.html).A new version of the TeXgraph plugin is attached.
I followed the help files to create two files :
- tm_texgraph based on tm_pstricks by Nicolas Ratier
- init-texgraph.scm based on init-eukleides.scm by Joris van der Hoeven.
To use it, you have to extract texgraph.tar.gz in the "~/.TeXmacs/plugin" directory under linux and to install TeXgraph of course.
With a little help by the developer of Texgraph, P. Fradin, I have succeeded in correcting this little problem and I added a test which let you know if you have done a syntax error and what kind of error has been done (missing bracket or coma...).
As it is my first attempt to do something like this, it is not clean and seems buggy.
There are a few things I can't correct. For example, in the following TeXgraph session in TeXmacs, I can't remove the red <\errput> just below the graph.
Everything works fine now and the whole thing is really worth trying. It is a really good complement to Eukleides, easy to use and efficient for plotting, 3D...
Last thing. In the session heading, I would like to know if it is possible to add :
1. a link to a documentation for TeXgraph commands which could be placed in the /plugins/texgraph folder
2. a folded environnement where I could place a few TeXgraph commands.
Let me know if you need more information or if there are things to correct.
Bye.
Bye.
Emmanuël Corcelle again
Emmanuël Corcelle
########################## tm_texgraph ###########################
((((( TeXmacs 1.0.7 and TeXgraph 1.94 beta on Ubuntu Intrepid (8.10) )))))
The 2 files :
#!/bin/bash
#=====================================================================
# MODULE : tm_texgraph
# VERSION : 0.02
# DESCRIPTION: A simple TeXgraph interface for TeXmacs
# Emmanuel Corcelle (corcelle at gmail dot com)
#------------------------------------------------------------------------------
# Based on : A simple PSTricks interface for TeXmacs
# COPYRIGHT : (C) 2004 Nicolas Ratier (nicolas DOT ratier AT lpmo DOT edu))
#------------------------------------------------------------------------------
# COPYRIGHT : (C) TeXgraph by Patrick Fradin (pfradin at tuxfamily point org) (http://texgraph.tuxfamily.org/)
#------------------------------------------------------------------------------
# tm_texgraph
# ==========
# bash script for interfacing TeXgraph from TeXmacs
# needs option --texmacs for compatibility with TeXmacs interface convention and user information
#
# usage within TeXmacs:
# =====================
# write texgraph-commands within the input line, use as many commands as necessary,
# divide them by the "," chararacter, because the ENTER key terminates the input and sends it to TeXgraph.
# output is the graph made via TeXgraphCmd, latex, and dvips -E mode.
#
# Temporary file are made in ~/.TeXmacs/system/tmp
#------------------------------------------------------------------------------
# This software falls under the GNU general public license and comes WITHOUT
# ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details.
# If you don't have this file, write to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#==============================================================================
if [ "$1" != "--texmacs" ]
then
echo tm_texgraph. This script should be started only from TeXmacs.
exit
fi
# control characters
tmp=`echo DATA_BEGIN=X DATA_END=Y DATA_ESCAPE=Z | tr "XYZ" "\002\005\027" `
eval $tmp
# defining temporary files directory and make it if it doesn't exist
TEMP_DIR=~/.TeXmacs/system/tmp
if [ -d $TEMP_DIR ]
then
cd $TEMP_DIR
else
mkdir -p $TEMP_DIR
cd $TEMP_DIR
fi
# defining primary temp file name
TEMP_FILE=texgraphtmp
# startup banner
echo -n $DATA_BEGIN
echo verbatim:TeXmacs interface to TeXgraph.
echo For LaTeX code, use \\\\ instead of \\ \for example, $\\\\pi$ instead of $\\pi$
echo Rappels \: Fenetre\(-4+3*i,4-3*i,1+i\), Marges\(0.25,0.25,0.25,0.25\), size\(5\)
echo -n $DATA_END
# prompt-input-texgraph-output loop
while [ 1 ]; do
# prompt
echo -n $DATA_BEGIN
echo -n channel:prompt
echo -n $DATA_END
echo -n TeXgraph'] '
echo -n $DATA_END
# read a line from stdin
read input
# begin creation of TeX file
echo -E "\documentclass{article}" > $TEMP_FILE.tex
echo -E "\usepackage{texgraph}" >> $TEMP_FILE.tex
echo -E "\pagestyle{empty}" >> $TEMP_FILE.tex
echo -E "\begin{document}" >> $TEMP_FILE.tex
echo -E "\begin{texgraph}[export=epsc]" >> $TEMP_FILE.tex
echo -E "Marges(0.25,0.25,0.25,0.25)," >> $TEMP_FILE.tex
#echo -E "Fenetre(-4+4*i,4-4*i,1+i)," >> $TEMP_FILE.tex
# other commands to initialize the graph can be included here
# copy TeXgraph in latex file
echo -E $input | tr "~" "\n" | cat >> $TEMP_FILE.tex
# finish TeX file
echo -E "\end{texgraph}" >> $TEMP_FILE.tex
echo -E "\end{document}" >> $TEMP_FILE.tex
# compile with latex, transform to .eps and cat .eps to TeXmacs.
latex --shell-escape --interaction=nonstopmode --draftmode $TEMP_FILE.tex 1> /dev/null 2> tmp_log
if [ -s texgraphtmp1.eps ]
then
echo -n $DATA_BEGIN
echo -n verbatim:
echo -n $DATA_BEGIN
echo -n ps:
cat texgraphtmp1.eps
echo -n $DATA_END
echo -ne "\n"
rm $TEMP_FILE.* texgraphtmp1.* tmp*
else
echo -n $DATA_BEGIN
echo -n verbatim:
cat texgraphtmp1.log
echo -n $DATA_BEGIN
echo -n ps:
echo -n $DATA_END
echo -ne "\n"
rm $TEMP_FILE.* texgraphtmp1.* tmp*
fi
done
######################### init-texgraph.scm ###########################
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; MODULE : init-texgraph.scm
;; DESCRIPTION : Initialize TeXgraph plugin
;; Emmanuel Corcelle (corcelle at gmail dot com)
;;-----------------------------------------------------------------------------
;; Based on : Initialize Eukleides plugin
;; COPYRIGHT : (C) 2003 Joris van der Hoeven (vdhoeven at texmacs dot org)
;;------------------------------------------------------------------------------
;;
;; This software falls under the GNU general public license and comes WITHOUT
;; ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for details.
;; If you don't have this file, write to the Free Software Foundation, Inc.,
;; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(plugin-configure texgraph
(:require (url-exists-in-path? "latex"))
(:launch "tm_texgraph --texmacs")
(:session "TeXgraph"))
Attachment:
texgraph.tar.gz
Description: GNU Zip compressed data
- Re: Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, (continued)
- Re: Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Andrea Gamba, 11/19/2008
- Re: Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Andrea Gamba, 11/19/2008
- Re: Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Marc Lalaude-Labayle, 11/19/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Kamaraju S Kusumanchi, 11/27/2008
- Re: Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Marc Lalaude-Labayle, 11/19/2008
- Re: Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Andrea Gamba, 11/19/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Kamaraju S Kusumanchi, 11/20/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Marc Lalaude-Labayle, 11/20/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Kamaraju S Kusumanchi, 11/27/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Marc Lalaude-Labayle, 11/27/2008
- [TeXmacs] Nouveau plugin TeXgraph., Corcelle, 11/27/2008
- Re: [TeXmacs] Nouveau plugin TeXgraph., Corcelle, 11/30/2008
- [TeXmacs] Nouveau plugin TeXgraph., Corcelle, 11/27/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Marc Lalaude-Labayle, 11/27/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Kamaraju S Kusumanchi, 11/27/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Marc Lalaude-Labayle, 11/20/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Kamaraju S Kusumanchi, 11/20/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Andrea Gamba, 11/21/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Kamaraju S Kusumanchi, 11/21/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Lionel Elie Mamane, 11/21/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Marc Lalaude-Labayle, 11/21/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Lionel Elie Mamane, 11/21/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Kamaraju S Kusumanchi, 11/21/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Andrea Gamba, 11/21/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Andrea Gamba, 11/21/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Andrea Gamba, 11/21/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Andrea Gamba, 11/21/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Javier Arantegui, 11/21/2008
- Re: [TeXmacs] texmacs 1.0.7 is now packaged for debian, Andrea Gamba, 11/28/2008
Archive powered by MHonArc 2.6.19.