Changes

Jump to navigation Jump to search
65 bytes added ,  11:51, 12 June 2012
space-gobbling fixed in mkiv
{{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? ===
:ConTeXt releases are identified by a time stamp, e.g. ''2010.06.23 12:45''. At most times, there is both a ''current'' and a ''beta'' ConTeXt release package available. As explained above, both packages contain MkII and MkIV, the difference between ''current'' and ''beta'' is that the latter contains the unstable developments to MkIV for testing by power users.
:Since "betas" are declared "current" only a few times a year and no bugfixes happen for "currents" (in contrary to "stable" branches in many software projects), you’re mostly better off with beta. It has some bugs fixed, bur mostly some new bugs. If you need a really stable and reliable system and can’t wait a few days for a fix, stick with MkII.
 
== Starting with ConTeXt ==
 
=== How do I install ConTeXt? ===
:See [[Installation]]
=== Is there a hello-world document? ===
:Yes. See [[First Document]] and [[Hello world]].
=== Is ConTeXt free (libre, open source) software? ===
:Yes. See the [[Read Me]] page for details.
 
=== How do I install ConTeXt? ===
 
:See [[Installation]]
=== Does ConTeXt support Unicode? ===
:Yes. It supports Unicode (UTF-8). In [[XeTeX]] and [[LuaTeX]] it is the default input encoding, while you need to use <cmd>enableregime</cmd><tt>[utf-8]</tt> command when working with [[pdfTeX]]. See also [[Encodings and Regimes]] (This needs a bit of elaboration!)
=== Why does <code>\startalignment[right]<should I only use letters, digits and hyphens in file/code> or <code>\framed[align=right]{some text}</code> align my text left instead of right and vice versapath names? ===:This is for backward compatibility with older versions; Please see section "Files" of the [http://pmrb.free.fr/contextref.pdf ConTeXt manual]. And also [Right and left]http://www.ntg.nl/pipermail/ntg-context/2011/057342.html here]for some discussion on the mailing-list. Hans was originally thinking of "ragged right" and "ragged left" alignment. Use '''flushleft''' and '''flushright''' instead == ConTeXt vs.LaTeX ==
=== 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 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)]]?
=== XML: please tell me more about it ===<texcode>There is a section on the wiki dedicated to typesetting \definefontfeature[default][XMLdefault][onum=yes] under the various flavours of ConTeXt.
=== 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? === :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. === 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> (just as one rather generally prefers to use <cmd>begin{equation}</cmd> and <cmd>end{equation}</cmd> in LaTeX). === How do I get a numbered equation? ===:Add <cmd>placeformula</cmd> before the <cmd>startformula</cmd>. === 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<cmd>hskip〈dimension〉</cmd> or with the ConTeXt command <cmd>hspace[identifier]</cmd>. === How can I get the “oldstyle numbers” (text figures) in a document? ===The mediaeval numbers can be inserted locally via the font switch <code>\os</code>. With OpenType fonts that come with text figures you can just ''add'' the respectivefont feature to the current set of font features.
<texcode>
% defining a new feature set called “oldstyle”\definefontfeature setupbodyfont[oldstyle] [default] [onum=yesschola,8pt]
% adding this feature set\addff{definefontfeature[oldstyle}][onum=yes]
\starttext
1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 9871234567890 {\addff{oldstyle}1234567890}
\stoptext
</texcode>
 
See mailing list discussion at http://www.ntg.nl/pipermail/ntg-context/2011/058394.html .
(You can check whether your font supports the “onum” feature by running
<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 <texcodecode>\parfillskip=\hsize\advance\parfillskip by -1.5\parindent\advance\parfillskip by 0pt minus \parfillskip\advance\parfillskip by 0pt minus -1emstartalignment[right]</texcodecodeLike this:or <texcodecode>\installalign framed[align=right]{blocksome text} {\parfillskip</code> align my text left instead of right and vice versa? ===\hsize \advance\parfillskip by -1.5\parindent \advance\parfillskip by 0pt minus \parfillskip \advance\parfillskip by 0pt minus -1em} % followed by\setupalign:This is for backward compatibility with older versions; see [[blockRight and left]]</texcode>. 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</cmd><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 the space is gobbled after some commands= === 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> (just as one rather generally prefers to use <cmd>begin{equation}</cmd> and <cmd>end{equation}<texcode/cmd>in LaTeX).\starttextX \externalfigure[hacker][width=1cm] X\stoptext== How do I get a numbered equation? ===:Add <cmd>placeformula</cmd> before the <cmd>startformula</texcodecmd>. == Misc ==
Answer: When you don't === Can I use all of the optional square bracket arguments,ConTeXt gobbles the space after the last square bracket. You have atleast 2 solutions:<texcode>\starttextX \externalfigure[hacker][widthsome simpler bibliography method? ===1cm][] X % adding empty square brackets
X \externalfigureI see that the method of [[hackerhttp://wiki.contextgarden.net/Bibliography adding references in ConTexT][width=1cm]is like bibtex in latex. Is there any simple methood like build-in latex method (\ X % adding explicit space command\stoptextthebibliography)?<: Perhaps [[http://wiki.contextgarden.net/texcode>Simple_Bibliography Simple bibliography (in simple bibliography)]]?
=== Why should How do I only use letters, digits and hyphens in file/path namesmake a presentation? ===
Answer: Please see section "Files" of You don't need any special package (like prosper or seminar in LaTeX) to make a presentation. In contrast to LaTeX, changing the[http://pmrbdocument size, changing colors, adding hyperlinks, .free.fr/contextref.pdf appears to be extremely simple in ConTeXt manual]. And alsoSee [http://www.ntg.nl/pipermail/ntg-context/2011/057342.html here[Presentations]] forsome discussion on the mailing-listmore specific topics.
148

edits

Navigation menu