Difference between revisions of "First Document"
Jump to navigation
Jump to search
m (Link to a more up to date page) |
(Better organization of the page.) |
||
Line 1: | Line 1: | ||
< [[Main Page]] | [[Second Step]] | [[Next Steps]] > | < [[Main Page]] | [[Second Step]] | [[Next Steps]] > | ||
− | + | First, make sure that ConTeXt is installed on your system. To check that, go to the command line and type | |
− | + | <pre>context --version</pre> | |
− | <texcode> | + | You should get an output as follows: |
− | \ | + | <pre> |
− | + | mtx-context | ConTeXt Process Management 0.60 | |
− | \stoptext | + | mtx-context | |
− | </texcode> | + | mtx-context | main context file: /opt/context-minimals/texmf-context/tex/context/base/context.mkiv |
+ | mtx-context | current version: 2013.01.27 21:24 | ||
+ | </pre> | ||
+ | |||
+ | If ConTeXt is not installed on your system, check the [[Installation|installation]] page for installation instructions. | ||
+ | |||
+ | Follow the steps below to create a simple document using ConTeXt: | ||
+ | |||
+ | == Create a ConTeXt file == | ||
+ | |||
+ | Open a [[Text Editors|text editor]], type the following content, and save the file as <code>hello.tex</code>: | ||
+ | |||
+ | <texcode>\starttext | ||
+ | \section {Testing ConTeXt} | ||
+ | This is my first ConTeXt document. | ||
+ | \stoptext</texcode> | ||
+ | |||
+ | == Compile the ConTeXt file == | ||
− | + | Go to the command-line and type: | |
− | <pre> | + | <pre>context hello.tex</pre> |
− | context hello.tex | ||
− | </pre> | ||
− | ConTeXt will then process your document | + | ConTeXt will then process your document, display some logging information on the console, and generate a <tt>hello.pdf</tt> output file. |
<pre><nowiki> | <pre><nowiki> | ||
Line 26: | Line 41: | ||
ConTeXt ver: 2013.01.27 21:24 MKIV fmt: 2013.1.28 int: english/english | ConTeXt ver: 2013.01.27 21:24 MKIV fmt: 2013.1.28 int: english/english | ||
− | + | ... | |
− | + | ... | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
mkiv lua stats > current memory usage - 23 MB (ctx: 23 MB) | mkiv lua stats > current memory usage - 23 MB (ctx: 23 MB) | ||
mkiv lua stats > runtime - 0.316 seconds, 1 processed pages, 1 shipped pages, 3.165 pages/second | mkiv lua stats > runtime - 0.316 seconds, 1 processed pages, 1 shipped pages, 3.165 pages/second | ||
Line 66: | Line 49: | ||
</nowiki></pre> | </nowiki></pre> | ||
− | + | == View the generated PDF file == | |
+ | |||
+ | Open the generated <tt>hello.pdf</tt> PDF file using a [http://en.wikipedia.org/wiki/List_of_PDF_software#Viewers PDF viewer]. It should look as follows: | ||
− | <context | + | <context mode=mkiv> |
+ | % Draw a white frame so that the page is not truncated. | ||
+ | % But it does not seem to work :( | ||
+ | \setupbackgrounds[page][frame=on,framecolor=white] | ||
\starttext | \starttext | ||
− | + | \section {Testing ConTeXt} | |
+ | This is my first ConTeXt document. | ||
\stoptext | \stoptext | ||
</context> | </context> |
Revision as of 20:11, 30 January 2013
< Main Page | Second Step | Next Steps >
First, make sure that ConTeXt is installed on your system. To check that, go to the command line and type
context --version
You should get an output as follows:
mtx-context | ConTeXt Process Management 0.60 mtx-context | mtx-context | main context file: /opt/context-minimals/texmf-context/tex/context/base/context.mkiv mtx-context | current version: 2013.01.27 21:24
If ConTeXt is not installed on your system, check the installation page for installation instructions.
Follow the steps below to create a simple document using ConTeXt:
Create a ConTeXt file
Open a text editor, type the following content, and save the file as hello.tex
:
\starttext \section {Testing ConTeXt} This is my first ConTeXt document. \stoptext
Compile the ConTeXt file
Go to the command-line and type:
context hello.tex
ConTeXt will then process your document, display some logging information on the console, and generate a hello.pdf output file.
mtx-context | run 1: luatex --fmt="/opt/context-minimals/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en" --jobname="hello" --lua="/opt/context-minimals/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui" --no-parse-first-line --c:currentrun=1 --c:fulljobname="./hello.tex" --c:input="./hello.tex" --c:kindofrun=1 "cont-yes.mkiv" This is LuaTeX, Version beta-0.74.0-2012122511 (rev 4541) \write18 enabled. (/opt/context-minimals/texmf-context/tex/context/base/cont-yes.mkiv ConTeXt ver: 2013.01.27 21:24 MKIV fmt: 2013.1.28 int: english/english ... ... mkiv lua stats > current memory usage - 23 MB (ctx: 23 MB) mkiv lua stats > runtime - 0.316 seconds, 1 processed pages, 1 shipped pages, 3.165 pages/second system | total runtime: 0.468
View the generated PDF file
Open the generated hello.pdf PDF file using a PDF viewer. It should look as follows: