ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: \centerline vs. \midaligned vs. \startalignment[middle]
Date: Wed, 26 Jun 2013 14:46:32 +0200	[thread overview]
Message-ID: <C5EAC96E-E1AD-4235-A6F0-F49C393473AD@gmail.com> (raw)
In-Reply-To: <op.wzaby9v5tpjj8f@lpr>


Am 26.06.2013 um 14:07 schrieb Procházka Lukáš Ing. - Pontex s. r. o. <LPr@pontex.cz>:

> Hello,
> 
> there are several similar commands to produce text (or another object) to be centered on the line.
> 
> What are differences (or intended usage) among \centerline, \midaligned, \startalignment[middle]?
> 
> (NB: \centerline has no its-own page on wiki, but it is used at several places in wiki samples.
> 
> \centerline was also mentioned here in the mailing list, when I was trying to center "tabulate" - and neither \midaligned nor \startalignment[middle] combined with \dontleavehmode worked.)

The three commands

  - \leftline,
  - \rightline and
  - \centerline

are copied from plain TeX and allow you to center short text which fits on a single line but it isn’t recommended to use them because ConTeXt has it’s own alternative for them. The replacement commands are

  - \leftaligned,
  - \rightaligned and
  - \midaligned.

Even though each command is only meant for short text you use the \\ command to put text into several lines, e.g.

  \starttext
  \midaligned{One\\Two\\Three}
  \stoptext

creates three lines for the input. In recent installations you can write

  \startlinealignment[left|middle|right]
  …
  \stopalignment

as a alternative to \leftaligned etc.

With the alignment environment you can change the alignment of the text for a certain region. Unlike the line alignment environment you can use text which covers more than a single line.

  \starttext
  \input knuth\par
  \startalignment[middle]
  \input knuth\par
  \stopalignment
  \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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2013-06-26 12:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-26 12:07 Procházka Lukáš Ing. - Pontex s. r. o.
2013-06-26 12:46 ` Wolfgang Schuster [this message]
2013-06-26 13:00   ` Procházka Lukáš Ing. - Pontex s. r. o.
2013-06-26 13:10     ` Wolfgang Schuster
2013-06-26 13:30       ` Procházka Lukáš Ing. - Pontex s. r. o.
2013-06-26 13:36         ` 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=C5EAC96E-E1AD-4235-A6F0-F49C393473AD@gmail.com \
    --to=schuster.wolfgang@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).