Discussion:
Possible to use MetaPost input directly?
Steinar Bang
2003-05-03 22:39:56 UTC
Permalink
Is it possible to use MetaPost input files directly in the LaTeX files
resulting from using the db2latex XSLT style sheet?

I guess that would require generating something different than
\includegraphics?


- Steinar



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
James Devenish
2003-05-04 02:25:43 UTC
Permalink
Post by Steinar Bang
Is it possible to use MetaPost input files directly in the LaTeX files
resulting from using the db2latex XSLT style sheet?
Maybe...
Post by Steinar Bang
I guess that would require generating something different than
\includegraphics?
One option in the style of DocBook is to use a particular attribute
(e.g. 'role') to trigger specific template handling in your own driver
file. However, there may be an existing mechanism that you can use.
If you have <mediaobject> with no <imageobject>s but with a <textobject>
containing <phrase role="latex">, you can insert actual LaTeX commands
(untested):

<mediaobject>
<textobject>
<phrase role="latex">\your\latex\code</phrase>
</textobject>
</mediaobject>





-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Steinar Bang
2003-05-04 08:30:41 UTC
Permalink
Post by James Devenish
One option in the style of DocBook is to use a particular attribute
(e.g. 'role') to trigger specific template handling in your own
driver file. However, there may be an existing mechanism that you
can use. If you have <mediaobject> with no <imageobject>s but with
a <textobject> containing <phrase role="latex">, you can insert
<mediaobject>
<textobject>
<phrase role="latex">\your\latex\code</phrase>
</textobject>
</mediaobject>
That's a possibility, using XInclude with xsltproc, or DocBook XSLT
file inclusion extensions with one of the Java XSLT engines, to
include the actual text.

But that won't give us scaling, hm...

I don't really _need_ it. I just thought it would be neat to include
vector graphics in a way that's not tied to PDF output. But all I
ever output from TeX is PDF or PS, so...:-)



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
James Devenish
2003-05-04 11:35:09 UTC
Permalink
Post by Steinar Bang
That's a possibility, using XInclude with xsltproc, or DocBook
XSLT file inclusion extensions with one of the Java XSLT engines,
to include the actual text.
Huh? I thought you could just insert your graphics codes directly.
Post by Steinar Bang
Post by James Devenish
<mediaobject>
<textobject>
<phrase role="latex">\input{my.file}</phrase>
</textobject>
</mediaobject>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Steinar Bang
2003-05-04 16:20:47 UTC
Permalink
Post by James Devenish
Huh? I thought you could just insert your graphics codes directly.
Nope. It's a dia[1] drawing. I generate the .mp (MetaPost input
files), and .mps (PostScript generated by MetaPost) files, with the
following GNU makefile rule:

%.mps: %.dia
dia --nosplash --export-to-format=mp $<
mpost $*.mp
mv $(*F).1 $*.mps

The .mp files are TeX, but I don't know if pdflatex has the neccessary
macros loaded. Do you know?

The .mps files are EPS, as far as I can tell, but EPS in a form that
pdflatex can digest. I'm told pdflatex cannot digest arbitrary EPS
files.
Post by James Devenish
<mediaobject>
<textobject>
<phrase role="latex">\input{my.file}</phrase>
</textobject>
</mediaobject>
Thanx. But there's still the scaling issue. And, I guess, not
picking an <imageobject> found inside the <mediaobject>, instead of
the <textobject>...?

Why's the role on the <phrase> and not on the <textobject>?


- Steinar

PS as I've said earlier, this was just an idle thought, and not
something I need. The .mps files work fine with pdflatex. So please
don't spend time on it on my account. Of course, if you find this an
interesting TeX-hack, I'm happy to assist in any way I can. :-)


[1] Gnome graphical editor, http://www.lysator.liu.se/~alla/dia/



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

Loading...