From b8d295e13b3ab8176190ab86b54b4badd54313b6 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 1 Mar 2022 12:05:55 -0500 Subject: latex \newcommand: \ocn for ocn with margin --- org/out_latex.org | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) (limited to 'org/out_latex.org') diff --git a/org/out_latex.org b/org/out_latex.org index 0a2cbac..807010d 100644 --- a/org/out_latex.org +++ b/org/out_latex.org @@ -601,9 +601,8 @@ _txt = _txt ) { if (obj.metainfo.is_of_type == "para") { string _tex_para; - _tex_para = q"┃\begin{tiny}\hspace{0mm}\end{tiny}{\marginpar{\begin{tiny}\hspace{0mm}\hypertarget{%s}{%s}\end{tiny}}}%s┃"; + _tex_para = q"┃\ocn{%s}%s┃"; _txt = format(_tex_para, - obj.metainfo.object_number, obj.metainfo.object_number, _txt.footnotes ).strip; @@ -759,13 +758,12 @@ _txt = _txt ); } else if (obj.metainfo.heading_lev_markup < 4) { 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} + _tex_para = q"┃%s\part*{\ocn{%s}%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, @@ -778,7 +776,7 @@ _txt = _txt \pagenumbering{none} \setcounter{page}{1} \setlength{\parskip}{1ex plus0.5ex minus0.2ex} -\part*{\begin{tiny}\hspace{0mm}\end{tiny}{\marginpar{\begin{tiny}\hspace{0mm}\hypertarget{1}{1}\end{tiny}}}%s \newline %s} +\part*{\ocn{1}%s \newline %s} \clearpage \markboth{%s}{%s} @@ -808,13 +806,12 @@ _txt = _txt && _part == "bookindex" && _txt.match(regex(r"^Index$")) ) { - _tex_para = q"┃%s\%s*{\begin{tiny}\hspace{0mm}\end{tiny}{\marginpar{\begin{tiny}\hspace{0mm}\hypertarget{%s}{%s}\end{tiny}}}%s} + _tex_para = q"┃%s\%s*{\ocn{%s}%s} \addcontentsline{toc}{%s}{%s%s}%s%s┃"; _txt = format(_tex_para, _pg_break, _sect.strip, obj.metainfo.object_number, - obj.metainfo.object_number, _txt.footnotes.strip, _sect, _txt.remove_footnotes.strip, @@ -827,13 +824,12 @@ _txt = _txt ) { /+ dummy headings completely omitted +/ _txt = ""; } else { - _tex_para = q"┃%s\%s*{\begin{tiny}\hspace{0mm}\end{tiny}{\marginpar{\begin{tiny}\hspace{0mm}\hypertarget{%s}{%s}\end{tiny}}}%s} + _tex_para = q"┃%s\%s*{\ocn{%s}%s} \addcontentsline{toc}{%s}{%s%s}%s┃"; _txt = format(_tex_para, _pg_break, _sect.strip, obj.metainfo.object_number, - obj.metainfo.object_number, _txt.footnotes.strip, _sect, _txt.remove_footnotes.strip, @@ -863,13 +859,12 @@ string group(O,M)( ) { if (obj.metainfo.is_a == "group") { string _tex_para; - _tex_para = q"┃\begin{tiny}\hspace{0mm}\end{tiny}{\marginpar{\begin{tiny}\hspace{0mm}\hypertarget{%s}{%s}\end{tiny}}}\setlength{\parskip}{0.5ex plus0.2ex minus0.1ex} + _tex_para = q"┃\ocn{%s}\setlength{\parskip}{0.5ex plus0.2ex minus0.1ex} \begin{footnotesize} %s \end{footnotesize} ┃"; _txt = format(_tex_para, - obj.metainfo.object_number, obj.metainfo.object_number, _txt.footnotes.strip ).strip; @@ -892,7 +887,7 @@ string block(O,M)( if (obj.metainfo.is_a == "block") { // _txt = _txt.nbsp_char; string _tex_para; - _tex_para = q"┃\begin{tiny}\hspace{0mm}\end{tiny}{\marginpar{\begin{tiny}\hspace{0mm}\hypertarget{%s}{%s}\end{tiny}}}\setlength{\parskip}{0.5ex plus0.2ex minus0.1ex} + _tex_para = q"┃\ocn{%s}\setlength{\parskip}{0.5ex plus0.2ex minus0.1ex} \begin{footnotesize} %s \end{footnotesize} @@ -901,7 +896,6 @@ string block(O,M)( /+ try both: +/ _txt = _txt.split(rgx.br_newlines_linebreaks).join("\n\n"); // _txt = _txt.split(rgx.br_newlines_linebreaks).join(" \\\n"); _txt = format(_tex_para, - obj.metainfo.object_number, obj.metainfo.object_number, _txt.nbsp_char.footnotes.strip ).strip; @@ -923,7 +917,7 @@ string verse(O,M)( ) { if (obj.metainfo.is_a == "verse") { string _tex_para; - _tex_para = q"┃\begin{tiny}\hspace{0mm}\end{tiny}{\marginpar{\begin{tiny}\hspace{0mm}\hypertarget{%s}{%s}\end{tiny}}}\setlength{\parskip}{0.1ex plus0.1ex minus0.1ex} + _tex_para = q"┃\ocn{%s}\setlength{\parskip}{0.1ex plus0.1ex minus0.1ex} \begin{footnotesize} %s @@ -933,7 +927,6 @@ string verse(O,M)( \linebreak ┃"; // \hardspace _txt = format(_tex_para, - obj.metainfo.object_number, obj.metainfo.object_number, _txt.nbsp_char.footnotes.split("\n").join("\n\n").strip ).strip; @@ -955,7 +948,7 @@ string codeblock(O,M)( ) { if (obj.metainfo.is_a == "code") { string _tex_para; - _tex_para = q"┃\begin{tiny}\hspace{0mm}\end{tiny}{\marginpar{\begin{tiny}\hspace{0mm}\hypertarget{%s}{%s}\end{tiny}}}\setlength{\parskip}{0.5ex plus0.2ex minus0.1ex}\begin{Codeblock} + _tex_para = q"┃\ocn{%s}\setlength{\parskip}{0.5ex plus0.2ex minus0.1ex}\begin{Codeblock} \begin{lstlisting} %s \end{lstlisting} @@ -963,7 +956,6 @@ string codeblock(O,M)( \setlength{\parskip}{1ex plus0.5ex minus0.2ex} ┃"; _txt = format(_tex_para, - obj.metainfo.object_number, obj.metainfo.object_number, _txt.nbsp_char_to_space ).strip; @@ -1053,7 +1045,7 @@ string table(O,M)( ); } string _tex_para; - _tex_para = q"┃\begin{tiny}\hspace{0mm}\end{tiny}{\marginpar{\begin{tiny}\hspace{0mm}\hypertarget{%s}{%s}\end{tiny}}} + _tex_para = q"┃\ocn{%s} \setlength{\LTleft}{0pt} \setlength{\LTright}{\fill} \begin{tiny} @@ -1063,7 +1055,6 @@ string table(O,M)( \end{tiny} ┃"; _txt = format(_tex_para, - obj.metainfo.object_number, obj.metainfo.object_number, _colw, _table, @@ -1665,6 +1656,9 @@ string _latex_head = format(q"┃%%%% spine LaTeX output \newcommand{\slash}{{/}} \newcommand{\underscore}{\_} \newcommand{\exclaim}{\Verbatim{!}} +\newcommand{\ocn}[1]{ +\begin{tiny}\hspace{0mm}\end{tiny}{\marginpar{\begin{tiny}\hspace{0mm}\hypertarget{#1}{#1}\end{tiny}}} +} \definecolor{listinggray}{gray}{0.9} \definecolor{lbcolor}{rgb}{0.9,0.9,0.9} \lstset{ -- cgit v1.2.3