Changes

Jump to navigation Jump to search
582 bytes removed ,  18:29, 20 February 2023
no edit summary
= Preamble =
Here is the place to get everything that is important to get started with ''ConTeXt'' (''mkiv'') and ''Textadept'' on ''MS Windows'' systemsoperating system.
Note that this page is a ''User talk'', which might differ from usual wiki-entries. In the end this page is meant to be of personal purpose. This means that there is no absolute truth to be found within this page. Experience might differ heavily from the expected results. Here I, ''Koenich'', will try to add as much info as I could gather on my way of learning, what I like to abbreviate ''CTX'', ConTeXt.
After reading this hopefully the reader will get a better understanding of what ConTeXt is, what its advantages and disadvantages are, also compared to other popular software, and how Textadept can be used to get the most out of ConTeXt regarding an efficient workflow. (Thanks to especially *''Donald Knuth''*, *''Hans Hagen''* and too many other coders and users to mention right here!)
= Introduction =
[http://wiki.contextgarden.net ConTeXt] (pronounced '''ConTehht''' as derived from Dutch) is a [http://en.wikipedia.org/wiki/TeX TeX] macro package created and maintained by [http://www.pragma-ade.com Pragma ADE]. The recent version ''mkiv'' is widely extensible using [https://www.lua.org/ Lua]. [https://github.com/orbitalquark/textadept Textadept] is a programmable text editor for Linux, Mac OSX and Windows, created and maintained by [https://github.com/orbitalquark Mitchell]. It is fully extensible using [https://www.lua.org/ Lua].
= Setup ConTeXt =
* If a message like '''context' is not recognized as an internal or external command...'' appears, you should make sure that you added the correct location of ConTeXt's executables (context.exe) path to Windows' search path or re-try the operation by starting from Step 2.1.
= Setup Text Editors = == ''CudaText'' == == ''Textadept '' ==
1. [https://foicica.com/textadept/download/textadept_LATEST.win32.zip Download] and extract [https://foicica.com/textadept/ '''Textadept'''] to a folder of your choice.
2. Use <code>textadept.exe</code> from the extracted folder to start Textadept.
=== Tweak Textadept's settings ===
'''Note''' that almost all changes to Textadept are saved in the file <code>init.lua</code>. There is two of them, of which you should edit only one:
Save <code>init.lua</code> and restart Textadept once. After doing so you can add changes to Textadept's configuration files and press <code>F9</code>-key afterwards to save and load the changes without having to restart Textadept.
=== Bind a PDF build command into Textadept ===
2.1.1. Use Textadept to open your <code>init.lua</code> stored in <code>SYSDRIVE:\users\USER\.textadept\</code>.
2.1.6. When you have a popular PDF reader installed already, it should pop up at the end of the process and show the created PDF output. [https://www.sumatrapdfreader.org/free-pdf-reader.html '''Sumatra PDF'''] is highly recommended for this.
=== Lexing (command highlighting & code folding) ===
A lexer is a file that defines command highlighting and code folding keywords. Textadept comes with a ConTeXt lexer. In order to be able to use command highlighting and code folding when writing ConTeXt documents, you have to bind those documents to the lexer. To do so
2.2.3. Open a ConTeXt document and check Textadept's status bar in the lower right corner. It should say '''context'''. If it says '''latex''' make sure it really is a ConTeXt file or repeat the procedure.
=== Themes & editor font changes ===
You can change the theme, font and font size of Textadept with the following line
buffer:set_theme('light', {font = 'Monospace', fontsize = 10})
* There are more settings which you can look up in Textadept's [https://foicica.com/textadept/manual.html#Themes manual].
=== Snippets ===
Snippets are predefined code or text blocks. Using snippets can save a lot of time as you won't have to retype often used commands and text passages. You add snippets to your <code>USER/.textadept/init.lua</code>. Alternatively you can create a new file, e.g. <code>USER/.textadept/mysnippets.lua</code>, add all snippets to that file and load it from within your <code>init.lua</code> with the following line:
require('mysnippets') -- Exemplary file name!
A ConTeXt module for Textadept is being developed at [https://github.com/stephengaito/ta-context-latex ta-context-latex].
Note though, that if you plan to use Textadept without LaTeX with ConTeXt mkiv only (recommended), then you might not need the package mentioned above as it comes with literally only a hand full of ConTeXt snippets. It also needs additional software to be installed (Textredux, ctags), so that it's almost more comfortable to create own ConTeXt snippets with the ease of Textadept (see above).
194

edits

Navigation menu