mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] How to output png or jpg inside a session ?


Chronological Thread 
  • From: address@hidden
  • To: address@hidden
  • Subject: Re: [TeXmacs] How to output png or jpg inside a session ?
  • Date: Thu, 29 Jan 2009 11:22:58 +0100

Selon chu-ching huang <address@hidden>:

> On Wed, 28 Jan 2009 16:12:45 +0100, Corcelle wrote
> > Hello,
> >
> > Writing a plugin for TeXmacs, it's easy to output an eps image
> > within a session. For exemple with :
> >
> > echo -n $DATA_BEGIN
> > echo -n ps:
> > cat $ FILE.eps
> > echo -n $DATA_END
> >
> > I can't find how to output a jpg or png file to be able to have
> > transparency in TeXgraph outputs.
> > If someone could tel me how to do this or where to find informations
> > it would be great.
> >
> How about use convert(Imagemagick):
> convert file.jpg fire.eps
> and output the eps in the session.

I already tried this (I should have told you).
The TeXgraph program can export eps or pdf files. Right now, the plugin can
output eps file directly or eps converted from pdf (with pdftops).
The problem is that the screen quality of "pdf-to-eps files" is not really
good
and eps looses real transparency. So I wanted to know if it was possible to
include jpg or pdf files (without convertion to eps) into a TeXmacs file.
You can have a look at the tm_texgraph file below.

Thank you.

Emmanuël
>
> Best regards,
>
> cch
>

######## a part of tm_texgraph ##########

...........
# determine the export type chosen by the user (eps, epsc, jpg,
png...)
EXP_CHOICE=epsc
EXP_CHOICE=`grep {export=.*} $TEMP_FILE.teg | sed 's/{/\n/g' | sed
's/}/\n/g' |
grep export=.* | sed 's/export=//g'`

# compile with CmdTeXgraph, transform to .EXPORT_CHOICE and cat file
to
TeXmacs.
EXPT=epsc
if [ "$EXP_CHOICE" = "epsc" ] ; then EXPT='epsc'
elif [ "$EXP_CHOICE" = "eps" ] ; then EXPT='eps'
elif [ "$EXP_CHOICE" = "pdfc" ] ; then EXPT='pdfc'
elif [ "$EXP_CHOICE" = "pdf" ] ; then EXPT='pdf'
#elif [ "$EXP_CHOICE" = "jpg" ] ; then EXPT='pdfc'
#elif [ "$EXP_CHOICE" = "png" ] ; then EXPT='pdfc'
fi

if [ "$OSTYPE" = "cygwin" ] ; then EXT='.bat'; else EXT=''; fi
CmdTeXgraph$EXT $EXPT $TEMP_FILE 2> tmp_log

if [ -s $TEMP_FILE.pdf ] # convert pdf to eps then
then
#convert -density 600 -depth 8 -quality 75 $TEMP_FILE.pdf
$TEMP_FILE.jpg
pdftops -eps $TEMP_FILE.pdf $TEMP_FILE.eps
echo -n $DATA_BEGIN
echo -n verbatim:
echo -n $DATA_BEGIN
echo -n ps:
cat $TEMP_FILE.eps
echo -n $DATA_END
echo -ne "\n"
rm $TEMP_FILE.* tmp* $EXPT $EXP_CHOICE 2> /dev/null
elif [ -s $TEMP_FILE.eps ]
then
echo -n $DATA_BEGIN
echo -n verbatim:
echo -n $DATA_BEGIN
echo -n ps:
cat $TEMP_FILE.eps
echo -n $DATA_END
echo -ne "\n"
rm $TEMP_FILE.* tmp* $EXPT $EXP_CHOICE 2> /dev/null
else .......



Archive powered by MHonArc 2.6.19.

Top of page