Dear list, sorry for insisting, but I need to solve this. I have to explain to newcomers (in my Spanish introduction to ConTeXt) what comments are and multiple lines don’t affect the final PDF document. I have the following sample: \setuptyping[lines=yes] \starttext \startTEXpage[offset=1em] \startTEX This is text. % and this is a comment \stopTEX \startXML <p>This is text.<!--and this is a comment--></p> \stopXML \startLUA if code=="code" then --this is a comment --[[ this is a multiline comment --]] ---[[ this isn’t a multiline comment --]] \stopLUA \stopTEXpage \stoptext I have three questions: 1. How do I enable that multiple blank lines are displayed as more than a single one? The Lua code contains one, two and three blank lines and they are displayed always as separation from single lines. I thought lines=yes should do that, but it doesn’t. 2. I accidentally discovered that the block comment opening (--[[) removes break with next line. I think it should be fixed. 3. The most important issue is that the whole comment (both markers and content) is displayed with \darkyellow. I wonder why comments aren’t display in typing as in any other editor. All comment characters should be displayed the same, since none of them would affect to the final output. How can I get the same color for the whole comment (again, both markers and content)? Many thanks for your help, Pablo -- http://www.ousia.tk
On Wed, 16 Aug 2017, Pablo Rodriguez wrote:
sorry for insisting, but I need to solve this.
I don't know how to answer your questions with the default syntax highlighting in ConTeXt, but are you willing to consider t-vim module for typesetting code. The output for your example is attached. All you need to do is add the following in the document preamble: \usemodule[vim] \definevimtyping[TEX][syntax=context] \definevimtyping[XML][syntax=xml] \definevimtyping[LUA][syntax=lua] If you have lot of code snippets, you may want to create a directory to store temporary files. You can do this using \setupvimtyping[directory=output] and then create a directory called "output" in the folder from which you run ConTeXt. Aditya
On 08/17/2017 12:00 AM, Aditya Mahajan wrote:
On Wed, 16 Aug 2017, Pablo Rodriguez wrote:
sorry for insisting, but I need to solve this.
I don't know how to answer your questions with the default syntax highlighting in ConTeXt, but are you willing to consider t-vim module for typesetting code. The output for your example is attached. Many thanks for your reply, Aditya,
your t-vim module is really useful, but I’m afraid it isn’t what I needed. I have to use \xmlprettyprinttext (input sources for most of my documents in ConTeXt are XML files). Besides, I think that the code highlighting in ConTeXt is clearer than the one that vim provides. Many thanks for your help, Pablo
All you need to do is add the following in the document preamble:
\usemodule[vim] \definevimtyping[TEX][syntax=context] \definevimtyping[XML][syntax=xml] \definevimtyping[LUA][syntax=lua]
If you have lot of code snippets, you may want to create a directory to store temporary files. You can do this using
\setupvimtyping[directory=output]
and then create a directory called "output" in the folder from which you run ConTeXt.
Aditya
On Wed, 16 Aug 2017 23:45:30 +0200
Pablo Rodriguez
I have to explain to newcomers (in my Spanish introduction to ConTeXt) what comments are and multiple lines don’t affect the final PDF document.
For such a document, it can be very useful to put code snippets into buffers and then use \typeTEXbuffer or \typeLUAbuffer and then \getbuffer Alan
On 08/17/2017 12:46 AM, Alan Braslau wrote:
On Wed, 16 Aug 2017 23:45:30 +0200 Pablo Rodriguez wrote:
I have to explain to newcomers (in my Spanish introduction to ConTeXt) what comments are and multiple lines don’t affect the final PDF document.
For such a document, it can be very useful to put code snippets into buffers and then use \typeTEXbuffer or \typeLUAbuffer and then \getbuffer
Many thanks for your reply, Alan. I use buffers and ConTeXt types them. But I don’t want to provide compiled examples (\getbuffer). I have two reasons for that: The first one is to motivate the user to try it. The second one is that I also offer the document in ePub format. Many thanks for your advice, Pablo -- http://www.ousia.tk
participants (3)
-
Aditya Mahajan
-
Alan Braslau
-
Pablo Rodriguez