Changes

Jump to navigation Jump to search
7,663 bytes added ,  13:21, 9 August 2020
m
Text replacement - "</cmd>" to "}}"
{{todo|This FAQ needs to have a lot of things worked on. To avoid clutter from repeated TODO tags, just note missing answers with "...", and put notes about missing information in parentheses.}}
 
== ConTeXt General ==
=== What is ConTeXt? ===
:It is a document production system based on Donald Knuth's [[http://www.tug.org/ TeX]]. It is a set of high-level macros written in the (somewhat arcane) TeX language, and these macros simplify the task of designing layouts, making hyperlinks, etc.
: ConTeXt is a document production system, based on Donald Knuth's [http://www.tug.org/ TeX], for typesetting high-quality documents. More specifically, it is both: :* a set of high-level macros written in the (somewhat arcane) TeX language, and these macros simplify the task of designing layouts, making hyperlinks, etc. :* and a set of software and tools for moving from these macros to high-quality digital documents.: Unlike familiar word processors where the formatting of the final document is crafted while writing the content, ConTeXt documents are written without formatting, in plain text, using a macro language. This means that the document's content can change independently of its formatting and vice versa. :; Features : ConTeXt supports colors, configurable page backgrounds, hyperlinks, presentations, figure-text integration, cross-references, bibliographies, indices, typesetting for [[Chemistry|chemistry]] and [[Command/unit|physics]], [[Modes|conditional compilation]], non-latin languages, and [[Imposition|binding and imposition]]. :; Graphics : ConTeXt integrates a superset of [[MetaPost]] called [[MetaFun - MetaPost in ConTeXt|MetaFun]], which allows drawing page backgrounds and ornaments. :; Internationalization : ConTeXt provides a multi-lingual user interface with support for markup in English, Dutch, German, French, and Italian and support for output in many languages including western European languages, eastern European languages, Arabic, Chinese, Japanese, and Korean. :; Compatibility : ConTeXt supports TeX engines such as [[wikipedia:pdfTeX|pdfTeX]], [[XeTeX]], and [[LuaTeX]] without changing the user interface. :; History : ConTeXt was developed from 1990 by Hans Hagen from [http://www.pragma-ade.com/ PRAGMA Advanced Document Engineering] (Pragma ADE), a Netherlands-based company. See [[ConTeXt history]] for further details. :; Licensing : ConTeXt is [http://en.wikipedia.org/wiki/free_software free software]. The program code (i.e. anything not under the <code>/doc</code> subtree) is distributed under the [http://en.wikipedia.org/wiki/GNU_GPL GNU GPL]; the documentation is provided under [http://en.wikipedia.org/wiki/Creative_Commons Creative Commons] Attribution NonCommercial ShareAlike license. :; Example : A simple ConTeXt document resembles: <context source="yes" text="This produces:">\setuphead[section][color= Is red] \starttext \section{Hello}World! \stoptext</context> :; Technical Details::: ConTeXt can be used to typeset complex and large collections of documents, like educational materials, user guides and technical manuals. Such documents often have high demands regarding structure, design and accessibility. Ease of maintenance, reuse of content and typographic consistency are important prerequisites.::: ConTeXt is developed for those who are responsible for producing such documents. ConTeXt is written in the typographical programming language TeX. For using ConTeXt, no TeX programming skills and no technical background are needed. Some basic knowledge of typography and document design will enable you to use the full power of ConTeXt.::: ConTeXt is parameter driven and the user interface supports several languages, like English, German and Dutch. This means that those less familiar with the English language can choose the interface that suits them best. Of course ConTeXt can typeset in many languages.::: Originally ConTeXt was written as tool for writing complex, constantly changing and extensive educational documents. Although much functionality originates there , ConTeXt has proven to be quite suitable to perform many other complex typesetting tasks. Some features are::::* automatic placement of figures, formulas, tables and other kind of floating bodies:::* automatic generation of lists of abbreviations, synonyms, and whatever needs to be sorted:::* automatic numbering of footnotes:::* adapting footers and headers to the current page content:::* extensive formatting of itemizations in many levels:::* consistent typesetting of legends to formulas:::* maintaining several registers, if needed with extensive interactive support:::* extensive cross-referencing capabilities:::* generating lists of used figures, tables, formulas and more:::* forcing rigourous consistency in emphasizing parts of the text:::* managing documents in a helloproject environment:::* automatic placement of marginal notes:::* typesetting in more than one column:::* identifying textual elements in such a way that they can be hidden, moved and reused when needed (questions, answers, definitions, etc.):::* using text in more that one document, with a different layout if needed :::* automatic hyphenation of words as well as adaptation to language specific typographic needs:::* inclusion of illustrations in standardized formats from other applications:::* using color:::* easy change of layout, while guarding consistent typography:::* providing multiple tables of contents and lists, at all levels, to provide optimal accessibility:::* automatic numbering of definitions, lemmas and other structural components:::* automatic numbering of figures, tables, and other floating bodies:::* automatic makeup of tables and formulas ::: ConTeXt supports the PDF format and is able to directly produce highly interactive PDF files, using pdfTeX. All cross-references are automatically converted to hyperlinks. Such documents can be viewed and consulted with Acrobat. ConTeXt can provide all kinds of navigational aids that can be activated without programming. Electronic versions of documents thereby become very useful in educational settings. The potential of PDF is available to the user: complex forms and JavaScripts are no problem for ConTeXt. [http://www.pragma-ade.nl/ PRAGMA ADE] has developed ConTeXt in-world documenthouse mainly to suit its own and customers' wishes concerning developing educational documents. Flexibility in layout, reuse of content, and maintenance are keywords. === How does ConTeXt versioning work? === : In short, there are 3 major version branches::* 1995: ConTeXt [[Mark II]], which defaulted to the pdfTeX engine, but also supported ε-TEX, XeTeX, and Aleph. Now in maintenance-only mode.:Yes* 2005: ConTeXt [[Mark IV]], using the LuaTeX engine. This is the current stable version. See :* 2019: ConTeXt [[First DocumentLMTX]] and , using the new LuaMetaTeX engine. This is the current development version.: Each of the releases in those major branches also has an ISO timestamp that functions as a minor version number.: See [[Hello worldConTeXt history]]for further details.
=== Is Starting with ConTeXt free (open source) software? ===:Yes. See the [[Read Me]] page for details.
=== How do I install ConTeXt? ===
:See [[Installation]]
 
=== Is there a hello-world document? ===
:Yes. See [[First Document]] and [[Detailed Example]].
=== Is ConTeXt free (libre, open source) software? ===:Yes. See the [[InstallationRead Me]]page for details.
=== Does ConTeXt support Unicode? ===
:Yes. It supports Unicode (utfUTF-8) . In [[XeTeX]] and [[LuaTeX]] it is the default inputencoding, with the <while you need to use {{cmd>|enableregime</cmd>}}<tt>[utf-8]</tt> commandwhen working with [[pdfTeX]]. See also [[Encodings and Regimes- Old Content]] (This needs a bit of elaboration!) If you  === Why should I only use letters, digits and hyphens in file/path names? ===:Please see section "Files" of the [http://pmrb.free.fr/contextref.pdf ConTeXt manual]. And also [XeTeXhttp://www.ntg.nl/pipermail/ntg-context/2011/057342.html here]], Unicode should work by defaultfor some discussion on the mailing-list.
=== Why does <code>\startalignment[right]</code> or <code>\framed[align=right]{some text}</code> align my text left instead of right and vice versa? ConTeXt vs. LaTeX ===:This is for backward compatibility with older versions; see [[Right and left]]. Hans was originally thinking of "ragged right" and "ragged left" alignment. Use '''flushleft''' and '''flushright''' instead.
=== What are the differences between ConTeXt and LaTeX? ===
:Another advantage is that many good books on LaTeX exist. Documentation of ConTeXt is not satisfactory, as attested by much activity on the mailing list, but is slowly being improved. And good books on the use of ConTeXt need to be written!
 
=== How transcribe this LaTeX macro to ConTeXt? ===
Could you please advice me, how transcribe this macro, controlling that no last line of a paragraph is shorter than the paragraph indenting?
 
<texcode>
\parfillskip=\hsize
\advance\parfillskip by -1.5\parindent
\advance\parfillskip by 0pt minus \parfillskip
\advance\parfillskip by 0pt minus -1em
</texcode>
 
Like this:
<texcode>
\installalign
{block}
{\parfillskip=\hsize
\advance\parfillskip by -1.5\parindent
\advance\parfillskip by 0pt minus \parfillskip
\advance\parfillskip by 0pt minus -1em}
 
% followed by
\setupalign[block]
</texcode>
 
== XML and other formats ==
=== How can I convert a document into RTF or HTML? ===
:[http://archive.contextgarden.net/thread/20050926.213139.45057948.en.html DOC/RTF to ConTeXt via XML]
=== XML: please tell me more about it ===
There is a section on the wiki dedicated to typesetting [[XML]] under the various flavours of ConTeXt.
 
== Fonts and Typography ==
=== Can I change to LaTeX’s Computer Modern's LaTeX font? ===
I see differences in screen between default fonts in ConTeXt (latin modernLatin Modern) and LaTeX (computer modernComputer Modern). Can I switch to latex LaTeX default font?. I think it's more steticalaesthetical.
: No.
: ''(I mean - of course you can; you only need to modify a few type-xxx.tex files and replace lm with cm in the source. But that solution is not/will not be supported officially.)''
:: Is there any tutorial for doing it?
::: ''No. There are no tutorials for the things that one is not supposed to mess with. Take a look at how things are done in those files and replace any occurrence of lm with cm.''
: There might be a workaround for this. Install the [http://cm-unicode.sourceforge.net/ OpenType version of Computer Modern fonts] on your system and use it with <code>simplefonts</code>.
=== Can How can I use some simpler bibliography methodget the “oldstyle numbers” (text figures) in a document? ===The mediaeval numbers can be inserted locally via the font switch <code>\os</code>.
I see With OpenType fonts that come with text figures you can just ''add'' the method respectivefont feature to the set of [[http://wiki.contextgarden.net/Bibliography adding references in ConTexT]] is like bibtex in latex. Is there any simple methood like build-in latex method (\thebibliography)?: Perhaps [[http://wiki.contextgardenfont features.net/Simple_Bibliography Simple bibliography (in simple bibliography)]]?
<texcode>\definefontfeature[default][default][onum=== XML: please tell me more about it ===yes]
=== How do I make a presentation? ===\setupbodyfont[schola,8pt]
:You don't need any special package (like prosper or seminar in LaTeX) to make a presentation. In contrast to LaTeX, changing the document size, changing colors, adding hyperlinks, ... appears to be extremely simple in ConTeXt. See [[Presentations]] for more specific topics.\starttext1234567890\stoptext</texcode>
=== <code>\setupindenting[medium]</code> doesn't work? ===or
:This does work, but the effect is not what you expect. Without <code>yes</code>, you have now set up the default size, but you have not turned paragraph indenting on. You have to execute <codetexcode>\setupindentingsetupbodyfont[yesschola,8pt]</code> before it starts actually indenting your paragraphs.
\definefontfeature[oldstyle][onum=== Does $$...$$ work for display math, like in (La)TeX? ===:No; the spacing above and below the equation will be wrong, and maybe other aspects too. Instead use <cmd>startformula</cmd> and <cmd>stopformula</cmd>.yes]
=== How do I get a numbered equation? ===\starttext1234567890 {\addff{oldstyle}1234567890}\stoptext:Add <cmd>placeformula</cmd> before the <cmd>startformula</cmdtexcode>.
=== How can I get a horizontal space with a defined width, so as exSee mailing list discussion at http://www.ntg. "\hspace{3em}" or "\hspace*{3em}" in LaTeX? ===:A horizontal space can be inserted with the TeXnl/pipermail/ntg-Primitive<cmd>hspace〈dimension〉<context/cmd> or with the ConTeXt command <cmd>hspace[identifier]<2011/cmd>058394.html .
=== How (You can I get check whether your font supports the lowercase (medieval, oldstyle figures) numbers in a document? ===“onum” feature by runningThe mediaeval numbers can be inserted locally by "\os". I would prefer a global setting of them but I don't know how to do it<code>otfinfo -f</code> on the OTF file.)
==Alignment = How transcribe this LaTeX macro to ConTEXt? ===Could you please advice me, how transcribe this macro, controlling that no last line of a paragraph is shorter than the paragraph indenting?
=== Why does <code>\startalignment[right]</code> or <texcodecode>\parfillskipframed[align=\hsize\advance\parfillskip by -1.5\parindent\advance\parfillskip by 0pt minus \parfillskip\advance\parfillskip by 0pt minus -1emright]{some text}</texcodecode>align my text left instead of right and vice versa? ===:This is for backward compatibility with older versions; see [[Right and left]]. Hans was originally thinking of "ragged right" and "ragged left" alignment. Use '''flushleft''' and '''flushright''' instead.
=== Why is \framed{} not centred? ===
\stoptext
</texcode>
 
== Spacing ==
 
=== <code>\setupindenting[medium]</code> doesn't work? ===
:This does work, but the effect is not what you expect. Without <code>yes</code>, you have now set up the default size, but you have not turned paragraph indenting on. You have to execute <code>\setupindenting[yes]</code> before it starts actually indenting your paragraphs.
 
=== How can I get a horizontal space with a defined width, so as ex. "\hspace{3em}" or "\hspace*{3em}" in LaTeX? ===
:A horizontal space can be inserted with the TeX-Primitive <code>\hskip〈dimension〉</code> or with the ConTeXt command {{cmd|hspace}}<tt>[identifier]</tt>.
=== Why is there a line-break in the output after some commands? ===
</texcode>
Answer: See previous answer!\externalfigure switches to vmode, so you need \dontleavehmode:
<texcode>
\starttext
</texcode>
==Math = Why = === Does $$...$$ work for display math, like in (La)TeX? ===:No; the spacing above and below the space is gobbled after equation will be wrong, and maybe other aspects too. Instead use {{cmd|startformula}} and {{cmd|stopformula}} (just as one rather generally prefers to use {{cmd|begin{equation}}} and {{cmd|end{equation}}} in LaTeX). === How do I get a numbered equation? ===:Add {{cmd|placeformula}} before the {{cmd|startformula}}. == Misc == === Can I use some commandssimpler bibliography method? ===<texcode>I see that the method of [[http://wiki.contextgarden.net/Bibliography adding references in ConTexT]] is like bibtex in latex. Is there any simple methood like build-in latex method (\starttextthebibliography)?X \externalfigure: Perhaps [[hackerhttp://wiki.contextgarden.net/Simple_Bibliography Simple bibliography (in simple bibliography)][width=1cm] X?\stoptext</texcode>=== How do I make a presentation? ===
Answer: When you You don't use all of need any special package (like prosper or seminar in LaTeX) to make a presentation. In contrast to LaTeX, changing the optional square bracket argumentsdocument size,the changing colors, adding hyperlinks, ... appears to be extremely simple in ConTeXt gobbles the space after the last square bracket. You have atleast 2 solutions:<texcode>\starttextX \externalfigureSee [hacker][width=1cmPresentations][] X % adding empty square bracketsfor more specific topics.
X \externalfigure[hacker[Category:Basics][width=1cm]\ X % adding explicit space command\stoptext</texcode>

Navigation menu