[NTG-context] tagged elements in tables (TABLE, tabulate, xtable)

2018-09-29 Thread Rik Kabel

List,

I am trying to use tables in an export with tagging to support CSS 
styling for eventual ebook production (with the added hope that 
cross-references and perhaps indexing someday might be supported). I 
have run into an odd limitation. It seems that only tagged element may 
not be present in a table.


The primary use is to manage text in sidebars (first or last column, 
moved by CSS to the correct position, for a two- or three-column one-row 
table).


 * When there are three tagged (or more) elements in the table, the
   table is not present in the resulting html export, nor is much of
   the document following it, and the file is not well-formed.
 * When there are two tagged elements in the table, the resulting html
   export is without part of the document following the table and is
   not well-formed (even though the table appears complete with the tag
   divs).
 * When there is only one tagged element in the table, the resulting
   html export appears to include the complete document but is still
   not well-formed.
 * When there are none, all is well, except that there is nothing to
   which I can associate the needed CSS.
 * In all cases, the pdf output is correct, but the pdf is a throw-away
   when generating html exports.

It looks like tagged elements are not currently supported within tables.

I had thought of putting the table into a tagged element and using 
nth-child selectors to apply CSS to cells by column, but that is finicky 
and it does not offer the flexibility that tagged elements provide.


Can anyone suggest another alternative?

Example follows. As supplied, no tagged elements are generated and all 
is well. Uncomment either the start/stop element lines in the table to 
get one tagged element in the output, or the getbuffer line to get two 
(or all to get three, or...). There are similar problems with tabulate 
and xtables, but only TABLE is shown here.


   \setupstructure[state=start,
method=auto]
   \setuptagging  [state=start]
   \setupbackend  [export=yes]
   \setupexport   [title={Test Example}]

   \setelementbackendtag  [Block]
   \setelementnature  [Block][display]
   \setelementbackendtag  [Column]
   \setelementnature  [Column][display]
   \setelementbackendtag  [Text]
   \setelementnature  [Text][display]

   \define\DummyText{Lorem ipsum dolor sit amet, \ldots}

   \startbuffer[Demo]
  \startelement[Block]
  \startelement[Text]
  \DummyText \DummyText
  \DummyText \DummyText
  \stopelement
  \stopelement
   \stopbuffer

   \starttext
   \startchapter[title={One}]
   \startsection[title={OneDotOne}]
   \bTABLE
  \bTR
\bTD
   % \startelement[Column]%  adds 1 tagged elements
\DummyText \DummyText
   %   \getbuffer[Demo]% adds 2 tagged elements
   % \stopelement
\eTD
\bTD
\DummyText \DummyText
\eTD
  \eTR
   \eTABLE
   \stopsection%
   \startsection[title={OneDotTwo}]
   \startparagraph
  \DummyText
   \stopparagraph
   \stopsection
   \stopchapter
   \stoptext

--
Rik

___
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] align is reversed inside a table

2018-09-29 Thread Rik Kabel

On 9/29/2018 20:29, David Walther wrote:
Using this table as an example, when I do align=left, the column 
aligns right,
and when I do align=right, it aligns left.  align=center works as 
expected.  Am

I doing something wrong or is this a bug?

I am using the version of context distributed with Debian unstable:

See the wiki, in particular the page Right and left 
.


--
Rik

___
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] setupitemize (no hanging)

2018-09-29 Thread Alan Braslau
On Sun, 30 Sep 2018 13:40:36 +1300
Henri Menke  wrote:

> On 30/09/18 13:17, Alan Braslau wrote:
> > Silly question:
> > 
> > How do I setup itemize so that there be no hanging indent and the symbol is 
> > aligned with the left edge of the text, i.e. not in the margin? (margin or 
> > inmargin or width=-2em puts the symbol in the margin.)  
> 
> Not sure whether I understood the question correctly.
> 
> \starttext
> 
> \startitemize[intext]
> \item \samplefile{knuth}
> \stopitemize
> 
> \stoptext


Yes, I guess that I always confuse [intext] with [text] (which adds joinedup 
and no break). Indeed intext is what I want.

