Changes

Jump to navigation Jump to search
3,167 bytes added ,  20:11, 28 June 2020
m
I missed an error in the year: 22020 to 2020
< [[Main PageFirst Document]]| [[Detailed Example]] | [[Basics]] >
What is ConTeXt? What can I do with it? Let’s see. Take your favourite text editor and type in the following document. Save it as file hello.tex.
ConTeXt is a ''[http://en.wikipedia.org/wiki/Markup_language markup language]'' used to primarily create PDF files. To use ConTeXt, create a text file (typically with a <code>.tex<texcode/code>\starttextHello World\stoptextextension) with ConTeXt markup and ''compile'' the file by running the command <code>context filename</texcodecode>. This creates a PDF file. This page explains how to create your very first ConTeXt document. == First steps ==
It shows already a Make sure that ConTeXt essential: everything's between <tt>\startsomething</tt> is installed on your system. To check that, go to the command line and <tt>\stopsomething</tt>.type
Now go to the shell<pre>context --version</command line and type inpre>
You should get an output as follows:
<pre>
texexec mtx-context | ConTeXt Process Management 1.03mtx-pdf hellocontext |mtx-context | main context file: /opt/context-minimals/texmf-context/tex/context/base/mkiv/context.texmkivmtx-context | current version: 2020.01.30 14:13
</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 now save the file as <code>hello.tex</code>: <texcode>\starttext\startsection[title={Testing ConTeXt}] This is my {\em first} ConTeXt will startdocument.\stopsection\stoptext</texcode> Words starting with a backslash (such as <code>\starttext</code>) are called '''command sequence''' or '''macros'''. The macros <texcode>\starttext....\stoptext</texcode> mark the content to be typeset. It will give you some The material before <code>\starttext</code> (called ''preamble'') is used to change the style of the output on your terminal ; any material after <code>\stoptext</code> is ignored.  The macros <texcode>\startsection[title={...}]...\stopsection</texcode> mark the title and the content of a section.  The macro <code>{\em ...}</code> is a [[Font Switching| font switch]] that emphasizes the content (by showing it in slanted font).  == Compile the ConTeXt file ==
<pre><nowiki> TeXExec 4.3 Go to the command- ConTeXt / PRAGMA ADE 1997-2004line and type:
executable : pdfetex format : cont-en inputfile : test output : standard interface : en options : once nonstop current mode : none<pre>context hello</pre>
This is pdfeTeXkConTeXt will then process your document, Version 3.141592-1.11a-2.1 (Web2C 7.5.2) \write18 enabled. %&-line parsing enabled. (/opt/texlive/8/texmf/web2c/cp8bit.tcx)entering extended mode(display some logging information on the console, and generate a <tt>hello.pdf</test.tex{pdftextt> output file.cfg}
ConTeXt ver<pre><nowiki>mtx-context | run 1: 2004luatex --fmt="/home/adityam/.cache/context-minimals/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en" --jobname="hello" --lua="/home/adityam/.cache/context-minimals/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.4lui" --c:currentrun=1 --c:fulljobname=".9 fmt/hello.tex" --c: 2004input=".4/hello.16 inttex" --c: english meskindofrun=1 --c: englishmaxnofruns=9 --c:texmfbinpath="/opt/context-minimals/texmf-linux-64/bin" "cont-yes.mkiv"
language : language en This is activeLuaTeX, Version 1.10.1 (TeX Live 2019) system commands enabled.open source > level 1, order 1, name '/opt/context-minimals/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'<protectionstate 0system >system > ConTeXt ver: 2019.07.24 11:17 MKIV beta fmt: 2019.8.17 int: english/english...
...
mkiv lua stats > lua properties: engine: lua 5.3, used memory: 94 MB, ctx: 93 MB, max: unknown MB), hash chars: min(64,40), symbol mask: utf (τεχ)
mkiv lua stats > runtime: 0.833 seconds, 1 processed pages, 1 shipped pages, 1.200 pages/second
system | total runtime: 4.485 seconds
</nowiki></pre>
Don’t be worried. This is == View the way it should look. Once texexec has finished, it will leave behind a generated PDF file called == Open the generated <tt>hello.pdf</tt>PDF file using a [http://en.wikipedia.org/wiki/List_of_PDF_software#Viewers PDF viewer]. Open it and you will see a It should look as follows: <context mode="Hello worldmkiv" >% Draw a white frame so that the page is not truncated. % But it does not seem to work :( \setupbackgrounds[text][frame=on ]\starttext\startsection[title={Testing ConTeXt}] This is my {\em first} ConTeXt document.\stopsection\stoptext</context> Note that the section has been numbered, the section number and the section title appear in a virtual A4 paper slightly larger fonts, and the emphasized word comes out in a page numberslanted font. == Modifying the output style == It is possible to change the style of the output by using appropriate ''setup'' commands in the preamble. For example, to make the section titles bold and to use italic (rather than slanted) font for emphasized words, use <context mode="mkiv" source="yes" text="which gives">\setuphead[section][style=\bfa]\setupbodyfontenvironment[default][em=italic] \starttext\startsection[title={Testing ConTeXt}] This is my {\em first} ConTeXt document.\stopsection\stoptext</context>
> [[Second StepCategory:Basics]][[Category:Sample documents]]
2

edits

Navigation menu