* Re: highlight problems on xml export [hacky workaround included]
2011-11-07 16:48 ` highlight problems on xml export [hacky workaround included] Marco Pessotto
@ 2011-11-05 15:13 ` Aditya Mahajan
2011-11-07 17:07 ` Marco Pessotto
2011-11-07 17:49 ` Hans Hagen
1 sibling, 1 reply; 12+ messages in thread
From: Aditya Mahajan @ 2011-11-05 15:13 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Mon, 7 Nov 2011, Marco Pessotto wrote:
> So, my impression is that for exporting the modal compilation is not an
> option.
So far, that has been my impression as well. I need a lot of tweaks to get
the right XML output (and I also need (multiple) PDF output). I have set a
separate mode for XML export, and use something equivalent to
context --mode=screen --result=s-filename filename
to get a screen version of the document,
context --mode=handout --result=h-filename filename
to get a handout version of the document, and
context --mode=export filename
to get an xml version.
> Is there a way to set the paper width to infinity? (Even if,
> speaking about impression, I believe the 4 meters are enough for
> the average usage).
TeX does finite precision arithematics, so infinity is not possible. But
you can set paper width (and paper height) to \maxdimen, which is the
maximum dimension TeX can handle.
\definepapersize[max][paperwidth=\maxdimen, paperheight=\maxdimen]
\setuppapersize[max]
Aditya
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 12+ messages in thread
* Missing <break/> while exporting to xml before <highlight>
@ 2011-11-06 13:54 Marco Pessotto
2011-11-06 20:38 ` Marco Pessotto
0 siblings, 1 reply; 12+ messages in thread
From: Marco Pessotto @ 2011-11-06 13:54 UTC (permalink / raw)
To: ntg-context
Hi!
See the following minimal example:
%%% start example
\setupbackend[export=yes]
\definehighlight[emph][style=italic]
\starttext
Hey, hello!
\emph{Hello world!}
\stoptext
%%% stop example
And the output is:
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<!-- input filename : prova -->
<!-- processing date : Sun Nov 6 14:50:01 2011 -->
<!-- context version : 2011.11.04 14:15 -->
<!-- exporter version : 0.30 -->
<document language="en" file="prova" date="Sun Nov 6 14:50:01 2011" context="2011.11.04 14:15" version="0.30" xmlns:m="http://www.w3.org/1998/Math/MathML">
Hey, hello!
<highlight detail="emph">Hello world!</highlight>
</document>
Best regards
--
Marco
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Missing <break/> while exporting to xml before <highlight>
2011-11-06 13:54 Missing <break/> while exporting to xml before <highlight> Marco Pessotto
@ 2011-11-06 20:38 ` Marco Pessotto
2011-11-06 23:26 ` Hans Hagen
0 siblings, 1 reply; 12+ messages in thread
From: Marco Pessotto @ 2011-11-06 20:38 UTC (permalink / raw)
To: ntg-context
Hi!
The highlight seems to act strangely. In addition to the previous
report, I get an unwanted <break/>:
%%% start example
\setupbackend[export=yes]
\definehighlight[emph][style=italic]
\starttext
\section{test}
\emph{Hello} world!
\stoptext
%%% stop example
And the output is:
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<!-- input filename : prova -->
<!-- processing date : Sun Nov 6 21:35:51 2011 -->
<!-- context version : 2011.11.04 14:15 -->
<!-- exporter version : 0.30 -->
<document language="en" file="prova" date="Sun Nov 6 21:35:51 2011" context="2011.11.04 14:15" version="0.30" xmlns:m="http://www.w3.org/1998/Math/MathML">
<section detail="section" location='aut:1'>
<sectionnumber>1</sectionnumber>
<sectiontitle>test</sectiontitle>
<sectioncontent>
<highlight detail="emph">Hello</highlight>
<break/>
world!
</sectioncontent>
</section>
</document>
Am I doing it wrong?
Best wishes
--
Marco
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Missing <break/> while exporting to xml before <highlight>
2011-11-06 20:38 ` Marco Pessotto
@ 2011-11-06 23:26 ` Hans Hagen
2011-11-07 7:53 ` Marco
0 siblings, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2011-11-06 23:26 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Marco Pessotto
On 6-11-2011 21:38, Marco Pessotto wrote:
>
> Hi!
>
> The highlight seems to act strangely. In addition to the previous
> report, I get an unwanted<break/>:
>
> %%% start example
> \setupbackend[export=yes]
> \definehighlight[emph][style=italic]
>
> \starttext
>
> \section{test}
>
> \emph{Hello} world!
>
> \stoptext
> %%% stop example
It has to do with the way grouping interferes with the start of a paragraph
\dontleavehmode \emph ...
I'll make highlights horizontal by default
Hans
-----------------------------------------------------------------
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Missing <break/> while exporting to xml before <highlight>
2011-11-06 23:26 ` Hans Hagen
@ 2011-11-07 7:53 ` Marco
2011-11-07 8:13 ` Hans Hagen
0 siblings, 1 reply; 12+ messages in thread
From: Marco @ 2011-11-07 7:53 UTC (permalink / raw)
To: Hans Hagen; +Cc: mailing list for ConTeXt users
Hans Hagen <pragma@wxs.nl> writes:
> On 6-11-2011 21:38, Marco Pessotto wrote:
>>
>> Hi!
>>
>> The highlight seems to act strangely. In addition to the previous
>> report, I get an unwanted<break/>:
>>
>> %%% start example
>> \setupbackend[export=yes]
>> \definehighlight[emph][style=italic]
>>
>> \starttext
>>
>> \section{test}
>>
>> \emph{Hello} world!
>>
>> \stoptext
>> %%% stop example
>
> It has to do with the way grouping interferes with the start of a paragraph
>
> \dontleavehmode \emph ...
>
> I'll make highlights horizontal by default
It works, thanks a bunch. The previous missing <break/> seems to be
fixed wrapping the paragraph with \startparagraph \stopparagraph. I
assume this is the right thing to do for a proper export, isn't it?
Btw, is there a way to run context just for the xml output (as I'm doing
conditional runs, and I discard the pdf which comes with the xml as a
side effect). context --help doesn't seem to have an option for
that. Well, not so important, just asking.
Thanks again
Best wishes
--
Marco
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Missing <break/> while exporting to xml before <highlight>
2011-11-07 7:53 ` Marco
@ 2011-11-07 8:13 ` Hans Hagen
2011-11-07 8:35 ` highlight problems on xml export (Was: Missing <break/> while exporting to xml before <highlight>) Marco Pessotto
0 siblings, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2011-11-07 8:13 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Marco
On 7-11-2011 08:53, Marco wrote:
> Hans Hagen<pragma@wxs.nl> writes:
>
>> On 6-11-2011 21:38, Marco Pessotto wrote:
>>>
>>> Hi!
>>>
>>> The highlight seems to act strangely. In addition to the previous
>>> report, I get an unwanted<break/>:
>>>
>>> %%% start example
>>> \setupbackend[export=yes]
>>> \definehighlight[emph][style=italic]
>>>
>>> \starttext
>>>
>>> \section{test}
>>>
>>> \emph{Hello} world!
>>>
>>> \stoptext
>>> %%% stop example
>>
>> It has to do with the way grouping interferes with the start of a paragraph
>>
>> \dontleavehmode \emph ...
>>
>> I'll make highlights horizontal by default
>
> It works, thanks a bunch. The previous missing<break/> seems to be
> fixed wrapping the paragraph with \startparagraph \stopparagraph. I
> assume this is the right thing to do for a proper export, isn't it?
Indeed. On and off I'm trying to make the automatic recognition more
clever but too much guessing is bad too.
> Btw, is there a way to run context just for the xml output (as I'm doing
> conditional runs, and I discard the pdf which comes with the xml as a
> side effect). context --help doesn't seem to have an option for
> that. Well, not so important, just asking.
Currently not. It would also complicate matters as we need to flush some
information in the pdf backend that is needed in following passes.
Hans
-----------------------------------------------------------------
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: highlight problems on xml export (Was: Missing <break/> while exporting to xml before <highlight>)
2011-11-07 8:13 ` Hans Hagen
@ 2011-11-07 8:35 ` Marco Pessotto
2011-11-07 16:48 ` highlight problems on xml export [hacky workaround included] Marco Pessotto
0 siblings, 1 reply; 12+ messages in thread
From: Marco Pessotto @ 2011-11-07 8:35 UTC (permalink / raw)
To: ntg-context
I think I'm hitting another bug with highlights:
See this following example:
%%% start example
\setupbackend[export=yes]
\definehighlight[emph][style=italic]
\starttext
\startparagraph
Published on \dontleavehmode\emph{Dissonanze} vol. I
\stopparagraph
\startparagraph
Published on vol. I Published on vol. I Published on vol. I Published on \dontleavehmode\emph{Dissonanze} vol. I
\stopparagraph
\stoptext
%%% stop example
Output:
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<!-- input filename : prova -->
<!-- processing date : Mon Nov 7 09:32:00 2011 -->
<!-- context version : 2011.11.04 14:15 -->
<!-- exporter version : 0.30 -->
<document language="en" file="prova" date="Mon Nov 7 09:32:00 2011" context="2011.11.04 14:15" version="0.30" xmlns:m="http://www.w3.org/1998/Math/MathML">
<paragraph>Published on <highlight detail="emph">Dissonanze</highlight> vol. I</paragraph>
<paragraph>Published on vol. I Published on vol. I Published on vol. I Published on <highlight detail="emph">Dissonanze</highlight>vol. I</paragraph>
</document>
As you can see, in the first case the space after "Dissonanze" is
preserved, while in the second paragraph the space is eaten and there's
no way to add it. The only thing that changes is the lenght of the paragraph.
(Oh, and thanks for the previous reply).
Best wishes
--
Marco
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: highlight problems on xml export [hacky workaround included]
2011-11-07 8:35 ` highlight problems on xml export (Was: Missing <break/> while exporting to xml before <highlight>) Marco Pessotto
@ 2011-11-07 16:48 ` Marco Pessotto
2011-11-05 15:13 ` Aditya Mahajan
2011-11-07 17:49 ` Hans Hagen
0 siblings, 2 replies; 12+ messages in thread
From: Marco Pessotto @ 2011-11-07 16:48 UTC (permalink / raw)
To: ntg-context
Well, after some trial and errors, I think I get what is going on with
the highlight. When on the generated pdf the </highlight> is at the edge
of the paper, the space is eaten. Hacky workaround follows:
%% start example
\setupbackend[export=yes]
\definehighlight[emph][style=italic]
\startmode[huge]
\definepapersize[huge][width=4000mm]
\setuppapersize[huge][huge]
\setupbodyfont[8pt]
\stopmode
\starttext
\startparagraph
Published on \dontleavehmode\emph{Dissonanze} vol. I
\stopparagraph
\startparagraph
Published on vol. I Published on vol. I Published on vol. I Published on \dontleavehmode\emph{Dissonanze} vol. I
\stopparagraph
\startparagraph
Published on vol. I Published on vol. I Published on vol. I Published on blablabla \dontleavehmode\emph{Dissonanze} vol. I
\stopparagraph
\stoptext
%%% stop example
Compiled with context prova.tex, the space is eaten on the second
paragraph. See produced pdf.
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<!-- input filename : prova -->
<!-- processing date : Mon Nov 7 17:43:10 2011 -->
<!-- context version : 2011.11.04 14:15 -->
<!-- exporter version : 0.30 -->
<document language="en" file="prova" date="Mon Nov 7 17:43:10 2011" context="2011.11.04 14:15" version="0.30" xmlns:m="http://www.w3.org/1998/Math/MathML">
<paragraph>Published on <highlight detail="emph">Dissonanze</highlight> vol. I</paragraph>
<paragraph>Published on vol. I Published on vol. I Published on vol. I Published on <highlight detail="emph">Dissonanze</highlight>vol. I</paragraph>
<paragraph>Published on vol. I Published on vol. I Published on vol. I Published on blablabla
<highlight detail="emph">Dissonanze</highlight> vol. I</paragraph>
</document>
With `context --mode=huge prova.tex` everything is fine (As the paper is
4 meters long on 8pt!)
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<!-- input filename : prova -->
<!-- processing date : Mon Nov 7 17:44:02 2011 -->
<!-- context version : 2011.11.04 14:15 -->
<!-- exporter version : 0.30 -->
<document language="en" file="prova" date="Mon Nov 7 17:44:02 2011" context="2011.11.04 14:15" version="0.30" xmlns:m="http://www.w3.org/1998/Math/MathML">
<paragraph>Published on <highlight detail="emph">Dissonanze</highlight> vol. I</paragraph>
<paragraph>Published on vol. I Published on vol. I Published on vol. I Published on <highlight detail="emph">Dissonanze</highlight> vol. I</paragraph>
<paragraph>Published on vol. I Published on vol. I Published on vol. I Published on blablabla <highlight detail="emph">Dissonanze</highlight> vol. I</paragraph>
</document>
So, my impression is that for exporting the modal compilation is not an
option. Is there a way to set the paper width to infinity? (Even if,
speaking about impression, I believe the 4 meters are enough for
the average usage).
Best wishes
--
Marco
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: highlight problems on xml export [hacky workaround included]
2011-11-05 15:13 ` Aditya Mahajan
@ 2011-11-07 17:07 ` Marco Pessotto
0 siblings, 0 replies; 12+ messages in thread
From: Marco Pessotto @ 2011-11-07 17:07 UTC (permalink / raw)
To: ntg-context
Aditya Mahajan <adityam@umich.edu> writes:
> TeX does finite precision arithematics, so infinity is not
> possible. But you can set paper width (and paper height) to \maxdimen,
> which is the maximum dimension TeX can handle.
>
> \definepapersize[max][paperwidth=\maxdimen, paperheight=\maxdimen]
> \setuppapersize[max]
Thanks!
--
Marco
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: highlight problems on xml export [hacky workaround included]
2011-11-07 16:48 ` highlight problems on xml export [hacky workaround included] Marco Pessotto
2011-11-05 15:13 ` Aditya Mahajan
@ 2011-11-07 17:49 ` Hans Hagen
2011-11-07 18:02 ` Marco Pessotto
2011-11-08 16:04 ` highlight problems on xml export Marco Pessotto
1 sibling, 2 replies; 12+ messages in thread
From: Hans Hagen @ 2011-11-07 17:49 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Marco Pessotto
On 7-11-2011 17:48, Marco Pessotto wrote:
>
> Well, after some trial and errors, I think I get what is going on with
> the highlight. When on the generated pdf the</highlight> is at the edge
> of the paper, the space is eaten. Hacky workaround follows:
i rewrote some of the 'heuristics' so best test the next beta
Hans
-----------------------------------------------------------------
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: highlight problems on xml export [hacky workaround included]
2011-11-07 17:49 ` Hans Hagen
@ 2011-11-07 18:02 ` Marco Pessotto
2011-11-08 16:04 ` highlight problems on xml export Marco Pessotto
1 sibling, 0 replies; 12+ messages in thread
From: Marco Pessotto @ 2011-11-07 18:02 UTC (permalink / raw)
To: Hans Hagen; +Cc: mailing list for ConTeXt users
Hans Hagen <pragma@wxs.nl> writes:
> On 7-11-2011 17:48, Marco Pessotto wrote:
>>
>> Well, after some trial and errors, I think I get what is going on with
>> the highlight. When on the generated pdf the</highlight> is at the edge
>> of the paper, the space is eaten. Hacky workaround follows:
>
> i rewrote some of the 'heuristics' so best test the next beta
>
I will for sure. Looking forward to the beta.
Thanks
Best wishes
--
Marco
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: highlight problems on xml export
2011-11-07 17:49 ` Hans Hagen
2011-11-07 18:02 ` Marco Pessotto
@ 2011-11-08 16:04 ` Marco Pessotto
1 sibling, 0 replies; 12+ messages in thread
From: Marco Pessotto @ 2011-11-08 16:04 UTC (permalink / raw)
To: Hans Hagen; +Cc: mailing list for ConTeXt users
Hans Hagen <pragma@wxs.nl> writes:
> On 7-11-2011 17:48, Marco Pessotto wrote:
>>
>> Well, after some trial and errors, I think I get what is going on with
>> the highlight. When on the generated pdf the</highlight> is at the edge
>> of the paper, the space is eaten. Hacky workaround follows:
>
> i rewrote some of the 'heuristics' so best test the next beta
In my testing the latest beta (2011.11.08 15:20) works well, and it
fixes some other problems (random <break/>, space eaten before
<highlight> which I noticed only now diff'ing the output and which my
infamous hacky workaround didn't fix).
Thanks a lot!
Best wishes
--
Marco
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2011-11-08 16:04 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-06 13:54 Missing <break/> while exporting to xml before <highlight> Marco Pessotto
2011-11-06 20:38 ` Marco Pessotto
2011-11-06 23:26 ` Hans Hagen
2011-11-07 7:53 ` Marco
2011-11-07 8:13 ` Hans Hagen
2011-11-07 8:35 ` highlight problems on xml export (Was: Missing <break/> while exporting to xml before <highlight>) Marco Pessotto
2011-11-07 16:48 ` highlight problems on xml export [hacky workaround included] Marco Pessotto
2011-11-05 15:13 ` Aditya Mahajan
2011-11-07 17:07 ` Marco Pessotto
2011-11-07 17:49 ` Hans Hagen
2011-11-07 18:02 ` Marco Pessotto
2011-11-08 16:04 ` highlight problems on xml export Marco Pessotto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).