ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Jairo A. del Rio" <jairoadelrio6@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: teaser
Date: Thu, 6 Aug 2020 23:22:08 -0500	[thread overview]
Message-ID: <CAKyqqaYC9Jk_Kt0mOAFRvzhacjt21qb3ESN_HAzCn0W_kSN+oA@mail.gmail.com> (raw)
In-Reply-To: <f79a14a8-e026-31ca-eb47-27ef54ab0b45@gmail.com>


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

Looks useful for multilingual documents, e.g. interleaved lines or
linguistic glosses.
The following example worked for me, but I share in case there's a way to
do better code from it:

\starttext
\newbox\spanishbox
\newbox\englishbox
\newbox\frenchbox

\setbox\spanishbox\vbox\bgroup\red\obeylines
Conocí a un viajero de una tierra antigua
quien dijo: «dos enormes piernas pétreas, sin su tronco
se yerguen en el desierto. A su lado, en la arena,
semihundido, yace un rostro hecho pedazos, cuyo ceño
y mueca en la boca, y desdén de frío dominio,
cuentan que su escultor comprendió bien esas pasiones
las cuales aún sobreviven, grabadas en estos inertes objetos,
a las manos que las tallaron y al corazón que las alimentó.
Y en el pedestal se leen estas palabras:
"Mi nombre es Ozymandias, rey de reyes:
¡Contemplad mis obras, poderosos, y desesperad!"
Nada queda a su lado. Alrededor de la decadencia
de estas colosales ruinas, infinitas y desnudas
se extienden, a lo lejos, las solitarias y llanas arenas».
\egroup

\setbox\englishbox\vbox\bgroup\blue\obeylines
I met a traveller from an antique land,
Who said—“Two vast and trunkless legs of stone
Stand in the desert. . . . Near them, on the sand,
Half sunk a shattered visage lies, whose frown,
And wrinkled lip, and sneer of cold command,
Tell that its sculptor well those passions read
Which yet survive, stamped on these lifeless things,
The hand that mocked them, and the heart that fed;
And on the pedestal, these words appear:
My name is Ozymandias, King of Kings;
Look on my Works, ye Mighty, and despair!
Nothing beside remains. Round the decay
Of that colossal Wreck, boundless and bare
The lone and level sands stretch far away.”
\egroup

\setbox\frenchbox\vbox\bgroup\darkgray\obeylines
J’ai rencontré un voyageur de retour d’une terre antique
Qui m'a dit : « Deux immenses jambes de pierre dépourvues de buste
Se dressent dans le désert. Près d’elles, sur le sable,
À moitié enfoui, gît un visage brisé dont le sourcil froncé,
La lèvre plissée et le rictus de froide autorité
Disent que son sculpteur sut lire les passions
Qui, gravées sur ces objets sans vie, survivent encore
À la main qui les imita et au cœur qui les nourrit.
Et sur le piédestal il y a ces mots :
"Mon nom est Ozymandias, Roi des Rois.
Voyez mon œuvre, ô puissants, et désespérez !"
À côté, rien ne demeure. Autour des ruines
De cette colossale épave, infinis et nus,
Les sables monotones et solitaires s’étendent au loin. »
\egroup

\dorecurse{\boxlines \spanishbox}{%
\strut\llap{\hbox to 1.5em{\txx#1\hss}}\boxline \englishbox#1\par
\strut\boxline \spanishbox#1\par
\strut\boxline \frenchbox#1\par
\blank
}
\stoptext

Thank you for the goodies, Hans

Regards,

Jairo :)

El jue., 6 de ago. de 2020 a la(s) 13:13, Wolfgang Schuster (
wolfgang.schuster.lists@gmail.com) escribió:

> Hans Hagen schrieb am 06.08.2020 um 19:26:
> > Hi,
> >
> > I uploaded a new lmtx version ... it has a new mechanism for
> > manipulating boxes:
> >
> > http://www.pragma-ade.com/general/magazines/mag-1105-mkiv.pdf
> >
> > (also in distribution)
> >
> > Of course experimental but I bet that some can think of usage.
>
> The \copyboxline command doesn't stop at the end of the requested line.
>
> BTW: Is it possible to have unbox command to get the width of the
> content in the lines without the spaces at the begin end. This is useful
> to get the width of first/last line in a box.
>
> %% begin example
> \starttext
>
> \setbox0\vbox
>    {\hsize=4cm
>     one\par
>     two\par
>     three\par
>     four}
>
> \setbox2\ruledhbox{\copyboxline 0 2}
> \setbox4\ruledhbox{\boxline 0 3}
> %\setbox6           \boxline 0 5 % error
>
> [2] [\box2] \par
> [3] [\box4] \par
> [5] [\box6] \par
>
> \stoptext
> %% end example
>
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
>
> ___________________________________________________________________________________
>

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

[-- Attachment #2: 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:[~2020-08-07  4:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-06 17:26 teaser Hans Hagen
2020-08-06 18:12 ` teaser Wolfgang Schuster
2020-08-07  4:22   ` Jairo A. del Rio [this message]
2020-08-07  7:50     ` teaser Hans Hagen
2020-08-07  7:59       ` teaser Jairo A. del Rio
2020-08-07  9:02         ` teaser Hans Hagen
2020-08-07  9:14           ` teaser Jairo A. del Rio
2020-08-07  9:37             ` teaser Hans Hagen
2020-08-07 12:24               ` teaser Jairo A. del Rio
2020-08-07 10:10             ` teaser Wolfgang Schuster

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=CAKyqqaYC9Jk_Kt0mOAFRvzhacjt21qb3ESN_HAzCn0W_kSN+oA@mail.gmail.com \
    --to=jairoadelrio6@gmail.com \
    --cc=ntg-context@ntg.nl \
    /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).