From a87543d091135cfe60cdb95c1f65f53313857378 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 19 Dec 2019 13:31:16 -0500 Subject: latex, footnotes only (endnotes section removed) --- org/out_latex.org | 30 +++++++++++++++++------------- src/doc_reform/io_out/latex.d | 30 +++++++++++++++++------------- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/org/out_latex.org b/org/out_latex.org index b88324e..8ae369b 100644 --- a/org/out_latex.org +++ b/org/out_latex.org @@ -631,17 +631,19 @@ string bullets_and_indentation(O)( (doc_matters.conf_make_meta.meta.rights_license).sp_char_esc_txt, ); } else if (obj.metainfo.heading_lev_markup < 4) { - _tex_para = q"┃%s\part*{\begin{tiny}\hspace{0mm}\end{tiny}{\marginpar{\begin{tiny}\hspace{0mm}\hypertarget{%s}{%s}\end{tiny}}}%s} + if (!(_txt.footnotes.strip == "Endnotes")) { + _tex_para = q"┃%s\part*{\begin{tiny}\hspace{0mm}\end{tiny}{\marginpar{\begin{tiny}\hspace{0mm}\hypertarget{%s}{%s}\end{tiny}}}%s} \addcontentsline{toc}{part}{%s} \markboth{%s}┃"; - _txt = format(_tex_para, - _pg_break, - obj.metainfo.object_number, - obj.metainfo.object_number, - _txt.strip.footnotes, - _txt.strip.remove_footnotes, - (doc_matters.conf_make_meta.meta.title_main).sp_char_esc_txt, - ); + _txt = format(_tex_para, + _pg_break, + obj.metainfo.object_number, + obj.metainfo.object_number, + _txt.strip.footnotes, + _txt.strip.remove_footnotes, + (doc_matters.conf_make_meta.meta.title_main).sp_char_esc_txt, + ); + } } else if (obj.metainfo.heading_lev_markup > 3) { if (obj.metainfo.heading_lev_markup == 4 && _txt.match(regex(r"^Table of Contents$"))) { @@ -1689,10 +1691,12 @@ string latex_body(D,M)( _txt = _txt.heading(obj, doc_matters, part); goto default; case "endnote": assert(part == "endnotes"); - _txt = _txt.para(obj) - .bullets_and_indentation(obj) - .links_and_images(obj, doc_matters); - goto default; + /* uncomment code to reinstate endnotes in endnote section */ + // _txt = _txt.para(obj) + // .bullets_and_indentation(obj) + // .links_and_images(obj, doc_matters); + // goto default; + break; case "glossary": assert(part == "glossary"); _txt = _txt.para(obj) .bullets_and_indentation(obj) diff --git a/src/doc_reform/io_out/latex.d b/src/doc_reform/io_out/latex.d index ceab202..52707db 100644 --- a/src/doc_reform/io_out/latex.d +++ b/src/doc_reform/io_out/latex.d @@ -382,17 +382,19 @@ template outputLaTeX() { (doc_matters.conf_make_meta.meta.rights_license).sp_char_esc_txt, ); } else if (obj.metainfo.heading_lev_markup < 4) { - _tex_para = q"┃%s\part*{\begin{tiny}\hspace{0mm}\end{tiny}{\marginpar{\begin{tiny}\hspace{0mm}\hypertarget{%s}{%s}\end{tiny}}}%s} + if (!(_txt.footnotes.strip == "Endnotes")) { + _tex_para = q"┃%s\part*{\begin{tiny}\hspace{0mm}\end{tiny}{\marginpar{\begin{tiny}\hspace{0mm}\hypertarget{%s}{%s}\end{tiny}}}%s} \addcontentsline{toc}{part}{%s} \markboth{%s}┃"; - _txt = format(_tex_para, - _pg_break, - obj.metainfo.object_number, - obj.metainfo.object_number, - _txt.strip.footnotes, - _txt.strip.remove_footnotes, - (doc_matters.conf_make_meta.meta.title_main).sp_char_esc_txt, - ); + _txt = format(_tex_para, + _pg_break, + obj.metainfo.object_number, + obj.metainfo.object_number, + _txt.strip.footnotes, + _txt.strip.remove_footnotes, + (doc_matters.conf_make_meta.meta.title_main).sp_char_esc_txt, + ); + } } else if (obj.metainfo.heading_lev_markup > 3) { if (obj.metainfo.heading_lev_markup == 4 && _txt.match(regex(r"^Table of Contents$"))) { @@ -1085,10 +1087,12 @@ string table(O,M)( _txt = _txt.heading(obj, doc_matters, part); goto default; case "endnote": assert(part == "endnotes"); - _txt = _txt.para(obj) - .bullets_and_indentation(obj) - .links_and_images(obj, doc_matters); - goto default; + /* uncomment code to reinstate endnotes in endnote section */ + // _txt = _txt.para(obj) + // .bullets_and_indentation(obj) + // .links_and_images(obj, doc_matters); + // goto default; + break; case "glossary": assert(part == "glossary"); _txt = _txt.para(obj) .bullets_and_indentation(obj) -- cgit v1.2.3