LibreOffice Writer Page Break before every occurence of a word

I am using Ubuntu 14.04 and LibreOffice 4.3. I have a document with several pages. How can I give a pagebreak before every occurence of a word that begins with MHAM

Please edit your question to give more details (really edit the question, don’t use comments). Note also that LO 4.3 is an obsolete version. Current release is in the 7.4.x series, very soon 7.5.x.

A page break can occur only between paragraphs. If your paragraph begins with “MHAM”, there is a solution with Edit>Find & Replace and a specific user-created paragraph style. This means you have some knowledge about styles, haven’t you?

Lokadalatdt.11.02.2023_Exp).odt (136.6 KB)

Your document is mostly direct formatted instead of using styles.

A style primarily does not describe the visual aspect of your text. A style tells Writer the significance or meaning of it. Styles can then be customised so that paragraph, pages or words assigned different styles look different. So, your job as an author is to think about the “components” of your document. You have title, headings, narrative and “special” paragraphs (such as list of items). The narrative for the main topic of the document is usually styled Text Body.

Because of the versatility implemented in the style machinery, Default Paragraph Style should never be used for real text because it is the ancestor of all other styles and whatever you change in it propagates down to all others. It is an effective way to define your own defaults which will give your documents a distinctive personal look.

Your “MHAM…” paragraphs look like an id (identification code). Consequently, they should receive an ad-hoc paragraph style. I create paragraph style Id for them. I configured its Text Flow to force a page break before it. In Indents & Spacing,I set a 2 cm space above so that I can remove your manual approximate vertical spacing preceding the paragraph.

I reformatted the first 3 pages in Lokadalatdt.11.02.2023_Exp-ajl.odt (154.2 KB)

To restyle everything, Edit>Find & Replace. In Find: enter “MHAM”. Press Find All. Quit the dialog. All occurrences are highlighted. Assign the Id paragraph style. You’re done.

*Final note: learn to use styles. They are your friends to automate document composition. Read the Writer Guide for an introduction.
{"cc_re__cc_re__cc_by_sa_3_0_le": ["pan>\n        </li>\n        </ul>\n      </nav>\n      <p class='powered-by-link'>Powered by <a href=\"https://www.discourse.org\">Discourse</a>, best viewed with JavaScript enabled</p>\n    </footer>\n    <div class=\"tdf-footer-legal\">\n  <hr>\n  <p>\n    <a href=\"https://www.libreoffice.org/imprint\" target=\"_blank\">Impressum (Legal Info)</a> |\n    <a href=\"https://www.libreoffice.org/privacy\" target=\"_blank\">Datenschutzerkl\u00e4rung (Privacy Policy)</a>\n    \u2002\n    Content on this site is licensed under a <a href=\"https://creativecommons.org/licenses/by-sa/3.0/legalcode\">Creative Commons Attribution Share Alike 3.0</a> license.\n    </p>\n</div>\n    \n  </body>\n  \n</html>\n"]}