ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Garulfo via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Garulfo <garulfo@azules.eu>
Subject: Pull quote between two column - trial
Date: Sat, 21 May 2022 23:20:05 +0200	[thread overview]
Message-ID: <3917871d-d393-4032-27c0-fba853c47c23@azules.eu> (raw)

[-- Attachment #1: Type: text/plain, Size: 422 bytes --]

Hi all,

hope you are all doing well.

I am still trying to display pull quote between two columns.

lmt_parshape is really helpfull.


I need to add a 1pt gap to make the left column behave correctly,
but the right column remains shifted one line below the intended one.

Question1: any clue ?

Question2: is there a way to use the columnset system to produce a 
similar output ?

Thanks again for your feedbacks,
Garulfo

[-- Attachment #2: pullquote_between_column_v01.tex --]
[-- Type: text/x-tex, Size: 4061 bytes --]


\setuplayout
  [grid=yes,
   headerdistance=5mm,
   margindistance=5mm,
   backspace=17.5mm,
   margin=10mm,
   topspace=40mm,
   height=23cm,
   header=10mm,
   footer=10mm,
   width=17.5cm]

%\showframe
%\showgrid
\usemodule     [visual]

\setupbodyfont [palatino,11pt]

\definecolor [transparentred]  [r=1,t=.5,a=1]
\definecolor [transparentgreen][g=1,t=.5,a=1]

%------------------------------------------------------------

\def\posA{10}
\def\posB{20}
\def\mygap{1pt}
\def\mypen{1pt}
\def\PQhalfwith{20mm}

%------------------------------------------------------------

\startuseMPgraphic{mytest0}   % for basic straight column
    begingroup ;
    save p ; path p ;
    p := (0,0)  --
         (0.3*TextWidth,0cm) --
         (0.3*TextWidth,TextHeight) --
         (0cm,TextHeight) --cycle  ;
    lmt_parshape [path = p] ;
    draw p withpen pencircle scaled \mypen ;
    endgroup ;
\stopuseMPgraphic

\startuseMPgraphic{mytest1}  % column on the left of the pull quote
    begingroup ;
    save p ; path p ;
    p := (0,0)  --
         (0.3*TextWidth,0cm) --
         (0.3*TextWidth,            TextHeight+\mygap-\posB*LineHeight) --
         (0.3*TextWidth-\PQhalfwith,TextHeight+\mygap-\posB*LineHeight) --
         (0.3*TextWidth-\PQhalfwith,TextHeight-\mygap-\posA*LineHeight) --
         (0.3*TextWidth,            TextHeight-\mygap-\posA*LineHeight) --
         (0.3*TextWidth,TextHeight) --
         (0cm,TextHeight) --cycle  ;
    lmt_parshape [path = p] ;
    draw p withpen pencircle scaled \mypen ;
    endgroup ;
\stopuseMPgraphic

\startuseMPgraphic{mytest2}   % column on the right of the pull quote
    begingroup ;
    save p ; path p ;
    p := (0,0)  --
         (0.3*TextWidth,0cm) --
         (0.3*TextWidth,TextHeight) --
         (0cm,TextHeight) --
         (0.0*TextWidth,            TextHeight-\mygap-\posA*LineHeight) --
         (0.0*TextWidth+\PQhalfwith,TextHeight-\mygap-\posA*LineHeight) --
         (0.0*TextWidth+\PQhalfwith,TextHeight+\mygap-\posB*LineHeight) --
         (0.0*TextWidth,            TextHeight+\mygap-\posB*LineHeight) --
         cycle  ;
    lmt_parshape [path = p] ;
    draw p withpen pencircle scaled \mypen ;
    endgroup ;
\stopuseMPgraphic

\defineoverlay[myOL1][\useMPgraphic{mytest1}]
\defineoverlay[myOL2][\useMPgraphic{mytest2}]

%------------------------------------------------------------

\defineframed
  [FramePage]
  [align=width,
   frame=off,
   location=high,
   strut=yes,
   offset=0pt,
   width=\textwidth,
   height=\textheight,
   before=]

\defineframed
  [FrameColumn]
  [FramePage]
  [background=color,
   backgroundcolor=transparentred,
   width=0.3\textwidth,
   after=\dontleavehmode]

%------------------------------------------------------------

\definelayer     % used to display the pull quote on the page
  [test]
  [x=0mm,
   y=0mm,
   width=\paperwidth,
   height=\paperheight]

%=======================================================

\starttext

\startshapetext[mytest1,mytest2,mytest0,mytest0]%
\strut%
\dorecurse{3}{\samplefile{douglas}
\blank[1*line]}%
\stopshapetext

%------------------------------------------------------------
% First page

\FramePage{%
\FrameColumn[background={color,myOL1}]{\getshapetext}\hfill
\FrameColumn[background={color,myOL2}]{\getshapetext}\hfill
\FrameColumn{empty}}


% and the pull quote

\setlayer
  [test]
  [hoffset=\backspace+0.3\textwidth-\PQhalfwith+0.2pt,
   voffset=\dimexpr(\topspace+\headerheight+\headerdistance+\posA\baselineskip-0.4pt)]
 {\framed[
    background=color,
    backgroundcolor=transparentgreen,
    frame=off,
    strut=yes,
    offset=0pt,
    width=\dimexpr(0.05\textwidth)+\PQhalfwith+\PQhalfwith,
    height=\dimexpr(\posB\baselineskip-\posA\baselineskip)]{\bfd PULL QUOTE\\TRIAL}}

\setupbackgrounds[page][background={foreground,test}]

%------------------------------------------------------------
% Second page just to demonstrate that \getshapetext continue to work

\page

\FramePage{%
\FrameColumn{\getshapetext}\hfill
\FrameColumn{\getshapetext}\hfill
\FrameColumn{empty}}


\stoptext


[-- Attachment #3: pullquote_between_column_v01.pdf --]
[-- Type: application/pdf, Size: 17425 bytes --]

[-- Attachment #4: 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
___________________________________________________________________________________

             reply	other threads:[~2022-05-21 21:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-21 21:20 Garulfo via ntg-context [this message]
2022-05-28 18:25 ` Garulfo via ntg-context
2022-05-28 22:55   ` jbf via ntg-context
2022-05-29 17:39   ` Garulfo via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3917871d-d393-4032-27c0-fba853c47c23@azules.eu \
    --to=ntg-context@ntg.nl \
    --cc=garulfo@azules.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).