Hi,
I've been playing around recently with developing a different technique for sectioning in LaTeX; put simply, instead of writing
\section{} ... \subsection{} ... \subsection{} ... \subsubsection{} ...
you write
\begin{sect}{} ... \begin{sect}{} ... \end{sect} \begin{sect}{} ... \begin{sect}{} ... \end{sect} \end{sect} \end{sect}
I'm not 100% convinced that this is an easier way to write than LaTeX's absolute method as opposed to this sort of relative one, but I'm willing to give it a try for my thesis to see how it works out.
The advantages are that folding is more easily supported :) and that it's much easier to move sections around without having to search/ replace all of the \(sub){0,2}section commands.
But here's the thing...I know it would take you guys orders of magnitude less time than it would take me to adjust the LaTeX bundle to integrate this structure into it. (Starred sections look like \begin{sect*}{} and optional ToC section titles are with \begin{sect} [toctitle]{...}.)
All I'm really missing is the nice outlining features. Is this an easy change to make to the bundle?
Many thanks, Will Robertson
Hi Will,
I believe you can already use \begin{section} and \begin{subsection} (And corresponding \end things), which might take you partly there without any changes, I think we support those variants. Changing the bundle to support something which is not standard, bound to be confusing (for instance should the top level correspond to a \section or a \chapter? or a \part?) and not offering much enhanced functionality is not something I look forward to.
There is of course a "Show outline" command, not sure how much that serves your needs. The safe moving of code around is the tricky part, if that's what you were hoping for. What exactly do you mean by "missing the nice outlining features"? In any case, I think it's preferable to make the current system work, instead of inventing a new system.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On May 26, 2008, at 2:17 AM, Will Robertson wrote:
Hi,
I've been playing around recently with developing a different technique for sectioning in LaTeX; put simply, instead of writing
\section{} ... \subsection{} ... \subsection{} ... \subsubsection{} ...
you write
\begin{sect}{} ... \begin{sect}{} ... \end{sect} \begin{sect}{} ... \begin{sect}{} ... \end{sect} \end{sect} \end{sect}
I'm not 100% convinced that this is an easier way to write than LaTeX's absolute method as opposed to this sort of relative one, but I'm willing to give it a try for my thesis to see how it works out.
The advantages are that folding is more easily supported :) and that it's much easier to move sections around without having to search/replace all of the \(sub){0,2}section commands.
But here's the thing...I know it would take you guys orders of magnitude less time than it would take me to adjust the LaTeX bundle to integrate this structure into it. (Starred sections look like \begin{sect*}{} and optional ToC section titles are with \begin {sect}[toctitle]{...}.)
All I'm really missing is the nice outlining features. Is this an easy change to make to the bundle?
Many thanks, Will Robertson
Hi Charilaos,
Thanks for your reply.
On 27/05/2008, at 3:36 AM, Charilaos Skiadas wrote:
I believe you can already use \begin{section} and \begin{subsection} (And corresponding \end things), which might take you partly there without any changes, I think we support those variants.
This does work as LaTeX syntax, but not in the "Symbols List" or "Show Outline" of TextMate.
Changing the bundle to support something which is not standard, bound to be confusing (for instance should the top level correspond to a \section or a \chapter? or a \part?) and not offering much enhanced functionality is not something I look forward to.
Oh, I wasn't trying to suggest this should be added to the default bundle :)
(I'd say that if the class support chapters, then the top level {sect} corresponds to a \chapter, else a \section.)
But it's not immediately obvious to me how to adjust the current definition to support this sort of style (for my own use). If it's not an easy adjustment to make to the current LaTeX bundle, no worries.
There is of course a "Show outline" command, not sure how much that serves your needs. The safe moving of code around is the tricky part, if that's what you were hoping for. What exactly do you mean by "missing the nice outlining features"? In any case, I think it's preferable to make the current system work, instead of inventing a new system.
As far as I can tell, nothing is broken in the current system (of LaTeX or of TextMate). I just wanted to experiment with a different way of doing things.
Many thanks, Will
As far as I can tell, nothing is broken in the current system (of LaTeX or of TextMate). I just wanted to experiment with a different way of doing things.
If there's one thing I've learned about LaTeX it is “don't try to change anything.” Or maybe “change things at your peril (you will die).”
But if you want to add \begin{sect}{} to the symbols list have a look at the Symbol List preference item. You add a regex clause to the symbolTransformation variable to match that form. One drawback will be that there's no way to figure out the depth of the current section... Something like the following should work:
s/^\begin{sect*}?(?:[[^]]*])?{(.+)}/ $1/; # \begin{sect}
As for modifying the Show Outline command... I don't think a simple modification will suffice as it is based on the same regular expressions that the Symbol List is. You'd have to rewrite the whole thing maintaining a stack to remember how deep you are...
Hi Alex,
On 27/05/2008, at 3:11 PM, Alex Ross wrote:
As far as I can tell, nothing is broken in the current system (of LaTeX or of TextMate). I just wanted to experiment with a different way of doing things.
If there's one thing I've learned about LaTeX it is “don't try to change anything.” Or maybe “change things at your peril (you will die).”
Heh :) On the whole I (think I) know what I'm doing, but you're right; it does make things harder for myself.
But if you want to add \begin{sect}{} to the symbols list have a look at the Symbol List preference item. You add a regex clause to the symbolTransformation variable to match that form. One drawback will be that there's no way to figure out the depth of the current section...
Ah, that's what I was afraid of. The example you showed looked good, thanks.
Best regards, Will
On May 27, 2008, at 1:14 AM, Will Robertson wrote:
Hi Charilaos,
Thanks for your reply.
On 27/05/2008, at 3:36 AM, Charilaos Skiadas wrote:
I believe you can already use \begin{section} and \begin {subsection} (And corresponding \end things), which might take you partly there without any changes, I think we support those variants.
This does work as LaTeX syntax, but not in the "Symbols List" or "Show Outline" of TextMate.
Making those two work with the Symbols List and Show Outline should be doable. You just need to add regular expressions to match them.
(Put another way, whatever method we may have had to make \begin {sect} work, we should definitely be able to use the same method for \begin{section} and \begin{subsection}).
Changing the bundle to support something which is not standard, bound to be confusing (for instance should the top level correspond to a \section or a \chapter? or a \part?) and not offering much enhanced functionality is not something I look forward to.
Oh, I wasn't trying to suggest this should be added to the default bundle :)
(I'd say that if the class support chapters, then the top level {sect} corresponds to a \chapter, else a \section.)
But how is TM to know if the class supports chapters or not? But that's a minor point really, the biggest problem is detecting the nesting, as Alex pointed out.
But it's not immediately obvious to me how to adjust the current definition to support this sort of style (for my own use). If it's not an easy adjustment to make to the current LaTeX bundle, no worries.
It should be possible to adjust it to make the \begin{section} parts work, for both the symbols list and the show outline command. The trick would be to just ignore the \end parts. I don't have much time this very moment, but I'll try to add something in the next couple of weeks.
There is of course a "Show outline" command, not sure how much that serves your needs. The safe moving of code around is the tricky part, if that's what you were hoping for. What exactly do you mean by "missing the nice outlining features"? In any case, I think it's preferable to make the current system work, instead of inventing a new system.
As far as I can tell, nothing is broken in the current system (of LaTeX or of TextMate). I just wanted to experiment with a different way of doing things.
Many thanks, Will
Haris Skiadas Department of Mathematics and Computer Science Hanover College