I'm using preview.sty to obtain an image of a *single* (FWIW)
equation. Actually, I'm using the following invocation:
\usepackage[active,textmath,tightpage]{preview}
Now, it's working pretty well, but I'd like to have some more tight
control on the size of the image:
1. the equation is pretty complex and I have written it in an explicit
equation *environment*. Though I see that if I do so then the actual
image border extends to what that corresponds to the left margin of
the page in the typeset document. (I think that this does make sense
for the typical usages of the preview package e.g. by preview-latex.)
I noticed that inline equations, instead, are more tightly bound on
the left too. So, what should I do? Write it as an inline equation,
playing with... err... what was that? \displaystyle? (I'm sorry, I'm a
bit rusty and I can't remember...) Or is there a package option to
properly "cut" it on the left? If so, then I must be very dumb for I
can't see it...
2. The final image should have an horizontal size of (about) 500
pixels, and I would like the equation to fit it in it as closely as
possible: of course I can play with a differently sized image in an
image manipulation program, and now we have good interpolation
algorithms. But is there a way I can get an image that's more or less
of the "right size" to begin with, with no further mangling? Please
note that I don't mind if the size is... say 480 pixels, it just has
to be *about* 500. (But, now that I think of it, NO MORE than that...)
TIA,
Michele
--
>It's because the universe was programmed in C++.
No, no, it was programmed in Forth. See Genesis 1:12:
"And the earth brought Forth ..."
- Robert Israel in sci.math, thread "Why numbers?"
> Hi all,
>
>
> I'm using preview.sty to obtain an image of a *single* (FWIW)
> equation. Actually, I'm using the following invocation:
>
> \usepackage[active,textmath,tightpage]{preview}
>
> Now, it's working pretty well, but I'd like to have some more tight
> control on the size of the image:
>
> 1. the equation is pretty complex and I have written it in an explicit
> equation *environment*. Though I see that if I do so then the actual
> image border extends to what that corresponds to the left margin of
> the page in the typeset document. (I think that this does make sense
> for the typical usages of the preview package e.g. by preview-latex.)
It's the TeX bounding box, period.
> I noticed that inline equations, instead, are more tightly bound on
> the left too. So, what should I do? Write it as an inline equation,
> playing with... err... what was that? \displaystyle? (I'm sorry, I'm a
> bit rusty and I can't remember...)
For example.
> Or is there a package option to properly "cut" it on the left? If so,
> then I must be very dumb for I can't see it...
It is properly cut on the left, where TeX says that the box ends.
> 2. The final image should have an horizontal size of (about) 500
> pixels, and I would like the equation to fit it in it as closely as
> possible: of course I can play with a differently sized image in an
> image manipulation program, and now we have good interpolation
> algorithms. But is there a way I can get an image that's more or less
> of the "right size" to begin with, with no further mangling? Please
> note that I don't mind if the size is... say 480 pixels, it just has
> to be *about* 500. (But, now that I think of it, NO MORE than that...)
TeX does not output pixels, butDVI files or similar. Use the "lyx"
option, parse the log file and/or console output to figure out the exact
box size, tell GhostScript (or dvipng) to render at a resolution that
will make just the right amount of pixels.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
UKTUG FAQ: <URL:http://www.tex.ac.uk/cgi-bin/texfaq2html>
>> Or is there a package option to properly "cut" it on the left? If so,
>> then I must be very dumb for I can't see it...
>
>It is properly cut on the left, where TeX says that the box ends.
Of course, I say "properly" in the Pooh sense. It is properly
TeX-wise, but not in "mine". It is somewhat obvious that I'm asking
for a way to trick it into doing it "properly" in the sense *I* mean:
so is there one?
>> 2. The final image should have an horizontal size of (about) 500
>> pixels, and I would like the equation to fit it in it as closely as
>> possible: of course I can play with a differently sized image in an
>> image manipulation program, and now we have good interpolation
>> algorithms. But is there a way I can get an image that's more or less
>> of the "right size" to begin with, with no further mangling? Please
>> note that I don't mind if the size is... say 480 pixels, it just has
>> to be *about* 500. (But, now that I think of it, NO MORE than that...)
>
>TeX does not output pixels, butDVI files or similar. Use the "lyx"
>option, parse the log file and/or console output to figure out the exact
>box size, tell GhostScript (or dvipng) to render at a resolution that
>will make just the right amount of pixels.
ATM I've been using straight out of the docs[1]
gs -sDEVICE=png16m -dTextAlphaBits=4 -r300 -dGraphicsAlphaBits=4\
-dSAFER -q -dNOPAUSE -sOutputFile=minimal%d.png minimal.ps
*Please* can you work out a complete and idiot-proof example[1] for
rendering a given equation? As far as the example goes, the equation
can be just as simple as
\begin{equation}
a=b;
\end{equation}
[1] From which it is clear that I went "the dvips rout" but if there's
a preferrable path, for any sense of preferrable I'd be happy to
follow it.
[2] In other ng's/fora I'm strongly against the give-a-man-a-fish
policy, but now I understand those who ask for such solutions... I
don't even know what I should look at in the log file or in the
console output, but is somebody tells me, then I can also automatize
it with some scripting language...
> On Wed, 05 Nov 2008 20:29:10 +0100, David Kastrup <d...@gnu.org> wrote:
>
>>> Or is there a package option to properly "cut" it on the left? If so,
>>> then I must be very dumb for I can't see it...
>>
>>It is properly cut on the left, where TeX says that the box ends.
>
> Of course, I say "properly" in the Pooh sense. It is properly
> TeX-wise, but not in "mine". It is somewhat obvious that I'm asking
> for a way to trick it into doing it "properly" in the sense *I* mean:
> so is there one?
Is there a reason you snipped the part about using \displaystyle in a
non-displayed equation from your reply?
>>> 2. The final image should have an horizontal size of (about) 500
>>> pixels, and I would like the equation to fit it in it as closely as
>>> possible: of course I can play with a differently sized image in an
>>> image manipulation program, and now we have good interpolation
>>> algorithms. But is there a way I can get an image that's more or less
>>> of the "right size" to begin with, with no further mangling? Please
>>> note that I don't mind if the size is... say 480 pixels, it just has
>>> to be *about* 500. (But, now that I think of it, NO MORE than that...)
>>
>>TeX does not output pixels, butDVI files or similar. Use the "lyx"
>>option, parse the log file and/or console output to figure out the
>>exact box size, tell GhostScript (or dvipng) to render at a resolution
>>that will make just the right amount of pixels.
>
> ATM I've been using straight out of the docs[1]
>
> gs -sDEVICE=png16m -dTextAlphaBits=4 -r300 -dGraphicsAlphaBits=4\
> -dSAFER -q -dNOPAUSE -sOutputFile=minimal%d.png minimal.ps
>
> *Please* can you work out a complete and idiot-proof example[1] for
> rendering a given equation?
Pick an appropriate setting of -r rather than -r300.
> [2] In other ng's/fora I'm strongly against the give-a-man-a-fish
> policy, but now I understand those who ask for such solutions... I
> don't even know what I should look at in the log file or in the
> console output, but is somebody tells me, then I can also automatize
> it with some scripting language...
Well, check the documentation of preview.sty. And/or actually run this
thing using the lyx option and see what output you get.
I don't have any fish I could hand you. In my book, it is not useful to
scale a set of equations with tight fit to your screen width since then
the font size of every equation will be different, and will not match
anywhere usefully with the rest of the page.
So it is a very peculiar fish you are trying to catch, and I don't know
anybody who would have bothered to do the same.
--
David Kastrup
>> Of course, I say "properly" in the Pooh sense. It is properly
>> TeX-wise, but not in "mine". It is somewhat obvious that I'm asking
>> for a way to trick it into doing it "properly" in the sense *I* mean:
>> so is there one?
>
>Is there a reason you snipped the part about using \displaystyle in a
>non-displayed equation from your reply?
So... did I get it right? I doubted it! ;)
>> ATM I've been using straight out of the docs[1]
>>
>> gs -sDEVICE=png16m -dTextAlphaBits=4 -r300 -dGraphicsAlphaBits=4\
>> -dSAFER -q -dNOPAUSE -sOutputFile=minimal%d.png minimal.ps
[cut]
>Pick an appropriate setting of -r rather than -r300.
In the end, I actually did it exactly like that: at 300 the image
rendered at 1122 pixels, thus to obtain the one at ~500 I needed, I
used -r133. Alternatively I tried with a very high resolution then
resampling exactly at 500 pixels in GIMP with bicubic interpolation.
But eventually I liked the former most, from a visual POV.
>I don't have any fish I could hand you. In my book, it is not useful to
>scale a set of equations with tight fit to your screen width since then
>the font size of every equation will be different, and will not match
>anywhere usefully with the rest of the page.
But it was a una tantum thingie, with a "set of a equations"
consisting of exactly ONE equation, for my blog, and a "funny" thing
too. (For some definition of fun, of course: YMMV...)
>So it is a very peculiar fish you are trying to catch, and I don't know
>anybody who would have bothered to do the same.
Well, there's some degree of satisfaction in being "the only one," I
must say!
> But it was a una tantum thingie, with a "set of a equations"
> consisting of exactly ONE equation, for my blog, and a "funny" thing
> too. (For some definition of fun, of course: YMMV...)
>
>>So it is a very peculiar fish you are trying to catch, and I don't know
>>anybody who would have bothered to do the same.
>
> Well, there's some degree of satisfaction in being "the only one," I
> must say!
So we progressed from "ante tunam" to "una tantum".
--
David Kastrup