Re: [NTG-context] Problem with math alignment

2017-11-12 Thread Jeong Dal
Dear Otared,

I run your code and found that they are not aligned properly as you want.
But I don’t know how to do for the correct alignment.

Did you see the mail about the \overline problem in column environment which I 
listed recently?
It is a different problem from yours, but I’d like to know whether  you got the 
same output as mine or not.
Would you please check it in your computer?

Thank you.

Best regards,

Dalyoung
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Problem with math alignment

2017-11-12 Thread Otared Kavian
Hi Matthias,

Thanks for your answer. I think that Hans has changed the way entries of 
mathmatrix are handled, that is they are now centered and this cannot be 
changed…
However I think now that my way of using mathmatrix in order to get aligned 
cases, should be changed into the following:

\definemathalignment[alignedcases]
[n=3,
align={right,left,left},
distance=3pt,
left={\left\{},
right={\right.},
style=\displaystyle]

Once this is done, the result is as expected since the math alignment 
environment accepts changing the alignment in each column. However the big 
problem is that one loses the left brace encompassing the displayed equations… 

I hope Hans will read this and help fix the issue…

Best regards: OK

%%% begin example-aligned-cases.tex
\definemathalignment[alignedcases]
[n=3,
align={right,left,left},
distance=3pt,
left={\left\{}, % this is not honoured…
right={\right.},
style=\displaystyle]
\starttext

\startformula
\startalignedcases
\NC \partial_{tt} u - \Delta u + q(x) u \NC = 0  \NC \quad\mbox{in 
}\;(0,T)\times\Omega \NR
\NC  u(0,x) \NC = 0 \NC \quad \mbox{in }\; \Omega \NR 
\NC  \partial_{t} u(0,x) \NC = 0 \NC \quad \mbox{in }\; \Omega \NR 
\NC {\partial u \over\partial{\bf n} } \NC = g(t,\sigma) \NC \quad \mbox{on }\; 
(0,T)\times\partial\Omega. \NR
\stopalignedcases
\stopformula


\startformula
\startalign[n=3,align={right,left,left}]
\NC \partial_{tt} u - \Delta u + q(x) u \NC = 0 \NC \quad\mbox{in }\; 
(0,T)\times\Omega \NR
\NC - \Delta v  \NC = q(x) \partial_{t}u \NC \quad\mbox{in }\; \Omega \NR
\stopalign
\stopformula

\startformula
\startalignedcases
\NC \partial_{tt} u - \Delta u + q(x) u \NC = 0 \NC \quad\mbox{in }\; 
(0,T)\times\Omega \NR
\NC - \Delta v  \NC = q(x) \partial_{t}u \NC \quad\mbox{in }\; \Omega \NR
\stopalignedcases
\stopformula
\stoptext
%%% end example-aligned-cases.tex

> On 12 Nov 2017, at 17:58, Weber, Matthias  wrote:
> 
> Same here. Curiously, the Garden version is ok, while the newest beta seems 
> to make all alignments centered.
> 
> 
> Minimal  Example:
> 
> 
> \starttext
> \startformula
> A=\startmathmatrix[align={right,right}]
> \NC1\NC-1\NR
> \NC-1\NC1\NR
> \stopmathmatrix
> \stopformula
> \stoptext
> 
> Matthias
> 
>> On Nov 12, 2017, at 11:37 AM, Otared Kavian  wrote:
>> 
>> Hi everybody,
>> 
>> Does anyone have noticed that the mathalignment has changed its behaviour 
>> recently? I think a bug has managed to enter the environment which handles 
>> the mathalignment, at least since a few weeks ago. I did not report it 
>> earlier because I was traveling and did not have a stable internet access.
>> 
>> Here is a minimal example where on can see in the first displayed formula 
>> that the first and third column are centered while the first one shoud be 
>> right-aligned and the third one left-aligned. (Actually it seems that all 
>> columns are centered…)
>> %%% begin pb-math-align.tex
>> \definemathmatrix[alignedcases]
>>  [align={right,left,left},
>>  distance=3pt,
>>  left={\left\{},
>>  right={\right.},
>>  style=\displaystyle]
>> 
>> 
>> \starttext
>> 
>> \startformula
>> \startalignedcases
>> \NC \partial_{tt} u - \Delta u + q(x) u \NC = 0  \NC \quad\mbox{in 
>> }\;(0,T)\times\Omega \NR
>> \NC  u(0,x) \NC = 0 \NC \quad \mbox{in }\; \Omega \NR 
>> \NC  \partial_{t} u(0,x) \NC = 0 \NC \quad \mbox{in }\; \Omega \NR 
>> \NC {\partial u \over\partial{\bf n} } \NC = g(t,\sigma) \NC \quad \mbox{on 
>> }\; (0,T)\times\partial\Omega. \NR
>> \stopalignedcases
>> \stopformula
>> 
>> 
>> \startformula
>> \startalignedcases
>> \NC \partial_{tt} u - \Delta u + q(x) u \NC = 0 \NC \quad\mbox{in }\; 
>> (0,T)\times\Omega \NR
>> \NC - \Delta v  \NC = q(x) \partial_{t}u \NC \quad\mbox{in }\; \Omega \NR
>> \stopalignedcases
>> \stopformula
>> 
>> \stoptext
>> %%% end pb-math-align.tex
>> 
>> 
>> 
>> ___
>> 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://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>> ___
> 
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http

Re: [NTG-context] Problem with math alignment

2017-11-12 Thread Weber, Matthias
Same here. Curiously, the Garden version is ok, while the newest beta seems to 
make all alignments centered.


Minimal  Example:


\starttext
\startformula
A=\startmathmatrix[align={right,right}]
\NC1\NC-1\NR
\NC-1\NC1\NR
\stopmathmatrix
\stopformula
\stoptext

Matthias

> On Nov 12, 2017, at 11:37 AM, Otared Kavian  wrote:
> 
> Hi everybody,
> 
> Does anyone have noticed that the mathalignment has changed its behaviour 
> recently? I think a bug has managed to enter the environment which handles 
> the mathalignment, at least since a few weeks ago. I did not report it 
> earlier because I was traveling and did not have a stable internet access.
> 
> Here is a minimal example where on can see in the first displayed formula 
> that the first and third column are centered while the first one shoud be 
> right-aligned and the third one left-aligned. (Actually it seems that all 
> columns are centered…)
> %%% begin pb-math-align.tex
> \definemathmatrix[alignedcases]
>   [align={right,left,left},
>   distance=3pt,
>   left={\left\{},
>   right={\right.},
>   style=\displaystyle]
> 
> 
> \starttext
> 
> \startformula
> \startalignedcases
> \NC \partial_{tt} u - \Delta u + q(x) u \NC = 0  \NC \quad\mbox{in 
> }\;(0,T)\times\Omega \NR
> \NC  u(0,x) \NC = 0 \NC \quad \mbox{in }\; \Omega \NR 
> \NC  \partial_{t} u(0,x) \NC = 0 \NC \quad \mbox{in }\; \Omega \NR 
> \NC {\partial u \over\partial{\bf n} } \NC = g(t,\sigma) \NC \quad \mbox{on 
> }\; (0,T)\times\partial\Omega. \NR
> \stopalignedcases
> \stopformula
> 
> 
> \startformula
> \startalignedcases
> \NC \partial_{tt} u - \Delta u + q(x) u \NC = 0 \NC \quad\mbox{in }\; 
> (0,T)\times\Omega \NR
> \NC - \Delta v  \NC = q(x) \partial_{t}u \NC \quad\mbox{in }\; \Omega \NR
> \stopalignedcases
> \stopformula
> 
> \stoptext
> %%% end pb-math-align.tex
> 
> 
> 
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] problems with XML export

2017-11-12 Thread Pablo Rodriguez
On 11/12/2017 05:06 PM, Alan Braslau wrote:
> [...]> Whereas I might want to export systematically, Hans suggests that one
> should export in a separate run using modes for example. This is not a
> bad idea, but I would NOT want to have to then make a third run to fix
> the "broken" PDF. This would be a nightmare in bookkeeping and prone to
> errors.

Hi Alan,

another approach would be to enable a --purgeall option (in mxtrun
--script epub) that also removes both the PDF document and the *-epub
and *-export subdirectories.

Just in case it helps,

Pablo
-- 
http://www.ousia.tk
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Problem with math alignment

2017-11-12 Thread Otared Kavian
Hi everybody,

Does anyone have noticed that the mathalignment has changed its behaviour 
recently? I think a bug has managed to enter the environment which handles the 
mathalignment, at least since a few weeks ago. I did not report it earlier 
because I was traveling and did not have a stable internet access.

Here is a minimal example where on can see in the first displayed formula that 
the first and third column are centered while the first one shoud be 
right-aligned and the third one left-aligned. (Actually it seems that all 
columns are centered…)
%%% begin pb-math-align.tex
\definemathmatrix[alignedcases]
[align={right,left,left},
distance=3pt,
left={\left\{},
right={\right.},
style=\displaystyle]


\starttext

\startformula
\startalignedcases
\NC \partial_{tt} u - \Delta u + q(x) u \NC = 0  \NC \quad\mbox{in 
}\;(0,T)\times\Omega \NR
\NC  u(0,x) \NC = 0 \NC \quad \mbox{in }\; \Omega \NR 
\NC  \partial_{t} u(0,x) \NC = 0 \NC \quad \mbox{in }\; \Omega \NR 
\NC {\partial u \over\partial{\bf n} } \NC = g(t,\sigma) \NC \quad \mbox{on }\; 
(0,T)\times\partial\Omega. \NR
\stopalignedcases
\stopformula


\startformula
\startalignedcases
\NC \partial_{tt} u - \Delta u + q(x) u \NC = 0 \NC \quad\mbox{in }\; 
(0,T)\times\Omega \NR
\NC - \Delta v  \NC = q(x) \partial_{t}u \NC \quad\mbox{in }\; \Omega \NR
\stopalignedcases
\stopformula

\stoptext
%%% end pb-math-align.tex



pb-align-math.pdf
Description: Adobe PDF document


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] new module seeking approval: handlecsv

2017-11-12 Thread Pablo Rodriguez
On 11/12/2017 11:46 AM, Mojca Miklavec wrote:
> On 11 November 2017 at 21:32, Pablo Rodriguez wrote:
>> [...]
>> If the module is
>> tex/texmf-context/tex/context/modules/mkiv/m-database.mkiv, I think this
>> is only intended for typesetting the database contents.
> 
> Well, it parses CSV files and typesets them in an arbitrary way.

If the module is the same as
http://dl.contextgarden.net/myway/csv.pdf#page=4, having to generate
letters inside a command definition may be a real pain with it.

>> handlecsv enables document merging. With the first (stupid) sample that
>> comes to my mind:
>>
>> \starttext
>> \startbuffer
>> \Name\ has completed the course {\em\Course}, achieving the
>> following grade: \Grade.\page
>> \stopbuffer
>> \doloopforall{\getbuffer}
>> \stoptext
> 
> Which is exactly what the other module supports. See page 4 of
> http://dl.contextgarden.net/myway/csv.pdf

Enabling conditional text fragments inside the command definition
doesn’t seem an easy task.

It seems to be much easier to deploy in with the buffer approach (from
handlecsv).

>> Having to do that with before and after options would be a pain (in my
>> opinion).
>>
>> You may page through
>> https://github.com/ousia/handlecsv/blob/context-suite/doc/context/third/handlecsv/handlecsv.pdf
>> to see the features.
> 
> The old module doesn't support invoking columns by title and doesn't
> do any special filters. Another limitation might be that it uses #1,
> #2, ... which reaches it limits pretty soon, but I'm sure that could
> (should?) be fixed anyway.

The approach is different, because the needs are different.

Extending the original module is an option, but ConTeXt has plenty of
things to improve that could come first.

> And certainly the documentation by Jaroslav is much much better
> written than my poor mock-up.

Many thanks for the compliment. The documentation was written by me ;-).

I wrote the documentation after having used the module to create an
automatic document generation method at work. It is far from being
perfect, but it solves some issues.

Your documentation is clear. And your sample on
http://dl.contextgarden.net/myway/csv.pdf#page=7 shows which is the
proper scenarion for the module.

handlecsv was written with something different in mind. Not better or
worse, but simply diverse.

>> I wonder whether it makes sense to extend the built-in module by Hans.
>> If this wasn’t needed before, it may be not needed now.
> 
> This is an oxymoron.

Many thanks for your kindness in the objection :-), although I don’t
think there is a contradiction. I didn’t explain myself well.

> If the functionality is not needed: then why do we need that new
> module in the first place? :)

