Re: [NTG-context] figures in tables

2016-04-01 Thread Jeong Dal
Dear Hans and listers,

I am sorry that I didn’t read another series of mails about “skipped figure 
numbers”.
Please ignore my previous mail.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] figures in tables

2016-04-01 Thread Jeong Dal
Dear Hans,

Your sample works fine. This method gives me a flexibility of combining figures.

BTW, I have one question.

In the output, figure numbers started from 3, but suddenly jumped to 184. 
In a log file, 

metapost> initializing number mode 'scaled'
floatblocks > '3' placed
floatblocks > '4' placed
floatblocks > '5' placed
floatblocks > '6' placed
floatblocks > '7' placed
floatblocks > '8' placed
floatblocks > '9' placed
floatblocks > '10' placed
floatblocks > '11' placed
…
floatblocks > '241' placed
floatblocks > '242' placed
floatblocks > '243' placed
backend > xmp > using file 
'/Users/graph/ConTeXt/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
pages   > flushing realpage 1, userpage 1
pages   > flushing realpage 2, userpage 2
pages   > flushing realpage 3, userpage 3
pages   > flushing realpage 4, userpage 4
pages   > flushing realpage 5, userpage 5
pages   > flushing realpage 6, userpage 6
pages   > flushing realpage 7, userpage 7
pages   > flushing realpage 8, userpage 8
pages   > flushing realpage 9, userpage 9
pages   > flushing realpage 10, userpage 10
pages   > flushing realpage 11, userpage 11

I just curious why the number started from 3, and where are the numbers 4 - 182 
omitted.
Is there any other meaning?

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Alignment for narrower text

2016-04-01 Thread Jan Tosovsky
On 2016-04-01 Hans Hagen wrote:
> On 3/31/2016 9:28 PM, Jan Tosovsky wrote:
> > On 2016-03-31 Hans Hagen wrote:
> >> On 3/30/2016 8:55 PM, Jan Tosovsky wrote:
> >>>
> >>> http://tracker.luatex.org/view.php?id=884
> >>
> >> indenting prohibits protrusion
> >>
> > Are there alternative ways?
> 
> you should use leftskip (\startnarrower...) in such cases

thanks, but I am lost here. The following has impact on the left margin and it 
doesn't help to hang the initial quote...

\definefontfamily[palatino][rm][Palatino Linotype][features={default, quality}]
\setupbodyfont[palatino]
\setupalign[hz, hanging]
\setupindenting[medium, yes]

\starttext
\input{tufte}
{\leftskip=1cm
\startnarrower
\it
»this is,\par
just sample.«\par
\stopnarrower
}
\input{tufte}
\stoptext

Jan

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

Re: [NTG-context] Protrusion cancellation by index term

2016-04-01 Thread Jan Tosovsky
On 2016-04-01 Hans Hagen wrote:
> On 3/31/2016 10:47 PM, Wolfgang Schuster wrote:
> > > On 2016-03-31 Jan Tosovsky wrote:
> > >
> > > I couldn't find any details for that \leftboundary
> >
> > spac-ver.mkiv:
> >
> > \unexpanded\def\leftboundary   {\boundary\plusone}
> > \unexpanded\def\rightboundary  {\boundary\plustwo}
> 
> it will instruct the protrusion checker to skip the next or 
> previous node (e.g. a char or hbox or ...) when looking for 
> an edge

Thanks for details. So if that worked with plain \hbox should be taken rather 
as coincidence?

I prefer motto the fewer commands, the better :-)

Jan


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

[NTG-context] WIKI - broken links to source files

2016-04-01 Thread Jan Tosovsky
Dear All,

there are broken links on several WIKI pages...

In e.g. http://wiki.contextgarden.net/Protrusion

there is
http://source.contextgarden.net/font-ext.lua
instead of proper one
http://source.contextgarden.net/tex/context/base/font-ext.lua

But when the latter link is clicked, instead of displaying the content I am
getting:
Internal Error - please restart the application!

Links to MkII source I couldn't locate at all.

A side note. Would it be possible to somehow grab Wiki content and verify if
such links to TEX or LUA files exists?

Thanks, Jan

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

Re: [NTG-context] Recent changes in paragraph composing

2016-04-01 Thread Jan Tosovsky
On 2016-03-31 Schmitz Thomas A. wrote: 
> > On 2016-03-31 Jan Tosovsky wrote:
> >
> > In time of producing the result image it was sufficient to set 
> > the tolerance to 'strict'.
> >
> > (1) How can this be fixed efficiently?
> 
> The example is missing the language setup:
> 
> \setuplanguage [en] [patterns={en,agr}]
> 
> \mainlanguage [en]
> 

This is indeed most sensible solution.

Thanks, Jan


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

Re: [NTG-context] [OT] Bash comes to Windows

2016-04-01 Thread luigi scarso
Il 01/apr/2016 00:05, "Mojca Miklavec"  ha
scritto:
>
> It seems that we'll have to extend the support of our bash
> installation script to support Windows:v
>
> https://www.youtube.com/watch?v=kJGqZHQzNRo
>
> (Note that this video was uploaded on 30th March, not the 1st April.)
>
> Mojca
>

https://blogs.windows.com/buildingapps/2016/03/30/run-bash-on-ubuntu-on-windows/

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

Re: [NTG-context] Skipped figure numbers

2016-04-01 Thread Alan BRASLAU
On Fri, 1 Apr 2016 11:17:07 +0100
Aidan Nichol  wrote:

> combinations only give regular grid. Sometimes you want an irregular
> grid. 

Use a nested combination.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] figures in tables

2016-04-01 Thread Hans Hagen

Hi,

I've added support for

\starttext

\useMPlibrary[dum]

\bTABLE
\bTR
\bTD
\placefigure{}{\externalfigure[dummy][width=4cm]}%
\eTD
\eTR
\eTABLE

\bTABLE[split=yes]
\dorecurse{10}{
\bTR
\bTD \placefigure{}{\externalfigure[dummy][width=4cm]} \eTD
\bTD \placefigure{}{\externalfigure[dummy][width=4cm]} \eTD
\eTR
\bTR
\bTD[nx=2] 
\placefigure{}{\externalfigure[dummy][width=12cm,height=3cm]} \eTD

\eTR
\bTR
\bTD 
\placefigure{}{\externalfigure[dummy][width=4cm]} \eTD
\bTD[ny=2] 
\placefigure{}{\externalfigure[dummy][width=4cm,height=8cm]} \eTD

\eTR
\bTR
\bTD 
\placefigure{}{\externalfigure[dummy][width=4cm]} \eTD

\eTR
}
\eTABLE

\stoptext

somewhat experimental (and I will not support floats in all kind of 
constructs ... after all, they are floats)


(btw, \placefigure[force,always] is pretty much a local float)

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | 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
___

Re: [NTG-context] Skipped figure numbers

2016-04-01 Thread Aidan Nichol
> On Thu, 31 Mar 2016 21:49:56 -0400 (EDT)
> Aditya Mahajan  wrote:
> 
> On Thu, 31 Mar 2016, Alan BRASLAU wrote:
> 
>> On Thu, 31 Mar 2016 17:51:07 -0400
>> Aditya Mahajan  wrote:
>> 
>>> @Hans: Does it make sense to disable \incrementcounter if
>>> \trialtypesetting is active?
>> 
>> I was going to suggest such things...
> 
> My motivation is different. If you have any macro in a table (or anything 
> that requires multiple runs to get the size right) that uses a counter 
> (e.g., enumeration), then the numbers will be off. That would not happen 
> if a counter is frozen when trialtypesetting is on.
> 
>> P.S. Would not the use of \startcombination\stopcombination be an
>> alternative to the placefigures within a table?

And \startcombination\stopcombination fails when you use \placefigure instead 
of \externalfigure because you want the captions to be numbered and included in 
the list of figures. You get an error like this one 

  > tex error on line 7 in file virtual: . . .  ! You can't use 
