AC-Archive
Autoconf Macro Archive

ac-archive.sf.net: - Project CVS - Download
Macro Index
- AM Support
- C++ Support
- C Support
- Fortran Support
- Java Support
- Cross Compilation
- Installed Packages
- Miscellaneous
- LaTeX Support
- Uncategorized
- archive macros
- adl's macros
- bkorb's macros
- guidod's macros
- latex's macros
- other's macros
- rleigh's macros
- obsoleted macros
- released macros
- search index

Documentation
- Contribute!
- History
- acincludedir m4
- acinclude (tool)
- macro howto
- ax tricks
- maintainers
- License
- Topics

generated...
2007-08-05

(C) 2007 guidod
Download the M4 Source.

acltx_converting_fig

Back to the Main Page.

Synopsis
ACLTX_CONVERTING_FIG([ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]])
, 
Version

2006-07-16

Author

Boretti Mathieu <boretti@eig.unige.ch>

License

lgpl

Category

cryp.to ac-archive's LaTeX Support (released)

Documentation

this macro find a way to convert .fig file to file that can be included by latex and set convert_fig

M4 Source Code
AC_DEFUN([_ACLTX_FIG2DEV_FCT],[
AC_MSG_CHECKING([for $fig2dev -L $1 $2])
$3='no';
rm -rf conftest.dir/.acltx
AS_MKDIR_P([conftest.dir/.acltx])
cd conftest.dir/.acltx
cat &gt; conftest.fig &lt;&lt; \ACLEOF
#FIG 3.2
Landscape
Center
Inches
Letter
100.00
Single
-2
1200 2
4 0 0 50 -1 0 12 0.0000 6 135 435 150 450 TEST\001
ACLEOF
$fig2dev -L $1 $2 $4 conftest.fig conftest.eps 2&gt;/dev/null 1&gt;/dev/null &amp;&amp; $3='yes';
cd ..
cd ..
sed 's/^/| /' conftest.dir/.acltx/conftest.fig &gt;&amp;5
echo "$as_me:$LINENO: executing $fig2dev -L $1 $2 $4 conftest.fig conftest.eps" &gt;&amp;5
rm -rf conftest.dir/.acltx
AC_MSG_RESULT([$]$3)
])


AC_DEFUN([ACLTX_CONVERTING_FIG],[
convert_fig="no";
ACLTX_PROG_FIG2DEV([AC_MSG_WARN([Unable to locate a fig2dev application to convert fig file])])
if test "$fig2dev" != "no" ; then
    _ACLTX_FIG2DEV_FCT(pstex,[],pstex)
    _ACLTX_FIG2DEV_FCT(pstex_t,[-p],pstex_t,conftest)

    AC_MSG_CHECKING(for a way to convert .fig file to .eps and _t file)
    if test "$pstex" = "yes" -a "$pstex_t" = "yes" ; then
        convert_fig="%.eps %_t : %.fig ; $fig2dev -L pstex \[$]&lt; \[$]*.eps ; $fig2dev -L pstex_t -p \[$]* \[$]&lt; \[$]*_t"
    fi
    AC_MSG_RESULT($convert_fig)
fi
AC_SUBST(convert_fig)
ifelse($#,0,[],$#,1,[
    if test "$convert_fig" != "no" ;
    then
        $1
    fi
],$#,2,[
    ifelse($1,[],[
        if test "$convert_fig" = "no" ;
        then
            $2
        fi
    ],[
        if test "$convert_fig" != "no" ;
        then
            $1
        else
            $2
        fi
    ])
])
])