Open main menu

Changes

1,004 bytes removed ,  06:52, 10 September 2023
All of my wiki.contextgarden.net work in progress= Preamble =
= Here is the place to get everything that is important to get started with ''ConTeXt mkiv with Textadept v9'' on ''MS Windows'' operating system.3 (updated 2017/03) =
== Step 1: Install Thanks to especially ''Donald Knuth'ConTeXt', '' ==Hans Hagen'', ''Taco Hoekwater'' and too many other coders and users to mention here!
work in progress= Introduction =
== Step 2[http: Add //wiki.contextgarden.net ConTeXt] (pronounced 's executables folder to Windows search PATH ==''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].
work in progress= Setup ConTeXt =
== Step 3: Download & Install '''Textadept''' ConTeXt ==
# [https://foicica.com/textadept/download/textadept_LATEST.win32.zip Download] Installation and extract [https://foicicaupdate of ConTeXt work the same way.com/textadept/ '''Textadept'''] If you only want to a folder of your choice.# Use <code>textadept.exe</code> from the extracted folder update ConTeXt, you can go to start '''Textadept'''point 3.
== Step 41. Download [http: Tweak '''Textadept''''s settings ==//standalone.contextgarden.net/setup/ ConTeXt].* [https://distribution.contextgarden.net/setup/context-setup-mswin.zip context-setup-mswin.zip]
1. Use your freshly installed Textadept to open Textadept's main configuration file called <code>init2.lua</code>.* After extraction of Extract the downloaded Textadept archive there is a file called <code>init.lua</code> in the main program folder. It is '''not recommended''' to edit this file as your changes will be lost when you update Textadept. Instead:* When you start Textadept for the first time a new folder <code>SYSDRIVE:\users\USERNAME\.textadept</code> gets created. It also contains the file called <code>init.lua</code>. It's the file and location where you should save all of your Textadept settings. This way you can make a copy and use it on several computers. When you open it for the first time it should be emptychoice.2. Add an execute command for ConTeXt to Textadept's menu:* If your ConTeXt executables folder is already in the Windows search PATH: textadept.run.compile_commands.tex = 'mtxrun --autogenerate --script context --autopdf --purge --synctex=-1 "%f"'* If for some reason you can't add the folder You might want to PATH you have to add change the full path to your ConTeXt executables. For example: textadept.run.compile_commands.tex = 'C:/ctx/tex/texmf-mswin/bin/mtxrun --autogenerate --script context --autopdf --purge --synctex=-1 "%f"'* '''Note''' that you have to use slash <code>/</code> instead name of backslash <code>\</code> in the file path, since Lua (same as ConTeXt) interprets extracted directory to a <code>\</code> shorter one as it will be the beginning of a command, while final location for Windows is doesn't make a difference.3. Restart Textadept to reload the modified <code>init.lua</code>ConTeXt.
43. Open or create a Install / Update ConTeXt test document: \starttext hello world! \stoptext5. Use Textadept's '''Tools''' -> '''Compile''' to build a PDF with the options added to <code>init.lua</code>. A message buffer with compilation status will open in a seperate tab.
6* Use Windows Explorer to navigate to your ConTeXt directory. When you have In there should be a popular PDF reader installed already, file called <code>install.bat</code>.* Execute by double-clicking on it . A command prompt window should pop up at .** If it appears for only a few seconds, chances are high that the end of download server is down. In that case you might want to re-try the process and show procedure at some other time.* Wait for the created PDF output. [https:/download /wwwupdate to finish.sumatrapdfreader.org/free-pdf-reader.html '''Sumatra PDF'''] After it is highly recommended for thisdone, the command window should disappear by itself.
== OptionalAlternatively, from the command prompt: Additional '''Textadept''' tweaks ==
=== Lexing ===* Use Windows Explorer to navigate to your ConTeXt directory.** Click into the upper white field where the current location is displayed.** Enter <code>cmd</code> and press <code>Enter</code>-key.** Now Windows command prompt should pop up with the correct location.* Otherwise, you can start your Windows command prompt** by using the key shortcut <code>Windows-key + R</code>, entering <code>cmd</code> and pressing <code>Enter</code>-key.** Alternatively, you can use <code>Start</code> -> <code>Programs</code> -> <code>Accessories</code> -> <code>Command Pompt</code>.* Some important ''MS DOS'' commands:** <code>dir</code> list the content of the current directory** <code>cd DIRECTORY</code> change to directory with name DIRECTORY** <code>cd..</code> change to superior directory** <code>cd\</code> change to drive root** <code>X:</code> change to drive X:** also possible: <code>cd directory\subdirectory\subsubdir...</code>* In the end your command prompt should look like this: X:\ConTeXt>_
Textadept comes with an own == Add ConTeXt lexer. A lexer is a file that defines command highlighting. So it's a good idea executables folder to bind <code>*.tex</code> and/or <code>*.ctx</code> files to Textadept's ConTeXt lexer. To do so:Windows search Path ==
1. Add the following lines to your <code>USER/.textadept/init.lua</code>: textadept.file_types.extensions.tex = 'context'* If 'Note''': you plan to use LaTeX and ConTeXt, you should use different file extensions. For example <code>*.tex</code> will need admin rights for LaTeX and <code>*this.ctx</code> On public machines for ConTeXt documents. In that case example you only have most probably won't be able to bind your new add ConTeXt extension to Textadeptthat machine's ConTeXt lexer, since <code>.tex</code> files are automatically recognized as LaTeX documents: textadept.file_types.extensions.ctx = 'context'2. Restart Textadept to reload <code>initpath.lua</code>
31. Open a ConTeXt document Windows' '''System''' dialog* either by <code>Right-click</code>ing on '''This PC''' / '''My Computer''' on your Desktop and check Textadeptthen clicking on 's status bar in the lower right corner. It should say ''Properties'''* or by clicking '''Start''' -> '''Settings''' -> '''contextAbout'''. If it says -> '''latexSystem Info''' make sure it really is a ConTeXt file * or repeat the procedureon older Windows Machines by going to '''Control Panel''' -> '''System'''.
=== Themes & editor font changes ===* You can change the theme, font and font size of Textadept with the following line ui2.set_theme('dark', {font = 'Monospace', fontsize = 10})in which the expression Click on '''darkAdvanced System Settings''' is the filename of the theme located either in <code>Textadept\themes</code> or you can download and add new themes to <code>USER\.textadept\themes</code>(create the folder if it's not there yet"System Properties").There are more settings which you can look up in Textadept's [https://foicica.com/textadept/manual.html#Themes online manual].
=== Snippets ===Snippets are predefined code blocks3. You add them, again, to your <code>USER/Click on '''Advanced'''-Tab.textadept/init.lua</code>. Snippets in Textadept look like this:
snippets['context'] = snippets['context'] or {} snippets4.context[Click on 'emph'] = '{\\em %0}' snippetsEnvironment Variables.context['bold'] = '{\\bf %0}' snippets.context['start'] = '\\start%1\n%0\n\\stop%1' snippets.context['itemize'] = '\\startitemize\n\t%0\n\\stopitemize' snippets.context['item'] = '\\startitem\n\t%0\n\\stopitem' snippets.context['enumerate'] = '\\startenumerate\n\t%0\n\\stopenumerate' snippets.context['chapter'] = '\\startchapter[title={%1},marking{%1}]\n%0\n\\stopchapter' snippets.context['section'] = '\\startsection[title={%1},marking{%1}]\n%0\n\\stopsection' snippets.context['ssection'] = '\\startsubsection[title={%1},marking{%1}]\n%0\n\\stopsubsection' snippets.context['title'] = '\\starttitle[title={%1},marking{%1}]\n%0\n\\stoptitle' snippets.context['subject'] = '\\startsubject[title={%1},marking{%1}]\n%0\n\\stopsubject' snippets.context['ssubject'] = '\\startsubsubject[title={%1},marking{%1}]\n%0\n\\stopsubsubject'
5. Choose where to add ConTeXt's executables folder to:*Either to '''User variables for USER''' for the current user only* or to '''NoteSystem variables''' that a backslash is created as you would type it in ConTeXt: typing a double backslash <code>\\</code> prints a single backslash <code>\</code>for all users.
6. Double-click on the respective variable called ''Path''. 7. Add your ConTeXt executables to Windows path.*'''Note''' that the position, to where you add the location is sorted by importancy. The most important formatting commands are directories will be searched first. This might be taken into account when using ConTeXt together with MiKTeX for example. It's safest to place ConTeXt's path at the following:very beginning.**In '''User''' Path variable you might need to add the location and seperate it from the existing ones by using a semikolon (<code>%0;</code> creates ).* In '''System''' Path variable you probably only have to add a primary or a single input caretnew line. The location should look like this: **<code>%1<Win x86 /code> creates a secondary input caret32 bit: X:\ConTeXt\tex\texmf-mswin\bin**<code>%n<Win x64 /code> creates 64 bit: X:\ConTeXt\tex\texmf-win64\bin 8. Save your changes. Usually no restart or re-login is needed after this operation. Opt 1. You can test whether it worked by starting your Command prompt and entering the following line, while being in a new linedirectory other than the one you just added.  context -version *A message with ConTeXt's version number should apear.*<code>%t</code> creates If a tabmessage 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. = Text Editors === ''CudaText'' ==See my article here [[CudaText]].
194

edits