aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/io_out/latex.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2022-03-07 21:23:25 -0500
committerRalph Amissah <ralph.amissah@gmail.com>2022-03-07 21:23:31 -0500
commit81f474707ecd781bc0a807179af2367215f96b1d (patch)
tree58b2649ad8675a9455b487ef087e67950ba9cc5c /src/doc_reform/io_out/latex.d
parentlatex, pagebreaks, make headers (diff)
latex, pagebreaks, make headers, consider
Diffstat (limited to 'src/doc_reform/io_out/latex.d')
-rw-r--r--src/doc_reform/io_out/latex.d34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/doc_reform/io_out/latex.d b/src/doc_reform/io_out/latex.d
index ef878fd..e70c315 100644
--- a/src/doc_reform/io_out/latex.d
+++ b/src/doc_reform/io_out/latex.d
@@ -508,9 +508,12 @@ template outputLaTeX() {
string paper_size_orientation,
string _part = ""
) {
- string manual_breaks(
- string test_for_break_level,
- string _pg_break
+ struct latexMarks {
+ string pg_break = "\\clearpage\n";
+ }
+ latexMarks manual_breaks(
+ latexMarks _ltx,
+ string test_for_break_level,
) {
if ((!(doc_matters.conf_make_meta.make.breaks.empty)
&& (matchFirst(doc_matters.conf_make_meta.make.breaks, test_for_break_level)))
@@ -520,7 +523,7 @@ template outputLaTeX() {
) {
if (auto m = matchFirst(doc_matters.conf_make_meta.make.breaks, rgx.make_breakpage)) {
if (matchFirst(m.captures["breakpage"], test_for_break_level)) {
- _pg_break = "\\clearpage\n";
+ _ltx.pg_break = "\\clearpage\n";
} else if (auto n = matchFirst(doc_matters.conf_make_meta.make.breaks, rgx.make_breakcolumn)) {
if (matchFirst(n.captures["breakcolumn"], test_for_break_level)) {
if ((paper_size_orientation == "a4.landscape")
@@ -529,16 +532,16 @@ template outputLaTeX() {
|| (paper_size_orientation == "letter.landscape")
|| (paper_size_orientation == "legal.landscape")
) {
- _pg_break = "\\\\ \\columnbreak\n"; // "\\\\ \\newpage\n";
+ _ltx.pg_break = "\\\\ \\columnbreak\n"; // "\\\\ \\newpage\n";
} else { // portrait
- _pg_break = "\\clearpage\n";
+ _ltx.pg_break = "\\clearpage\n";
}
}
}
}
} else if (auto m = matchFirst(doc_matters.conf_make_meta.make.breaks, rgx.make_breakpage)) {
if (matchFirst(m.captures["breakpage"], test_for_break_level)) {
- _pg_break = "\\clearpage\n";
+ _ltx.pg_break = "\\clearpage\n";
}
} else if (auto m = matchFirst(doc_matters.conf_make_meta.make.breaks, rgx.make_breakcolumn)) {
if (matchFirst(m.captures["breakcolumn"], test_for_break_level)) {
@@ -548,19 +551,20 @@ template outputLaTeX() {
|| (paper_size_orientation == "letter.landscape")
|| (paper_size_orientation == "legal.landscape")
) {
- _pg_break = "\\\\ \\columnbreak\n"; // "\\\\ \\newpage\n";
+ _ltx.pg_break = "\\\\ \\columnbreak\n"; // "\\\\ \\newpage\n";
} else { // portrait
- _pg_break = "\\clearpage\n";
+ _ltx.pg_break = "\\clearpage\n";
}
}
}
} else if (!(doc_matters.conf_make_meta.make.breaks.empty)) {
- _pg_break = "";
+ _ltx.pg_break = "";
}
- return _pg_break;
+ return _ltx;
}
if (obj.metainfo.is_a == "heading") {
string _tex_para;
+ latexMarks _ltx = latexMarks();
string _pg_break;
string _sect;
string _post;
@@ -583,12 +587,14 @@ template outputLaTeX() {
_columns = (_part != "bookindex")
? "" : "\n\\br\n\\begin{multicols}{2}";
if (doc_matters.conf_make_meta.make.doc_type == "article") { // defaults for article
- _pg_break = "";
+ _ltx.pg_break = "";
} else if (doc_matters.conf_make_meta.make.doc_type == "book") { // defaults for book
- _pg_break = "\\clearpage\n";
+ _ltx.pg_break = "\\clearpage\n";
} else {
- _pg_break = "\\clearpage\n";
+ _ltx.pg_break = "\\clearpage\n";
}
+ _ltx = manual_breaks(_ltx, "1");
+ _pg_break = _ltx.pg_break;
_sect = "section";
_post = "";
_title_add = format(q"┃