|
From: Dave K. <dku...@pa...> - 2013-08-14 20:20:39
|
> From: Traore Beydi Amadou >Sent: Wednesday, August 14, 2013 8:40 AM > > From: Traore Beydi Amadou >Sent: Wednesday, August 14, 2013 8:40 AM > >Hey > I am interested in your wonderful module document generation ODTavec > the LPOD library python. I would like to add a page break (a crtl-c > classic in the open document) in my document but I get no instance > after internet search and hack. I'll take kindly tell me if it is > possible or not. If so the function to do. Traore - I don't think there is such an explicit command in Docutils/reStructuredText. However, here is something that you might try if you do *not* need transitions otherwise: For a transition in reStructuredText odf-odt writer (rst2odt.py) inserts a horizontal line. In odf-odt writer, that's just a style. So, you might open your styles.odt in oowriter/librewriter and edit the horizontalline style to get what you want. styles.odt is part of the docutils distribution. ee this for information on transitions: http://docutils.sourceforge.net/docs/user/rst/quickref.html#transitions If a transition does not work for your use case, you might try to use some other style that rst2odt.py generates, for example maybe rststyle-heading2 or rststyle-heading3, if you need the page break before a section heading. And, here are some detailed instructions on how to do the above, in case it's not obvious. By the way, until you asked about it, I did not realize that this was possible. But, a Web search led to instructions on how to use transitions to create page breaks with rst2latex.py, and then ... So, thanks for helping me learn this, and hope it helps you, too. ======================================================= 1. Make a copy of styles.odt. Then either modify styles.odt itself, or modify your copy. If you modify the copy, you will later need to run rst2odt.py with the --stylesheet command line option. 2. To modify the copy of styles.odt or styles.odt itself, open it in librewriter/openofficewriter. 3. Open the Styles and Formatting window (it's under the Format menu). 4. Right click on the paragraph style rststyle-horizontalline, and select Modify. You might have to select All Styles in order to see the rst styles. 5. Click on the Text Flow tab, then under Breaks, set the Insert checkbox to on and select Type "Page". 6. Click on the Borders tab, then under Line, select none. 7. Click on OK/Apply, then save your style sheet. Now your should be able to create a page break by inserting a transition (for example, 4 or more dashes on a line by itself). Again, if you modified a copy of styles.odt, you will need to use the rst2odt.py command line option --stylesheet to refer to that modified stylesheet. ======================================================= - Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman |