[texworks] Draft of the manual (in French)

Jonathan Kew jonathan at jfkew.plus.com
Sun Nov 30 00:16:59 CET 2008

On 30 Nov 2008, at 06:30, Alain Delmotte wrote:

> Hi,
> You can find a draft for the manual (in French) at:
> TeXworks manuel <http://www.leliseron.org/annexes/TeXworks- 
> manuel.pdf> (http://www.leliseron.org/annexes/TeXworks-manuel.pdf)
> Any comments?
> Still missing the list of regular expressions.
> I do have problems with regular expressions:
> 1) in TeXworks, if I want to insert "\noindent" at the beginning of  
> sentences, I search for "\n" and replace by "\n\\noindent";
> but I still get a second line feed due to the "\\n" from \noindent  
> (in fact I get \ and a line feed)

Oops, yes, that's a bug. The processing of backslash-escaped chars in  
the replacement was too simplistic. I have just updated the code (svn  
r.239) so this should improve in the next build.

> 2) in TeXworks, what is the scope of the replace, in particular "^"  
> and "$" for beginning and end of line; "^" is only working for the  
> very first line of the document, but "Replace" can do some replaces  
> in the whole document

Currently, ^ and $ refer only to the absolute beginning and end of the  
document; to match line-ends within the document you'd need to use \n.  
I don't really like it this way, but it's the default behavior of the  
Qt regex engine; it doesn't seem to have an option to make ^ and $  
respect line boundaries within the text. So changing this -- without  
losing the ability to also match \n itself within the expression --  
will require some careful work on how the expressions are applied.

I'd definitely like to do this, as the current behavior isn't good,  
but I don't feel it's a top priority.

> 3) I'd like to define regular expressions to put in "syntax- 
> pattern.txt" for highlighting (examples in pink the \verb argument  
> and everything in the verbatim environment, in blue between $ and $  
> - I get that, but if there is a second $ $ everything is blue  
> between the first and the last $ *of the same sentence* - in blue  
> between \[ and \] even multiline,...)
> It seems that the scope of the expression is only one line (up to  
> line feed), so multiline doesn't work.

Right, currently the syntax highlighting rules operate just within a  
text block/paragraph, up to a newline. I realize there are some cases  
where it would be nice to define larger environments, and may work on  
extending this sometime, but currently it is targeted at "low-level"  
syntax of control sequences, special chars, etc., rather than "higher- 
level" large structural parts of the document.


More information about the texworks mailing list