Difference between revisions of "User talk:Koenich"

From Wiki
Jump to navigation Jump to search
m
(more and more complete)
Line 1: Line 1:
 
All of my wiki.contextgarden.net work in progress
 
All of my wiki.contextgarden.net work in progress
  
== ConTeXt (beta 2017/02/19) with Textadept (9.3) ==
+
= ConTeXt mkiv with Textadept v9.3 (updated 2017/03) =
=Intstallation & ConTeXt Integration in Windows (as of 2017/03)=
 
  
* Install (i.e. download, extract and update) '''ConTeXt''' (mkiv)
+
== Step 1: Install '''ConTeXt''' ==
** work in progress
 
* Add ConTeXt's executables folder to Windows PATH
 
** work in progress
 
* [https://foicica.com/textadept/download/textadept_LATEST.win32.zip Download] and extract [https://foicica.com/textadept/ '''Textadept'''] to a folder of your choice.
 
* Edit Textadept's ''init.lua''
 
** '''Note''' that there are two ''init.lua'' of certain importancy:
 
*** one is located in Textadept's program folder: don't edit this one, as you will lose your changes when you update Textadept
 
*** second is created by Textadept when you start it for the first time and it's located at '''SYSDRIVE:\users\USERNAME\.textadept\init.lua'''
 
* add the following line to the blank init.lua:
 
** textadept.run.compile_commands.tex = 'mtxrun --autogenerate --script context --autopdf --purge --synctex=-1 "%f"'
 
*** '''Note''' that it's only a single line, so you might need to re-format it when you copy and paste it from here into your document. Also '''note''' that your ''mtxrun.exe'' has to be in the Windows PATH (see above) in order to work, otherwise you have to add the full path to mtxrun. For example:
 
**** textadept.run.compile_commands.tex = 'C:/CTX/tex/texmf-win64/bin/mtxrun --autogenerate --script context --autopdf --purge --synctex=-1 "%f"'
 
***** '''Note''' that you have to use slash ( / ) instead of backslash ( \ ) in the file path, since Lua (same as ConTeXt) interprets a \ as the beginning of a command, while for Windows is doesn't make a change.
 
* restart Textadept and open or create a ConTeXt test document:
 
** \starttext hello world! \stoptext
 
* use Textadept's '''Tools''' -> '''Compile''' to build a PDF with the options added to the line
 
* That's it, you're done. 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.
 
  
* further options that can be added to your '''user/init.lua
+
work in progress
** As of v9 (at least) Textadept seems to have an own ConTeXt lexer. So you can add the following lines to your ''init.lua'' to let Textadept choose it when you open a ''.tex'' document.
 
textadept.file_types.extensions.tex = 'context'
 
*** if you plan to use ConTeXt mkiv alone, or use another ending to seperate ConTeXt from LaTeX documents, for example ''.ctx'':
 
textadept.file_types.extensions.ctx = 'context'
 
  
** Change the theme, font and font size of Textadept with the following line
+
== Step 2: Add ConTeXt's executables folder to Windows search PATH ==
ui.set_theme('dark', {font = 'Monospace', fontsize = 10})
+
 
*** the expression ''dark'' is the filename of the theme located either in Textadept's program folder themes or you can download and add new themes to USER\.textadept\themes
+
work in progress
(create the folder if it's not there yet)
+
 
 +
== Step 3: Install '''Textadept''' ==
 +
 
 +
# [https://foicica.com/textadept/download/textadept_LATEST.win32.zip Download] and extract [https://foicica.com/textadept/ '''Textadept'''] to a folder of your choice.
 +
# Use <code>textadept.exe</code> from the extracted folder to start '''Textadept'''.
 +
 
 +
== Step 4: Tweak '''Textadept''''s settings ==
 +
 
 +
1. Use your freshly installed Textadept to open Textadept's main configuration file called <code>init.lua</code>.
 +
* After extraction of 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 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 empty.
 +
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 to PATH you have to add 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 of backslash <code>\</code> in the file path, since Lua (same as ConTeXt) interprets a <code>\</code> as the beginning of a command, while for Windows is doesn't make a difference.
 +
3. Restart Textadept to reload the modified <code>init.lua</code>.
 +
 
 +
4. Open or create a ConTeXt test document:
 +
  \starttext hello world! \stoptext
 +
5. 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. 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.
 +
 
 +
== Optional: Additional '''Textadept''' tweaks ==
 +
 
 +
=== Lexing ===
 +
 
 +
Textadept comes with an own ConTeXt lexer. A lexer is a file that defines command highlighting. So it's a good idea to bind <code>*.tex</code> and/or <code>*.ctx</code> files to Textadept's ConTeXt lexer. To do so:
 +
1. Add the following lines to your <code>USER/.textadept/init.lua</code>:
 +
  textadept.file_types.extensions.tex = 'context'
 +
* If you plan to use LaTeX and ConTeXt, you should use different file extensions. For example <code>*.tex</code> for LaTeX and <code>*.ctx</code> for ConTeXt documents. In that case you only have to bind your new ConTeXt extension to Textadept'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>init.lua</code>
 +
 
 +
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
 +
  ui.set_theme('dark', {font = 'Monospace', fontsize = 10})
 +
in which the expression '''dark''' is the filename of the theme located either in Textadept\themes or you can download and add new themes to USER\.textadept\themes
 +
(create the folder if it's not there yet).
 +
There are more settings which you can look up in Textadept's [https://foicica.com/textadept/manual.html#Themes online manual].

Revision as of 21:44, 2 March 2017

All of my wiki.contextgarden.net work in progress

ConTeXt mkiv with Textadept v9.3 (updated 2017/03)

Step 1: Install ConTeXt

work in progress

Step 2: Add ConTeXt's executables folder to Windows search PATH

work in progress

Step 3: Install Textadept

  1. Download and extract Textadept to a folder of your choice.
  2. Use textadept.exe from the extracted folder to start Textadept.

Step 4: Tweak Textadept's settings

1. Use your freshly installed Textadept to open Textadept's main configuration file called init.lua.

  • After extraction of the downloaded Textadept archive there is a file called init.lua 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 SYSDRIVE:\users\USERNAME\.textadept gets created. It also contains the file called init.lua. It's the file and location where you should save all 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 empty.

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 to PATH you have to add 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 / instead of backslash \ in the file path, since Lua (same as ConTeXt) interprets a \ as the beginning of a command, while for Windows is doesn't make a difference.

3. Restart Textadept to reload the modified init.lua.

4. Open or create a ConTeXt test document:

 \starttext hello world! \stoptext

5. Use Textadept's Tools -> Compile to build a PDF with the options added to init.lua. A message buffer with compilation status will open in a seperate tab.

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. Sumatra PDF is highly recommended for this.

Optional: Additional Textadept tweaks

Lexing

Textadept comes with an own ConTeXt lexer. A lexer is a file that defines command highlighting. So it's a good idea to bind *.tex and/or *.ctx files to Textadept's ConTeXt lexer. To do so: 1. Add the following lines to your USER/.textadept/init.lua:

 textadept.file_types.extensions.tex = 'context'
  • If you plan to use LaTeX and ConTeXt, you should use different file extensions. For example *.tex for LaTeX and *.ctx for ConTeXt documents. In that case you only have to bind your new ConTeXt extension to Textadept's ConTeXt lexer, since .tex files are automatically recognized as LaTeX documents:
 textadept.file_types.extensions.ctx = 'context'

2. Restart Textadept to reload init.lua

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
 ui.set_theme('dark', {font = 'Monospace', fontsize = 10})

in which the expression dark is the filename of the theme located either in Textadept\themes or you can download and add new themes to USER\.textadept\themes (create the folder if it's not there yet). There are more settings which you can look up in Textadept's online manual.