ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* formula-style alignment
@ 2009-05-17 19:23 afsmith
  2009-05-18  6:58 ` Wolfgang Schuster
  2009-05-18 10:53 ` afsmith
  0 siblings, 2 replies; 3+ messages in thread
From: afsmith @ 2009-05-17 19:23 UTC (permalink / raw)
  To: ntg-context

Hey again, ntg-context.

I would like to align one piece of a line to the left, and another
piece of the same line to the right, sort of like numbered math
equations, except not math.
Additionally I would like to do this inside a narrowed block


How can I do this? I have tried side-by-side-frames-inside-a-frame but
the two pieces of the line just stay clumped together. I have tried
'\startalign' and '\(left|right)aligned' to no avail. I have tried
'\hfill' but that pushes things past into/past the right margin...
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: formula-style alignment
  2009-05-17 19:23 formula-style alignment afsmith
@ 2009-05-18  6:58 ` Wolfgang Schuster
  2009-05-18 10:53 ` afsmith
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfgang Schuster @ 2009-05-18  6:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 17.05.2009 um 21:23 schrieb afsmith:

> Hey again, ntg-context.
>
> I would like to align one piece of a line to the left, and another
> piece of the same line to the right, sort of like numbered math
> equations, except not math.
> Additionally I would like to do this inside a narrowed block

\starttext

\input knuth

\startnarrower

\input knuth

\dontleavehmode\framed[width=\localhsize,align=normal]{left\hfill right}

\stopnarrower

\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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: formula-style alignment
  2009-05-17 19:23 formula-style alignment afsmith
  2009-05-18  6:58 ` Wolfgang Schuster
@ 2009-05-18 10:53 ` afsmith
  1 sibling, 0 replies; 3+ messages in thread
From: afsmith @ 2009-05-18 10:53 UTC (permalink / raw)
  To: ntg-context

Thanks Wolfgang. That works...

Now how about inside a definition or subject header?

Here is an example. \localhsize in this case seems to resolve to a
width of 0, making the contained text break as often as it can...

\defineframed[lrframe][
width=\localhsize,
align=normal,
rulethickness=1pt]

\setuplayout[header=0pt,footer=0pt]
\definedescription[topdesc][
inbetween={\blank[none]},
headstyle={\bf},
style={\tf\rm},
location=top,
width=broad]

\define[3]\CHRONDESC
{\starttopdesc
{\dontleavehmode\lrframe{#1\hfill#2}}
\startnarrower[left]{#3}\stopnarrower
\stoptopdesc}

\definehead[mysubject][subject]
\setuphead[mysubject][style={\bf}]
\define[3]\CHRONSUB
{\mysubject{\dontleavehmode\lrframe{#1\hfill#2}}
\startnarrower[left]{#3}\stopnarrower}

\showframe[text]

\starttext

\startnarrower[left]
\dontleavehmode\lrframe[width=broad]
{leftleftleft \hfill right rightrightright}
\stopnarrower \crlf

\startnarrower[left]
\dontleavehmode\lrframe[width=\localhsize]
{leftleftleftleft\hfill right rightrightright}
\stopnarrower \crlf

\CHRONDESC
  {This happened from June 08 to June 09}
  {06/08--06/09}
  {\CHRONDESC
    {This happened from June 08 to December 08}
    {06/08--12/08}
    {\input tufte }
  \CHRONDESC
    {This happened from January 09 to June 09}
    {01/09--06/09}
    {\input zapf }}
\CHRONDESC
  {This happened from June 09 to July 09}
  {06/09-07/09}
  {\input knuth }
\crlf

\CHRONSUB
  {This happened from June 08 to June 09}
  {06/08--06/09}
  {\CHRONSUB
    {This happened from June 08 to December 08}
    {06/08--12/08}
    {\input tufte }
  \CHRONSUB
    {This happened from January 09 to June 09}
    {01/09--06/09}
    {\input zapf }}
\crlf

\stoptext



> Am 17.05.2009 um 21:23 schrieb afsmith:
>
> > Hey again, ntg-context.
> >
> > I would like to align one piece of a line to the left, and another
> > piece of the same line to the right, sort of like numbered math
> > equations, except not math.
> > Additionally I would like to do this inside a narrowed block
>
> \starttext
>
> \input knuth
>
> \startnarrower
>
> \input knuth
>
> \dontleavehmode\framed[width=\localhsize,align=normal]{left\hfill right}
>
> \stopnarrower
>
> \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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2009-05-18 10:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-17 19:23 formula-style alignment afsmith
2009-05-18  6:58 ` Wolfgang Schuster
2009-05-18 10:53 ` afsmith

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