ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Matthijs Kooijman <matthijs@stdin.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Using \startalign outside of math mode?
Date: Fri, 28 Aug 2009 13:57:12 +0200	[thread overview]
Message-ID: <20090828115712.GZ12901@katherina.student.utwente.nl> (raw)
In-Reply-To: <20090828112910.GY12901@katherina.student.utwente.nl>


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

Hi all,

>    foo = bar
>        | baz

it seems I found some sort of a solution. Using the \setwidthof I found at
[1], I wrote the following:


  \def\setwidthof#1\to#2%
  {\bgroup
  \setbox\scratchbox\hbox{#1}%
  \expanded{\egroup\def\noexpand#2{\the\wd\scratchbox}}}

  foo = bar
  \setwidthof{foo }\to\alignwidth
  \hskip\alignwidth| baz

This works, but is not so pretty, obviously. Since I'm using a custom pretty
printer, I can probably hack something up that generates this from the more
natural form automatically. Still, I'm wondering if there are more pretty
methods to do this. In particular, this method is completely limited to
indents at the start of a line (e.g., aligning the b's of bar and baz isn't
possible, though I could perhs do more complicated math using the width of
"| ", but that will become even more hideous...

Any other suggestions?

Gr.

Matthijs

[1]: http://www.ntg.nl/pipermail/ntg-context/2009/037404.html

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2009-08-28 11:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-28 11:29 Matthijs Kooijman
2009-08-28 11:57 ` Matthijs Kooijman [this message]
2009-08-28 14:31 ` Aditya Mahajan

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=20090828115712.GZ12901@katherina.student.utwente.nl \
    --to=matthijs@stdin.nl \
    --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).