Re: [NTG-context] horizontal alignment of table cells when the content is a \framed

2018-05-04 Thread Wolfgang Schuster

Use \dontleavehmode\framed{…} for the frames in the tables.

Wolfgang

MF 
4. Mai 2018 um 10:28
Hello list,
i have a problem of alignment of cell tables that contain a \framed:
the horizontal alignment is ignored by table cells in natural and
extreme tables.

Instead a \framed inside a \framed looks ok:

\starttext

Framed:

\framed[framecolor=blue,offset=none,width=10cm,height=7cm,align={middle
,lohi}]
{\framed[width=3cm,height=2cm,align={middle,lohi},orientation=35]{hello
}}

\blank

Natural tables:

\bTABLE[framecolor=green]
\bTR
\bTD[offset=none,width=10cm,height=7cm,align={middle,lohi}]

\framed[width=3cm,height=2cm,align={middle,lohi},orientation=35]{hello}
\eTD
\eTR
\eTABLE

\blank

Extreme tables

\startxtable[framecolor=red]
\startxrow
\startxcell[offset=none,width=10cm,height=7cm,align={middle,lohi}]

\framed[width=3cm,height=2cm,align={middle,lohi},orientation=35]{hello}
\stopxcell
\stopxrow
\stopxtable

\stoptext

(the problem arose when i tried to set the dimensions of a rotated
content independently from the cell's dimensions)

Best greetings,
Massi
___
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] horizontal alignment of table cells when the content is a \framed

2018-05-04 Thread MF
Hello list,
i have a problem of alignment of cell tables that contain a \framed:
the horizontal alignment is ignored by table cells in natural and
extreme tables.

Instead a \framed inside a \framed looks ok:

\starttext

Framed:

\framed[framecolor=blue,offset=none,width=10cm,height=7cm,align={middle
,lohi}]
{\framed[width=3cm,height=2cm,align={middle,lohi},orientation=35]{hello
}}

\blank

Natural tables:

\bTABLE[framecolor=green]
\bTR
\bTD[offset=none,width=10cm,height=7cm,align={middle,lohi}]
 
\framed[width=3cm,height=2cm,align={middle,lohi},orientation=35]{hello}
\eTD
\eTR
\eTABLE

\blank

Extreme tables

\startxtable[framecolor=red]
\startxrow
\startxcell[offset=none,width=10cm,height=7cm,align={middle,lohi}]
 
\framed[width=3cm,height=2cm,align={middle,lohi},orientation=35]{hello}
\stopxcell
\stopxrow
\stopxtable

\stoptext

(the problem arose when i tried to set the dimensions of a rotated
content independently from the cell's dimensions)

Best greetings,
Massi
___
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] horizontal alignment

2010-07-11 Thread Wolfgang Schuster

Am 09.07.10 13:13, schrieb Michael Murphy:

On 09/07/10 01:32, Michael Goerz wrote:

Hi everyone,

I'm trying to do some horizontal alignment, for typesetting poetry.
How would you solve this kind of problem? I've considered defining a
macro \BrokenLine[line1][line2] that does the above. But, there are
also instances where there are two or more lines as a continuation of
one previous line. Maybe there is a possibility to mark a horizontal
position temporarily, and then jump to that position later?


Didn't know you were into ConTeXt...

Anyway, this is a crappy solution and you could probably make it better.
As far as I'm aware, there is no way to get the current horizontal
position across the page at any particular moment. The method below
essentially just measures the length of the line that you want to enter,
and sets this as the indent.

\dimendef\indentl=10

\def\savewidth#1{%
\setbox0=\hbox{#1}%
\copy0%
\indentl=\wd0%
}

\def\addtosavewidth#1{%
\setbox0=\hbox{#1}%
\mindent\copy0%
\advance\indentl by \wd0%
}

\def\mindent{\hskip\indentl}



Nice solution but you can improve it with a few context functions:

\newdimen\indentleft

\def\savewidth
  {\dowithnextbox
 {\indentleft\nextboxwd
  \copy\nextbox}
 \hbox}

\def\addtosavewidth
  {\dowithnextbox
 {\mindent\copy\nextbox
  \advance\indentleft\nextboxwd}
 \hbox}

\def\mindent{\hskip\indentleft}


A different solution is to store the end of the last line in one run and 
reuse this value in the next:


\def\SKIP
  {\doglobal\increment\SKIPcount
   \xypos{NP:\SKIPcount}%
   \par\hskip\dimexpr\MPx{NP:\SKIPcount}-\MPx{text:\realfolio}\relax}

\def\LASTSKIP
  {\par\hskip\dimexpr\MPx{NP:\SKIPcount}-\MPx{text:\realfolio}\relax}

\starttext
\startlines
here we now see you ~~  already in grief
as you see ~~  yourselves ~~  as the last of the lasts
we are mirrors of your consciousness \SKIP as you see the end
and you see us ~~ deep \SKIP in \SKIP the spring
\LASTSKIP of the universe
seeing you deep ~~ in the gravity well of the heat death
\stoplines
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] horizontal alignment

