Re: [O] Force new page on exporting

2014-07-03 Thread York Zhao
Thought I should post an update to fix a regexp problem, hopfully somebody else will find it useful. (defun yz/org-export-headline-on-new-page (contents backend info) "Export headlines with tag `newpage' on new pages." (when (org-export-derived-backend-p backend 'latex) (with-temp-buffer

Re: [O] Force new page on exporting

2014-07-01 Thread York Zhao
OK, hacked `org-export-filter-headline-functions' and added the facility to force exporting a headline on new page by adding a new tag "newpage" to the headline. Here is the code: (defun yz/org-export-headline-on-new-page (contents backend info) "Export headlines with tag `newpage' on new pages.

Re: [O] Force new page on exporting

2014-07-01 Thread York Zhao
> So before parsing, you are getting rid of the "ignoreheading" headline (first, > "promoting" it to a comment and then deleting the region), so the #+latex: > \newpage line now belongs to headline 2 which is then parsed and discarded. Really great catch Nick, exactly as what you pointed out. Save

Re: [O] Force new page on exporting

2014-07-01 Thread Thomas S. Dye
Aloha John, John Hendy writes: > On Mon, Jun 30, 2014 at 11:00 PM, Thomas S. Dye wrote: >> Aloha York, >> >> York Zhao writes: >> >>> Thanks Thomas. This works but is not an ideal approach because in a complex >>> file >>> it may not be so easy to find out the location to insert the "\newpage

Re: [O] Force new page on exporting

2014-07-01 Thread Nick Dokos
York Zhao writes: >> My understanding is that you need extra machinery to implement >> "ignoreheading" > > I had implemented machinery the "ignoreheading" and posted the code in the > post > "Wrong numbering after removal of headline". But anyways here's my code: > > (defun yz/org-export-proces

Re: [O] Force new page on exporting

2014-07-01 Thread Thomas S. Dye
Aloha York, York Zhao writes: >> * Latex New Page :ignoreheading: >> #+latex: \newpage > > This should work, but didn't, I will figure out why when I have some time. > >> Also, see the LaTeX commands \pagebreak and \clearpage, which do generally >> the >> same thing but in slightly different wa

Re: [O] Force new page on exporting

2014-07-01 Thread York Zhao
> My understanding is that you need extra machinery to implement "ignoreheading" I had implemented machinery the "ignoreheading" and posted the code in the post "Wrong numbering after removal of headline". But anyways here's my code: (defun yz/org-export-process-heading-removal (backend) "Ignor

Re: [O] Force new page on exporting

2014-07-01 Thread Nick Dokos
York Zhao writes: >> * Latex New Page :ignoreheading: >> #+latex: \newpage > > This should work, but didn't, I will figure out why when I have some time. > My understanding is that you need extra machinery to implement "ignoreheading": some sort of a filter[fn:1] is necessary, is this correct? M

Re: [O] Force new page on exporting

2014-07-01 Thread John Hendy
On Mon, Jun 30, 2014 at 11:00 PM, Thomas S. Dye wrote: > Aloha York, > > York Zhao writes: > >> Thanks Thomas. This works but is not an ideal approach because in a complex >> file >> it may not be so easy to find out the location to insert the "\newpage" >> instruction. Plus, each time when inse

Re: [O] Force new page on exporting

2014-07-01 Thread York Zhao
> * Latex New Page :ignoreheading: > #+latex: \newpage This should work, but didn't, I will figure out why when I have some time. > Also, see the LaTeX commands \pagebreak and \clearpage, which do generally the > same thing but in slightly different ways. I was aware of these, but if \newpage do

Re: [O] Force new page on exporting

2014-06-30 Thread Thomas S. Dye
Aloha York, York Zhao writes: > Thanks Thomas. This works but is not an ideal approach because in a complex > file > it may not be so easy to find out the location to insert the "\newpage" > instruction. Plus, each time when inserting new exported tree between > "Headline1" and "Headline2" you

Re: [O] Force new page on exporting

2014-06-30 Thread York Zhao
Thanks Thomas. This works but is not an ideal approach because in a complex file it may not be so easy to find out the location to insert the "\newpage" instruction. Plus, each time when inserting new exported tree between "Headline1" and "Headline2" you would have to remember to move the "\newpage

Re: [O] Force new page on exporting

2014-06-30 Thread Thomas S. Dye
Aloha York, York Zhao writes: > I'm selectively exporting some subtree of an org-mode buffer, like this: > > * Headline1 :export: #+latex: \newpage > * Headline2 > * Headline3 :exp

[O] Force new page on exporting

2014-06-30 Thread York Zhao
I'm selectively exporting some subtree of an org-mode buffer, like this: * Headline1 :export: * Headline2 * Headline3 :export: Question is: how do I force Headline3 to be on a new pag