From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: "Wrapping" section into LaTeX statements? Date: Fri, 11 May 2012 05:57:38 -1000 Message-ID: References: <4FACDF3A.6080902@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:45569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSsEA-0004N2-4s for emacs-orgmode@gnu.org; Fri, 11 May 2012 11:58:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSsE5-0003ai-Gj for emacs-orgmode@gnu.org; Fri, 11 May 2012 11:57:57 -0400 Received: from oproxy6-pub.bluehost.com ([67.222.54.6]:48584) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SSsE5-0003a4-71 for emacs-orgmode@gnu.org; Fri, 11 May 2012 11:57:53 -0400 In-Reply-To: <4FACDF3A.6080902@gmail.com> (Rainer M. Krug's message of "Fri, 11 May 2012 11:43:22 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: R.M.Krug@gmail.com Cc: emacs-orgmode Rainer M Krug writes: > Hi > > I want to wrap a section of a document into LaTeX statements, as I would like to redefine > \subsectionbreak so that it does a \pagebreak before - but *only in one section*: > > * A normal section > * Here I want the redefinition > #+BEGIN_LaTeX > \let\oldsubsection = \subsection > \renewcommand{\subsection}[1]{ > \pagebreak{} > \oldsubsection{#1} > } > #+END_LaTeX > ** subsection 1 > ** subsection 2 > * And here I want to use the old sectionbreak > #+BEGIN_LaTeX > \renewcommand{\subsection}[1]{ > \oldsubsection{#1} > } > #+END_LaTeX > ** subsection 1 > ** subsection 2 > > Now I can do this as above, but I don't like it, as the second LaTeX code actually should be at > the end of the previous section and if I insert a section, I have to move the LaTeX code. > > I could put it into the previous section, but then it would be in the subsection 2, and if I add a > subsection 3, I would have to move the LaTeX code into this subsection. > > So nothing is optimal - is there an alternative which makes more sense and is easier to maintain? > > Thanks, > > Rainer Aloha Rainer, * section \pagebreak ** subsection 1 ** subsection 2 Would this work? Note that \pagebreak doesn't have a required argument--the optional argument \pagebreak[] lets LaTeX decide whether or not to break the page. All the best, Tom -- Thomas S. Dye http://www.tsdye.com