2010-07-09 Thread Michael Murphy

On 09/07/10 01:32, Michael Goerz wrote:

Hi everyone,

I'm trying to do some horizontal alignment, for typesetting poetry.
How would you solve this kind of problem? I've considered defining a
macro \BrokenLine[line1][line2] that does the above. But, there are
also instances where there are two or more lines as a continuation of
one previous line. Maybe there is a possibility to mark a horizontal
position temporarily, and then jump to that position later?


Didn't know you were into ConTeXt...

Anyway, this is a crappy solution and you could probably make it better. 
As far as I'm aware, there is no way to get the current horizontal 
position across the page at any particular moment. The method below 
essentially just measures the length of the line that you want to enter, 
and sets this as the indent.


\dimendef\indentl=10

\def\savewidth#1{%
  \setbox0=\hbox{#1}%
  \copy0%
  \indentl=\wd0%
}

\def\addtosavewidth#1{%
  \setbox0=\hbox{#1}%
  \mindent\copy0%
  \advance\indentl by \wd0%
}

\def\mindent{\hskip\indentl}

\starttext
\startlines
  here we now see you ~~  already in grief
  as you see ~~  yourselves ~~  as the last of the lasts
  \savewidth{we are mirrors of your consciousness }
  \mindent as you see the end
  \savewidth{and you see us ~~ deep }
  \addtosavewidth{in }
  \addtosavewidth{the spring }
  \mindent of the universe
  seeing you deep ~~ in the gravity well of the heat death
  we are dying ~~ in the spring as we watch you die
  we are grieving in the spring as you begin to grieve for all
  we are talking about bone-dry at the bottom of the well of time
  \savewidth{we are already parched }
  \mindent for time is transparent
  \savewidth{and we are all rats in the glassy }
  \mindent labyrinth of time.
  \stoplines
\stoptext


--
Michael Murphy
___
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] horizontal alignment

2010-07-09 Thread Michael Goerz
On Fri, Jul 9, 2010 at 7:13 AM, Michael Murphy
michael.mur...@uni-ulm.de wrote:
 On 09/07/10 01:32, Michael Goerz wrote:
 I'm trying to do some horizontal alignment, for typesetting poetry.
 How would you solve this kind of problem? I've considered defining a
 macro \BrokenLine[line1][line2] that does the above. But, there are
 also instances where there are two or more lines as a continuation of
 one previous line. Maybe there is a possibility to mark a horizontal
 position temporarily, and then jump to that position later?

 Anyway, this is a crappy solution and you could probably make it better. As
 far as I'm aware, there is no way to get the current horizontal position
 across the page at any particular moment. The method below essentially just
 measures the length of the line that you want to enter, and sets this as the
 indent.

 \dimendef\indentl=10

 \def\savewidth#1{%
  \setbox0=\hbox{#1}%
  \copy0%
  \indentl=\wd0%
 }

 \def\addtosavewidth#1{%
  \setbox0=\hbox{#1}%
  \mindent\copy0%
  \advance\indentl by \wd0%
 }

 \def\mindent{\hskip\indentl}
Thanks, Michael, that works great!

Just out of interest: why does \savewidth create a newline
if there's more text on the same line,
(like this:
   \savewidth{start of line} and some more text
)
while \addtosavewidth does not? The difference is the \hskip in front
of the \copy0%; if I add \hskip0pt in front of the the \copy in
\savewidth, there's also no newline -- but how does that make sense?

Michael
___
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] horizontal alignment

2010-07-08 Thread Michael Goerz
Hi everyone,

I'm trying to do some horizontal alignment, for typesetting poetry.
There are lines that are continuations of the previous line, and should
be aligned to the end of that previous line. Currently, I'm doing this
by using \phantom text, which for some reason I also have to wrap into
an \mbox to avoid a line break. As an example:

\startlines
here we now see you ~~  already in grief
as you see ~~  yourselves ~~  as the last of the lasts
we are mirrors of your consciousness
\mbox{\phantom{we are mirrors of your consciousness} as you see the end}
and you see us ~~ deep in the spring of the universe
seeing you deep ~~ in the gravity well of the heat death
we are dying ~~ in the spring as we watch you die
we are grieving in the spring as you begin to grieve for all
we are talking about bone-dry at the bottom of the well of time
we are already parched
\mbox{\phantom{we are already parched} for time is transparent}
and we are all rats in the glassy
\mbox{\phantom{and we are all rats in the glassy} labyrinth of time.
\stoplines

How would you solve this kind of problem? I've considered defining a
macro \BrokenLine[line1][line2] that does the above. But, there are
also instances where there are two or more lines as a continuation of
one previous line. Maybe there is a possibility to mark a horizontal
position temporarily, and then jump to that position later?

Thanks,
Michael
___
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
___