From 81f474707ecd781bc0a807179af2367215f96b1d Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 7 Mar 2022 21:23:25 -0500 Subject: latex, pagebreaks, make headers, consider --- org/out_latex.org | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'org/out_latex.org') diff --git a/org/out_latex.org b/org/out_latex.org index 0b37389..af17d60 100644 --- a/org/out_latex.org +++ b/org/out_latex.org @@ -776,9 +776,12 @@ _txt = _txt 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))) @@ -788,7 +791,7 @@ _txt = _txt ) { 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") @@ -797,16 +800,16 @@ _txt = _txt || (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)) { @@ -816,19 +819,20 @@ _txt = _txt || (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; @@ -851,12 +855,14 @@ _txt = _txt _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"┃ -- cgit v1.2.3