First, time devoted to ConTeXt is scarce and there are many areas for
improvements (I could name a few :-)).

Second, if the functionality wasn’t required *in that module*, does it
make sense to implement it now?

> What I want to encourage is one well-written and fully functional
> module rather than ending up with ten solutions, each one of them with
> its own set of bugs.

This should be similar to parallel text streams. Hans stated that he
would implement it, when there were a unified proposal.

I don’t think it makes sense to implement new features in the old module
before users start using the new module. Their approaches are totally
different.

> The MKII version of the database module admittedly has a number of
> issues, in particular when it comes to non-ascii.
Does it even make sense even to fix the issues the old module has for
MkII? (If no one had problems for years, new usage cases should deploy
MkIV.)

BTW, handlecsv doesn’t support MkII (only MkIV).

> There might be issues with MKIV as well, I haven't used it
> for a while because I now usually start with lua tables.

It is probably a better method, isn’t it?

> But all in all it would be much better to have some "perfectly
> working" built-in functionality to parse CSV files in my opinion.
Voltaire wrote « le mieux est l’ennemi du bien » (“the perfect is the
enemy of the good”), which is also a saying in Spanish.

I mean, the present m-database.mkiv is just fine for addding tables to
ConTeXt document. A sounder approach to document merging would be to use
SQL databases.

