missing pagebreak using vim-module for typing
![](https://secure.gravatar.com/avatar/946accc6e24c43fe03ca8184736b063f.jpg?s=120&d=mm&r=g)
Dear context folks, since Aditya recommended I am using the vim module for including MATLAB-files in my TeX-files. But for longer code snippets there is no pagebreak, so that the code is cuttet at the end of the page. What do I have to do? current version: 2012.04.19 23:18 Thanks, Xenia
![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
On Tue, 1 May 2012, Xenia wrote:
Dear context folks,
since Aditya recommended I am using the vim module for including MATLAB-files in my TeX-files. But for longer code snippets there is no pagebreak, so that the code is cuttet at the end of the page. What do I have to do?
current version: 2012.04.19 23:18
Can you post a minimal example? The attached simple test gives me page breaks. Aditya
![](https://secure.gravatar.com/avatar/946accc6e24c43fe03ca8184736b063f.jpg?s=120&d=mm&r=g)
On 01.05.2012 08:50, Aditya Mahajan wrote:
On Tue, 1 May 2012, Xenia wrote:
Dear context folks,
since Aditya recommended I am using the vim module for including MATLAB-files in my TeX-files. But for longer code snippets there is no pagebreak, so that the code is cuttet at the end of the page. What do I have to do?
current version: 2012.04.19 23:18
Can you post a minimal example? The attached simple test gives me page breaks.
The reason seems so be the frame, that I prefer. I am attaching the files. Thanks, Xenia
![](https://secure.gravatar.com/avatar/93131e1e6e2204bd13501390d768dbdc.jpg?s=120&d=mm&r=g)
Am 01.05.2012 um 12:24 schrieb Xenia:
On 01.05.2012 08:50, Aditya Mahajan wrote:
On Tue, 1 May 2012, Xenia wrote:
Dear context folks,
since Aditya recommended I am using the vim module for including MATLAB-files in my TeX-files. But for longer code snippets there is no pagebreak, so that the code is cuttet at the end of the page. What do I have to do?
current version: 2012.04.19 23:18
Can you post a minimal example? The attached simple test gives me page breaks.
The reason seems so be the frame, that I prefer. I am attaching the files.
Use \definetextbackground for the frame, framedtext’s are unbreakable boxes. Wolfgang
![](https://secure.gravatar.com/avatar/946accc6e24c43fe03ca8184736b063f.jpg?s=120&d=mm&r=g)
On 01.05.2012 13:02, Wolfgang Schuster wrote:
Am 01.05.2012 um 12:24 schrieb Xenia:
On 01.05.2012 08:50, Aditya Mahajan wrote:
On Tue, 1 May 2012, Xenia wrote:
Dear context folks,
since Aditya recommended I am using the vim module for including MATLAB-files in my TeX-files. But for longer code snippets there is no pagebreak, so that the code is cuttet at the end of the page. What do I have to do?
current version: 2012.04.19 23:18
Can you post a minimal example? The attached simple test gives me page breaks.
The reason seems so be the frame, that I prefer. I am attaching the files.
Use \definetextbackground for the frame, framedtext’s are unbreakable boxes.
Thanks, that works, but now the linewrapping does not work correctly (after the frame) and the line numbering starts in line 2. I am attaching all files. Thank you. Xenia
![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
On Tue, 1 May 2012, Xenia wrote:
Use \definetextbackground for the frame, framedtext’s are unbreakable boxes.
Thanks, that works, but now the linewrapping does not work correctly (after the frame)
The bad linebreaks also happen if you remove the background. I'll look into it (in any case, hypenation should be disabled, so there is a bug somewhere).
and the line numbering starts in line 2. I am attaching all files.
Add location=paragraph to definebackground. Aditya
![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
On Tue, 1 May 2012, Aditya Mahajan wrote:
On Tue, 1 May 2012, Xenia wrote:
Use \definetextbackground for the frame, framedtext’s are unbreakable boxes.
Thanks, that works, but now the linewrapping does not work correctly (after the frame)
The bad linebreaks also happen if you remove the background. I'll look into it (in any case, hypenation should be disabled, so there is a bug somewhere).
Add: \startsetups linebreak \language\minusone %disable hypenation \raggedright %avoid overflow lines \stopsetups \unprotect \setupsyntaxhighlighting [setups={syntaxhighlighting@setup,linebreak}] \protect I'll add these to the main module and release a new version. Aditya
![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
On 1-5-2012 19:35, Aditya Mahajan wrote:
\startsetups linebreak \language\minusone %disable hypenation \raggedright %avoid overflow lines \stopsetups
\unprotect \setupsyntaxhighlighting [setups={syntaxhighlighting@setup,linebreak}] \protect
I'll add these to the main module and release a new version.
best use a (public) namespace : \startsetups vim:linebreak or so ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
On Tue, 1 May 2012, Hans Hagen wrote:
On 1-5-2012 19:35, Aditya Mahajan wrote:
\startsetups linebreak \language\minusone %disable hypenation \raggedright %avoid overflow lines \stopsetups
\unprotect \setupsyntaxhighlighting [setups={syntaxhighlighting@setup,linebreak}] \protect
I'll add these to the main module and release a new version.
best use a (public) namespace :
\startsetups vim:linebreak
That was just to indicate a quick fix at the user-level. In the new version of the module, no manual correction in needed. Aditya
![](https://secure.gravatar.com/avatar/93131e1e6e2204bd13501390d768dbdc.jpg?s=120&d=mm&r=g)
Am 01.05.2012 um 19:35 schrieb Aditya Mahajan:
On Tue, 1 May 2012, Aditya Mahajan wrote:
On Tue, 1 May 2012, Xenia wrote:
Use \definetextbackground for the frame, framedtext’s are unbreakable boxes. Thanks, that works, but now the linewrapping does not work correctly (after the frame)
The bad linebreaks also happen if you remove the background. I'll look into it (in any case, hypenation should be disabled, so there is a bug somewhere).
Add:
\startsetups linebreak \language\minusone %disable hypenation \raggedright %avoid overflow lines \stopsetups
\unprotect \setupsyntaxhighlighting [setups={syntaxhighlighting@setup,linebreak}] \protect
I'll add these to the main module and release a new version.
Why don’t you add a align key and use “align={flushleft,nothyphenated}” as default. Wolfgang
![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
On Tue, 1 May 2012, Wolfgang Schuster wrote:
Am 01.05.2012 um 19:35 schrieb Aditya Mahajan:
On Tue, 1 May 2012, Aditya Mahajan wrote:
On Tue, 1 May 2012, Xenia wrote:
Use \definetextbackground for the frame, framedtext’s are unbreakable boxes. Thanks, that works, but now the linewrapping does not work correctly (after the frame)
The bad linebreaks also happen if you remove the background. I'll look into it (in any case, hypenation should be disabled, so there is a bug somewhere).
Add:
\startsetups linebreak \language\minusone %disable hypenation \raggedright %avoid overflow lines \stopsetups
\unprotect \setupsyntaxhighlighting [setups={syntaxhighlighting@setup,linebreak}] \protect
I'll add these to the main module and release a new version.
Why don’t you add a align key and use “align={flushleft,nothyphenated}” as default.
Good idea! I'll add align key to the filter module and set it to `flushleft,nothyphenated` in the vim moule. Thanks, Aditya
![](https://secure.gravatar.com/avatar/946accc6e24c43fe03ca8184736b063f.jpg?s=120&d=mm&r=g)
On 01.05.2012 19:35, Aditya Mahajan wrote:
On Tue, 1 May 2012, Aditya Mahajan wrote:
On Tue, 1 May 2012, Xenia wrote:
Use \definetextbackground for the frame, framedtext’s are unbreakable boxes.
Thanks, that works, but now the linewrapping does not work correctly (after the frame)
The bad linebreaks also happen if you remove the background. I'll look into it (in any case, hypenation should be disabled, so there is a bug somewhere).
Add:
\startsetups linebreak \language\minusone %disable hypenation \raggedright %avoid overflow lines \stopsetups
\unprotect \setupsyntaxhighlighting [setups={syntaxhighlighting@setup,linebreak}] \protect
I am using your workaround and it works fine for most code-snippets. But with longer formulas, this fails. I am attaching a minimal example.
![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
On Sun, 6 May 2012, Xenia wrote:
\startsetups linebreak \language\minusone %disable hypenation \raggedright %avoid overflow lines \stopsetups
\unprotect \setupsyntaxhighlighting [setups={syntaxhighlighting@setup,linebreak}] \protect
I am using your workaround and it works fine for most code-snippets.
I released a new version that incorporates this fix, so you no longer need to add this to your code.
But with longer formulas, this fails. I am attaching a minimal example.
Currently, breaks only occur at spaces. So, in your example, there are no good linebreaks. I released a new version that allows you some control over the linebreaks around each syntax group. You can add \setupsyntaxgroup[after={\allowbreak}] to allow a break after each syntaxgroup. If you prefer line breaks before a syntaxgroup, set \setupsyntaxgroup[before={\allowbreak}] Keep in mind that this may not result in good looking linebreaks. A better solution is to manually set linebreaks in your source code. Aditya
participants (4)
-
Aditya Mahajan
-
Hans Hagen
-
Wolfgang Schuster
-
Xenia