Function definition with LaTeX

Syntax highlighting, code folding, brace matching, code indenting, and function list

Function definition with LaTeX

Postby joonro » Mon Jun 22, 2009 10:18 am

Hi there,

I like to use function definition with \section in LaTeX so I can see the structure of a document when I see function list in UltraEdit. Before upgrading to UE15, it worked, but after the update it stopped working. (No Functions! message at funtion list)

Here is the header for my LaTeX Wordfile:

Code: Select all
/L14"TeX/LaTeX" LATEX_LANG Noquote Line Comment Num = 2% String Chars = {} File Extensions = LAT TEX LEX
/Colors = 0,8421376,8421376,8421504,255,
/Colors Back = 16777215,16777215,16777215,16777215,16777215,
/Colors Auto Back = 1,1,1,1,1,
/Font Style = 0,2,0,0,0,
/Regexp Type = Perl
/Function String = "\\section{([^}]+)}"
/Delimiters = #$%&()+,-. /0123456789:;<=>[\]^_{|}~`
/Open Brace Strings =  "{"
/Close Brace Strings = "}"
/Marker Characters = "{}"
/C1 Colors = 16711680 Colors Back = 16777215 Colors Auto Back = 1 Font Style = 0


I tried many things with /Function String = "RegEx" in case I had it wrong, but no luck. I have never succeeded.

Any help will be very apprecieated.

Best Regards,
Joon
joonro
Newbie
 
Posts: 3
Joined: Fri Mar 13, 2009 2:13 pm

Re: Function definition with LaTeX

Postby Mofi » Mon Jun 22, 2009 10:47 am

You have really used that Perl function string before?

If I copy that regular expression string into the find dialog and try to run a Perl regex search with it, I get an error message indicating that this is an invalid regular expression. Correct is:

\\section\{([^}]+)\}
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4066
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Function definition with LaTeX

Postby joonro » Mon Jun 22, 2009 11:00 am

That RegEx was what I was using previously, which was working with UE14. The one I posted was wrong because I did a lot of tests since it stopped working with the RegEx. I tried that again but still no luck. :cry:

Best Regards,
Joon
joonro
Newbie
 
Posts: 3
Joined: Fri Mar 13, 2009 2:13 pm

Re: Function definition with LaTeX

Postby Mofi » Tue Jun 23, 2009 6:23 am

Do you have also some example lines, so I can test it too? I don't have a LaTeX file for testing.

Try also deleting line /Regexp Type = Perl and use following UltraEdit regular expression:

/Function String = "\section{^([~}]+^)}"

or better when } is always on the same line as {

/Function String = "\section{^(?+^)}"


The Perl version for the regular expression string above would be:

/Function String = "\\section\{(.+)\}"

Maybe this one works better because it can't span over multiple lines.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4066
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Function definition with LaTeX

Postby joonro » Tue Jun 23, 2009 9:53 am

Mofi wrote:Do you have also some example lines, so I can test it too? I don't have a LaTeX file for testing.


Code: Select all
\section{Analytic derivation}

\section{A Numerical Simulation}

\section{Conclusion}

\appendix



Mofi wrote:Try also deleting line /Regexp Type = Perl and use following UltraEdit regular expression:

/Function String = "\section{^([~}]+^)}"

or better when } is always on the same line as {

/Function String = "\section{^(?+^)}"


I tried
Code: Select all
/Function String = "\section{^(?+^)}"
, and it worked! Since the Perl style RegEx worked in 14 version, I think there might be a bug ..

Thanks a lot for your help. I really appreciate it.

Joon
joonro
Newbie
 
Posts: 3
Joined: Fri Mar 13, 2009 2:13 pm


Return to Syntax Highlighting