Thank you - it was a silly question.

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] align is reversed inside a table

2018-09-29 Thread Alan Braslau
On Sat, 29 Sep 2018 17:29:40 -0700
David Walther  wrote:

> Using this table as an example, when I do align=left, the column aligns right,
> and when I do align=right, it aligns left.  align=center works as expected.  
> Am
> I doing something wrong or is this a bug?

align=left means raggedleft
align=right means raggedright

This is historical, and remains for compatibility.

use

align=flushleft
align=flushright
align=middle

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] setupitemize (no hanging)

2018-09-29 Thread Henri Menke
On 30/09/18 13:17, Alan Braslau wrote:
> Silly question:
> 
> How do I setup itemize so that there be no hanging indent and the symbol is 
> aligned with the left edge of the text, i.e. not in the margin? (margin or 
> inmargin or width=-2em puts the symbol in the margin.)

Not sure whether I understood the question correctly.

\starttext

\startitemize[intext]
\item \samplefile{knuth}
\stopitemize

\stoptext

> 
> 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
> ___
> 

___
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] align is reversed inside a table

2018-09-29 Thread David Walther

Using this table as an example, when I do align=left, the column aligns right,
and when I do align=right, it aligns left.  align=center works as expected.  Am
I doing something wrong or is this a bug?

I am using the version of context distributed with Debian unstable:

mtx-context | ConTeXt Process Management 1.01
mtx-context |
mtx-context | main context file: 
/usr/share/texmf/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2017.05.15 21:48

Minimal example here:

