aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2022-03-01 12:05:55 -0500
committerRalph Amissah <ralph.amissah@gmail.com>2022-03-05 10:33:48 -0500
commitb8d295e13b3ab8176190ab86b54b4badd54313b6 (patch)
treec1a80dad22ff876c1cfcd5dbc09c62c52b48322b
parentlatex font sizes (diff)
latex \newcommand: \ocn for ocn with margin
-rw-r--r--org/out_latex.org32
-rw-r--r--src/doc_reform/io_out/latex.d32
2 files changed, 26 insertions, 38 deletions
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,10 +601,9 @@ _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,14 +859,13 @@ 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}
@@ -902,7 +897,6 @@ string block(O,M)(
_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
@@ -934,7 +928,6 @@ string verse(O,M)(
┃"; // \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}
@@ -964,7 +957,6 @@ string codeblock(O,M)(
┃";
_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}
@@ -1064,7 +1056,6 @@ string table(O,M)(
┃";
_txt = format(_tex_para,
obj.metainfo.object_number,
- obj.metainfo.object_number,
_colw,
_table,
).strip;
@@ -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{
diff --git a/src/doc_reform/io_out/latex.d b/src/doc_reform/io_out/latex.d
index 6160a3e..d87a938 100644
--- a/src/doc_reform/io_out/latex.d
+++ b/src/doc_reform/io_out/latex.d
@@ -382,10 +382,9 @@ template outputLaTeX() {
) {
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;
}
@@ -483,13 +482,12 @@ template outputLaTeX() {
);
} 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,
@@ -502,7 +500,7 @@ template outputLaTeX() {
\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}
@@ -532,13 +530,12 @@ template outputLaTeX() {
&& _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,
@@ -551,13 +548,12 @@ template outputLaTeX() {
) { /+ 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,
@@ -578,14 +574,13 @@ 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;
}
@@ -599,7 +594,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}
@@ -609,7 +604,6 @@ string block(O,M)(
_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;
}
@@ -622,7 +616,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
@@ -633,7 +627,6 @@ string verse(O,M)(
┃"; // \hardspace
_txt = format(_tex_para,
obj.metainfo.object_number,
- obj.metainfo.object_number,
_txt.nbsp_char.footnotes.split("\n").join("\n\n").strip
).strip;
}
@@ -646,7 +639,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}
@@ -655,7 +648,6 @@ string codeblock(O,M)(
┃";
_txt = format(_tex_para,
obj.metainfo.object_number,
- obj.metainfo.object_number,
_txt.nbsp_char_to_space
).strip;
}
@@ -728,7 +720,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}
@@ -739,7 +731,6 @@ string table(O,M)(
┃";
_txt = format(_tex_para,
obj.metainfo.object_number,
- obj.metainfo.object_number,
_colw,
_table,
).strip;
@@ -1085,6 +1076,9 @@ string table(O,M)(
\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{