Betweeen those two needs, one can use handlecsv. But I realize that the
best option for some tasks is SQL (I cannot use it at work).

Pablo
-- 
http://www.ousia.tk
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Reproducible PDF output

2017-11-12 Thread Alan Braslau
On Sun, 12 Nov 2017 09:37:33 +0100
Henning Hraban Ramm  wrote:

> Am 2017-11-11 um 21:06 schrieb Pablo Rodriguez :
> 
> > I always use contextjit instead of context, because it’s faster.
> > 
> > Other than speed, I think there is no other difference.  
> 
> Sometimes it has its own bugs, like at the moment (at least in last
> week’s beta) with Lua code. Sometimes ConTeXtJIT couldn’t find my
> fonts, where ConTeXt could (maybe an old, solved problem).

And luajittex is not *always* faster, as Hans has shown us many times
at meetings, although it is usually faster, I believe. It all depends
on what type of operations one is processing.

Note, as well, that luajittex is not available on all platforms for
now. Luajit cannot be compiled for certain processors (one example is
powerpc).

Alan
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] problems with XML export

2017-11-12 Thread Alan Braslau
Hans made some changes a while ago.

Enabling export, floats are handled differently, notably side floats
become location=here. Hans tells me that this derives from how the xml
export is constructed, and this makes handling certain bugs with the
export possible.

