Discussion:
Scaling in LaTeX
Benoit Pelletier
2001-06-14 23:11:48 UTC
Permalink
Hi,

I am exporting a dia file to TeX and I would like to scale it in my
LaTeX document using something like

\resizebox{5cm}{!}{\include{myfile}}

But LaTeX complains and stops:

/* ------------- LaTeX Errors ------------------ */
! Missing } inserted.
<inserted text>
}
l.16 \resizebox{5cm}{!}{\include{myfile}}

[1] (passband.tex) [2]
! Extra }, or forgotten \endgroup.
\@***@tempboxa ...begingroup #2\***@endgroup }
\def \width {\wd
\@tempbox...
l.16 \resizebox{5cm}{!}{\include{passband}}


! Package graphics Error: Division by 0.
/* ------------------------------------- */

Of course I can scale the figure in Dia but I cannot force it to have a
specific size (in cm or in for example). It also makes the trial and
error process to find the correct scale factor very long. The reason I
am not using .eps instead is because I want to have math formulas in the
diagram...

Does anyone have an idea on how I could do this?

Thanks,
Benoit Pelletier
--
Benoit Pelletier,
Telecommunications and Signal Processing Laboratory
McGill University,
http://www.tsp.ece.mcgill.ca
mailto:***@tsp.ece.mcgill.ca
Tel: (514)398-5233
Elena Zotova
2001-06-15 05:26:29 UTC
Permalink
Post by Benoit Pelletier
Hi,
I am exporting a dia file to TeX and I would like to scale it in my
LaTeX document using something like
\resizebox{5cm}{!}{\include{myfile}}
/* ------------- LaTeX Errors ------------------ */
! Missing } inserted.
<inserted text>
}
l.16 \resizebox{5cm}{!}{\include{myfile}}
[1] (passband.tex) [2]
! Extra }, or forgotten \endgroup.
\def \width {\wd
l.16 \resizebox{5cm}{!}{\include{passband}}
! Package graphics Error: Division by 0.
/* ------------------------------------- */
Of course I can scale the figure in Dia but I cannot force it to have a
specific size (in cm or in for example). It also makes the trial and
error process to find the correct scale factor very long. The reason I
am not using .eps instead is because I want to have math formulas in the
diagram...
Does anyone have an idea on how I could do this?
What about export dia-file to eps and includ in LaTeX eps-file?
IMHO, it is solution of this problem.
Benoit Pelletier
2001-06-15 13:36:52 UTC
Permalink
Hi,

On 15 Jun 2001 09:26:29 +0400, Elena Zotova wrote:
d do this?
Post by Elena Zotova
What about export dia-file to eps and includ in LaTeX eps-file?
IMHO, it is solution of this problem.
Yes, I do that for some diagrams but I need to have equations in some of
them. Exporting to eps does not render the equations. Only when we
export to TeX that it is possible to do so.

Benoit P.
Jacek Pliszka
2001-06-15 14:35:49 UTC
Permalink
Post by Benoit Pelletier
I am exporting a dia file to TeX and I would like to scale it in my
LaTeX document using something like
\resizebox{5cm}{!}{\include{myfile}}
Hi!

I am not really on-line now so I cannot test it but:

1. Check if that works under \include, i.e. whe you
insert the \resibox command into the myfile.

2. In TeX export I use:
\scalebox{1 -1}{}
which does work and you may treat as temporary solution.

Good Luck,

Jacke
Benoit Pelletier
2001-06-15 21:19:03 UTC
Permalink
Hi,
Post by Jacek Pliszka
1. Check if that works under \include, i.e. whe you
insert the \resibox command into the myfile.
\scalebox{1 -1}{}
which does work and you may treat as temporary solution.
I tried both and it works. I was a bit surprised that #1 worked, I
thought \include was like concatenating the file at the point of
insertion. It turns out that we should use \input instead.

The scalebox thing also worked but this is a given since it is actually
used internally by Dia.

The problem I have now is with the bounding box and the equations. The
equations can be quite long and the bounding box is chosen as to fit the
equation command text and not the actual equation.

Furthermore, it seems that there is a problem with equation and fonts in
general; they are way too small on the graphic. I use the following
LaTeX code:

\documentclass{article}
\usepackage{graphicx}
\usepackage{pstricks}

\pagestyle{empty}

\begin{document}
\begin{figure}
\begin{center}
\resizebox{5in}{!}{\input{equation_ps}}
\end{center}
\end{figure}
\end{document}

and then dvips -o equation_ps.ps equation_ps.dvi.

If you want I can send you the .dia file so you can see for yourself
what I mean.

Thanks again,
Benoit P.
--
Benoit Pelletier,
Telecommunications and Signal Processing Laboratory
McGill University,
http://www.tsp.ece.mcgill.ca
mailto:***@tsp.ece.mcgill.ca
Tel: (514)398-5233
Jacek Pliszka
2001-06-17 20:59:18 UTC
Permalink
Post by Benoit Pelletier
I tried both and it works. I was a bit surprised that #1 worked, I
thought \include was like concatenating the file at the point of
insertion. It turns out that we should use \input instead.
Right. \include is not a simple \input.
Post by Benoit Pelletier
The problem I have now is with the bounding box and the equations. The
equations can be quite long and the bounding box is chosen as to fit the
equation command text and not the actual equation.
I must say I do not really understand this problem.
Please send me the sample dia file.
Post by Benoit Pelletier
Furthermore, it seems that there is a problem with equation and fonts in
general; they are way too small on the graphic.
This is indeed true. This is exactly the same problem which
was noted by Kostas a few days ago.

The reason is the set_font function in pstricks output plug-in is
not yet implemented. I wanted to do it in an elegant way
and I simply did not know how and had no time to investigate that
so I left \setfont macro in the exported code.

If you know how to match font names and sizes in TeX, let me know
or write set_font function yourself (Kostas is also looking into it).

Best Regards,

Jacek

P.S. Currently I am in Italy so my response may not be immediate.
--
email:***@fuw.edu.pl http://www.fuw.edu.pl/~pliszka
work:+48225532303 fax: +48226219475 cell/SMS:+48606788528
smail:IFT UW, ul Hoza 69, 00-681 Warszawa, Poland
Jacek Pliszka
2001-06-20 21:32:40 UTC
Permalink
Hi!

I know I asked about it some time ago but:
a) I have forgotten.
b) I cannot find the archives of our list at www.gnome.org

