Handling EMBED tag in Tex
![](https://secure.gravatar.com/avatar/5cd43c57e1983fb7db9f9c265a2db416.jpg?s=120&d=mm&r=g)
Hi, I have embed tags in my xhtml can i render it in my pdf. How should I form the .tex file to handle this? <embed type='image/svg+xml' align='middle' width='200' height='200' src='/javascript/d.svg' script='initPicture(-.5,5,-.5,5);path([[0,0],[1,4],[4,4],[3,0],[0,0]]);text([2.5,4],"44","above");text([3.5,2],"44","right");stroke="red";fontfill="red";line([1,0],[1,4]);text([1,2],"?","right");' /> Thanks Anand
![](https://secure.gravatar.com/avatar/93131e1e6e2204bd13501390d768dbdc.jpg?s=120&d=mm&r=g)
Am 06.01.2011 um 04:42 schrieb Anand Raj:
Hi,
I have embed tags in my xhtml can i render it in my pdf.
How should I form the .tex file to handle this?
<embed type='image/svg+xml' align='middle' width='200' height='200' src='/javascript/d.svg' script='initPicture(-.5,5,-.5,5);path([[0,0],[1,4],[4,4],[3,0],[0,0]]);text([2.5,4],"44","above");text([3.5,2],"44","right");stroke="red";fontfill="red";line([1,0],[1,4]);text([1,2],"?","right");' />
Write the whole block to a external file and read import it them with \externalfigure. \startxmlsetups xml:embed \setbuffer[embed]\xmlflush{#1}\endbuffer \savebuffer[embed][embed.svg] \externalfigure[embed.svg] \stopxmlsetups Wolfgang
![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
On 6-1-2011 9:02, Wolfgang Schuster wrote:
Am 06.01.2011 um 04:42 schrieb Anand Raj:
Hi,
I have embed tags in my xhtml can i render it in my pdf.
How should I form the .tex file to handle this?
<embed type='image/svg+xml' align='middle' width='200' height='200' src='/javascript/d.svg' script='initPicture(-.5,5,-.5,5);path([[0,0],[1,4],[4,4],[3,0],[0,0]]);text([2.5,4],"44","above");text([3.5,2],"44","right");stroke="red";fontfill="red";line([1,0],[1,4]);text([1,2],"?","right");' />
Write the whole block to a external file and read import it them with \externalfigure.
\startxmlsetups xml:embed \setbuffer[embed]\xmlflush{#1}\endbuffer \savebuffer[embed][embed.svg] \externalfigure[embed.svg] \stopxmlsetups
remind me to make a \xmltofile some time ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
![](https://secure.gravatar.com/avatar/5cd43c57e1983fb7db9f9c265a2db416.jpg?s=120&d=mm&r=g)
Yes. the svg content is not stored in the embed.svg.
can you make it?
Thanks
On Thu, Jan 6, 2011 at 5:28 PM, Hans Hagen
On 6-1-2011 9:02, Wolfgang Schuster wrote:
Am 06.01.2011 um 04:42 schrieb Anand Raj:
Hi,
I have embed tags in my xhtml can i render it in my pdf.
How should I form the .tex file to handle this?
<embed type='image/svg+xml' align='middle' width='200' height='200' src='/javascript/d.svg' script='initPicture(-.5,5,-.5,5);path([[0,0],[1,4],[4,4],[3,0],[0,0]]);text([2.5,4],"44","above");text([3.5,2],"44","right");stroke="red";fontfill="red";line([1,0],[1,4]);text([1,2],"?","right");' />
Write the whole block to a external file and read import it them with \externalfigure.
\startxmlsetups xml:embed \setbuffer[embed]\xmlflush{#1}\endbuffer \savebuffer[embed][embed.svg] \externalfigure[embed.svg] \stopxmlsetups
remind me to make a \xmltofile some time
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net
___________________________________________________________________________________
![](https://secure.gravatar.com/avatar/5cd43c57e1983fb7db9f9c265a2db416.jpg?s=120&d=mm&r=g)
Hi, Herewith I am attaching the question_svg.xml and question.tex files. With this I am trying to convert the xml to pdf. I encounter two problems here. I am using asciimath module in my tex. 1. *times* not rendered to *X* In the first question in the xml, can find line*<am>8.404 times 10^(-7)</am>*. 2. *embed* to *svg* In the last question in the xml, can find line *<embed type='image/svg+xml' align='middle' width='250' height='250' src='/javascript/d.svg' script='initPicture(-10,130,-10,130);stroke="black";fill="gray";strokewidth=1;rect([0,0],[50,40]);rect([50,0],[100,100]);text([50/2,40+6],"5y cm");text([75,106],"17 cm");text([50,40/2],"4y cm",right);text([100,50],"13y cm",right);' />* Thanks Anand On Thu, Jan 6, 2011 at 9:50 PM, Wolfgang Schuster < schuster.wolfgang@googlemail.com> wrote:
Am 06.01.2011 um 10:32 schrieb Anand Raj:
Yes. the svg content is not stored in the embed.svg.
can you make it?
You you at least give a few information, the thing you’re telling is that my example doesn’t work but you don’t tell how you integrated it in your own setups.
Wolfgang
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net
___________________________________________________________________________________
![](https://secure.gravatar.com/avatar/93131e1e6e2204bd13501390d768dbdc.jpg?s=120&d=mm&r=g)
Am 07.01.2011 um 03:35 schrieb Anand Raj:
Hi,
Herewith I am attaching the question_svg.xml and question.tex files. With this I am trying to convert the xml to pdf. I encounter two problems here.
I am using asciimath module in my tex.
1. times not rendered to X In the first question in the xml, can find line<am>8.404 times 10^(-7)</am>.
The symbol for \times is “*”, not “times” as you expect. There is a short chapter about calculator math in the Mk manual but it doesn’t cover all symbols and you have to read the source to get all of them. Wolfgang
![](https://secure.gravatar.com/avatar/93131e1e6e2204bd13501390d768dbdc.jpg?s=120&d=mm&r=g)
Am 07.01.2011 um 13:57 schrieb Wolfgang Schuster:
Am 07.01.2011 um 03:35 schrieb Anand Raj:
Hi,
Herewith I am attaching the question_svg.xml and question.tex files. With this I am trying to convert the xml to pdf. I encounter two problems here.
I am using asciimath module in my tex.
1. times not rendered to X In the first question in the xml, can find line<am>8.404 times 10^(-7)</am>.
The symbol for \times is “*”, not “times” as you expect. There is a short chapter about calculator math in the Mk manual but it doesn’t cover all symbols and you have to read the source to get all of them.
Sorry but but i mixed calcmath and asciimath but nevertheless you should look at the source where you can find the hint that \times is produced with “xx” as input. Wolfgang
![](https://secure.gravatar.com/avatar/da56018fec1036eb1e02305d09a0bce8.jpg?s=120&d=mm&r=g)
2011/1/7 Wolfgang Schuster
Sorry but but i mixed calcmath and asciimath but nevertheless you should look at the source where you can find the hint that \times is produced with “xx” as input.
Wolfgang
there are 3 math operators which can be “times”: “·”, “×” and “∗” (not “*”) which of it is it? i am confused by your “x”es and other stuff *shudder* (modern linux systems have useful keyboard layouts to input these)
![](https://secure.gravatar.com/avatar/93131e1e6e2204bd13501390d768dbdc.jpg?s=120&d=mm&r=g)
Am 07.01.2011 um 14:43 schrieb Philipp A.:
2011/1/7 Wolfgang Schuster
Sorry but but i mixed calcmath and asciimath but nevertheless you should look at the source where you can find the hint that \times is produced with “xx” as input. Wolfgang
there are 3 math operators which can be “times”: “·”, “×” and “∗” (not “*”)
which of it is it? i am confused by your “x”es and other stuff *shudder* (modern linux systems have useful keyboard layouts to input these)
Asciimath: ["xx"] = "\\times ", Calcmath: elseif how == '*' then texprint("\\times") These are the relevant parts from the asciimath and calcmath sources, to get the output “3 \times 3 = 9” in TeX you have to type with asciimath “3 xx 3 = 9” and with calcmath “3 * 3 = 9”. Wolfgang
![](https://secure.gravatar.com/avatar/da56018fec1036eb1e02305d09a0bce8.jpg?s=120&d=mm&r=g)
2011/1/7 Wolfgang Schuster
Asciimath:
["xx"] = "\\times ",
Calcmath:
elseif how == '*' then texprint("\\times")
These are the relevant parts from the asciimath and calcmath sources, to get the output “3 \times 3 = 9” in TeX you have to type with asciimath “3 xx 3 = 9” and with calcmath “3 * 3 = 9”.
Wolfgang
ok, sorry, now i understand. out of curiosity: how do you get “·”?
![](https://secure.gravatar.com/avatar/93131e1e6e2204bd13501390d768dbdc.jpg?s=120&d=mm&r=g)
Am 07.01.2011 um 03:35 schrieb Anand Raj:
Hi,
Herewith I am attaching the question_svg.xml and question.tex files. With this I am trying to convert the xml to pdf. I encounter two problems here.
2. embed to svg In the last question in the xml, can find line <embed type='image/svg+xml' align='middle' width='250' height='250' src='/javascript/d.svg' script='initPicture(-10,130,-10,130);stroke="black";fill="gray";strokewidth=1;rect([0,0],[50,40]);rect([50,0],[100,100]);text([50/2,40+6],"5y cm");text([75,106],"17 cm");text([50,40/2],"4y cm",right);text([100,50],"13y cm",right);' />
Can you also provide the picture file the embed tag refers to. Wolfgang
![](https://secure.gravatar.com/avatar/5cd43c57e1983fb7db9f9c265a2db416.jpg?s=120&d=mm&r=g)
*d.svg* <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> <svg id="root" xml:space="preserve" width="100%" height="100%" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg"> </svg> can you help me to create svg files from the given embed tag. On Fri, Jan 7, 2011 at 9:23 PM, Wolfgang Schuster < schuster.wolfgang@googlemail.com> wrote:
Am 07.01.2011 um 03:35 schrieb Anand Raj:
Hi,
Herewith I am attaching the question_svg.xml and question.tex files. With this I am trying to convert the xml to pdf. I encounter two problems here.
2. *embed* to *svg* In the last question in the xml, can find line *<embed type='image/svg+xml' align='middle' width='250' height='250' src='/javascript/d.svg' script='initPicture(-10,130,-10,130);stroke="black";fill="gray";strokewidth=1;rect([0,0],[50,40]);rect([50,0],[100,100]);text([50/2,40+6],"5y cm");text([75,106],"17 cm");text([50,40/2],"4y cm",right);text([100,50],"13y cm",right);' />*
Can you also provide the picture file the embed tag refers to.
Wolfgang
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net
___________________________________________________________________________________
![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
Hi Wolfgang, the next beta will provide \xmltofile{#1}{.}{filename} so that one can avoid a buffer. ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (4)
-
Anand Raj
-
Hans Hagen
-
Philipp A.
-
Wolfgang Schuster