I have urged Hans to consider, if this need be so, that the PDF file
produced when export is enabled NOT overwrite a PDF that might have
been produced in a run where export was not enabled. The easiest in my
opinion would be for this PDF to be placed in the filename-export/
sub-directory, leaving filename.pdf (if exists) untouched. Hans
answered that he would have to think about this as it would break his
present workflow where he runs context from his (Scite) editor and
relies looking at the PDF to see certain results.

Whereas I might want to export systematically, Hans suggests that one
should export in a separate run using modes for example. This is not a
bad idea, but I would NOT want to have to then make a third run to fix
the "broken" PDF. This would be a nightmare in bookkeeping and prone to
errors.

Alan



On Sat, 11 Nov 2017 19:46:21 +0100
Pablo Rodriguez  wrote:

> On 11/11/2017 06:30 PM, Henning Hraban Ramm wrote:
> > Here are a few problems that I encountered in my current ePub
> > projects:
> > 
> > * \color[]{} leaves no trace in export.
> 
> Hi Hraban,
> 
> this works with PDF, it should work with ePub:
> 
>   \definehighlight[read][color=red, style=\sc]
>   \starttext
>   \starthighlight[read] rot\stophighlight
>   \stoptext
> 
> I guess you have to use this instead of \color[]{}.
> 
> > * As soon as I activate export, my PDFs get two pages more, i.e.
> > page breaking changes somehow, I didn’t yet track how.
> 
> Without minimal sample and invocation command, it is rather hard to
> reproduce the issue.
> 
> > * For quotability, I’d like to set markers in my HTML, where the
> > print version has page breaks. But the exported XML doesn’t contain
> > anything like that. Is it possible to add?
> 
> Just out of curiosity, I wonder how this could be achieved.
> 
> Do you have other approach than the following?
> 
> 1. Complete PDF compilation with saving of page breaks.
> 
> 2. Add the markers in XML code generation.
> 
> > * Errors in exported XML:
> > [...]
> > (2)
> > \def\SC#1{\dostarttagged{highlight}{scaps}{\sc\lowercase{#1}}\dostoptagged}
> > [...]
> > -  breaks  (maybe my \SC definition is bad,
> > but nobody answered to my according question)
> 
> Try the approach proposed above. I think it should work.
> 
> I hope it helps,
> 
> Pablo

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] insert tags in export xml

