ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Shift tabulate into margin and center
       [not found] <a41b220e-e6f8-4fc7-b91c-6af76fd4c561@Spark>
@ 2020-05-04 18:42 ` Tim Steenvoorden
  2020-05-05  7:05   ` Tim Steenvoorden
  0 siblings, 1 reply; 2+ messages in thread
From: Tim Steenvoorden @ 2020-05-04 18:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1259 bytes --]

Hi all,

I’ve a page layout with a broad left margin. I’d like to create frames in the text which utilize the margin and the typearea with centered contents. I managed to do this with the following code, but I wonder if there is an easier and more elegant way to do this in ConTeXt, especially the centering of the tabulation.

Cheers,
Tim


\startproduct test-tabulate

\setuppapersize[B5]
\setuplayout
[backspace=13pc,
leftmargin=8pc,
leftmargindistance=1pc,
width=24.5pc,
rightmargin=0pc,
%%
topspace=4pc,
header=0pc,
height=49pc,
footer=0pc,
bottomdistance=2.5pc,
bottom=1pc,
location=middle]

\define\fullwidth{\dimexpr(\leftmargindistance+\leftmarginwidth+\textwidth)}

\section{First}
\subsection{First first}

\input tufte

\setupnarrower[left=-9pc]
\startnarrower[left]
\startframedtext[frame=off,topframe=on,bottomframe=on,align=middle,width=\fullwidth]
The whole frame should be shifted to the left.
As the text, this table should centered in the box.
\placefigure[none,force]{}
\starttabulate[|l|r|]
\NC 0 \NC 1 \NR
\NC 2 \NC 3 \NR
\NC 4 \NC 5 \NR
\NC 6 \NC 7 \NR
\NC 8 \NC 9 \NR
\stoptabulate
\startformula
E=mc^2
\stopformula
\stopframedtext
\stopnarrower

\input tufte

\stopproduct


[-- Attachment #1.2: Type: text/html, Size: 5609 bytes --]

[-- Attachment #2: test-tabulate.pdf --]
[-- Type: application/octet-stream, Size: 16741 bytes --]

[-- Attachment #3: Type: text/plain, Size: 493 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Shift tabulate into margin and center
  2020-05-04 18:42 ` Shift tabulate into margin and center Tim Steenvoorden
@ 2020-05-05  7:05   ` Tim Steenvoorden
  0 siblings, 0 replies; 2+ messages in thread
From: Tim Steenvoorden @ 2020-05-05  7:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1650 bytes --]

Hi all,

Apparently the solution does not work with multiple blocks on the same page. Table floats get ill aligned and frame rules are drawn double (see attachment). How should I fix this?

Cheers,
Tim
On 4 May 2020, 20:42 +0200, Tim Steenvoorden <tim.steenvoorden@gmail.com>, wrote:
> Hi all,
>
> I’ve a page layout with a broad left margin. I’d like to create frames in the text which utilize the margin and the typearea with centered contents. I managed to do this with the following code, but I wonder if there is an easier and more elegant way to do this in ConTeXt, especially the centering of the tabulation.
>
> Cheers,
> Tim
>
>
> \startproduct test-tabulate
>
> \setuppapersize[B5]
> \setuplayout
> [backspace=13pc,
> leftmargin=8pc,
> leftmargindistance=1pc,
> width=24.5pc,
> rightmargin=0pc,
> %%
> topspace=4pc,
> header=0pc,
> height=49pc,
> footer=0pc,
> bottomdistance=2.5pc,
> bottom=1pc,
> location=middle]
>
> \define\fullwidth{\dimexpr(\leftmargindistance+\leftmarginwidth+\textwidth)}
>
> \section{First}
> \subsection{First first}
>
> \input tufte
>
> \setupnarrower[left=-9pc]
> \startnarrower[left]
> \startframedtext[frame=off,topframe=on,bottomframe=on,align=middle,width=\fullwidth]
> The whole frame should be shifted to the left.
> As the text, this table should centered in the box.
> \placefigure[none,force]{}
> \starttabulate[|l|r|]
> \NC 0 \NC 1 \NR
> \NC 2 \NC 3 \NR
> \NC 4 \NC 5 \NR
> \NC 6 \NC 7 \NR
> \NC 8 \NC 9 \NR
> \stoptabulate
> \startformula
> E=mc^2
> \stopformula
> \stopframedtext
> \stopnarrower
>
> \input tufte
>
> \stopproduct
>

[-- Attachment #1.2: Type: text/html, Size: 6206 bytes --]

[-- Attachment #2: test-tabulate.pdf --]
[-- Type: application/octet-stream, Size: 14590 bytes --]

[-- Attachment #3: Type: text/plain, Size: 493 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-05  7:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <a41b220e-e6f8-4fc7-b91c-6af76fd4c561@Spark>
2020-05-04 18:42 ` Shift tabulate into margin and center Tim Steenvoorden
2020-05-05  7:05   ` Tim Steenvoorden

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).