ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Sanjoy Mahajan <sanjoy@mrao.cam.ac.uk>
Subject: Re: Manual (English) Update soon?
Date: Sat, 30 Dec 2006 05:47:56 +0000	[thread overview]
Message-ID: <E1H0X4W-0000XV-00@skye.ra.phy.cam.ac.uk> (raw)
In-Reply-To: Your message of "Fri, 29 Dec 2006 11:14:52 EST." <9D262742-4464-4342-8EA8-EA01AAC9A344@mac.com>

> So, I've been contemplating whether I should move "up" the
> abstraction ladder to ConTeXt or "down" to plain TeX and really
> learn to build the world from boxes and glue. :-)

I wrote my dissertation using plain TeX plus eplain, and spent several
days learning about insertions so that I could float figures in the
margin.  It looked decent, but I got tired of maintaining and
improving the macro hackery, so I decided to leap over LaTeX to
ConTeXt.  I use LaTeX under duress (e.g. journal gives you a style
file).  But for any document where I decide the layout, I use ConTeXt,
and I'm very happy with the decision to leap.

Here is a hello-world template that I just wrote.  It contains many of
the ConTeXt commands that I use most frequently.  Maybe it should go
on the wiki?

-Sanjoy


% "Hello world!" document for the ConTeXt typesetting system
%
% === History ===
% 2006-12-29  Sanjoy Mahajan  <sanjoy@mit.edu>
%     * Created
% 
% This document is the public domain (no copyright).

\setupcolors[state=start]       % otherwise you get greyscale
\definecolor[headingcolor][r=1,b=0.4]

% for the document info/catalog (reported by 'pdfinfo', for example)
\setupinteraction[state=start,  % make hyperlinks active, etc.
  title={Hello world!},
  subtitle={A ConTeXt template},
  author={Sanjoy Mahajan},
  keyword={template}]

% useful urls
\useURL[author-email][mailto:a.u.thor@somewhere.edu][][a.u.thor@somewhere.edu]
\useURL[wiki][http://wiki.contextgarden.net][][\ConTeXt\ wiki]
\useURL[sanjoy][mailto:sanjoy@mit.edu][][sanjoy@mit.edu]

% for US paper; the sensible default is [A4][A4] (A4 typesetting,
% printed on A4 paper)
\setuppapersize[letter][letter]
\setuplayout[topspace=0.5in, backspace=1in, header=24pt, footer=36pt,
  height=middle, width=middle]
% uncomment the next line to see the layout
% \showframe

% headers and footers
\setupfooter[style=\it]
\setupfootertexts[\date\hfill \ConTeXt\ template]
\setuppagenumbering[location={header,right}, style=bold]

\setupbodyfont[11pt]            % default is 12pt

\setuphead[section,chapter,subject][color=headingcolor]
\setuphead[section,subject][style={\ss\bfa},
  before={\bigskip\bigskip}, after={}]
\setuphead[chapter][style={\ss\bfd}]
\setuphead[title][style={\ss\bfd},
  before={\begingroup\setupbodyfont[14.4pt]},
  after={\leftline{\ss\tfa A. U. Thor $\langle$\from[author-email]$\rangle$}
         \bigskip\bigskip\endgroup}]

\setupitemize[inbetween={}, style=bold]

% set inter-paragraph spacing
\setupwhitespace[medium]
% comment the next line to not indent paragraphs
\setupindenting[medium, yes]

\starttext

\title{Hello, world!}

Here is a hello-world template document to illustrates a few \ConTeXt\
features.  Have fun.  You can find a lot more information at
\from[wiki]; the preceding text should be colored and clickable, and
clicking it should take you to the wiki.

\subject{A list}

Here is an example of a list.

\startitemize[a]                % tags are lowercase letters
\item first
\item second
\item third
\stopitemize

\subject{Math}

An equation can be typeset inline like $e^{\pi i}+1=0$, or as a
displayed formula:
\startformula
\int_0^\infty t^4 e^{-t}\,dt = 24.
\stopformula
% don't use $$...$$ (the plain TeX equivalent)
You can also have numbered equations:
\placeformula[eq:factorial-example]\startformula
\int_0^\infty t^5 e^{-t}\,dt = 120.
\stopformula
And you can refer to them by name. I called the previous equation {\tt
factorial-example}, and it is equation \in[eq:factorial-example].
\ConTeXt\ figures out the number for you.  And with interaction turned
on, you can click on the equation number to get to the equation.

\subject{Text with figures}

Now text with a few figures.  The first figure goes on the right, with
the paragraph flowing around it.

\placefigure[right,none]{}{\externalfigure[dummy]}

\input tufte

The next figure will go inline, like a displayed formula:
\placefigure[here,none]{}{\externalfigure[dummy]}
\input tufte

Here's another reference to the numbered equation -- equation
\in[eq:factorial-example] on \at{page}[eq:factorial-example], so that
you can test clicking on it or on the page reference.

% most plain TeX commands work
\vfill

\noindent 
\framed[corner=round, width=\textwidth,height=1in,
backgroundcolor=gray,background=color]
{This document is in the public domain, so that you can improve it, share
it, and otherwise do what you want with it.  
Suggestions are welcome.  You can send them to me
at \from[sanjoy] (Sanjoy Mahajan).}

\stoptext

  parent reply	other threads:[~2006-12-30  5:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-28 21:10 Douglas Philips
2006-12-28 22:00 ` Aditya Mahajan
2006-12-29 16:14   ` Douglas Philips
2006-12-30  3:04     ` Mojca Miklavec
2006-12-30  9:28       ` Douglas Philips
2007-01-02 22:28         ` Henning Hraban Ramm
2006-12-30  5:47     ` Sanjoy Mahajan [this message]
2006-12-30  9:40       ` Douglas Philips
2006-12-30 11:43       ` Rolf Marvin Bøe Lindgren
2006-12-30 18:38         ` Sanjoy Mahajan
2006-12-30 19:45           ` Rolf Marvin Bøe Lindgren
2006-12-29  0:43 ` Mojca Miklavec
2006-12-29  1:58   ` John R. Culleton
2006-12-29  4:37     ` Idris Samawi Hamid
2006-12-29 16:35   ` Douglas Philips
2006-12-29 19:22     ` andrea valle
2006-12-30  9:20       ` Douglas Philips
2006-12-29 17:38   ` plink
2006-12-30  9:17     ` Douglas Philips
2007-01-01 22:32     ` Hans Hagen

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=E1H0X4W-0000XV-00@skye.ra.phy.cam.ac.uk \
    --to=sanjoy@mrao.cam.ac.uk \
    --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).