2017-11-12 Thread Wolfgang Schuster



Henning Hraban Ramm 
8. November 2017 um 10:57
Ahoi,
I’m working on ePubs again and need a bit more information in the 
exported xml.


E.g. I defined my own small caps macro:
\def\SC#1{{\sc\lowercase{#1}}}
to be able to say \SC{ISO} instead of changing everything into 
lowercase like {\sc iso}.
(I also tried OpenType features, but those were too unreliable with my 
fonts. That’s not the problem here.)


But my small caps end as unmarked lowercase in the exported xml.
I didn’t manage to combine my above approach with \definehighlight, 
but after poking around in the source (core-sys.mkiv, strc-tag.mkiv)

I found this solution:

\def\SC#1{\dostarttagged{highlight}{scaps}{\sc\lowercase{#1}}\dostoptagged}

so that \SC{ISO} becomes
iso

Works for me. Better suggestions?


\definehighlight[SC][style=capital]

\starttext
so that \SC{ISO} becomes
\stoptext


or


\setupsynonyms[abbreviation][synonymstyle=capital]

\abbreviation{ISO}{International Organization for Standardization}

\starttext
so that \ISO\ becomes
\stoptext


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] new module seeking approval: handlecsv

2017-11-12 Thread Mojca Miklavec
On 11 November 2017 at 21:32, Pablo Rodriguez wrote:
> On 11/11/2017 08:01 PM, Mojca Miklavec wrote:
>> On 8 November 2017 at 20:46, Pablo Rodriguez wrote:
>>> [...]
>>> It can handle different .csv files to data merging for document
>>> automatic generation.
>>
>> It would be helpful to figure out what exactly is missing in the
>> built-in module written by Hans. Maybe that module could be upgraded
>> as well?
>
> If the module is
> tex/texmf-context/tex/context/modules/mkiv/m-database.mkiv, I think this
> is only intended for typesetting the database contents.

Well, it parses CSV files and typesets them in an arbitrary way.

> handlecsv enables document merging. With the first (stupid) sample that
> comes to my mind:
>
> \starttext
> \startbuffer
> \Name\ has completed the course {\em\Course}, achieving the
> following grade: \Grade.\page
> \stopbuffer
> \doloopforall{\getbuffer}
> \stoptext

Which is exactly what the other module supports. See page 4 of
http://dl.contextgarden.net/myway/csv.pdf

> Having to do that with before and after options would be a pain (in my
> opinion).
>
> You may page through
> https://github.com/ousia/handlecsv/blob/context-suite/doc/context/third/handlecsv/handlecsv.pdf
> to see the features.

The old module doesn't support invoking columns by title and doesn't
do any special filters. Another limitation might be that it uses #1,
#2, ... which reaches it limits pretty soon, but I'm sure that could
(should?) be fixed anyway.

And certainly the documentation by Jaroslav is much much better
written than my poor mock-up.

> I wonder whether it makes sense to extend the built-in module by Hans.
> If this wasn’t needed before, it may be not needed now.

This is an oxymoron. If the functionality is not needed: then why do
we need that new module in the first place? :)

What I want to encourage is one well-written and fully functional
module rather than ending up with ten solution, each one of them with
its own set of bugs. The MKII version of the database module
admittedly has a number of issues, in particular when it comes to
non-ascii. There might be issues with MKIV as well, I haven't used it
for a while because I now usually start with lua tables. But all in
all it would be much better to have some "perfectly working" built-in
functionality to parse CSV files in my opinion.

Mojca
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] problems with XML export

