aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/out_latex.org
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2022-04-02 10:37:34 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2022-04-03 18:13:53 -0400
commit4b0ae05439e2f5c33c452bd39baed3b8198ccc4a (patch)
tree85c4bc117bdfd3ff1aa967c8a1d4f337db647444 /org/out_latex.org
parentlatex header, work on (& some code formatting) (diff)
latex head adjustments
Diffstat (limited to 'org/out_latex.org')
-rw-r--r--org/out_latex.org72
1 files changed, 36 insertions, 36 deletions
diff --git a/org/out_latex.org b/org/out_latex.org
index 817bbc8..a03c588 100644
--- a/org/out_latex.org
+++ b/org/out_latex.org
@@ -29,6 +29,7 @@ module doc_reform.io_out.latex;
template outputLaTeX() {
<<ImportsAndMixins_imports>>
<<Function_shared_geometry_paper_dimensions>>
+ <<Function_shared_special_characters_to_escape_operations>>
<<Function_shared_special_characters_to_escape_object>>
<<Function_shared_special_characters_to_escape_text>>
<<Function_shared_fontface>>
@@ -112,6 +113,7 @@ template outputLaTeX() {
#+END_SRC
** write latex output :latex:out:
+*** write latex output :latex:out:
#+NAME: Function_output_write
#+BEGIN_SRC d
@@ -153,7 +155,7 @@ void writeOutputLaTeX(T,M)(
}
#+END_SRC
-** latex output hub [#A] :latex:pdf:out:
+*** latex output hub [#A] :latex:pdf:out:
#+NAME: Function_output_set
#+BEGIN_SRC d
@@ -459,11 +461,10 @@ auto paper() {
*** latex \escape special characters
**** general
-#+NAME: Function_shared_special_characters_to_escape_object
+#+NAME: Function_shared_special_characters_to_escape_operations
#+BEGIN_SRC d
-@safe string sp_char_esc(O)(
+@safe string sp_char_ops()(
string _txt,
- const O obj,
) {
string _unescape_sp_char_esc()(string _txt) {
_txt = _txt
@@ -478,38 +479,37 @@ auto paper() {
format(q"┃%s%s┃", "$1", "$2"));
return _txt;
}
+ _txt = replaceAll!(m => "\\" ~ m[1])(_txt, rgx.latex_special_char_for_escape);
+ _txt = replaceAll!(m => "{\\" ~ m[1] ~ "}")(_txt, rgx.latex_special_char_for_escape_and_braces);
+ _txt = replaceAll!(m => "''")(_txt, rgx.quotes_open_and_close);
+ _txt = replaceAll!(m => "$\\cdot$")(_txt, rgx.middle_dot);
+ _txt = replaceAll!(m => _unescape_sp_char_esc(m[0]))(_txt, rgx.latex_identify_inline_link);
+ _txt = replaceAll!(m => _unescape_fontface_esc(m[0]))(_txt, rgx.latex_identify_inline_fontface);
+ return _txt;
+}
+#+END_SRC
+
+#+NAME: Function_shared_special_characters_to_escape_object
+#+BEGIN_SRC d
+@safe string sp_char_esc(O)(
+ string _txt,
+ const O obj,
+) {
if (obj.metainfo.is_a != "code") {
- _txt = replaceAll!(m => "\\" ~ m[1])(_txt, rgx.latex_special_char_for_escape);
- _txt = replaceAll!(m => "{\\" ~ m[1] ~ "}")(_txt, rgx.latex_special_char_for_escape_and_braces);
- _txt = replaceAll!(m => _unescape_sp_char_esc(m[0]))(_txt, rgx.latex_identify_inline_link);
- _txt = replaceAll!(m => _unescape_fontface_esc(m[0]))(_txt, rgx.latex_identify_inline_fontface);
+ _txt = _txt.sp_char_ops;
}
return _txt;
}
#+END_SRC
+**** string text
+
#+NAME: Function_shared_special_characters_to_escape_text
#+BEGIN_SRC d
@safe string sp_char_esc_txt()(
string _txt,
) {
- string _unescape_sp_char_esc()(string _txt) {
- _txt = _txt
- .replaceAll(rgx.latex_special_char_escaped,
- format(q"┃%s┃", "$1"))
- .replaceAll(rgx.latex_special_char_escaped_braced,
- format(q"┃%s┃", "$1"));
- return _txt;
- }
- string _unescape_fontface_esc()(string _txt) {
- _txt = _txt.replaceAll(rgx.latex_identify_inline_fontface,
- format(q"┃%s%s┃", "$1", "$2"));
- return _txt;
- }
- _txt = replaceAll!(m => "\\" ~ m[1])(_txt, rgx.latex_special_char_for_escape);
- _txt = replaceAll!(m => "{\\" ~ m[1] ~ "}")(_txt, rgx.latex_special_char_for_escape_and_braces);
- _txt = replaceAll!(m => _unescape_sp_char_esc(m[0]))(_txt, rgx.latex_identify_inline_link);
- _txt = replaceAll!(m => _unescape_fontface_esc(m[0]))(_txt, rgx.latex_identify_inline_fontface);
+ _txt = _txt.sp_char_ops;
return _txt;
}
#+END_SRC
@@ -540,8 +540,8 @@ _txt = _txt
.replaceAll(rgx.inline_bold, format(q"┃\begin{bfseries}%s\end{bfseries}┃", "$1"))
.replaceAll(rgx.inline_italics, format(q"┃\emph{%s}┃", "$1"))
.replaceAll(rgx.inline_italics, format(q"┃\uline{%s}┃", "$1"))
- .replaceAll(rgx.inline_superscript, format(q"┃$$^{\textrm{%s}}$$┃", "$1"))
- .replaceAll(rgx.inline_subscript, format(q"┃$$_{\textrm{%s}}$$┃", "$1"))
+ .replaceAll(rgx.inline_superscript, format(q"┃$$^{%s}$$┃", "$1"))
+ .replaceAll(rgx.inline_subscript, format(q"┃$$_{%s}$$┃", "$1"))
.replaceAll(rgx.inline_strike, format(q"┃\sout{%s}┃", "$1"))
.replaceAll(rgx.inline_insert, format(q"┃\uline{%s}┃", "$1"))
.replaceAll(rgx.inline_mono, format(q"┃\begin{monosp}%s\end{monosp}┃", "$1"))
@@ -1556,16 +1556,13 @@ if (
#+NAME: FmtTxtOpen_head_format_tex_set_start_latex_head
#+BEGIN_SRC d
-string _latex_head = format(q"┃%%%% spine LaTeX output
+string _latex_head = format(q"┃%%%% spine LaTeX output%s%s%s
#+END_SRC
***** description comment
#+NAME: FmtTxtSet_head_tex_set_generated_by
#+BEGIN_SRC latex
-%%%% Generated by: %s
-%%%% D version: %s
-%s
%%%% %s %s
#+END_SRC
@@ -1610,6 +1607,9 @@ string _latex_head = format(q"┃%%%% spine LaTeX output
#+NAME: FmtTxtSet_head_tex_set_usepackages_languages_and_font
#+BEGIN_SRC latex
+\usepackage[scaled]{dejavu}
+\renewcommand*\familydefault{\sfdefault}
+\usepackage{inconsolata}
\usepackage[T1]{fontenc}
%% \usepackage[utf8]{inputenc}
\usepackage[english]{babel}
@@ -1617,8 +1617,6 @@ string _latex_head = format(q"┃%%%% spine LaTeX output
\usepackage{polyglossia}
\setmainlanguage{%s}
\setotherlanguage{%s}
-\setmainfont{Liberation Sans}
-\setmonofont[Scale=0.85]{Liberation Mono}
#+END_SRC
%% \setsansfont{Liberation Sans}
@@ -1704,6 +1702,8 @@ string _latex_head = format(q"┃%%%% spine LaTeX output
\usepackage{graphicx}
\usepackage[tc]{titlepic}
\usepackage{amssymb}
+\usepackage{amsmath}
+\usepackage[cm]{sfmath}
\usepackage{listings}
\setcounter{secnumdepth}{2}
\setcounter{tocdepth}{4}
@@ -1932,9 +1932,9 @@ string _latex_head = format(q"┃%%%% spine LaTeX output
#+NAME: FmtTxtClose_head_a_format_string_variables
#+BEGIN_SRC d
┃",
- doc_matters.opt.action.debug_do_latex ? "" : doc_matters.generator_program.name_and_version.strip,
- doc_matters.opt.action.debug_do_latex ? "" : doc_matters.generator_program.compiler.strip,
- doc_matters.opt.action.debug_do_latex ? "" : "", // "%%%% LaTeX output last Generated on: " ~ doc_matters.generator_program.stime.strip,
+ doc_matters.opt.action.generated_by ? " " ~ doc_matters.generator_program.name_and_version.strip : "",
+ doc_matters.opt.action.generated_by ? " (" ~ doc_matters.generator_program.compiler.strip ~ ")" : "",
+ doc_matters.opt.action.generated_by ? " (LaTeX output last Generated on: " ~ doc_matters.generator_program.stime.strip ~ ")" : "",
doc_matters.generator_program.project_name.strip,
doc_matters.generator_program.url_home.strip,
paper_size_orientation_latex.strip,