[texworks] Window Show Tags and Window Show Contents

Paul A Norman paul.a.norman at gmail.com
Thu Sep 10 08:55:45 CEST 2009


Hi Jonathan,

Like a fwe others I'm not that up with REGEX, but looking at the
configuration file I thought if I want my own book marks to fit in to the
general heading structure along with the standard LaTeX h\eadings in the
edotir tag window, what if I define headings for them so my bookmarks start
with an indicator as to where they should fall, so that they keep within the
structure when the file is parsed for generating the Tag window in the
editor?

And ones that dont have the necessaary prefix will continue to fall to tag
level 0 at the end.

I just have to use the prefix for ones I want in the right place in the
headings heirachy.

So after looking at the tag-patterns.txt file, and some help on the web, I
wondered, would some sort of scheme like this would work ...

 - I'm not sure if I got the REGEX right.

# Patterns for LaTeX sectioning commands:
1 ^\s*\\part\*?\s*(?:\[[^]]*\]\s*)?\{([^}]*)\}
#
1 ^%:\s*part-\s*(.+)
# (i.e.  in LaTeX on new line)  %: part- Camels My 1st Div
#
2 ^\s*\\chapter\*?\s*(?:\[[^]]*\]\s*)?\{([^}]*)\}
#
2 ^%:\s*chapter-\s*(.+)
# (i.e.  in LaTeX on new line)  %: chapter- Deserts My 1st Chapt
#
3 ^\s*\\section\*?\s*(?:\[[^]]*\]\s*)?\{([^}]*)\}
#
3 ^%:\s*section-\s*(.+)
# (i.e.  in LaTeX on new line)  %: section- Well Water My top Section
#
4 ^\s*\\ssection\*?\s*(?:\[[^]]*\]\s*)?\{([^}]*)\}
#
4 ^%:\s*subsection-\s*(.+)
# (i.e.  in LaTeX on new line)  %: ssection- Straw Supply My Sub Section
#
5 ^\s*\\sssection\*?\s*(?:\[[^]]*\]\s*)?\{([^}]*)\}
#
5 ^%:\s*sssection-\s*(.+)
# (i.e.  in LaTeX on new line)  %: sssection- Feed My SubSub Section
Any help appreciated please.

Paul

2009/9/10 Paul A Norman <paul.a.norman at gmail.com>

> Thanks Jonathan I'll have  alook into that file and idea,  sounds
> intereseting and worthwhile.
>
> Will I need any other information?
>
> Paul
>
> 2009/9/10 Jonathan Kew <jfkthame at googlemail.com>
>
>  On 9 Sep 2009, at 13:23, Paul A Norman wrote:
>>
>> Great Stuff!
>>>
>>> So just to clarify things,  when using things like
>>>
>>> \phantomsection
>>> \addcontentsline{toc}{section}{<section-name>}
>>>
>>> to get appropriate bookmark in editor tags, I can add
>>>
>>> %:section-name
>>> \phantomsection
>>> \addcontentsline{toc}{section}{<section-name>}
>>>
>>
>> Yes, that should work. Though the default configuration for the editor
>> Tags feature (you can customize it via a file in the texworks configuration
>> folder) will display %: bookmarks in a separate section from the
>> (hierarchical) display of the document structure as defined by \section,
>> \subsection, etc.
>>
>> If you wanted to add "phantom" bookmarks that become part of the section
>> hierarchy, you'd need to invent a new form of "bookmark comment" that
>> indicates the level in the hierarchy, rather than simply "flat" (level 0)
>> markers, and add these to the configuration file.
>>
>> (But maybe that's getting into too much detail!)
>>
>> JK
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texworks/attachments/20090910/f059e1a6/attachment-0001.html>


More information about the texworks mailing list