https://wiki.contextgarden.net/api.php?action=feedcontributions&user=68.40.50.205&feedformat=atomWiki - User contributions [en]2024-03-28T15:34:38ZUser contributionsMediaWiki 1.34.1https://wiki.contextgarden.net/index.php?title=Framed&diff=7142Framed2007-01-10T16:31:13Z<p>68.40.50.205: /* Rounded Corners */ Added example from core-rul</p>
<hr />
<div>< [[Visuals]] |<br />
<br />
<br />
{{todo|the page devoted to all kinds of framed stuff}}<br />
<br />
= How to achieve specific results =<br />
<br />
== Preventing hyphenation ==<br />
<br />
One can prevent hypenation inside a frame by passing <code>nothypenated</code> option to <code>align</code>. It is also a good idea to add <code>verytolerant</code> and <code>strectch</code> options.<br />
<br />
<context source="yes"><br />
\startcombination[2*1]<br />
{\framed<br />
[width=5cm,<br />
align={flushleft}]<br />
{\input ward \endgraf}}<br />
{flushleft}<br />
{\framed<br />
[width=5cm,<br />
align={flushleft,nothyphenated,verytolerant}] % maybe also stretch<br />
{\input ward \endgraf}}<br />
{flushleft,\crlf nothypenated, \crlf verytolerant}<br />
\stopcombination<br />
</context><br />
<br />
== Specify the width no longer than needed ==<br />
<br />
I want to specify the maximum width of a frame. If the size of the <br />
box is smaller than the maximum width, I want a tight box. This can be done using the <code>autowidth=force</code> option to framed.<br />
<br />
<context source="yes"><br />
\defineframed<br />
[tightframed][width=5cm,autowidth=force,align=middle]<br />
<br />
\tightframed{Small}<br />
<br />
\tightframed{A really really long line that is split at 5cm}<br />
<br />
</context><br />
<br />
== Rounded Coreners ==<br />
<br />
<cmd>framed</cmd> allows you to have round corners with <code>corner=round</code>. There are also other possibilities if you want round corners but not at all places by giving an appropriate number to <code>corner=...</code>. This example is taken from [[source:core-rul.tex | core-rul.tex]] and each frame is typeset using<br />
<br />
<texcode><br />
\framed[corener=....,frame=on]{...}<br />
</texcode><br />
<br />
<context><br />
\dontleavehmode\framed<br />
[corner=0,frame=on,<br />
]{\tttf corner=<br />
\twodigits\recurselevel}%<br />
\vskip1em<br />
\dontleavehmode\dostepwiserecurse {1} {4}{1}{\framed<br />
[corner=\recurselevel,frame=on]<br />
{\tttf corner=\twodigits\recurselevel}%<br />
\quad}<br />
\vskip1em<br />
\dontleavehmode\dostepwiserecurse {5} {8}{1}{\framed<br />
[corner=\recurselevel,frame=on]<br />
{\tttf corner=\twodigits\recurselevel}%<br />
\quad}<br />
\vskip1em<br />
\dontleavehmode\dostepwiserecurse {1} {4}{1}{\framed<br />
[corner=\recurselevel,frame=on]<br />
{\tttf corner=\twodigits\recurselevel}%<br />
\quad}<br />
\vskip1em<br />
\dontleavehmode\dostepwiserecurse {5} {8}{1}{\framed<br />
[corner=\recurselevel,frame=on]<br />
{\tttf corner=\twodigits\recurselevel}%<br />
\quad}<br />
\vskip1em<br />
\dontleavehmode\dostepwiserecurse {9}{12}{1}{\framed<br />
[corner=\recurselevel,frame=on]<br />
{\tttf corner=\twodigits\recurselevel}%<br />
\quad}<br />
\vskip1em<br />
\dontleavehmode\dostepwiserecurse{13}{16}{1}{\framed<br />
[corner=\recurselevel,frame=on]<br />
{\tttf corner=\twodigits\recurselevel}%<br />
\quad}<br />
\vskip1em<br />
\dontleavehmode\dostepwiserecurse{17}{20}{1}{\framed<br />
[corner=\recurselevel,frame=on]<br />
{\tttf corner=\twodigits\recurselevel}%<br />
\quad}<br />
\vskip1em<br />
\dontleavehmode\dostepwiserecurse{21}{24}{1}{\framed<br />
[corner=\recurselevel,frame=on]<br />
{\tttf corner=\twodigits\recurselevel}%<br />
\quad}<br />
\vskip1em<br />
\dontleavehmode\dostepwiserecurse{25}{28}{1}{\framed<br />
[corner=\recurselevel,frame=on]<br />
{\tttf corner=\twodigits\recurselevel}%<br />
\quad}<br />
<br />
</context><br />
<br />
<br />
<br />
= Similar topics =<br />
* [[Vertically Centered Boxes]]<br />
* [[Overlays]]<br />
* [[Tables Overview]]</div>68.40.50.205https://wiki.contextgarden.net/index.php?title=Floating_Objects&diff=6439Floating Objects2006-08-15T14:33:39Z<p>68.40.50.205: /* Examples */ fixed typos</p>
<hr />
<div>< [[Visuals]] | [[Graphics]] | [[Using Graphics]] ><br />
<br />
Floats are elements like tables or figures that are placed (and numbered) automatically by TeX. They are so called as they can ''float'' around the output pages to a place where TeX thinks they are appropriate (You can influence what TeX thinks as appropriate).<br />
<br />
Floats are ConTeXt's "base class" for everything that uses a <tt>\place...</tt> command (table, figure, own floats).<br />
<br />
If you search options of e.g. <cmd>placeexternalfigure</cmd> you must look after <cmd>placefloat</cmd> in the manual! (same for <tt>\setup...</tt> etc.)<br />
<br />
The float types "graphic", "figure", "table" and "intermezzo" are readily defined. If you need more (i.e. if you need another numbering or table of something), you can easily define your own floats with <cmd>definefloat</cmd>.<br />
<br />
<texcode><br />
\placefloat[place][reference]{caption}{some float}<br />
</texcode><br />
<br />
'''place''' is one or several (comma separated) of:<br />
<table><br />
<tr bgcolor="#AAAAAA"><th>preference</th><th align="left">result</th></tr><br />
<tr bgcolor="#DDDDDD"><td>left</td><td>left of text</td></tr><br />
<tr><td>right</td><td>right of text</td></tr><br />
<tr bgcolor="#DDDDDD"><td>here</td><td>preferably here</td></tr><br />
<tr><td>top</td><td>at top of page</td></tr><br />
<tr bgcolor="#DDDDDD"><td>bottom</td><td>at bottom of page</td></tr><br />
<tr><td>inleft</td><td>in left margin</td></tr><br />
<tr bgcolor="#DDDDDD"><td>inright</td><td>in right margin</td></tr><br />
<tr><td>inmargin</td><td>in the margin (left or right)</td></tr><br />
<tr bgcolor="#DDDDDD"><td>margin</td><td>in the margin (margin float)</td></tr><br />
<tr><td>page</td><td>on a new (empty) page</td></tr><br />
<tr bgcolor="#DDDDDD"><td>opposite</td><td>on the left page</td></tr><br />
<tr><td>always</td><td>precedence over stored floats</td></tr><br />
<tr bgcolor="#DDDDDD"><td>force</td><td>per se here</td></tr><br />
</table><br />
(table copied from the manual)<br />
<br />
<cmd>placefigure</cmd> and <cmd>placetable</cmd> also accept the same set of options, and allow to create floating figures and captions respectively.<br />
<br />
'''reference'''<br />
<br />
If you don't need to refer to your float, you can leave this parameter out.<br />
<br />
== Examples ==<br />
I will explain the examples in terms of <cmd>placefigure</cmd> but the same set of options are also valid for other floats.<br />
<br />
* If you do not want a caption<br />
<texcode><br />
\placefigure {none} {\externalfigure[figurename]}<br />
</texcode><br />
<br />
or<br />
<br />
<texcode><br />
\placefigure[none] {} {\externalfigure[figurename]}<br />
</texcode><br />
<br />
<br />
* If you do not want the figure to be numbered (but still want the caption)<br />
<br />
<texcode><br />
\placefigure [nonumber] {caption} {\externalfigure[figurename]}<br />
</texcode><br />
<br />
* Suppose you want the figure to be placed on the right side of the page, a few lines into the paragraph, and want the rest of the paragraph to warp around the figure<br />
<br />
<texcode><br />
\placefigure [right,2*line] {caption} {\externalfigure[figurename]}<br />
</texcode><br />
<br />
or <br />
<br />
<texcode><br />
\placefigure [right,2*hang] {caption} {\externalfigure[figurename]}<br />
</texcode><br />
<br />
This does not want correctly at a page boundary. The <tt>line</tt> options leaves the space above the figures empty, while the <tt>hang</tt> option also wraps texts above the figure.</div>68.40.50.205https://wiki.contextgarden.net/index.php?title=Titles&diff=5871Titles2006-06-25T18:15:33Z<p>68.40.50.205: /* Independent Section Numbering */ Hans soln on the ML</p>
<hr />
<div>< [[Structurals]] | [[Visuals]] ><br />
<br />
==Default==<br />
<br />
Titles define the structure of your document. Decide yourself, how deep you want to nest them:<br />
<br />
<table><br />
<tr bgcolor="#CCCCCC"><th>numbered</th><th>unnumbered</th></tr><br />
<tr><td><cmd>part</cmd></td><td>&#151;</td></tr><br />
<tr><td><cmd>chapter</cmd></td><td><cmd>title</cmd></td></tr><br />
<tr><td><cmd>section</cmd></td><td><cmd>subject</cmd></td></tr><br />
<tr><td><cmd>subsection</cmd></td><td><cmd>subsubject</cmd></td></tr><br />
<tr><td><cmd>subsubsection</cmd></td><td><cmd>subsubsubject</cmd></td></tr><br />
<tr><td>...</td><td>...</td></tr><br />
</table><br />
<br />
The "unnumbered" versions don't appear in a table of contents! But you can switch off the numbering of the "numbered" versions with <cmd>setuphead</cmd> to get unnumbered titles ''and'' a toc (confusing?).<br />
<br />
===Referencing Titles===<br />
<br />
Every heading command can take an optional parameter as reference:<br />
<texcode><br />
\title[hasselt-by-night]{Hasselt by night}<br />
</texcode><br />
<br />
The bracket pair is optional and used for internal [[References]]. If you want to refer to this<br />
header you type for example<br />
<texcode><br />
\at{page}[hasselt-by-night].<br />
</texcode><br />
(see <cmd>at</cmd>)<br />
<br />
==Titling Style==<br />
<br />
see <cmd>setuphead</cmd> and some enhanced samples below.<br />
<br />
A FAQ is how to get a line under the title:<br />
<texcode><br />
\setupbackgrounds[header][text][bottomframe=on]<br />
</texcode><br />
<br />
To make the section numbers appear as characters, do<br />
<texcode><br />
\setupsection[section-3][bodypartconverion=Character]<br />
</texcode><br />
The <code>section-3</code> corresponds to <code>section</code>. Similarly,<br />
<code>section-1</code> corresponds to <code>part</code>, <code>section-2</code> corresponds to <code>chapter</code> and so on.<br />
<br />
===Using colors in chapters and sections===<br />
<br />
If you want you may have colors on your document's chapters or sections.<br />
To do that you should use <code>\setuphead</code>.<br />
Take a look at the following example:<br />
<br />
<texcode><br />
\setupcolors[state=start] % Important. You won't have colors without it.<br />
<br />
\setuphead[chapter][header=empty] % Chapter pages won't have headers<br />
<br />
\setupheadertexts[][chapter] % The header will be the chapter's name<br />
<br />
\starttext<br />
<br />
\completecontent<br />
<br />
\chapter{Black chapter 1}<br />
<br />
\setuphead[section][color=darkcyan] % This is how you change your chapter's color.<br />
<br />
\section{Dark cyan section 1.1}<br />
<br />
\page<br />
Test.<br />
<br />
\setuphead[chapter][color=darkgreen]<br />
<br />
\chapter{Dark green chapter}<br />
<br />
\page<br />
Test.<br />
<br />
\setuphead[chapter][color=red]<br />
<br />
\chapter{Red chapter}<br />
<br />
\page<br />
Test.<br />
<br />
\stoptext <br />
<br />
</texcode><br />
<br />
==Your Own Titling Levels==<br />
<br />
Of course you can define your own titling commands and probably must adapt the default settings.<br />
<br />
<texcode><br />
\definehead[myheader][section]<br />
<br />
\setuphead[myheader]<br />
[numberstyle=bold,<br />
textstyle=cap,<br />
before=\hairline\blank,<br />
after=\nowhitespace\hairline]<br />
<br />
\myheader[hasselt-ref]{Hasselt makes headlines}<br />
</texcode><br />
<br />
A new header <cmd>myheader</cmd> is defined and it inherits the properties of <cmd>section</cmd> (title, subject, whatever).<br />
You can "define" several headers at once!<br />
<br />
==Formatting Titles with <cmd>setuphead</cmd>==<br />
<br />
<cmd>setuphead</cmd> accepts a number of parameters which change the style of the heading. At least the following commands are available:<br />
<br />
<table><br />
<tr bgcolor="#CCCCCC"><th>text</th><th>number</th></tr><br />
<tr><td><tt>textstyle</tt></td><td><tt>numberstyle</tt></td></tr><br />
<tr><td><tt>textcommand</tt></td><td><tt>numbercommand</tt></td></tr><br />
<tr><td><tt>deeptextcommand</tt></td><td><tt>deepnumbercommand</tt></td></tr><br />
</table><br />
<br />
Quite obviously, the number-commands work on the chapter/section/etc. number, their text counterparts change the text itself. However, there are differences between <tt>style</tt>, <tt>command</tt> and <tt>deepcommand</tt>.<br />
<br />
The <tt>style</tt> variants accept a style (<tt>bold</tt>, <tt>cap</tt>, etc.) or a font switch (<cmd>em</cmd>, <cmd>tfx</cmd>, etc). <tt>texstyle</tt> prepends the text with the associated style. <tt>textcommand</tt> is a command name which is given the text (with all markup) as a parameter. <tt>deeptextcommand</tt> is similar to <tt>textcommand</tt> but it acts only on the text (not on the markup).<br />
<br />
So, if we have <cmd>title{A story}</cmd>, the different parameters have the following results:<br />
<br />
<table><br />
<tr><td><tt>textstyle=\em</tt></td><td><tt>=></tt></td><td><tt>\em A story</tt></td></tr><br />
<tr><td><tt>textstyle=\em, textcommand=\uppercase</tt></td><td><tt>=></tt></td><td><tt>\uppercase{\em A story}</tt></td><td><tt>=></tt></td><td><tt>\em A STORY</tt></td></tr><br />
<tr><td><tt>textstyle=\em, deeptextcommand=\uppercase</tt></td><td><tt>=></tt></td><td><tt>\em\uppercase{A story}</tt></td><td><tt>=></tt></td><td><tt>\em A STORY</tt></td></tr><br />
</table><br />
<br />
What is the difference between <tt>textcommand</tt> and <tt>deeptextcommand</tt>, then? With this example there is very little difference, as <tt>uppercase</tt> knows how to handle markup. Sometimes this is not the case. For example, an almost similar command <tt>WORD</tt> is not compatible with <tt>textcommand</tt>, because it wreaks havoc with markup:<br />
<br />
<table><br />
<tr><td><tt>textstyle=\em, textcommand=\WORD</tt></td><td><tt>=></tt></td><td><tt>\WORD{\em A story}</tt></td><td><tt>=></tt></td><td><tt>\EM A STORY</tt></td></tr><br />
<tr><td><tt>textstyle=\em, deeptextcommand=\WORD</tt></td><td><tt>=></tt></td><td><tt>\em\WORD{A story}</tt></td><td><tt>=></tt></td><td><tt>\em A STORY</tt></td></tr><br />
</table><br />
<br />
In this case using <tt>deeptextcommand</tt> is the correct solution for capitalizing headers. (Using <cmd>uppercase</cmd> works in this specific case, but only if you stick to Latin 1 or Anglo-Saxon characters. Other languages will suffer from lowercase accented characters, like CAFé.)<br />
<br />
=== Truely empty pagebreak before chapters ===<br />
Using <cmd>\setuppagenumbering[alternative=doublesided]</cmd> makes the chapters start on the right page. However, the blank page is not truely empty, it contains headers and footers. To get truely empty pages, use the following<br />
<br />
<texcode><br />
\definepagebreak<br />
[mychapterpagebreak]<br />
[yes,header,right]<br />
% [yes,header,left]<br />
% [yes,header,footer,right]<br />
<br />
\setuphead<br />
[chapter]<br />
[page=mychapterpagebreak]<br />
% [page=Mychapterpagebreak,header=empty,footer=empty]<br />
<br />
\setuppagenumbering[alternative=doublesided,location={header,margin}]<br />
\setupheadertexts[{My special headertext}]<br />
\setupfootertexts[This is a text in the footer]<br />
% \setupbackgrounds[header][text][bottomframe=on]<br />
<br />
\starttext<br />
\chapter {testA} \dorecurse{10}{\input tufte }<br />
\chapter {testB} \dorecurse{10}{\input tufte }<br />
\chapter {testC} \dorecurse{10}{\input tufte }<br />
\stoptext<br />
</texcode><br />
<br />
Explaination (provided by Willi Egger on the mailing list)<br />
<br />
* You define a new pagebreak rule. It has the name <code>mychapterpagebreak</code>. The options set read as: <code>pagebreak=yes</code>, placeheader, use a right page.<br />
* You set options for the header of type chapter and use for the option page the before defined new pagebreak.<br />
* You might want to experiment with the commented lines ans see what happens.<br />
<br />
== Independent Section Numbering ==<br />
If you want section numbering to be independent of chapter numbering, use<br />
<br />
<texcode><br />
\setuphead [chapter][resetnumber=no]<br />
\setupsection[section][previousnumber=no]<br />
</texcode><br />
<br />
<br />
==Table(s) of Contents==<br />
<br />
Default:<br />
<texcode><br />
\completecontent % with title<br />
\placecontent % without title<br />
</texcode><br />
<br />
Define your own "table of somewhat" with <cmd>definelist</cmd> and <cmd>setuplist</cmd>!<br />
You can "collect" several section levels in one list using <cmd>definecombinedlist</cmd>, that's even explained in "ConTeXt, an excursion" (see [[Official_ConTeXt_Documentation]]).<br />
<br />
To have some parts of your title texts ''not'' appear in the table of contents, use <cmd>nolist</cmd> and have a look at http://www.pragma-ade.com/general/magazines/mag-0001.pdf.<br />
<br />
===Page Numbering in Tables of Contents===<br />
<br />
If you have a special page numbering style it won't automatically be reflected in the table of contents. You need to set the parameters of the table of contents separately. For example, <br />
<br />
<texcode><br />
\starttext<br />
\startfrontmatter<br />
\placecombinedlist[MyContentsList]<br />
\stopfrontmatter<br />
\startbodymatter<br />
\setuppagenumbering[way=bychapter, left=A, chapternumber=yes, numberseparator=/]<br />
...<br />
\stopbodymatter<br />
</texcode><br />
<br />
will give you pagenumbering such as A1/1, A1/2 etc. on the pages in the bodymatter. In the table of contents, however, these will show up as 1-1, 1-2 etc. The ToC needs to be formatted separately. <br />
<br />
To get a prefix to the page numbering (like "A"), use<br />
<br />
<texcode><br />
\def\ChapterPrefix#1{A#1}<br />
\setuplist[chapter][pagecommand=\ChapterPrefix]<br />
</texcode><br />
<br />
To get the numberseparator working, you need to know that the ToC will use the separator that is active ''at the time the ToC is output''. So you need to set it immediately before you call the ToC command, e.g.<br />
<br />
<texcode><br />
\setuppagenumbering[numberseparator=/]<br />
\placecombinedlist[MyContentsList]<br />
</texcode><br />
<br />
==Your Own Title Styles==<br />
<br />
Sometimes the possibilities of <cmd>setuphead</cmd> aren't enough. You can define your own styling commands, as shown in the following examples.<br />
<br />
===Expanded chapter titles===<br />
This example illustrates expanded chapter titles.<br />
<br />
<texcode><br />
\def\MyChapterCommand#1#2{\framed[frame=off, bottomframe=on, topframe=on]{\vbox{\headtext{chapter} #1\blank#2}}}<br />
% #1 is number, #2 is text<br />
% \vbox is needed for \blank to work<br />
<br />
\setuphead[chapter][command=\MyChapterCommand, style={\ss\bfa}]<br />
<br />
\setupheadtext[chapter=Chapter] % used by \headtext<br />
</texcode><br />
so <tt>\chapter{My First Chapter}</tt> looks like:<br />
<context><br />
\def\MyChapterCommand#1#2{\framed[frame=off, bottomframe=on, topframe=on]{\vbox{\headtext{chapter} #1\blank#2}}}<br />
\setuphead[chapter][command=\MyChapterCommand, style={\ss\bfa}]<br />
\setupheadtext[chapter=Chapter]<br />
<br />
\chapter{My First Chapter}<br />
</context><br />
<br />
===Exercise numbers===<br />
<br />
For a textbook, suppose that you collect the exercises in a section at the end of each chapter, with each exercise a subsection having a short title, and the exercises should be numbered only by the subsection (not 1.6.7 for example, just 7). The usage:<br />
<br />
<texcode><br />
\section{Exercises}<br />
<br />
\exercise{Batteries}<br />
What is the cost of energy from a 9V battery? From a wall socket (the<br />
mains)?<br />
</texcode><br />
<br />
The setup code:<br />
<texcode><br />
\definehead[exercise][subsection]<br />
\setuphead[exercise][style=italic, <br />
numbercommand={\determineheadnumber[subsection]\currentheadnumber<br />
\gobbleoneargument}]<br />
</texcode><br />
<br />
===A complex graphical element under the chapter title===<br />
<br />
<texcode><br />
\setupcolors[state=start]<br />
\startuseMPgraphic{HeaderDeco}<br />
numeric w, h, repeats;<br />
path p[];<br />
w := OverlayWidth ; h := OverlayHeight ;<br />
repeats := abs(TextWidth/BodyFontSize);<br />
p[1] := unitsquare xscaled w yscaled h ;<br />
draw p[1] withcolor white;<br />
p[2] := fullcircle scaled BodyFontSize;<br />
p[3] := fullcircle scaled .25BodyFontSize;<br />
draw p[2] shifted (.5BodyFontSize,0);<br />
for i = 1 upto repeats:<br />
if odd i :<br />
filldraw p[3] shifted (i*BodyFontSize+.5BodyFontSize,0);<br />
else :<br />
draw p[2] shifted (i*BodyFontSize+.5BodyFontSize,0);<br />
fi;<br />
endfor;<br />
\stopuseMPgraphic<br />
<br />
\setuphead[chapter][command=\Myheader]<br />
\setupheadtext<br />
[chapter=Chapitre]<br />
\defineoverlay[HeaderDeco][\uniqueMPgraphic{HeaderDeco}]<br />
<br />
\def\Myheader#1#2{%<br />
\framedtext<br />
[width= \overlaywidth,<br />
height=6\bodyfontsize,<br />
background={foreground,HeaderDeco},<br />
offset=0pt,<br />
strut=no,<br />
frame=off,<br />
align=middle]{%<br />
\headtext{chapter} #1<br />
\blank[small]<br />
#2}}<br />
<br />
\starttext<br />
\chapter{Here we go!}<br />
\stoptext<br />
</texcode><br />
<br />
It looks like:<br />
<br />
<context><br />
\setupcolors[state=start]<br />
\startuseMPgraphic{HeaderDeco}<br />
numeric w, h, repeats;<br />
path p[];<br />
w := OverlayWidth ; h := OverlayHeight ;<br />
repeats := abs(TextWidth/BodyFontSize);<br />
p[1] := unitsquare xscaled w yscaled h ;<br />
draw p[1] withcolor white;<br />
p[2] := fullcircle scaled BodyFontSize;<br />
p[3] := fullcircle scaled .25BodyFontSize;<br />
draw p[2] shifted (.5BodyFontSize,0);<br />
for i = 1 upto repeats:<br />
if odd i :<br />
filldraw p[3] shifted (i*BodyFontSize+.5BodyFontSize,0);<br />
else :<br />
draw p[2] shifted (i*BodyFontSize+.5BodyFontSize,0);<br />
fi;<br />
endfor;<br />
\stopuseMPgraphic<br />
<br />
\setuphead[chapter][command=\Myheader]<br />
\setupheadtext<br />
[chapter=Chapitre]<br />
\defineoverlay[HeaderDeco][\uniqueMPgraphic{HeaderDeco}]<br />
<br />
\def\Myheader#1#2{%<br />
\framedtext<br />
[width= \overlaywidth,<br />
height=6\bodyfontsize,<br />
background={foreground,HeaderDeco},<br />
offset=0pt,<br />
strut=no,<br />
frame=off,<br />
align=middle]{%<br />
\headtext{chapter} #1<br />
\blank[small]<br />
#2}}<br />
<br />
\starttext<br />
\chapter{Here we go!}<br />
\stoptext<br />
</context></div>68.40.50.205https://wiki.contextgarden.net/index.php?title=Math&diff=5540Math2006-04-16T01:21:39Z<p>68.40.50.205: /* Numbering Formulae */ reduced formula width</p>
<hr />
<div>< [[Main Page]] | [[Math with newmat]] | [[MathML]] | [[Math_structures]]><br />
<br />
== Introduction ==<br />
<br />
TeX was designed for ease of typesetting books that contained mathematics. As ConTeXt is built on top of TeX, it inherits all those features. In addition to these, ConTeXt adds lot of macros to make the typesetting of mathematics easier.<br />
<br />
For typesetting of mathematics follows different rules than that of normal text, TeX uses something called "math mode" where some characters get a different meaning to enable a simple syntax for complicated formulas.<br />
<br />
==Simple Math==<br />
<br />
Typesetting mathematics can be divided into two parts, '''inline''' math (mathematical formulas set within ordinary paragraphs as part of the text) and '''display''' math mathematics set on lines by themselves, often with equation numbers). Inline math consists of maths that is typed in a sentence. For example<br />
<br />
<context><br />
\setuplayout[scale=0.8,width=13cm]<br />
Pythagoras formula, stating \mathematics{a^2 + b^2 = c^2} was one of the first trignometric results<br />
</context><br />
<br />
There are two ways of typing inline math. The TeX way is to surround what you want to type within <code>$</code>...<code>$</code>. Thus, the above will be typed as<br />
<texcode><br />
Pythagoras formula, stating $a^2 + b^2 = c^2$ was one of the first trignometric results<br />
</texcode><br />
<br />
ConTeXt also provides an alternative way of typing the same result. Instead of dollars, you can write the material for maths inside <cmd>mathematics</cmd>. Thus, an alternate way to type the above is,<br />
<texcode><br />
Pythagoras formula, stating \mathematics{a^2 + b^2 = c^2} was one of the first trignometric results<br />
</texcode><br />
<br />
Choose the method that suits your style.<br />
((I do not know if there are pros and cons of $..$ vs \mathematics{}. If someone knows, then please elaborate -- aditya ))<br />
<br />
Display math is enclosed in a <cmd>startformula</cmd> / <cmd>stopformula</cmd> pair. Thus <br />
<br />
<table width="100%" cols="2"><tr valign="top"><td width="50%"><br />
<texcode><br />
The famous result (once more) is given by<br />
\startformula<br />
c^2 = a^2 + b^2.<br />
\stopformula<br />
</texcode><br />
</td><td><br />
This, when typeset, produces the following:<br />
<br />
<context><br />
\setuplayout[scale=0.8,width=13cm]<br />
The famous result (once more) is given by<br />
\startformula<br />
c^2 = a^2 + b^2.<br />
\stopformula<br />
</context><br />
</td></tr></table><br />
<br />
== Numbering Formulae ==<br />
<br />
ConTeXt provides an easy way to number the display maths equations. Simply, put <cmd>placeformula</cmd> before <cmd>startformula</cmd> / <cmd>stopformula</cmd> pair and you will get numbered equations. Thus,<br />
<table width="100%" cols="2"><tr valign="top"><td width="50%"><br />
<texcode><br />
The famous result (once more) is given by<br />
\placeformula<br />
\startformula<br />
c^2 = a^2 + b^2.<br />
\stopformula<br />
</texcode><br />
</td><td><br />
This, when typeset, produces the following:<br />
<br />
<context><br />
\setuplayout[scale=0.8,width=8cm]<br />
The famous result (once more) is given by<br />
\placeformula<br />
\startformula<br />
c^2 = a^2 + b^2.<br />
\stopformula<br />
</context><br />
</td></tr></table><br />
<br />
The <cmd>placeformula</cmd> command is optional, and produces the equation number; leaving it off produces an unnumbered equation.<br />
<br />
== Not so Simple Maths ==<br />
<br />
ConTeXt's base mathematics support is built on the mathematics support in plain TeX, thus allowing quite complicated formulas. (There are also some additional macros, such as the <cmd>text</cmd> command for text-mode notes within math.) For instance:<br />
<texcode><br />
A more complicated equation:<br />
\placeformula<br />
\startformula<br />
{{\theta_{\text{\CONTEXT}}}^2 \over x+2}<br />
= \pmatrix{a_{11}&a_{12}&\ldots&a_{1n}\cr<br />
a_{21}&a_{22}&\ldots&a_{2n}\cr<br />
\vdots&\vdots&\ddots&\vdots\cr<br />
a_{n1}&a_{n2}&\ldots&a_{nn}\cr}<br />
\pmatrix{b_1 \cr b_2 \cr \vdots \cr b_n}<br />
+ \sum_{j=1}^\infty z^j<br />
\left( \sum_{\scriptstyle n=1 \atop \scriptstyle n \ne j}^\infty Z_j^n \right)<br />
\stopformula<br />
</texcode><br />
<br />
which produces<br />
<br />
<context><br />
\setuplayout[scale=0.8,width=13cm]<br />
A more complicated equation:<br />
\placeformula<br />
\startformula<br />
{{\theta_{\text{\CONTEXT}}}^2 \over x+2}<br />
= \pmatrix{a_{11}&a_{12}&\ldots&a_{1n}\cr<br />
a_{21}&a_{22}&\ldots&a_{2n}\cr<br />
\vdots&\vdots&\ddots&\vdots\cr<br />
a_{n1}&a_{n2}&\ldots&a_{nn}\cr}<br />
\pmatrix{b_1 \cr b_2 \cr \vdots \cr b_n}<br />
+ \sum_{j=1}^\infty z^j<br />
\left( \sum_{\scriptstyle n=1 \atop \scriptstyle n \ne j}^\infty Z_j^n \right)<br />
\stopformula<br />
</context><br />
<br />
Context provides a wrapper around tex <cmd>pmatrix</cmd>. The above can be typeset in a contextish way as<br />
<texcode><br />
A more complicated equation:<br />
\definemathmatrix[pmatrix][left={\left(\,},right={\,\right)}]<br />
\placeformula<br />
\startformula<br />
{{\theta_{\text{\CONTEXT}}}^2 \over x+2}<br />
= \startpmatrix<br />
\NC a_{11} \NC a_{12} \NC \ldots \NC a_{1n} \NR<br />
\NC a_{21} \NC a_{22} \NC \ldots \NC a_{2n} \NR<br />
\NC \vdots \NC \vdots \NC \ddots \NC \vdots \NR<br />
\NC a_{n1} \NC a_{n2} \NC \ldots \NC a_{nn} \NR<br />
\stoppmatrix<br />
\startpmatrix b_1 \NR b_2 \NR \vdots \NR b_n \NR \stoppmatrix<br />
+ \sum_{j=1}^\infty z^j<br />
\left( \sum_{\scriptstyle n = 1 \atop \scriptstyle n \ne j}^\infty Z_j^n \right)<br />
\stopformula<br />
</texcode><br />
<context><br />
\setuplayout[scale=0.8,width=13cm]<br />
A more complicated equation:<br />
\definemathmatrix[pmatrix][left={\left(\,},right={\,\right)}]<br />
\placeformula<br />
\startformula<br />
{{\theta_{\text{\CONTEXT}}}^2 \over x+2}<br />
= \startpmatrix<br />
\NC a_{11} \NC a_{12} \NC \ldots \NC a_{1n} \NR<br />
\NC a_{21} \NC a_{22} \NC \ldots \NC a_{2n} \NR<br />
\NC \vdots \NC \vdots \NC \ddots \NC \vdots \NR<br />
\NC a_{n1} \NC a_{n2} \NC \ldots \NC a_{nn} \NR<br />
\stoppmatrix<br />
\startpmatrix b_1 \NR b_2 \NR \vdots \NR b_n \NR \stoppmatrix<br />
+ \sum_{j=1}^\infty z^j<br />
\left( \sum_{\scriptstyle n = 1 \atop \scriptstyle n \ne j}^\infty Z_j^n \right)<br />
\stopformula<br />
</context><br />
<br />
[http://www.pragma-ade.com/texmath.html Here] you can try it "live" (you must go to [http://www.pragma-ade.com/exalogin login] first).<br />
<br />
[[MathAlignment]] is covered on a separate page.<br />
<br />
==Sub-Formula Numbering==<br />
<br />
As mentioned above, formulas can be numbered using the <cmd>placeformula</cmd> command. This (and the related <cmd>placesubformula</cmd> command have an optional argument which can be used to produce sub-formula numbering. For example:<br />
<br />
<table width="100%" cols="2"><tr valign="top"><td width="50%"><br />
<texcode><br />
Examples:<br />
\placeformula{a}<br />
\startformula<br />
c^2 = a^2 + b^2<br />
\stopformula<br />
<br />
\placesubformula{b}<br />
\startformula<br />
c^2 = a^2 + b^2<br />
\stopformula<br />
</texcode><br />
</td><td><br />
<context><br />
\setuplayout[scale=0.8,width=8cm]<br />
Examples:<br />
\placeformula{a}<br />
\startformula<br />
c^2 = a^2 + b^2<br />
\stopformula<br />
<br />
\placesubformula{b}<br />
\startformula<br />
c^2 = a^2 + b^2<br />
\stopformula<br />
</context><br />
</td></tr></table><br />
<br />
What's going on here is simpler than it might appear at first glance. Both <cmd>placeformula</cmd> and <cmd>placesubformula</cmd> produce equation numbers with the optional tag added at the end; the sole difference is that the former increments the equation number first, while the latter does not (and thus can be used for the second and subsequent formulas that use the same formula number but presumably have different tags).<br />
<br />
This is sufficient for cases where the standard ConTeXt equation numbers suffice, and where only one equation number is needed per formula. However, there are many cases where this is insufficient, and <cmd>placeformula</cmd> defines <cmd>formulanumber</cmd> and <cmd>subformulanumber</cmd> commands, which provide hooks to allow the use of ConTeXt-managed formula numbers with plain TeX equation numbering. These, when used within a formula, simply return the formula number in properly formatted form, as can be seen in this simple example with plain TeX's <cmd>eqno</cmd>. Note that the optional tag is inherited from <cmd>placeformula</cmd>.<br />
<br />
<table width="100%" cols="2"><tr valign="top"><td width="50%"><br />
<texcode><br />
More examples:<br />
\placeformula{c}<br />
\startformula<br />
\let\doplaceformulanumber\empty<br />
c^2 = a^2 + b^2 \eqno{\formulanumber}<br />
\stopformula<br />
</texcode><br />
</td><td><br />
<context><br />
\setuplayout[scale=0.8,width=8cm]<br />
More examples:<br />
\placeformula{c}<br />
\startformula<br />
\let\doplaceformulanumber\empty<br />
c^2 = a^2 + b^2 \eqno{\formulanumber}<br />
\stopformula<br />
</context><br />
</td></tr></table><br />
<br />
In order for this to work properly, we need to turn off ConTeXt's automatic formula number placement; thus the <cmd>let</cmd> command to empty <cmd>doplaceformulanumber</cmd>, which must be placed <em>after</em> the start of the formula. In many practical examples, however, this is not necessary; ConTeXt redefines <cmd>displaylines</cmd> and <cmd>eqalignno</cmd> to do this automatically.<br />
<br />
For more control over sub-formula numbering, <cmd>formulanumber</cmd> and <cmd>subformulanumber</cmd> have an optional argument parallel to that of <cmd>placeformula</cmd>, as demonstrated in this use of plain TeX's <cmd>eqalignno</cmd>, which places multiple equation numbers within one formula.<br />
<br />
<table width="100%" cols="2"><tr valign="top"><td width="50%"><br />
<texcode><br />
Yet more examples:<br />
\placeformula<br />
\startformula<br />
\eqalignno{c^2 &= a^2 + b^2 &\formulanumber{a} \cr<br />
a^2 + b^2 &= c^2 &\subformulanumber{b} \cr<br />
d^2 &= e^2 &\formulanumber\cr}<br />
\stopformula<br />
</texcode><br />
</td><td><br />
<context><br />
\setuplayout[scale=0.8,width=8cm]<br />
Yet more examples:<br />
\placeformula<br />
\startformula<br />
\eqalignno{c^2 &= a^2 + b^2 &\formulanumber{a} \cr<br />
a^2 + b^2 &= c^2 &\subformulanumber{b} \cr<br />
d^2 &= e^2 &\formulanumber\cr}<br />
\stopformula<br />
</context><br />
</td></tr></table><br />
<br />
Note that both <cmd>formulanumber</cmd> and <cmd>subformulanumber</cmd> can be used within the same formula, and the formula number is incremented as expected. Also, if an optional argument is specified in both <cmd>placefigure</cmd> and <cmd>formulanumber</cmd>, the latter takes precedence.<br />
<br />
<table width="100%" cols="2"><tr valign="top"><td width="50%"><br />
<texcode><br />
More examples for left-located equation number:<br />
\setupformulas[location=left]<br />
\placeformula{d}<br />
\startformula<br />
\let\doplaceformulanumber\empty<br />
c^2 = a^2 + b^2 \leqno{\formulanumber}<br />
\stopformula<br />
and<br />
\placeformula<br />
\startformula<br />
\leqalignno{c^2 &= a^2 + b^2 &\formulanumber{a} \cr<br />
a^2 + b^2 &= c^2 &\subformulanumber{b} \cr<br />
d^2 &= e^2 &\formulanumber\cr}<br />
\stopformula<br />
</texcode><br />
</td><td><br />
<context><br />
\setuplayout[scale=0.8,width=8cm]<br />
More examples for left-located equation no.:<br />
\setupformulas[location=left]<br />
\placeformula{d}<br />
\startformula<br />
\let\doplaceformulanumber\empty<br />
c^2 = a^2 + b^2 \leqno{\formulanumber}<br />
\stopformula<br />
and<br />
\placeformula<br />
\startformula<br />
\leqalignno{c^2 &= a^2 + b^2 &\formulanumber{a} \cr<br />
a^2 + b^2 &= c^2 &\subformulanumber{b} \cr<br />
d^2 &= e^2 &\formulanumber\cr}<br />
\stopformula<br />
</context><br />
</td></tr></table><br />
<br />
-- 23:46, 15 Aug 2005 (CEST) Prinse Wang<br />
<br />
== Other Methods ==<br />
* There are two different math modules on [http://dante.ctan.org/tex-archive/macros/context/contrib/maths/ CTAN], [[Math with nath|nath]] and [[Math with amsl|amsl]]. And there's a [[Math with newmat|new math]] module in the distribution.<br />
* Context now has inbuilt support for [[Math_structures]]<br />
* It is also possible to use most [[LaTeX Math in ConTeXt|LaTeX equations in ConTeXt]] with a relatively small set of supporting definitions.<br />
* The "native" ConTeXt way of math is [[MathML]], an application of [[XML]] - rather verbose but mighty.<br />
<br />
==Number Formatting==<br />
There's a special command, <cmd>digits</cmd>, and a own manual about formatting numbers, see [http://www.pragma-ade.com/general/magazines/mag-0003.pdf Pasting digits together]<br />
<br />
==Math [[Fonts]]==<br />
* [[Bold Math]]<br />
* [http://homepage.mac.com/atl/tex/EulerContext.pdf Euler in ConTeXt (using Euler math font)] by Adam Lindsay<br />
<br />
==Science==<br />
* Esp. for physics there’s the [[units]] module.<br />
* Additions to [[MathML]] are PhysML and ChemML.<br />
* [[Chemistry]]<br />
* There's a module for chemical structure formulae: [[Chemistry|PPCHTeX]] (works also with LaTeX).<br />
<br />
[[Category:Math]]</div>68.40.50.205https://wiki.contextgarden.net/index.php?title=Article_Abstracts&diff=5044Article Abstracts2006-02-05T01:00:55Z<p>68.40.50.205: /* ConTeXt: A simple solution */</p>
<hr />
<div>< [[From LaTeX to ConTeXt]] | [[Document Titles]] ><br />
<br />
== LaTeX ==<br />
<br />
Much as with [[Document Titles]], the standard LaTeX article and report classes define an <code>abstract</code> environment to typeset an abstract in a way that distinguishes it from the rest of the text. In a single-column article, it is set somewhat narrower than the main text, with the word "Abstract" centered above it.<br />
<br />
<texcode><br />
\documentclass{article}<br />
\begin{document}<br />
\begin{abstract}<br />
This is the abstract of the paper.<br />
\end{abstract}<br />
\end{document}<br />
</texcode><br />
<br />
== ConTeXt: A simple solution ==<br />
<br />
The simplest way of producing an abstract in a ConTeXt document is to specify the formatting directly. The code from LaTeX's <code>classes.dtx</code> is nearly trivial, and is quite easy to replicate in ConTeXt idioms.<br />
<br />
<texcode><br />
\starttext<br />
\midaligned{\bf Abstract}<br />
\startnarrower[2*middle]<br />
This is the document's abstract. It contains enough text for two lines, but no more.<br />
\stopnarrower<br />
\blank[big]<br />
<br />
This is the main text of the document. Like the abstract, it contains enough text<br />
for two lines, to show the margins.<br />
\stoptext<br />
</texcode><br />
<br />
<context><br />
\starttext<br />
\midaligned{\bf Abstract}<br />
\startnarrower[2*middle]<br />
This is the document's abstract. It contains enough text for two lines, but no more.<br />
\stopnarrower<br />
\blank[big]<br />
<br />
This is the main text of the document. Like the abstract, it contains enough text<br />
for two lines, to show the margins.<br />
\stoptext<br />
</context><br />
<br />
In the two-column document classes, LaTeX's <code>abstract</code> environment does nothing beyond putting a <code>\section*{Abstract}</code> in front of the abstract's text. This can be easily replicated in ConTeXt with <code>\subject{Abstract}</code>. (See [[Unnumbered Sections]].)<br />
<br />
== ConTeXt: A more reusable solution ==<br />
<br />
As with [[Document Titles]], to replicate the spirit of the LaTeX environment, we might want to separate the document formatting commands from the actual text of the abstract. <br />
The low-level Context command <cmd>definestartstop</cmd> defines a pair of <br />
<cmd>start</cmd> - <cmd>stop</cmd> commands, so we can define an <br />
<code>abstract</code> environment using the following commands:<br />
<br />
<texcode><br />
\definestartstop<br />
[abstract]<br />
[before={\midaligned{\bf Abstract}<br />
\startnarrower[2*middle]},<br />
after={\stopnarrower<br />
\blank[big]}]<br />
</texcode><br />
<br />
This code can be placed in the document header, or can be placed in a module file to be loaded in a number of documents. It could also be enhanced by <cmd>if</cmd> statements to distinguish between the one-column and two-column cases, as LaTeX does. In any case, once these commands are defined, they can be used in the obvious manner.<br />
<br />
<texcode><br />
\starttext<br />
\startabstract<br />
This is the document's abstract. It contains enough text for two lines, but no more.<br />
\stopabstract<br />
<br />
This is the main text of the document. Like the abstract, it contains enough text<br />
for two lines, to show the margins.<br />
\stoptext<br />
</texcode><br />
<br />
This, of course, produces exactly the same result as the previous illustration.</div>68.40.50.205https://wiki.contextgarden.net/index.php?title=Article_Abstracts&diff=4481Article Abstracts2005-12-02T17:10:37Z<p>68.40.50.205: /* ConTeXt: A simple solution */ how to do one column abstracts in two column documents</p>
<hr />
<div>< [[From LaTeX to ConTeXt]] | [[Document Titles]] ><br />
<br />
== LaTeX ==<br />
<br />
Much as with [[Document Titles]], the standard LaTeX article and report classes define an <code>abstract</code> environment to typeset an abstract in a way that distinguishes it from the rest of the text. In a single-column article, it is set somewhat narrower than the main text, with the word "Abstract" centered above it.<br />
<br />
<texcode><br />
\documentclass{article}<br />
\begin{document}<br />
\begin{abstract}<br />
This is the abstract of the paper.<br />
\end{abstract}<br />
\end{document}<br />
</texcode><br />
<br />
== ConTeXt: A simple solution ==<br />
<br />
The simplest way of producing an abstract in a ConTeXt document is to specify the formatting directly. The code from LaTeX's <code>classes.dtx</code> is nearly trivial, and is quite easy to replicate in ConTeXt idioms.<br />
<br />
<texcode><br />
\starttext<br />
\midaligned{\bf Abstract}<br />
\startnarrower[2*middle]<br />
This is the document's abstract. It contains enough text for two lines, but no more.<br />
\stopnarrower<br />
\blank[big]<br />
<br />
This is the main text of the document. Like the abstract, it contains enough text<br />
for two lines, to show the margins.<br />
\stoptext<br />
</texcode><br />
<br />
<context><br />
\starttext<br />
\midaligned{\bf Abstract}<br />
\startnarrower[2*middle]<br />
This is the document's abstract. It contains enough text for two lines, but no more.<br />
\stopnarrower<br />
\blank[big]<br />
<br />
This is the main text of the document. Like the abstract, it contains enough text<br />
for two lines, to show the margins.<br />
\stoptext<br />
</context><br />
<br />
In the two-column document classes, LaTeX's <code>abstract</code> environment does nothing beyond putting a <code>\section*{Abstract}</code> in front of the abstract's text. This can be easily replicated in ConTeXt with <code>\subject{Abstract}</code>. (See [[Unnumbered Sections]].)<br />
<br />
This is not always true. There are classes like ieeetran.cls that use a one column abstract in a two column document. Can someone explain how to do that<br />
{{howto}}<br />
<br />
== ConTeXt: A more reusable solution ==<br />
<br />
As with [[Document Titles]], to replicate the spirit of the LaTeX environment, we might want to separate the document formatting commands from the actual text of the abstract. <br />
The low-level Context command <cmd>definestartstop</cmd> defines a pair of <br />
<cmd>start</cmd> - <cmd>stop</cmd> commands, so we can define an <br />
<code>abstract</code> environment using the following commands:<br />
<br />
<texcode><br />
\definestartstop<br />
[abstract]<br />
[before={\midaligned{\bf Abstract}<br />
\startnarrower[2*middle]},<br />
after={\stopnarrower<br />
\blank[big]}]<br />
</texcode><br />
<br />
This code can be placed in the document header, or can be placed in a module file to be loaded in a number of documents. It could also be enhanced by <cmd>if</cmd> statements to distinguish between the one-column and two-column cases, as LaTeX does. In any case, once these commands are defined, they can be used in the obvious manner.<br />
<br />
<texcode><br />
\starttext<br />
\startabstract<br />
This is the document's abstract. It contains enough text for two lines, but no more.<br />
\stopabstract<br />
<br />
This is the main text of the document. Like the abstract, it contains enough text<br />
for two lines, to show the margins.<br />
\stoptext<br />
</texcode><br />
<br />
This, of course, produces exactly the same result as the previous illustration.</div>68.40.50.205https://wiki.contextgarden.net/index.php?title=Vim&diff=4476Vim2005-12-02T02:12:09Z<p>68.40.50.205: /* TODO */ Filetype detection</p>
<hr />
<div>< [[Related Programs]] | [[Text editor]] ><br />
<br />
http://www.vim.org/<br />
<br />
This page will be about editing ConTeXt source in (g)vim.<br />
<br />
== context.vim ==<br />
<br />
Nikolai Weibull was the first one who wrote context.vim files and submitted them to the official vim cvs repository.<br />
They will be part of the official Vim 7. However, as it is still in alpha state at the time of writing, you probably don't have those files in Vim 6.<br />
<br />
You can download the files at:<br />
* [http://cvs.sourceforge.net/viewcvs.py/vim/vim7/runtime/syntax/context.vim runtime/syntax/context.vim] - syntax highlighting<br />
* [http://cvs.sourceforge.net/viewcvs.py/vim/vim7/runtime/ftplugin/context.vim runtime/ftplugin/context.vim] - filetype specific behaviour (like repeating comments at the beginning of line)<br />
<br />
If you don't use LaTeX (if your <code>*.tex</code> files are mostly for ConTeXt), you can add the following lines to filetype.vim:<br />
" ConTeXt<br />
augroup filetypedetect<br />
au! BufRead,BufNewFile *.tex setfiletype context<br />
augroup END<br />
so the next time you open a <code>*.tex</code> file in vim, context.vim will be loaded instead of tex.vim.<br />
<br />
It's mostly up to you which syntax highlighting scheme you prefer. <code>context.vim</code> is a lighter version than <code>tex.vim</code>. It knows some ConTeXt details that are not implemented in <code>tex.vim</code>, while math and some other TeX features are not supported yet in <code>context.vim</code>.<br />
<br />
<b>If you feel that something is missing, please contribute!</b><br />
<br />
=== TODO ===<br />
<br />
* extract data from texweb and create syntax highlighting definitions for ConTeXt<br />
* add metafun macros (from metafun manual)<br />
* enable metapost/metafun, JavaScript and XML inside ConTeXt<br />
* some essential math support<br />
* proper URL highlighting ('%' doesn't start a comment, ...) [request by VnPenguin]<br />
* perhaps borrow something from http://vim-latex.sourceforge.net/?<br />
* Have a better filetype detection for *.tex files, to distinguish between plain tex, latex and context files<br />
<br />
== Other useful vim plugins ==<br />
<br />
* autocomplete: http://vim.sourceforge.net/scripts/script.php?script_id=182, almost undocumented, but life-saving<br />
* spell-checker: http://www.vim.org/scripts/script.php?script_id=499, but native spell-checking support will be included in Vim 7<br />
<br />
<br />
== Powerful key mappings ==<br />
<br />
a set of buffer-local insert-mode macros to speed up ConTeXt source editing (by [[User:David antos|D.A.]] 19:52, 8 Jul 2005 (CEST))<br />
* I have remapped <leader> to comma (one hardly ever use commas just before a letter)<br />
* two types of mappings: stand-alone and changing the previous word<br />
* usage of mappings that change the previous word: type the name of the macro and ,ta (for tag, use your leader character instead of the comma); it created \start-\stop block of the macro<br />
* put the code into <code>.vim/after/plugin/context.vim</code><br />
<pre><br />
let maplocalleader = mapleader<br />
<br />
" Make start-stop block out of the previous word<br />
imap <buffer> <LocalLeader>ta \start<Cr>\stop<Cr><Esc>4bhdiw$pj$pO<br />
imap <buffer> <LocalLeader>tb \begin<Cr>\end<Cr><Esc>4bhdiw$pj$pO<br />
<br />
" Itemize<br />
imap <buffer> <LocalLeader>it \startitemize<Cr>\stopitemize<Esc>O\item<Space><br />
imap <buffer> <LocalLeader>en \startitemize[n]<Cr>\stopitemize<Esc>O\item<Space><br />
imap <buffer> <LocalLeader>i<Return> \item<Space><br />
<br />
" Font switching and emphasize<br />
imap <buffer> <LocalLeader>em {\em }<Left><br />
imap <buffer> <LocalLeader>sc {\sc }<Left><br />
<br />
" Define... and setup...<br />
imap <buffer> <LocalLeader>de \define<br />
imap <buffer> <LocalLeader>se \setup<br />
<br />
" Typing and type<br />
imap <buffer> <LocalLeader>ty \type{}<Left><br />
imap <buffer> <LocalLeader>typ typing<LocalLeader>ta<br />
<br />
" Quote and quotation<br />
imap <buffer> <LocalLeader>" \quotation{}<Left><br />
imap <buffer> <LocalLeader>' \quote{}<Left><br />
</pre><br />
<br />
<br />
== Makefile ==<br />
<br />
For your ConTeXt document, you can prepare a Makefile like this one (Contributed by [[User:Buggs|Buggs]]):<br />
<br />
# An example Makefile to compile a context file, paper.tex<br />
paper.pdf: paper.tex<br />
texexec paper<br />
<br />
test:<br />
xpdf paper.pdf<br />
<br />
clean:<br />
rm *.bbl *.dvi *.aux *.log *.blg<br />
<br />
If you put these mappings to your <code>.vimrc</code> file, you can than compile the document with F9 and preview it with F8:<br />
<br />
" map ":make" to the F9 key<br />
imap <F9> <ESC>:make<CR><br />
nmap <F9> :make<CR><br />
<br />
"map ":make test" to the F8 key<br />
imap <F8> <ESC>:make test<CR><br />
nmap <F8> :make test<CR><br />
<br />
<br />
=== MetaPost extension ===<br />
<br />
Should highlight the syntax between <code>btex/verbatimtex</code> ... <code>etex</code> as TeX.<br />
<br />
This doesn't work 100% (problems with commands inside comments): If anyone knows how to repair that, please do so. It would be nice if this would have landed in the official metapost syntax highlighting script for vim one day.<br />
<br />
unlet b:current_syntax<br />
syn include @texTop syntax/tex.vim<br />
" MetaPost has TeX inserts for typeset labels<br />
" verbatimtex, btex, and etex will be treated as keywords<br />
syn match mpTeXbegin "\(verbatimtex\|btex\)"<br />
syn match mpTeXend "etex"<br />
syn region mpTeXinsert start="\(verbatimtex\|btex\)"hs=e+1 end="etex"he=s-1 \<br />
contains=@texTop,mpTeXbegin,mpTeXend containedin=ALL keepend</div>68.40.50.205https://wiki.contextgarden.net/index.php?title=Math_with_nath&diff=4463Math with nath2005-11-29T06:05:26Z<p>68.40.50.205: added todo to provide correct link, the link provided does not work</p>
<hr />
<div>< [[Math]] | [[Math with amsl|amsl]] ><br />
<br />
Nath stands for "natural math". Our nath module is a translation of the nath LaTeX package (by Michal Marvan) to ConTeXt by Giuseppe Bilotta ([[User:Oblomov|Oblomov]]). Is it built ontop of the [[Math with amsl|amsl]] module.<br />
<br />
<texcode><br />
\usemodule[nath]<br />
</texcode><br />
<br />
The documentation in the source is still about LaTeX, so I don't know what I should tell you here, sorry. --[[User:Hraban|Hraban]]<br />
<br />
This LaTeX nath documentation is available at http://www.ctan.org/tex-archive/macros/latex/contrib/nath/<br />
--[[User:mdiam|mdiam]]<br />
<br />
[http://www.ntg.nl:8061/calcmath.pdf Here] you can try "natural math" online (PDF interface!); but I don't know if it’s the same as the nath module provides.<br />
{{todo| the link provided above does not work. Can someone tell the correct link}}<br />
[[Category:Math]]</div>68.40.50.205https://wiki.contextgarden.net/index.php?title=From_LaTeX_to_ConTeXt&diff=4440From LaTeX to ConTeXt2005-11-22T06:34:20Z<p>68.40.50.205: Copy Paste text between Latex and Context</p>
<hr />
<div>< [[Main Page]] ><br />
<br />
General hints for converting from LaTeX to Context can be found in the [http://www.berenddeboer.net/tex/LaTeX2ConTeXt.pdf LaTeX in proper ConTeXt] manual, by [http://www.berenddeboer.net/ Berend de Boer]<br />
<br />
This page offers specific advice on a number of special things that you may be doing with LaTeX, but are not so obvious to do with ConTeXt.<br />
<br />
=== Document and Page Layout ===<br />
* [[Document Titles]]: Title blocks, as in the standard LaTeX article.<br />
* [[LaTeX Thanks|The thanks command]] adds footnoted information, usually to author blocks.<br />
* [[Article Abstracts]]: Abstracts from the standard LaTeX article or report.<br />
* [[KOMA-scrartcl Type Area]]: An interesting automated type-area setup.<br />
* [[Unnumbered Sections]]: Section and subsection headings without numbers.<br />
* [[Flush bottom]]<br />
* [[Vertically Centered Boxes]]: Centering parboxes and tables in a line of text.<br />
<br />
=== Text Formatting ===<br />
* [[Bold small caps]]<br />
* [[Bold typewriter]]: Bold versions of the <tt>cmtt</tt> family of monospaced fonts.<br />
* [[Verbatim with line breaks]]<br />
* [[ISO-8859-15]]: Using the ISO Latin-9 (Western European) character encoding for input.<br />
* [[Description]]<br />
<br />
=== Programming ===<br />
* [[Commands with optional arguments]]<br />
<br />
=== Document Metadata ===<br />
* [[PDF-strings]]<br />
<br />
<br />
=== Copy Paste text between Latex and Context ===<br />
* [[Introduction]]<br />
* [[Basic Latex]]<br />
* [[Math Environments]]<br />
Also, many of the macros on the [[LaTeX Math in ConTeXt]] page are equally useful in ConTeXt formulas.<br />
<br />
A Vietnamese version of <i>LaTeX in proper ConTeXt</i> is available at [http://vnoss.org/docs/LaTeX2ConTeXt-vi.pdf VnOSS].</div>68.40.50.205https://wiki.contextgarden.net/index.php?title=Presentation_Styles&diff=4439Presentation Styles2005-11-22T06:12:54Z<p>68.40.50.205: </p>
<hr />
<div>< [[Presentations]]<br />
<br />
This is a list of existing presentation styles (made by Hans Hagen) which are shiped with ConTeXt. There will also be a list of predefined commands specific for single styles.<br />
{{todo|page in progress - feel free to contribute<br />
<br />
Things that have to come here: links to sources, links to PDF documents with sources explained, links to a couple of documents which use this style, title page, inner page, specific commands, how to change color of buttons & background, ...}}<br />
<br />
* [http://www.pragma-ade.com/articles/art-pres.pdf Article about presentation styles]<br />
* If you don't know the name of a specific style, take a look into [[source:cont-fil.tex|cont-fil.tex]].<br />
* to test a style execute<br />
texexec --pdf --mode=demo s-pre-xx<br />
where <code>xx</code> is replaced with appropriate number.<br />
<br />
== 01. original ==<br />
<br />
* Source: [[source:s-pre-01.tex|s-pre-01.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-01.pdf s-pre-01.pdf]<br />
<br />
<texcode><br />
\usemodule[pre-original]<br />
\TitlePage {pre-original\\Title Page}<br />
</texcode><br />
<context><br />
\usemodule[pre-original]<br />
\setuplayout[location=middle,scale=.2]<br />
\TitlePage {pre-original\\Title Page}<br />
</context><br />
<br />
== 02. green ==<br />
<br />
* Source: [[source:s-pre-02.tex|s-pre-02.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-02.pdf s-pre-02.pdf]<br />
<br />
<texcode><br />
\usemodule[pre-green]<br />
\TitlePage {pre-green\\Title Page}<br />
</texcode><br />
<context><br />
\usemodule[pre-green]<br />
\setuplayout[location=middle,scale=.2]<br />
\TitlePage {pre-green\\Title Page}<br />
</context><br />
<br />
== 03. funny ==<br />
* Source: [[source:s-pre-03.tex|s-pre-03.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-03.pdf s-pre-03.pdf]<br />
<texcode><br />
\usemodule[pre-funny]<br />
\TitlePage {pre-funny\\Title Page}<br />
</texcode><br />
<context><br />
\usemodule[pre-funny]<br />
\setuplayout[location=middle,scale=.2]<br />
\TitlePage {pre-funny\\Title Page}<br />
</context><br />
<br />
<br />
== 04. colorful ==<br />
<br />
* Source: [[source:s-pre-04.tex|s-pre-04.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-04.pdf s-pre-04.pdf]<br />
<br />
== 05. fuzzy ==<br />
<br />
* Source: [[source:s-pre-05.tex|s-pre-05.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-05.pdf s-pre-05.pdf]<br />
<br />
== 06. polish ==<br />
<br />
* Source: [[source:s-pre-06.tex|s-pre-06.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-06.pdf s-pre-06.pdf]<br />
<br />
== 07. spider ==<br />
<br />
* Source: [[source:s-pre-07.tex|s-pre-07.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-07.pdf s-pre-07.pdf]<br />
<texcode><br />
\usemodule[pre-spider]<br />
\TitlePage {pre-spider\\Title Page}<br />
</texcode><br />
<context><br />
\usemodule[pre-spider]<br />
\setuplayout[location=middle,scale=.2]<br />
\TitlePage {pre-spider\\Title Page}<br />
</context><br />
<br />
== 08. wonder ==<br />
<br />
* Source: [[source:s-pre-08.tex|s-pre-08.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-08.pdf s-pre-08.pdf]<br />
<br />
== 09. windows ==<br />
<br />
* Source: [[source:s-pre-09.tex|s-pre-09.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-09.pdf s-pre-09.pdf]<br />
<br />
== 10. grow ==<br />
<br />
* Source: [[source:s-pre-10.tex|s-pre-10.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-10.pdf s-pre-10.pdf]<br />
<br />
== 11. stack ==<br />
<br />
* Source: Not available.<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-11.pdf s-pre-11.pdf]<br />
<br />
== 12. arrows ==<br />
<br />
* Source: Not available.<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-12.pdf s-pre-12.pdf]<br />
<br />
== 13. writing ==<br />
<br />
* Source: [[source:s-pre-13.tex|s-pre-13.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-13.pdf s-pre-13.pdf]<br />
<br />
== 14. split ==<br />
<br />
* Source: [[source:s-pre-14.tex|s-pre-14.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-14.pdf s-pre-14.pdf]<br />
<br />
== 15. balls ==<br />
<br />
* Source: [[source:s-pre-15.tex|s-pre-15.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-15.pdf s-pre-15.pdf]<br />
<br />
== 16. knot ==<br />
<br />
* Source: [[source:s-pre-16.tex|s-pre-16.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-16.pdf s-pre-16.pdf]<br />
<br />
== 17. weird ==<br />
<br />
* Source: Not available.<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-17.pdf s-pre-17.pdf]<br />
<br />
== 18. shade ==<br />
<br />
* Source: Not available.<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-18.pdf s-pre-18.pdf]<br />
<br />
== 19. organic ==<br />
<br />
* Source: [[source:s-pre-19.tex|s-pre-19.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-19.pdf s-pre-19.pdf]<br />
<br />
== 20. speckle ==<br />
<br />
* Source: Not available.<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-20.pdf s-pre-20.pdf]<br />
<br />
== 21. zoom ==<br />
<br />
* Source: Not available.<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-21.pdf s-pre-21.pdf]<br />
<br />
== 22. cycle ==<br />
<br />
* Source: [[source:s-pre-22.tex|s-pre-22.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-22.pdf s-pre-22.pdf]<br />
<br />
== 23. super ==<br />
<br />
* Source: [[source:s-pre-23.tex|s-pre-23.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-23.pdf s-pre-23.pdf]<br />
<br />
== 24. - 28. ==<br />
[http://www.pragma-ade.com/general/sources/s-pre-24.pdf s-pre-24.pdf]<br />
[http://www.pragma-ade.com/general/sources/s-pre-25.pdf s-pre-25.pdf]<br />
[http://www.pragma-ade.com/general/sources/s-pre-26.pdf s-pre-26.pdf]<br />
[http://www.pragma-ade.com/general/sources/s-pre-27.pdf s-pre-27.pdf]<br />
[http://www.pragma-ade.com/general/sources/s-pre-28.pdf s-pre-28.pdf]<br />
<br />
== 50. ==<br />
<br />
* Source: [[source:s-pre-50.tex|s-pre-50.tex]]<br />
<br />
Cited from the documentation:<br />
<br />
''When my mailbox started to overflow with messages about problems with the '''presentation step mechanism''', I looked up old presentaton, hacked a bit and cooked up an alternative that is less dependent on PDF trickery.''<br />
<br />
''Consider it a cheap trick and prelude to a couple of new presentation styles. (At the time of writing this, I still have some 10 of those styles to clean up and document.) You can give it a try: ''<br />
<br />
== 60. stepwise ==<br />
<br />
* Source: [[source:s-pre-60.tex|s-pre-60.tex]]<br />
<br />
== 61. stepper ==<br />
<br />
* Source: [[source:s-pre-61.tex|s-pre-61.tex]]</div>68.40.50.205https://wiki.contextgarden.net/index.php?title=Presentation_Styles&diff=4438Presentation Styles2005-11-22T06:12:15Z<p>68.40.50.205: added context code for funnyl style</p>
<hr />
<div>< [[Presentations]]<br />
<br />
This is a list of existing presentation styles (made by Hans Hagen) which are shiped with ConTeXt. There will also be a list of predefined commands specific for single styles.<br />
{{todo|page in progress - feel free to contribute<br />
<br />
Things that have to come here: links to sources, links to PDF documents with sources explained, links to a couple of documents which use this style, title page, inner page, specific commands, how to change color of buttons & background, ...}}<br />
<br />
* [http://www.pragma-ade.com/articles/art-pres.pdf Article about presentation styles]<br />
* If you don't know the name of a specific style, take a look into [[source:cont-fil.tex|cont-fil.tex]].<br />
* to test a style execute<br />
texexec --pdf --mode=demo s-pre-xx<br />
where <code>xx</code> is replaced with appropriate number.<br />
<br />
== 01. original ==<br />
<br />
* Source: [[source:s-pre-01.tex|s-pre-01.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-01.pdf s-pre-01.pdf]<br />
<br />
<texcode><br />
\usemodule[pre-original]<br />
\TitlePage {pre-original\\Title Page}<br />
</texcode><br />
<context><br />
\usemodule[pre-original]<br />
\setuplayout[location=middle,scale=.2]<br />
\TitlePage {pre-original\\Title Page}<br />
</context><br />
<br />
== 02. green ==<br />
<br />
* Source: [[source:s-pre-02.tex|s-pre-02.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-02.pdf s-pre-02.pdf]<br />
<br />
<texcode><br />
\usemodule[pre-green]<br />
\TitlePage {pre-green\\Title Page}<br />
</texcode><br />
<context><br />
\usemodule[pre-green]<br />
\setuplayout[location=middle,scale=.2]<br />
\TitlePage {pre-green\\Title Page}<br />
</context><br />
<br />
== 03. funny ==<br />
* Source: [[source:s-pre-03.tex|s-pre-03.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-03.pdf s-pre-03.pdf]<br />
<texcode><br />
\usemodule[pre-funny]<br />
\TitlePage {pre-funny\\Title Page}<br />
</texcode><br />
<context><br />
\usemodule[pre-funny]<br />
\setuplayout[location=middle,scale=.2]<br />
\TitlePage {pre-funny\\Title Page}<br />
</context><br />
<br />
<texcode><br />
\usemodule[pre-funny]<br />
\TitlePage {pre-funny\\Title Page}<br />
</texcode><br />
<context><br />
\usemodule[pre-funny]<br />
\setuplayout[location=middle,scale=.2]<br />
\TitlePage {pre-funny\\Title Page}<br />
</context><br />
<br />
== 04. colorful ==<br />
<br />
* Source: [[source:s-pre-04.tex|s-pre-04.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-04.pdf s-pre-04.pdf]<br />
<br />
== 05. fuzzy ==<br />
<br />
* Source: [[source:s-pre-05.tex|s-pre-05.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-05.pdf s-pre-05.pdf]<br />
<br />
== 06. polish ==<br />
<br />
* Source: [[source:s-pre-06.tex|s-pre-06.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-06.pdf s-pre-06.pdf]<br />
<br />
== 07. spider ==<br />
<br />
* Source: [[source:s-pre-07.tex|s-pre-07.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-07.pdf s-pre-07.pdf]<br />
<texcode><br />
\usemodule[pre-spider]<br />
\TitlePage {pre-spider\\Title Page}<br />
</texcode><br />
<context><br />
\usemodule[pre-spider]<br />
\setuplayout[location=middle,scale=.2]<br />
\TitlePage {pre-spider\\Title Page}<br />
</context><br />
<br />
== 08. wonder ==<br />
<br />
* Source: [[source:s-pre-08.tex|s-pre-08.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-08.pdf s-pre-08.pdf]<br />
<br />
== 09. windows ==<br />
<br />
* Source: [[source:s-pre-09.tex|s-pre-09.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-09.pdf s-pre-09.pdf]<br />
<br />
== 10. grow ==<br />
<br />
* Source: [[source:s-pre-10.tex|s-pre-10.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-10.pdf s-pre-10.pdf]<br />
<br />
== 11. stack ==<br />
<br />
* Source: Not available.<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-11.pdf s-pre-11.pdf]<br />
<br />
== 12. arrows ==<br />
<br />
* Source: Not available.<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-12.pdf s-pre-12.pdf]<br />
<br />
== 13. writing ==<br />
<br />
* Source: [[source:s-pre-13.tex|s-pre-13.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-13.pdf s-pre-13.pdf]<br />
<br />
== 14. split ==<br />
<br />
* Source: [[source:s-pre-14.tex|s-pre-14.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-14.pdf s-pre-14.pdf]<br />
<br />
== 15. balls ==<br />
<br />
* Source: [[source:s-pre-15.tex|s-pre-15.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-15.pdf s-pre-15.pdf]<br />
<br />
== 16. knot ==<br />
<br />
* Source: [[source:s-pre-16.tex|s-pre-16.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-16.pdf s-pre-16.pdf]<br />
<br />
== 17. weird ==<br />
<br />
* Source: Not available.<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-17.pdf s-pre-17.pdf]<br />
<br />
== 18. shade ==<br />
<br />
* Source: Not available.<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-18.pdf s-pre-18.pdf]<br />
<br />
== 19. organic ==<br />
<br />
* Source: [[source:s-pre-19.tex|s-pre-19.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-19.pdf s-pre-19.pdf]<br />
<br />
== 20. speckle ==<br />
<br />
* Source: Not available.<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-20.pdf s-pre-20.pdf]<br />
<br />
== 21. zoom ==<br />
<br />
* Source: Not available.<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-21.pdf s-pre-21.pdf]<br />
<br />
== 22. cycle ==<br />
<br />
* Source: [[source:s-pre-22.tex|s-pre-22.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-22.pdf s-pre-22.pdf]<br />
<br />
== 23. super ==<br />
<br />
* Source: [[source:s-pre-23.tex|s-pre-23.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-23.pdf s-pre-23.pdf]<br />
<br />
== 24. - 28. ==<br />
[http://www.pragma-ade.com/general/sources/s-pre-24.pdf s-pre-24.pdf]<br />
[http://www.pragma-ade.com/general/sources/s-pre-25.pdf s-pre-25.pdf]<br />
[http://www.pragma-ade.com/general/sources/s-pre-26.pdf s-pre-26.pdf]<br />
[http://www.pragma-ade.com/general/sources/s-pre-27.pdf s-pre-27.pdf]<br />
[http://www.pragma-ade.com/general/sources/s-pre-28.pdf s-pre-28.pdf]<br />
<br />
== 50. ==<br />
<br />
* Source: [[source:s-pre-50.tex|s-pre-50.tex]]<br />
<br />
Cited from the documentation:<br />
<br />
''When my mailbox started to overflow with messages about problems with the '''presentation step mechanism''', I looked up old presentaton, hacked a bit and cooked up an alternative that is less dependent on PDF trickery.''<br />
<br />
''Consider it a cheap trick and prelude to a couple of new presentation styles. (At the time of writing this, I still have some 10 of those styles to clean up and document.) You can give it a try: ''<br />
<br />
== 60. stepwise ==<br />
<br />
* Source: [[source:s-pre-60.tex|s-pre-60.tex]]<br />
<br />
== 61. stepper ==<br />
<br />
* Source: [[source:s-pre-61.tex|s-pre-61.tex]]</div>68.40.50.205https://wiki.contextgarden.net/index.php?title=Presentation_Styles&diff=4437Presentation Styles2005-11-22T06:11:30Z<p>68.40.50.205: added context code for funny and colorful style</p>
<hr />
<div>< [[Presentations]]<br />
<br />
This is a list of existing presentation styles (made by Hans Hagen) which are shiped with ConTeXt. There will also be a list of predefined commands specific for single styles.<br />
{{todo|page in progress - feel free to contribute<br />
<br />
Things that have to come here: links to sources, links to PDF documents with sources explained, links to a couple of documents which use this style, title page, inner page, specific commands, how to change color of buttons & background, ...}}<br />
<br />
* [http://www.pragma-ade.com/articles/art-pres.pdf Article about presentation styles]<br />
* If you don't know the name of a specific style, take a look into [[source:cont-fil.tex|cont-fil.tex]].<br />
* to test a style execute<br />
texexec --pdf --mode=demo s-pre-xx<br />
where <code>xx</code> is replaced with appropriate number.<br />
<br />
== 01. original ==<br />
<br />
* Source: [[source:s-pre-01.tex|s-pre-01.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-01.pdf s-pre-01.pdf]<br />
<br />
<texcode><br />
\usemodule[pre-original]<br />
\TitlePage {pre-original\\Title Page}<br />
</texcode><br />
<context><br />
\usemodule[pre-original]<br />
\setuplayout[location=middle,scale=.2]<br />
\TitlePage {pre-original\\Title Page}<br />
</context><br />
<br />
== 02. green ==<br />
<br />
* Source: [[source:s-pre-02.tex|s-pre-02.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-02.pdf s-pre-02.pdf]<br />
<br />
<texcode><br />
\usemodule[pre-green]<br />
\TitlePage {pre-green\\Title Page}<br />
</texcode><br />
<context><br />
\usemodule[pre-green]<br />
\setuplayout[location=middle,scale=.2]<br />
\TitlePage {pre-green\\Title Page}<br />
</context><br />
<br />
== 03. funny ==<br />
* Source: [[source:s-pre-03.tex|s-pre-03.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-03.pdf s-pre-03.pdf]<br />
<texcode><br />
\usemodule[pre-funny]<br />
\TitlePage {pre-funny\\Title Page}<br />
</texcode><br />
<context><br />
\usemodule[pre-funny]<br />
\setuplayout[location=middle,scale=.2]<br />
\TitlePage {pre-funny\\Title Page}<br />
</context><br />
<br />
== 04. colorful ==<br />
<br />
* Source: [[source:s-pre-04.tex|s-pre-04.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-04.pdf s-pre-04.pdf]<br />
<br />
== 05. fuzzy ==<br />
<br />
* Source: [[source:s-pre-05.tex|s-pre-05.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-05.pdf s-pre-05.pdf]<br />
<br />
== 06. polish ==<br />
<br />
* Source: [[source:s-pre-06.tex|s-pre-06.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-06.pdf s-pre-06.pdf]<br />
<br />
== 07. spider ==<br />
<br />
* Source: [[source:s-pre-07.tex|s-pre-07.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-07.pdf s-pre-07.pdf]<br />
<texcode><br />
\usemodule[pre-spider]<br />
\TitlePage {pre-spider\\Title Page}<br />
</texcode><br />
<context><br />
\usemodule[pre-spider]<br />
\setuplayout[location=middle,scale=.2]<br />
\TitlePage {pre-spider\\Title Page}<br />
</context><br />
<br />
== 08. wonder ==<br />
<br />
* Source: [[source:s-pre-08.tex|s-pre-08.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-08.pdf s-pre-08.pdf]<br />
<br />
== 09. windows ==<br />
<br />
* Source: [[source:s-pre-09.tex|s-pre-09.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-09.pdf s-pre-09.pdf]<br />
<br />
== 10. grow ==<br />
<br />
* Source: [[source:s-pre-10.tex|s-pre-10.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-10.pdf s-pre-10.pdf]<br />
<br />
== 11. stack ==<br />
<br />
* Source: Not available.<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-11.pdf s-pre-11.pdf]<br />
<br />
== 12. arrows ==<br />
<br />
* Source: Not available.<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-12.pdf s-pre-12.pdf]<br />
<br />
== 13. writing ==<br />
<br />
* Source: [[source:s-pre-13.tex|s-pre-13.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-13.pdf s-pre-13.pdf]<br />
<br />
== 14. split ==<br />
<br />
* Source: [[source:s-pre-14.tex|s-pre-14.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-14.pdf s-pre-14.pdf]<br />
<br />
== 15. balls ==<br />
<br />
* Source: [[source:s-pre-15.tex|s-pre-15.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-15.pdf s-pre-15.pdf]<br />
<br />
== 16. knot ==<br />
<br />
* Source: [[source:s-pre-16.tex|s-pre-16.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-16.pdf s-pre-16.pdf]<br />
<br />
== 17. weird ==<br />
<br />
* Source: Not available.<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-17.pdf s-pre-17.pdf]<br />
<br />
== 18. shade ==<br />
<br />
* Source: Not available.<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-18.pdf s-pre-18.pdf]<br />
<br />
== 19. organic ==<br />
<br />
* Source: [[source:s-pre-19.tex|s-pre-19.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-19.pdf s-pre-19.pdf]<br />
<br />
== 20. speckle ==<br />
<br />
* Source: Not available.<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-20.pdf s-pre-20.pdf]<br />
<br />
== 21. zoom ==<br />
<br />
* Source: Not available.<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-21.pdf s-pre-21.pdf]<br />
<br />
== 22. cycle ==<br />
<br />
* Source: [[source:s-pre-22.tex|s-pre-22.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-22.pdf s-pre-22.pdf]<br />
<br />
== 23. super ==<br />
<br />
* Source: [[source:s-pre-23.tex|s-pre-23.tex]]<br />
* Source explained: [http://www.pragma-ade.com/general/sources/s-pre-23.pdf s-pre-23.pdf]<br />
<br />
== 24. - 28. ==<br />
[http://www.pragma-ade.com/general/sources/s-pre-24.pdf s-pre-24.pdf]<br />
[http://www.pragma-ade.com/general/sources/s-pre-25.pdf s-pre-25.pdf]<br />
[http://www.pragma-ade.com/general/sources/s-pre-26.pdf s-pre-26.pdf]<br />
[http://www.pragma-ade.com/general/sources/s-pre-27.pdf s-pre-27.pdf]<br />
[http://www.pragma-ade.com/general/sources/s-pre-28.pdf s-pre-28.pdf]<br />
<br />
== 50. ==<br />
<br />
* Source: [[source:s-pre-50.tex|s-pre-50.tex]]<br />
<br />
Cited from the documentation:<br />
<br />
''When my mailbox started to overflow with messages about problems with the '''presentation step mechanism''', I looked up old presentaton, hacked a bit and cooked up an alternative that is less dependent on PDF trickery.''<br />
<br />
''Consider it a cheap trick and prelude to a couple of new presentation styles. (At the time of writing this, I still have some 10 of those styles to clean up and document.) You can give it a try: ''<br />
<br />
== 60. stepwise ==<br />
<br />
* Source: [[source:s-pre-60.tex|s-pre-60.tex]]<br />
<br />
== 61. stepper ==<br />
<br />
* Source: [[source:s-pre-61.tex|s-pre-61.tex]]</div>68.40.50.205https://wiki.contextgarden.net/index.php?title=Bibliography_mkii&diff=1747Bibliography mkii2005-07-29T02:42:17Z<p>68.40.50.205: </p>
<hr />
<div>< [[Modules]]<br />
<br />
The '''bib''' module provides the<br />
<cmd>cite</cmd><br />
and <br />
<cmd>placepublications</cmd><br />
commands, in addition to some setup commands, for collecting and referencing bibliography. Single references can be supplied by special commands, or by using BibTeX databases.<br />
<br />
As of [[Context 2005.01.13]], this module is part of the standard distribution. <br />
<br />
The manual can be downloaded from [[http://tex.aanhet.net/bib/ Taco's Page]]<br />
<br />
== Example ==<br />
Can someone give a '''complete working example''' on how to use it with bibtex</div>68.40.50.205https://wiki.contextgarden.net/index.php?title=KOMA-scrartcl_Type_Area&diff=2076KOMA-scrartcl Type Area2005-07-26T18:16:52Z<p>68.40.50.205: changed to texcode instead of pre</p>
<hr />
<div>< [[From LaTeX to ConTeXt]]<br />
<br />
LaTeX:<br />
<br />
The <tt>scrartcl</tt> class from the KOMA package does some fairly sophisticated calculations to determine an appropriate page layout. A sample document (with a framebox to show the text area) is simply:<br />
<texcode><br />
\documentclass[DIVcalc,twoside]{scrartcl}<br />
\begin{document}<br />
\noindent\framebox{\rule{0pt}{\textheight}\rule{\textwidth}{0pt}}<br />
\end{document}<br />
</texcode><br />
<br />
ConTeXt:<br />
<br />
The following code duplicates the <tt>scrartcl</tt> calculations to set the text area and produces a similar sample document, again with a framed box to show the text area.<br />
<texcode><br />
\def\BCOR{3mm}% eventual bounding correction<br />
\newdimen\PageWidth \PageWidth=\paperwidth<br />
\doifmode{BCOR}{\PageWidth=\dimexpr(\PageWidth-\BCOR)}<br />
\edef\Ratio{\withoutpt{\the\dimexpr(2\paperheight/(\PageWidth/32768))}}<br />
\setbox\scratchbox\hbox{\dorecurse{26}{\character\recurselevel}}<br />
\newdimen\Width \newdimen\Height \newdimen\Back<br />
\Width=\dimexpr(2.6\wd\scratchbox) \Height=\dimexpr(\Ratio\Width)<br />
\doifmodeelse{oneside}{\Back=\dimexpr((\PageWidth - \Width) / 2)}<br />
{\Back=\dimexpr((\PageWidth - \Width) / 3)}<br />
\doifmode{BCOR}{\Back=\dimexpr(\Back + \BCOR)}<br />
\edef\Top{\the\dimexpr((\paperheight - \Height) / 3 - 3\lineheight)}<br />
\Height=\dimexpr(\Height + 8\lineheight)<br />
\setuplayout[backspace=\the\Back,height=\the\Height,width=\the\Width,<br />
header=2\lineheight,headerdistance=\lineheight,<br />
footer=2\lineheight,footerdistance=3\lineheight,topspace=\Top]<br />
<br />
\starttext<br />
\framed[width=\textwidth,height=\textheight]{}<br />
\stoptext<br />
</texcode><br />
<br />
In the beta version of ConTeXt, there is probably a better way to achieve the<br />
same...</div>68.40.50.205https://wiki.contextgarden.net/index.php?title=Description&diff=2068Description2005-07-26T18:15:38Z<p>68.40.50.205: changed to texcode instead of pre</p>
<hr />
<div>< [[From LaTeX to ConTeXt]]<br />
<br />
LaTeX:<br />
<texcode><br />
\documentclass{article}<br />
\begin{document}<br />
\begin{description}<br />
\item[Short label] bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla<br />
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla<br />
\item[Very long label] bla bla bla bla bla bla bla bla bla bla bla bla bla<br />
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla<br />
\end{description}<br />
\end{document}<br />
</texcode><br />
<br />
ConTeXt: <tt>\setupdescription</tt> with some special parameters<br />
(<tt>location=hanging</tt>, <tt>width=broad</tt>,<br />
<tt>margin=</tt><i>indentation</i>)<br />
<br />
<texcode><br />
\definedescription[notation][<br />
headstyle=bold,style=normal,align=left,location=hanging,<br />
width=broad,margin=1cm]<br />
<br />
\starttext<br />
\notation{A very very very very long item}<br />
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla<br />
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla<br />
bla bla bla bla<br />
<br />
\notation{i}<br />
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla<br />
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla<br />
bla bla bla bla<br />
<br />
\stoptext<br />
</texcode><br />
<br />
The empty lines (or <tt>\par</tt>) after each description<br />
(here notation) are necessary.<br />
<br />
<b>Hint:</b> This solution uses the <tt>distance=</tt><i>dimension</i><br />
distance for separation of label and text.<br />
<br />
<br />
== Description with minimal label width: ==<br />
<br />
<br />
LaTeX:<br />
<texcode><br />
\documentclass{article}<br />
\usepackage{mdwlist}<br />
\begin{document}<br />
\begin{basedescript}{\desclabelstyle{\pushlabel}\desclabelwidth{6em}}<br />
\item[Label] bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla<br />
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla<br />
\item[Very long label] bla bla bla bla bla bla bla bla bla bla bla bla bla bla<br />
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla<br />
\end{basedescript}<br />
\end{document}<br />
</texcoed><br />
<br />
ConTeXt: ???</texcode></div>68.40.50.205https://wiki.contextgarden.net/index.php?title=Document_Titles&diff=1947Document Titles2005-07-26T18:13:24Z<p>68.40.50.205: </p>
<hr />
<div>This is totally basic, but I could not find a ''natural way'' to this in Context<br />
<br />
<texcode><br />
\documentclass{article}<br />
\begin{document}<br />
\title{How to do this in Context}<br />
\author{The author}<br />
\date{July 26, 2005}<br />
\end{document}<br />
</texcode></div>68.40.50.205https://wiki.contextgarden.net/index.php?title=Document_Titles&diff=1735Document Titles2005-07-26T18:12:30Z<p>68.40.50.205: Title with context</p>
<hr />
<div>== Title with Context ==<br />
<br />
This is totally basic, but I could not find a ''natural way'' to this in Context<br />
<br />
<code><br />
\documentclass{article}<br />
\begin{document}<br />
\title{How to do this in Context}<br />
\author{The author}<br />
\date{July 26, 2005}<br />
\end{document}<br />
</code></div>68.40.50.205https://wiki.contextgarden.net/index.php?title=From_LaTeX_to_ConTeXt&diff=1794From LaTeX to ConTeXt2005-07-26T18:09:45Z<p>68.40.50.205: </p>
<hr />
<div>< [[Main Page]]<br />
<br />
General hints: [http://www.berenddeboer.net/tex/LaTeX2ConTeXt.pdf LaTeX in proper ConTeXt] by [http://www.berenddeboer.net/ Berend de Boer]<br />
<br />
Special things that you've been used to do with LaTeX, but that are not so obvious to do with ConTeXt.<br />
<br />
<br />
* [[Title Page]]<br />
* [[Bold small caps]]<br />
* [[Bold typewriter]]<br />
* [[Description]]<br />
* [[Flush bottom]]<br />
* [[Verbatim with line breaks]]<br />
* [[Typearea]]<br />
* [[PDF-strings]]<br />
* [[Commands with optional arguments]]<br />
* [[ISO-8859-15]]<br />
* [[Vertically centred]]<br />
<br />
Also, many of the macros on the [[LaTeX Math in ConTeXt]] page are equally useful in ConTeXt formulas.<br />
<br />
Vietnamese version of LaTeX2ConTeXt is available at [http://vnoss.org/docs/LaTeX2ConTeXt-vi.pdf VnOSS].</div>68.40.50.205