\setuppagenumbering[alternative=doublesided,location=none,page=no]
\setupfootertexts[\sans{Source: http://mywebsite}]
\setupheadertexts[test column text wrapping]
\setupheadertexts
 [] [Page \userpagenumber\ of \lastuserpagenumber]
 [Page \userpagenumber\ of \lastuserpagenumber] []
\setuppapersize[letter, portrait]
\setuplayout[topspace=0.5in, backspace=1in, height=10in, width=7in,
header=0.5in, footer=0.5in, headerdistance=0in, footerdistance=0in]
\switchtobodyfont[12pt]
\starttext
\setupTABLE[split=repeat]
\setupTABLE[r][each][toffset=3pt, boffset=3pt, loffset=3pt, roffset=3pt]
\setupTABLE[c][each][leftframe=off,rightframe=off,align=right]
\setupTABLE[c][first][frame=off,align=left]
\setupTABLE[c][2][style=\tfx\it,align=left]
\bTABLE
\bTABLEhead
\bTR\bTH Col1 \eTH\bTH Col2 \eTH\bTH Col3 \eTH\eTR
\eTABLEhead
\bTABLEnext
\bTR\bTH Col1 \eTH\bTH Col2 \eTH\bTH Col3 \eTH\eTR
\eTABLEnext
\bTABLEbody
\bTR\bTC \eTC\bTC NightShift \eTC\bTC Tension Lines 146 - 150 \eTC\eTR
\bTR\bTC 30. \eTC \bTC[nc=2,align=center,style=] \bf{Foo Bar} \eTC\eTR
%\bTR\bTC 30. \eTC \bTC\eTC \bTC[align=center] \bf{Foo Bar} \eTC\eTR
\eTABLEbody
\eTABLE
\stoptext
___
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] table making ugly column sizes, how to fix?

2018-09-29 Thread David Walther

Full example at the bottom.

I'm making a table.  So far so good.

Every so often I want to make something like a section header.

Regular table rows are like this:

\bTR\bTC \eTC\bTC NightShift \eTC\bTC Tension Lines 146 - 150 \eTC\eTR

For the section headers, I do this, and they look the way I want:

\bTR\bTC 30. \eTC \bTC[nc=2,align=center,style=] \bf{Foo Bar} \eTC\eTR

But then the regular lines have ugly line breaks and suddenly the column size 
of column 3 is squeezed.  This shouldn't be, we have the whole page to work 
with.

So, when I do my section headers this way, the columns come out sized nicely, 
but the section header isn't styled the way I want it:

\bTR\bTC 30. \eTC \bTC\eTC \bTC[align=center] \bf{Foo Bar} \eTC\eTR

Below is my minimal example you can cut and paste.  How do I do the section
headers without messing up the column sizing?


\setuppagenumbering[alternative=doublesided,location=none,page=no]
\setupfootertexts[\sans{Source: http://mywebsite}]
\setupheadertexts[test column text wrapping]
\setupheadertexts
 [] [Page \userpagenumber\ of \lastuserpagenumber]
 [Page \userpagenumber\ of \lastuserpagenumber] []
\setuppapersize[letter, portrait]
\setuplayout[topspace=0.5in, backspace=1in, height=10in, width=7in,
header=0.5in, footer=0.5in, headerdistance=0in, footerdistance=0in]
\switchtobodyfont[12pt]
\starttext
\setupTABLE[split=repeat]
\setupTABLE[r][each][toffset=3pt, boffset=3pt, loffset=3pt, roffset=3pt]
\setupTABLE[c][each][leftframe=off,rightframe=off,align=right]
\setupTABLE[c][first][frame=off,align=left]
\setupTABLE[c][2][style=\tfx\it,align=left]
\bTABLE
\bTABLEhead
\bTR\bTH Col1 \eTH\bTH Col2 \eTH\bTH Col3 \eTH\eTR
\eTABLEhead
\bTABLEnext
\bTR\bTH Col1 \eTH\bTH Col2 \eTH\bTH Col3 \eTH\eTR
\eTABLEnext
\bTABLEbody
\bTR\bTC \eTC\bTC NightShift \eTC\bTC Tension Lines 146 - 150 \eTC\eTR

% This displays the way I want, but breaks the regular rows.
\bTR\bTC 30. \eTC \bTC[nc=2,align=center,style=] \bf{Foo Bar} \eTC\eTR

% This works with the regular rows, but doesn't look how I want.
%\bTR\bTC 30. \eTC \bTC\eTC \bTC[align=center] \bf{Foo Bar} \eTC\eTR
\eTABLEbody
\eTABLE
\stoptext
___
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] setupitemize (no hanging)

2018-09-29 Thread Alan Braslau
Silly question:

How do I setup itemize so that there be no hanging indent and the symbol is 
aligned with the left edge of the text, i.e. not in the margin? (margin or 
inmargin or width=-2em puts the symbol in the margin.)

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] remapper change in luatex-basics-gen.lua

2018-09-29 Thread Hans Hagen

On 9/29/2018 11:38 PM, Ulrike Fischer wrote:

in luatex-basics-gen.lua
the remapper maps lua to "tex":

local remapper = {
 otf= "opentype fonts",
 ttf= "truetype fonts",
 ttc= "truetype fonts",
 cid= "cid maps",
 cidmap = "cid maps",
  -- fea= "font feature files", -- no longer supported
 pfb= "type1 fonts",-- needed for vector loading
 afm= "afm",
 enc= "enc files",
 lua= "tex", --<<

which is quite a while ago ...


The remapper is then used in resolvers.findfile.

The change has been imported in latex with the new luaotfload and
now broke the function  "pgf_lookup_and_require" in the pgf
graphdrawing library which in its code uses resolvers.findfile --
probably so that it works also as context library
(http://minimals.contextgarden.net/current/modules/t-tikz/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.code.tex)

Due to the mapping of lua to the tex type
resolvers.findfile("layered","lua") no longer finds layered.lua.

Apart from telling the pgf people not to use resolvers.findfile like
this when latex is used, is there anything one could do in the
generic fontloader?
hm, isn't latex using kpse ? in generic this resolver is just for fonts 
(and this one is for lua font files - some demos - with luatex-plain)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] remapper change in luatex-basics-gen.lua

2018-09-29 Thread Ulrike Fischer
in luatex-basics-gen.lua
the remapper maps lua to "tex":

local remapper = {
otf= "opentype fonts",
ttf= "truetype fonts",
ttc= "truetype fonts",
cid= "cid maps",
cidmap = "cid maps",
 -- fea= "font feature files", -- no longer supported
pfb= "type1 fonts",-- needed for vector loading
afm= "afm",
enc= "enc files",
lua= "tex", --<