I am trying to compile dia on my notebook. I downloaded
and installed all (I hope) needed packages.
When I run ./autogen.sh I got:


I am going to run ./configure with no arguments - if you wish
to pass any to it, please specify them on the ./autogen.sh command line.
Running gettextize... Ignore non-fatal messages.
intl/ subdirectory exists: use option -f if you really want to delete it.
Running libtoolize
You should add the contents of `/usr/share/aclocal/libtool.m4' to
`aclocal.m4'.
aclocal: configure.in: 114: macro `AM_LANGINFO_CODESET' not found in
library
aclocal: configure.in: 115: macro `AM_ICONV' not found in library
lib/Makefile.am:3: library used but `RANLIB' not defined in `configure.in'
objects/standard/Makefile.am:3: library used but `LIBTOOL' not defined in
`configure.in'
app/Makefile.am:143: variable `GTK_LIBS' not defined
app/Makefile.am:143: variable `INTLLIBS' not defined
app/Makefile.am:143: variable `LIBART_LIBS' not defined
app/Makefile.am:143: variable `GDK_PIXBUF_LIBS' not defined
app/Makefile.am:156: variable `LIBART_LIBS' not defined
app/Makefile.am:156: variable `GDK_PIXBUF_LIBS' not defined
app/Makefile.am:156: variable `INTLLIBS' not defined
plug-ins/python/Makefile.am:16: variable `PYTHON_LIBS' not defined
autoconf: Undefined macros:
configure.in:134: AC_DEFINE(HAVE_UNICODE,, Unicode support library
available)
configure.in:13:AC_DISABLE_STATIC
configure.in:14:AC_PROG_LIBTOOL
configure.in:152:AC_CHECK_LIB(popt, poptSetOtherOptionHelp,
[AC_DEFINE(HAVE_LIBPOPT)
configure.in:162: AC_DEFINE(HAVE_LIBART)],
configure.in:169:AM_PATH_GDK_PIXBUF(0.7.0,,AC_MSG_ERROR([gdk-pixbuf >=
0.7.0 is required]))
configure.in:187: AC_DEFINE(HAVE_LIBPNG)
configure.in:235: AC_MSG_ERROR(you need libxml >= 1.8.5 for this
version of dia)
configure.in:240: AC_MSG_ERROR(Can't find libxml library.)
configure.in:294: AM_CHECK_PYMOD(gtk,,,[AC_MSG_ERROR(could not find pygtk
module)])
configure.in:299: AC_MSG_ERROR([could not find files required to build
python plugin])
configure.in:34: AC_DEFINE(USE_XIM)
configure.in:62: AC_DEFINE(GNOME)
configure.in:67: AC_DEFINE(GNOME_PRINT)
loading cache ./config.cache
./configure: syntax error near unexpected token `AM_INIT_AUTOMAKE(dia,'
./configure: ./configure: line 539: `AM_INIT_AUTOMAKE(dia, 0.88.1)'


Could you remind me what was the magic sentence to have it compiling?

It would be good if both this
and the address fo this list archives can be found in our FAQ.

Thanks in advance!

Jacek
Cyrille Chepelov
2001-06-21 06:23:19 UTC
Permalink
Post by Jacek Pliszka
I am trying to compile dia on my notebook. I downloaded
and installed all (I hope) needed packages.
Basically, you miss all devel packages (gtk-dev, libtool, libart-dev, etc
etc)

AM_ICONF and AM_LANGINFO_CODESET are provided by gettext >= 0.10.36, or
please read my message about "dcgettext__ etc." posted two days ago.

-- Cyrille
--
Grumpf.
Jacek Pliszka
2001-06-21 20:07:20 UTC
Permalink
Hi!

I am fixing the font size in pstricks plug-in.

I wanted to fix also shapes and series of the font
(bold,oblique etc.) but I failed to find how to access
those parameters.

Could somebody hint me if I can get this information
in the renderer?

Thanks in advance,

Jacek

Continue reading on narkive:
Loading...