Difference between revisions of "Installation"

From Wiki
Jump to navigation Jump to search
 
(45 intermediate revisions by the same user not shown)
Line 12: Line 12:
 
<li>
 
<li>
  
=== MacOS ===
+
=== macOS ===
 
* X86 [https://lmtx.pragma-ade.com/install-lmtx/context-osx-64.zip 64bits]
 
* X86 [https://lmtx.pragma-ade.com/install-lmtx/context-osx-64.zip 64bits]
 
* ARM [https://lmtx.pragma-ade.com/install-lmtx/context-osx-arm64.zip 64bits]
 
* ARM [https://lmtx.pragma-ade.com/install-lmtx/context-osx-arm64.zip 64bits]
Line 63: Line 63:
 
See the next sections for instructions specific to various platforms.
 
See the next sections for instructions specific to various platforms.
  
== Unix ==
+
== GNU/Linux ==
  
 
The steps in this section show how to download and install ConTeXt for a 64-bit Linux system. Change the archive file download link as needed for your target platform. Open a new terminal then run the following commands:
 
The steps in this section show how to download and install ConTeXt for a 64-bit Linux system. Change the archive file download link as needed for your target platform. Open a new terminal then run the following commands:
  
# mkdir $HOME/context
+
# <code>mkdir $HOME/context</code> and <code>cd $HOME/context</code>
# cd $HOME/context
+
# <code>wget https://lmtx.pragma-ade.com/install-lmtx/context-linux-64.zip</code>
# wget https://lmtx.pragma-ade.com/install-lmtx/context-linux-64.zip
+
# <code>unzip context-linux-64.zip</code>
# unzip context-linux-64.zip
+
# <code>sh install.sh</code>
# sh install.sh
+
# Update the PATH environment variable by using the path instructions displayed when the install program finishes. The instructions will vary depending on the type of shell being used:
 +
#* <kbd>'''Bash:    '''</kbd> <code>echo 'export PATH=...instructions...:$PATH'  >> ~/.bashrc</code>
 +
#* <kbd>'''Zsh:    '''</kbd> <code>echo 'export PATH=...instructions...:$PATH'  >> ~/.zshenv</code>
 +
#* <kbd>'''Sh/Ksh:  '''</kbd> <code>echo 'export PATH=...instructions...:$PATH'  >> ~/.profile</code>
 +
#* <kbd>'''Tcsh/csh:'''</kbd> <code>echo 'set path = ($path ...instructions...)' >> ~/.cshrc</code>
 +
#* For example, if ConTeXt was downloaded into `$HOME/context` on a system running bash, then the following line would update the PATH environment variable: <code>echo 'export PATH=$HOME/context/tex/texmf-linux-64/bin:$PATH' >> ~/.bashrc</code>
 +
# Then generate the cache with <code>mtxrun --generate</code>.
 +
# <code>rm context-linux-64.zip</code>
  
Update the PATH environment variable by using the path instructions displayed when the install program finishes. The instructions will vary depending on the type of shell being used:
+
== macOS ==
 
 
* '''Bash''': <code>echo 'export PATH=...instructions...:$PATH'  >> ~/.bashrc</code>
 
* '''Zsh''': <code>echo 'export PATH=...instructions...:$PATH'  >> ~/.zshenv</code>
 
* '''Sh'''/'''Ksh''': <code>echo 'export PATH=...instructions...:$PATH'  >> ~/.profile</code>
 
* '''Tcsh'''/'''csh''': <code>echo 'set path = ($path ...instructions...)' >> ~/.cshrc</code>
 
 
 
For example, if ConTeXt was downloaded into `$HOME/context` on a system running bash, then the following line would update the PATH environment variable:
 
 
 
<code>echo 'export PATH=$HOME/context/tex/texmf-linux-64/bin:$PATH' >> ~/.bashrc</code>
 
 
 
Then generate the cache with
 
<code>mtxrun --generate</code>.
 
== MacOS ==
 
  
 
The instructions for MacOS are the same as for Unix, but note that:
 
The instructions for MacOS are the same as for Unix, but note that:
Line 93: Line 87:
 
* MacOS versions before Catalina use '''Bash''' by default.
 
* MacOS versions before Catalina use '''Bash''' by default.
 
* You might need to de-quarantine the binaries (and sometimes every created PDF):
 
* You might need to de-quarantine the binaries (and sometimes every created PDF):
 
+
** <code>sudo xattr -r -d com.apple.quarantine bin/mtxrun</code>
    sudo xattr -r -d com.apple.quarantine bin/mtxrun
+
** <code>sudo xattr -r -d com.apple.quarantine tex/texmf-osx-64/bin/*</code>
    sudo xattr -r -d com.apple.quarantine tex/texmf-osx-64/bin/*
 
  
 
== Windows ==
 
== Windows ==
Line 101: Line 94:
 
Complete the following steps to set up ConTeXt on Windows:
 
Complete the following steps to set up ConTeXt on Windows:
  
# Create a directory for ConTeXt, such as `C:\context`.
+
# Create a directory for ConTeXt, such as <code>C:\context</code>.
 
# Download the architecture-specific version into the ConTeXt directory.
 
# Download the architecture-specific version into the ConTeXt directory.
 
# Extract the archive.
 
# Extract the archive.
 
# Run: <code>install.bat</code>
 
# Run: <code>install.bat</code>
 
# Run: <code>setpath.bat</code>
 
# Run: <code>setpath.bat</code>
 +
# Then generate the cache with the command <code>mtxrun --generate</code> in a command prompt.
 +
# Delete the file archive file context-*win*.zip.
  
Installation is complete.
+
= Check the installation =
  
 +
Make sure that ConTeXt is installed on your system. To check that, go to the command prompt and type
  
= First document =
+
  context --version
  
Make sure that ConTeXt is installed on your system. To check that, go to the command line and type
+
You should get an output as follows:
  
<pre>context --version</pre>
+
  mtx-context     | ConTeXt Process Management 1.06
 +
  mtx-context    |
 +
  mtx-context    | main context file: /home/myuser/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
 +
  mtx-context    | current version: 2024.04.01 08:59
 +
  mtx-context    | main context file: /home/myuser/context/tex/texmf-context/tex/context/base/mkxl/context.mkxl
 +
  mtx-context    | current version: 2024.04.01 08:59
  
You should get an output as follows:
+
= Upgrade =
<pre>
+
 
mtx-context    | ConTeXt Process Management 1.03
+
Re-run the install program to upgrade, which will update the distribution incrementally:
mtx-context    |
 
mtx-context    | main context file: /opt/context-minimals/texmf-context/tex/context/base/mkiv/context.mkiv
 
mtx-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.
+
* Windows: <code>install.bat</code>
 +
* GNU/Linux or macOS: <code>sh install.sh</code>
  
Follow the steps below to create a simple document using ConTeXt:
+
= First document =
  
== Create a ConTeXt file ==
+
== Creation of a first ConTeXt file ==
 
   
 
   
Open a [[Text Editors|text editor]], type the following content, and save the file as <code>hello.tex</code> or <code>hello.mkxl</code>:
+
Open a [[Text Editors|text editor]], type the following content, and save the file as <code>doc01.tex</code>:
  
<texcode>\starttext
+
<texcode>
 +
\setuppapersize[A6]
 +
\starttext
 
\startsection[title={Testing ConTeXt}]
 
\startsection[title={Testing ConTeXt}]
  This is my {\em first} ConTeXt document.
+
This is my first ConTeXt document.
 
\stopsection
 
\stopsection
\stoptext</texcode>
+
\stoptext
 +
</texcode>
  
Words starting with a backslash (such as <code>\starttext</code>) are called '''command sequence''' or '''macros'''. The macros
+
== Compilation of the ConTeXt file to PDF file ==
 
 
<texcode>\starttext
 
....
 
\stoptext</texcode>
 
 
 
mark the content to be typeset. The material before <code>\starttext</code> (called ''preamble'') is used to change the style of the output; 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 ==
 
  
 
Go to the command-line and type:
 
Go to the command-line and type:
  
<pre>context hello</pre>
+
<pre>context doc01</pre>
  
ConTeXt will then process your document, display some logging information on the console, and generate a <tt>hello.pdf</tt> output file.
+
ConTeXt will then process your document, display some logging information on the console, and generate a <tt>doc01.pdf</tt> output file.
  
 
<pre><nowiki>
 
<pre><nowiki>
mtx-context    | run 1: luatex --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.lui" --c:currentrun=1 --c:fulljobname="./hello.tex" --c:input="./hello.tex" --c:kindofrun=1 --c:maxnofruns=9 --c:texmfbinpath="/opt/context-minimals/texmf-linux-64/bin" "cont-yes.mkiv"
+
resolvers      | formats | executing runner 'run luametatex format': /home/myuser/context/tex/texmf-linux-64/bin/luametatex --jobname="./doc01.tex" --socket --shell-escape --fmt=/home/myuser/context/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt --lua=/home/myuser/context/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui --c:currentrun=1 --c:fulljobname="./doc01.tex" --c:input="./doc01.tex" --c:kindofrun=1 --c:maxnofruns=9 --c:texmfbinpath="/home/myuser/context/tex/texmf-linux-64/bin"
 +
system          >
 +
system          > ConTeXt  ver: 2024.04.01 08:59 LMTX  fmt: 2024.4.13  int: english/english
 +
system          >
  
This is LuaTeX, 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'
+
mkiv lua stats  > used engine: luametatex version: 2.11.02, functionality level: 20240311, format id: 700, compiler: gcc
system          >  
+
mkiv lua stats > tex properties: 807100 hash slots used of 2097152, 51019 control sequences, approximate memory usage: 42 MB
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.5, used memory: 57 MB, ctx: 54 MB, max: 54 MB, symbol mask: utf (τεχ)
...
+
mkiv lua stats  > runtime: 0.617 seconds, 1 processed pages, 1 shipped pages, 1.620 pages/second
...
+
system          | total runtime: 1.989 seconds of 2.052 seconds
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>
 
</nowiki></pre>
  
== View the generated PDF file ==
+
== Viewing 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:
+
Open the generated <tt>doc01.pdf</tt> PDF file using a [http://en.wikipedia.org/wiki/List_of_PDF_software#Viewers PDF viewer]. It should look as follows:
  
<context mode="mkiv">
+
<context force="yes">
% Draw a white frame so that the page is not truncated.
+
\setuppapersize[A6]
% But it does not seem to work :(
 
\setupbackgrounds[text][frame=on]
 
 
\starttext
 
\starttext
 
\startsection[title={Testing ConTeXt}]
 
\startsection[title={Testing ConTeXt}]
  This is my {\em first} ConTeXt document.
+
This is my first ConTeXt document.
 
\stopsection
 
\stopsection
 
\stoptext
 
\stoptext
 
</context>
 
</context>
  
Note that the section has been numbered, the section number and the section title appear in a slightly larger fonts, and the emphasized word comes out in a slanted font.
+
Note that the section has been numbered, the section number and the section title appear in a slightly larger fonts.
 
 
 
 
== Running MkIV ==
 
  
The new distribution has all the files to run the previous version of ConTeXt.
+
Your installation is now up and running: you can start working on the [[Tutorials]].
* Run <code>context --luatex Hello-world.tex</code> to use the `luatex` binary and [[MkIV]].
 
  
= Upgrade =
+
= Additional instructions =
 
 
Re-run the install program to upgrade, which will update the distribution incrementally:
 
 
 
* Windows: <code>install.bat</code>
 
* Unix: <code>sh install.sh</code>
 
 
 
 
 
= Further installation instructions =
 
  
 
* [[Installing ConTeXt LMTX on MacOS]]
 
* [[Installing ConTeXt LMTX on MacOS]]
Line 216: Line 185:
 
* The official page '''[http://www.pragma-ade.nl/install.htm Installing ConTeXt LMTX ]''' is hosted by Pragma ADE.
 
* The official page '''[http://www.pragma-ade.nl/install.htm Installing ConTeXt LMTX ]''' is hosted by Pragma ADE.
 
* Pragma ADE also provides the '''[http://www.pragma-ade.nl/download-1.htm ConTeXt MkIV distribution]''' (version MkIV is the predecessor of LMTX) for which there are also [[ConTeXt_Standalone|detailed installation instructions]].
 
* Pragma ADE also provides the '''[http://www.pragma-ade.nl/download-1.htm ConTeXt MkIV distribution]''' (version MkIV is the predecessor of LMTX) for which there are also [[ConTeXt_Standalone|detailed installation instructions]].
 +
* Compilation with ConTeXt MkIV (old LuaTeX-based version): The new distribution has all the files to run the previous version of ConTeXt.
 +
** <code>context --luatex doc01</code>
  
 
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</code> extension) with ConTeXt markup and ''compile'' the file by running the command <code>context filename</code>. This creates a PDF file. This page explains how to create your very first ConTeXt document.
 
----
 
 
{{Installation navbox}}
 
  
 
[[Category:Basics]]
 
[[Category:Basics]]
 
[[Category:Installation]]
 
[[Category:Installation]]

Latest revision as of 19:23, 14 April 2024

Download


You can read the licence (Creative Commons GNU GPL for program code, and Creative Commons Attribution ShareAlike for documentation).

Installation

The general steps to install ConTeXt LMTX are as follows:

  1. Create a directory for ConTeXt.
  2. Download the platform-specific archive file into the ConTeXt directory.
  3. Unpack the archive.
  4. Execute the install program, which downloads the distribution.
  5. Update the PATH environment variable.
  6. Generate cache
  7. Optionally, delete the archive file.

See the next sections for instructions specific to various platforms.

GNU/Linux

The steps in this section show how to download and install ConTeXt for a 64-bit Linux system. Change the archive file download link as needed for your target platform. Open a new terminal then run the following commands:

  1. mkdir $HOME/context and cd $HOME/context
  2. wget https://lmtx.pragma-ade.com/install-lmtx/context-linux-64.zip
  3. unzip context-linux-64.zip
  4. sh install.sh
  5. Update the PATH environment variable by using the path instructions displayed when the install program finishes. The instructions will vary depending on the type of shell being used:
    • Bash: echo 'export PATH=...instructions...:$PATH' >> ~/.bashrc
    • Zsh: echo 'export PATH=...instructions...:$PATH' >> ~/.zshenv
    • Sh/Ksh: echo 'export PATH=...instructions...:$PATH' >> ~/.profile
    • Tcsh/csh: echo 'set path = ($path ...instructions...)' >> ~/.cshrc
    • For example, if ConTeXt was downloaded into $HOME/context on a system running bash, then the following line would update the PATH environment variable: echo 'export PATH=$HOME/context/tex/texmf-linux-64/bin:$PATH' >> ~/.bashrc
  6. Then generate the cache with mtxrun --generate.
  7. rm context-linux-64.zip

macOS

The instructions for MacOS are the same as for Unix, but note that:

  • MacOS versions from Catalina (10.15) and newer use Zsh by default.
  • MacOS versions before Catalina use Bash by default.
  • You might need to de-quarantine the binaries (and sometimes every created PDF):
    • sudo xattr -r -d com.apple.quarantine bin/mtxrun
    • sudo xattr -r -d com.apple.quarantine tex/texmf-osx-64/bin/*

Windows

Complete the following steps to set up ConTeXt on Windows:

  1. Create a directory for ConTeXt, such as C:\context.
  2. Download the architecture-specific version into the ConTeXt directory.
  3. Extract the archive.
  4. Run: install.bat
  5. Run: setpath.bat
  6. Then generate the cache with the command mtxrun --generate in a command prompt.
  7. Delete the file archive file context-*win*.zip.

Check the installation

Make sure that ConTeXt is installed on your system. To check that, go to the command prompt and type

  context --version

You should get an output as follows:

  mtx-context     | ConTeXt Process Management 1.06
  mtx-context     |
  mtx-context     | main context file: /home/myuser/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
  mtx-context     | current version: 2024.04.01 08:59
  mtx-context     | main context file: /home/myuser/context/tex/texmf-context/tex/context/base/mkxl/context.mkxl
  mtx-context     | current version: 2024.04.01 08:59

Upgrade

Re-run the install program to upgrade, which will update the distribution incrementally:

  • Windows: install.bat
  • GNU/Linux or macOS: sh install.sh

First document

Creation of a first ConTeXt file

Open a text editor, type the following content, and save the file as doc01.tex:

\setuppapersize[A6]
\starttext
\startsection[title={Testing ConTeXt}]
This is my first ConTeXt document.
\stopsection
\stoptext

Compilation of the ConTeXt file to PDF file

Go to the command-line and type:

context doc01

ConTeXt will then process your document, display some logging information on the console, and generate a doc01.pdf output file.

resolvers       | formats | executing runner 'run luametatex format': /home/myuser/context/tex/texmf-linux-64/bin/luametatex --jobname="./doc01.tex" --socket --shell-escape --fmt=/home/myuser/context/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt --lua=/home/myuser/context/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui  --c:currentrun=1 --c:fulljobname="./doc01.tex" --c:input="./doc01.tex" --c:kindofrun=1 --c:maxnofruns=9 --c:texmfbinpath="/home/myuser/context/tex/texmf-linux-64/bin"
system          > 
system          > ConTeXt  ver: 2024.04.01 08:59 LMTX  fmt: 2024.4.13  int: english/english
system          > 

…

mkiv lua stats  > used engine: luametatex version: 2.11.02, functionality level: 20240311, format id: 700, compiler: gcc
mkiv lua stats  > tex properties: 807100 hash slots used of 2097152, 51019 control sequences, approximate memory usage: 42 MB
mkiv lua stats  > lua properties: engine: lua 5.5, used memory: 57 MB, ctx: 54 MB, max: 54 MB, symbol mask: utf (τεχ)
mkiv lua stats  > runtime: 0.617 seconds, 1 processed pages, 1 shipped pages, 1.620 pages/second
system          | total runtime: 1.989 seconds of 2.052 seconds

Viewing the generated PDF file

Open the generated doc01.pdf PDF file using a PDF viewer. It should look as follows:

Note that the section has been numbered, the section number and the section title appear in a slightly larger fonts.

Your installation is now up and running: you can start working on the Tutorials.

Additional instructions