diff --git a/src/main/java/writer2latex/xhtml/TextConverter.java b/src/main/java/writer2latex/xhtml/TextConverter.java
index 6f7c83b..e22d84f 100644
--- a/src/main/java/writer2latex/xhtml/TextConverter.java
+++ b/src/main/java/writer2latex/xhtml/TextConverter.java
@@ -1687,6 +1687,7 @@ public class TextConverter extends ConverterHelper {
}
if (currentMasterPage == null && style != null) {
hnode = StartMasterPage(hnode, style, newPageNumber);
+ hnode = GreenstoneTags.processHeading(currentNode, hnode, pageNum);
} else if (checkMasterPageBreak(style) || checkHardBreakBefore(style) || breakBeforeNextNode) {
// Insert footnotes
inFootnote = true;
@@ -1703,13 +1704,13 @@ public class TextConverter extends ConverterHelper {
pageNum++;
fitPageNumberToMasterPageStyle();
}
-
if (currentNode.getNodeType() == Node.ELEMENT_NODE
&& Misc.getAttribute(currentNode, XMLString.TEXT_OUTLINE_LEVEL) != null
&& !Misc.getAttribute(currentNode, XMLString.TEXT_OUTLINE_LEVEL).isEmpty()) {
hnode = GreenstoneTags.processHeading(currentNode, hnode, pageNum);
} else {
hnode = GreenstoneTags.processPageBreak(currentNode, hnode, pageNum);
+
}
// Print new header