2017-11-12 Thread Pablo Rodriguez
On 11/12/2017 09:33 AM, Henning Hraban Ramm wrote:
> Am 2017-11-11 um 19:46 schrieb Pablo Rodriguez:
>> \definehighlight[read][color=red, style=\sc]
>> [...]
>> I guess you have to use this instead of \color[]{}.
> 
> Yes, I guess too. I remembered highlight suits color after sending,
> but that means I need to define a new highlight for every color - as
> semantic as that may be, it’s a PITA.

I wonder whether Hans would accept a patch with these definitions to be
applied in the ConTeXt source.

> [...]
> At the state where it exports XML, ConTeXt already knows about page
> breaks, doesn’t it?

You are right. I have almost no experience generating ePubs with ConTeXt
(trying your sample was one of my first attempts to generate an ePub
document with ConTeXt [I use pandoc for that]).

>> [...]
>> Try the approach proposed above. I think it should work.
> 
> No, that was my question in the thread "insert tags in export xml".

Sorry, I overlooked that message.

> \definehighlight only supports style and color, but not command.

I wonder whether this is the right approach.

I mean, you could only (ab)use the style option:

  \setupbackend[export=yes]

  \definehighlight[read][style=\word\sc]
  \starttext
  \starthighlight[read] ROT ROT ROT\stophighlight
  \stoptext

Other approach would be to use your own CSS file:

  .read { text-transform: lowercase; font-variant: small-caps; }

In any case, you need to add the small caps to the class definition in
the CSS file. ConTeXt doesn’t seem to export \sc to anything in the CSS
file.

> I tried to understand its definition and found \dostarttagged, but I
> guess I used it the wrong way, since it breaks the tabulation.

I guess custom CSS is an easier approach.

Just in case it helps,

Pablo
-- 
http://www.ousia.tk
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Reproducible PDF output

2017-11-12 Thread Henning Hraban Ramm
Am 2017-11-11 um 21:06 schrieb Pablo Rodriguez :

> I always use contextjit instead of context, because it’s faster.
> 
> Other than speed, I think there is no other difference.

Sometimes it has its own bugs, like at the moment (at least in last week’s 
beta) with Lua code.
Sometimes ConTeXtJIT couldn’t find my fonts, where ConTeXt could (maybe an old, 
solved problem).

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] problems with XML export

2017-11-12 Thread Henning Hraban Ramm
Am 2017-11-11 um 19:46 schrieb Pablo Rodriguez :

> On 11/11/2017 06:30 PM, Henning Hraban Ramm wrote:
>> Here are a few problems that I encountered in my current ePub projects:
>> 
>> * \color[]{} leaves no trace in export.
> 
> Hi Hraban,
> 
> this works with PDF, it should work with ePub:
> 
>  \definehighlight[read][color=red, style=\sc]
>  \starttext
>  \starthighlight[read] rot\stophighlight
>  \stoptext
> 
> I guess you have to use this instead of \color[]{}.

Yes, I guess too. I remembered highlight suits color after sending, but that 
means I need to define a new highlight for every color - as semantic as that 
may be, it’s a PITA.

>> * As soon as I activate export, my PDFs get two pages more, i.e.
>> page breaking changes somehow, I didn’t yet track how.
> 
> Without minimal sample and invocation command, it is rather hard to
> reproduce the issue.

Of course. I still didn’t check what changes at all.

>> * For quotability, I’d like to set markers in my HTML, where the print
>> version has page breaks. But the exported XML doesn’t contain anything
>> like that. Is it possible to add?
> 
> Just out of curiosity, I wonder how this could be achieved.
> 
> Do you have other approach than the following?
> 
> 1. Complete PDF compilation with saving of page breaks.
> 
> 2. Add the markers in XML code generation.

At the state where it exports XML, ConTeXt already knows about page breaks, 
doesn’t it?

>> * Errors in exported XML:
>> [...]
>> (2)
>> \def\SC#1{\dostarttagged{highlight}{scaps}{\sc\lowercase{#1}}\dostoptagged}
>> [...]
>> -  breaks  (maybe my \SC definition is bad,
>> but nobody answered to my according question)
> 
> Try the approach proposed above. I think it should work.

No, that was my question in the thread "insert tags in export xml".
\definehighlight only supports style and color, but not command.
I tried to understand its definition and found \dostarttagged, but I guess I 
used it the wrong way, since it breaks the tabulation.


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___