`\prevdepth' in restricted horizontal mode

Using \startfloatcombinations\stopfloatcombination (which appears to be 
undocumented) avoids this error.


> 
> combinations only give regular grid. Sometimes you want an irregular grid. 
> For example, the OP wanted
> 
> +---+--+
> |  | |
> |  | Fig2 |
> | Fig1 +---+
> |  | Fig3 |
> |  | |
> +--+---+
> 
> Such layouts are not possible using combinations.

I thought that nesting combinations might enable this type of combination but 
it didn’t work. see
https://mailman.ntg.nl/pipermail/ntg-context/2016/084926.html 


Using tables is a better solution because it has the syntax to handle figures 
that span rows or columns

> 
> Aditya
> 
Lots of things seem to work well with external figures but as soon as you embed 
them in a \placefigure, which makes them a float, you make things more complex 
and run into the possibility of triggering the restricted horizontal mode  
error.

It seems to me that once you place an object that is normally a float inside 
another float you want the inner one to lose it floating characteristics. Is 
there a way do this explicitly i.e. instead of creating an inner float with

\placefigure[force][ref1]{this is the caption 
}{\externalfigure[cow][width=3in,height=1in]}

could we create a non-floating version with something explicit like

\externalfigure[cow][width=3in,height=1in]
\addcaption[figure][ref1]{this is the caption }

Aidan


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

Re: [NTG-context] Skipped figure numbers

2016-04-01 Thread Hans Hagen

On 3/31/2016 11:51 PM, Aditya Mahajan wrote:

On Thu, 31 Mar 2016, Aidan Nichol wrote:


On Wed, 30 Mar 2016, Aidan Nichol wrote:


I have been looking at various options for controlling how figures
are placed on a page and based on answers to similar questions in
this mailing list I  tried various options. The most flexible one
seems to be using tables e.g.

\setupexternalfigures[location={default}]

\starttext

\placefigure[]{}{\externalfigure[hacker][height=1in]}

\startxtable[frame=off,align=low]
\startxrow
\startxcell[ny=2]
\placefigure[force][]{left
twoup}{\externalfigure[mill][height=4in]}
 \stopxcell
 \startxcell
   \placefigure[force][]{the
first}{\externalfigure[spider][height=1.5in]}
 \stopxcell
\stopxrow
\startxrow
\startxcell
  \placefigure[force][]{the second}{\externalfigure[cow][height=1.5in]}
\stopxcell
\stopxrow
\stopxtable

It seems to work well except that figure numbers are being skipped.
In this example hacker=1 mill=8, spider=9 and cow=10.
Varying the contents of the table reveals that It is skipping two
times the number of figures in the table.

Is this an invalid combination of features I’m using or am I doing
something wrong?


The contents of a table are typeset multiple times to get an idea of the
height and width. Here is one option:

\useMPlibrary[dum]

\starttext

\bTABLE[frame=off,align=low]
\bTR
\bTD[ny=2]
 \placefigure[here,\iftrialtypesetting nonumber \fi]
 []{left
twoup}{\externalfigure[mill][width=2in,height=4in]}
\eTD
\bTD
 \placefigure[here,\iftrialtypesetting nonumber \fi]
 []{the
first}{\externalfigure[spider][width=2in,height=2in]}
\eTD
\eTR
\bTR
\bTD
 \placefigure[here,\iftrialtypesetting nonumber \fi]
 []{the
second}{\externalfigure[cow][width=2in,height=2in]}
\eTD
\eTR
\eTABLE
\stoptext


Thanks Aditya

That solved the problem


@Hans: Does it make sense to disable \incrementcounter if
\trialtypesetting is active?


btw, floats are just that: floats ...

\starttext

\useMPlibrary[dum]

\dorecurse{34}{test\par}

\bTABLE[split=yes]
\dorecurse{10}{
\bTR
\bTD \placefigure{}{\externalfigure[dummy][width=2cm]} \eTD
\bTD \placefigure{}{\externalfigure[dummy][width=2cm]} \eTD
\eTR
\bTR
\bTD[nx=2] 
\placefigure{}{\externalfigure[dummy][width=4cm]} \eTD

\eTR
}
\eTABLE

\stoptext


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | 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
___

Re: [NTG-context] Skipped figure numbers

2016-04-01 Thread Hans Hagen

On 3/31/2016 11:51 PM, Aditya Mahajan wrote:

On Thu, 31 Mar 2016, Aidan Nichol wrote:


On Wed, 30 Mar 2016, Aidan Nichol wrote:


I have been looking at various options for controlling how figures
are placed on a page and based on answers to similar questions in
this mailing list I  tried various options. The most flexible one
seems to be using tables e.g.

\setupexternalfigures[location={default}]

\starttext

\placefigure[]{}{\externalfigure[hacker][height=1in]}

\startxtable[frame=off,align=low]
\startxrow
\startxcell[ny=2]
\placefigure[force][]{left
twoup}{\externalfigure[mill][height=4in]}
 \stopxcell
 \startxcell
   \placefigure[force][]{the
first}{\externalfigure[spider][height=1.5in]}
 \stopxcell
\stopxrow
\startxrow
\startxcell
  \placefigure[force][]{the second}{\externalfigure[cow][height=1.5in]}
\stopxcell
\stopxrow
\stopxtable

It seems to work well except that figure numbers are being skipped.
In this example hacker=1 mill=8, spider=9 and cow=10.
Varying the contents of the table reveals that It is skipping two
times the number of figures in the table.

Is this an invalid combination of features I’m using or am I doing
something wrong?


The contents of a table are typeset multiple times to get an idea of the
height and width. Here is one option:

\useMPlibrary[dum]

\starttext

\bTABLE[frame=off,align=low]
\bTR
\bTD[ny=2]
 \placefigure[here,\iftrialtypesetting nonumber \fi]
 []{left
twoup}{\externalfigure[mill][width=2in,height=4in]}
\eTD
\bTD
 \placefigure[here,\iftrialtypesetting nonumber \fi]
 []{the
first}{\externalfigure[spider][width=2in,height=2in]}
\eTD
\eTR
\bTR
\bTD
 \placefigure[here,\iftrialtypesetting nonumber \fi]
 []{the
second}{\externalfigure[cow][width=2in,height=2in]}
\eTD
\eTR
\eTABLE
\stoptext


Thanks Aditya

That solved the problem


@Hans: Does it make sense to disable \incrementcounter if
\trialtypesetting is active?


depends a bit .. other mechanisms do a save, increment, restore, which 
better reflects the number to be rendered (otherwise you can get 
oscillating runs)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | 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
___

Re: [NTG-context] Protrusion cancellation by index term

2016-04-01 Thread Hans Hagen

On 3/31/2016 9:28 PM, Jan Tosovsky wrote:

On 2016-03-31 Hans Hagen wrote:

On 3/30/2016 9:53 PM, Jan Tosovsky wrote:

On 2016-03-22 Hans Hagen wrote:

On 3/21/2016 10:59 PM, Jan Tosovsky wrote:

On 2014-02-23 Hans Hagen wrote:

On 2/22/2014 2:38 PM, Jan Tosovsky wrote:

On 2014-02-22 Jan Tosovsky wrote:


when a punctuated phrase appears at the beginning of the
line, it is not protruded correctly when preceded by an
index term.

... \index{foo}>Bar< ...

A minimal example is available at
http://drifted.in/other/sample.tex


I'd be grateful for ignoring any non document content
preceding punctuation to avoid its influence on protrusion.


it's not that trivial

for the index we can cheat a bit but then i also need to
check lots of other cases for possible interference


you can try to do this:

\leftboundary\hbox{\index{foo}}


Wow, I am quite satisfied with this solution.

Btw, I couldn't find any details for that \leftboundary command either in TeX 
[1] or ConTeXt [2] command references.

I've tried it just with \hbox{} and it works as well.

Couldn't this be generalized in a way - if you want protrusion even in edge 
cases, any inline commands have to be wrapped in \hbox{} ?


because for instance you wouldn't want to protrude into a constructed 
compound hyphen which is a inline construct, just as you don't want to 
protrude into a formula or something explicitely boxed


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | 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
___

Re: [NTG-context] Alignment for narrower text

2016-04-01 Thread Hans Hagen

On 3/31/2016 9:28 PM, Jan Tosovsky wrote:

On 2016-03-31 Hans Hagen wrote:

On 3/30/2016 8:55 PM, Jan Tosovsky wrote:

On 2014-01-30 Jan Tosovsky wrote:


I'd expect that starting french quote sign outside the left
text edge - similarly like it is aligned the main flow when
the hanging feature is enabled.

Now I've found it works as expected when the indenting is
disabled...


http://tracker.luatex.org/view.php?id=884


indenting prohibits protrusion



Good to know, thanks. I take it rather as a limitation.

Use case:
- book uses global indentation
- there is poem typeset in narrower block
- there is punctuation in the first verse which disrupt optical margin alignment

Are there alternative ways?


in your example you use indentation to get a narrower block (and as each 
line is a paragraph each line gets an indent box prepended) .. you 
should use leftskip (\startnarrower...) in such cases



Btw, from end user perspective I'd expect it should work by default without 
further tweaking.


so what if someone has

\hbox{some image or whatever unknonws}

should character overflow into the box?

how is tex supposed to know the intentions

so if all gets a boundary mark in the end you end up with as many 
exceptions (maybe more) than when you get now



Jan

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




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | 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
___

Re: [NTG-context] Protrusion cancellation by index term

2016-04-01 Thread Hans Hagen

On 3/31/2016 10:47 PM, Wolfgang Schuster wrote:

Jan Tosovsky 
31. März 2016 um 21:28

Wow, I am quite satisfied with this solution.

Btw, I couldn't find any details for that \leftboundary command either
in TeX [1] or ConTeXt [2] command references.

The \leftboundary command uses a new LuaTeX primitive which means you
can’t find it in a TeX [1] reference.

spac-ver.mkiv:

\unexpanded\def\leftboundary   {\boundary\plusone}
\unexpanded\def\rightboundary  {\boundary\plustwo}


it will instruct the protrusion checker to skip the next or previous 
node (e.g. a char or hbox or ...) when looking for an edge


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | 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
___