diff options
Diffstat (limited to 'org/out_latex.org')
| -rw-r--r-- | org/out_latex.org | 1394 | 
1 files changed, 760 insertions, 634 deletions
| diff --git a/org/out_latex.org b/org/out_latex.org index a03c588..9b52a26 100644 --- a/org/out_latex.org +++ b/org/out_latex.org @@ -21,17 +21,45 @@  * latex  ** _module template_ :latex:pdf:module: +*** latex.d module & templates -#+HEADER: :tangle "../src/doc_reform/io_out/latex.d" :noweb yes +#+HEADER: :tangle "../src/doc_reform/io_out/latex.d" +#+HEADER: :noweb yes  #+BEGIN_SRC d  <<doc_header_including_copyright_and_license>>  module doc_reform.io_out.latex; +<<Template_paper_latex>> +<<Template_output_latex>> +<<Template_latex_init>> +<<Template_latex_sty_static>> +<<Template_latex_sty_paper_dimensions>> +#+END_SRC + +*** template paperLaTeX + +#+NAME: Template_paper_latex +#+BEGIN_SRC d +template paperLaTeX() { +  import +    std.format, +    std.conv : to; +  auto paperLaTeX() { +    <<Struct_shared_geometry_paper_dimensions>> +    return PaperType(); +  } +} +#+END_SRC + +*** template outputLaTeX + +#+NAME: Template_output_latex +#+BEGIN_SRC d  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_marked_linebreaks_newline_to_latex>>    <<Function_shared_fontface>>    <<Function_shared_leading_hardspaces>>    <<Function_shared_character_nbsp_to_hardspace>> @@ -55,9 +83,6 @@ template outputLaTeX() {      <<Function_head_footer>>      <<Struct_head_tex_papermargins>>      <<Struct_head_tex_columns_multi>> -    <<FmtTxtOpen_head_tex_columns_multi_portrait>> -<<FmtTxtSet_head_tex_columns_multi_portrait>> -<<FmtTxtClose_head_tex_columns_multi_portrait>>      <<VarSet_head_tex_columns_multi_landscape>>      <<Struct_head_tex_colorlinks>>      <<FmtTxtOpen_head_tex_colorlinks_mono>> @@ -69,9 +94,11 @@ template outputLaTeX() {      <<MethodOpen_head_format_string_paper_set>>        <<Condition_FmtTxtOpen_head_format_string_paper_set_format_portrait>>  <<FmtTxtSet_head_format_string_paper_set_format_portrait_tex>> +<<FmtTxtSet_head_tex_set_part_section_subsection_subsubsection_paragraph_subparagraph>>          <<FmtTxtClose_head_format_string_paper_set_format_portrait_variables>>        <<Condition_FmtTxtOpen_head_format_string_paper_set_format_landscape>>  <<FmtTxtSet_head_format_string_paper_set_format_landscape_tex>> +<<FmtTxtSet_head_tex_set_part_section_subsection_subsubsection_paragraph_subparagraph>>          <<FmtTxtClose_head_format_string_paper_set_format_landscape_variables>>      <<MethodClose_head_format_string_paper_set_return>>      <<Switch_head_format_string_paper_set_orientation>> @@ -80,19 +107,6 @@ template outputLaTeX() {  <<FmtTxtSet_head_tex_set_generated_by>>  <<FmtTxtSet_head_tex_set_paper_type>>  <<FmtTxtSet_head_tex_set_orintation>> -<<FmtTxtSet_head_tex_set_columns>> -<<FmtTxtSet_head_tex_set_margins>> -<<FmtTxtSet_head_tex_set_usepackages_languages_and_font>> -<<FmtTxtSet_head_tex_set_usepackages_1>> -<<FmtTxtSet_head_tex_set_metadata>> -<<FmtTxtSet_head_tex_set_colors>> -<<FmtTxtSet_head_tex_set_usepackage_misc>> -<<FmtTxtSet_head_tex_set_indent_bullet_list>> -<<FmtTxtSet_head_tex_set_part_section_subsection_subsubsection_paragraph_subparagraph>> -<<FmtTxtSet_head_tex_set_misc>> -<<FmtTxtSet_head_tex_newEnvironment>> -<<FmtTxtSet_head_tex_newCommands>> -%% <<FmtTxtSet_head_tex_bug_remove_blank_first_page>>      <<FmtTxtClose_head_a_format_string_variables>>    <<MethodClose_head_close>>    <<MethodOpen_body_function>> @@ -112,6 +126,45 @@ template outputLaTeX() {  }  #+END_SRC +*** template outputLaTeXstyInit + +#+NAME: Template_latex_init +#+BEGIN_SRC d +template outputLaTeXstyInit() { +  import doc_reform.io_out; +  mixin spineRgxOut; +  auto paper = paperLaTeX; +  <<Function_output_style_write>> +  <<Function_output_stylesheets_get_each_written>> +} +#+END_SRC + +*** template outputLaTeXstyStatic + +#+NAME: Template_latex_sty_static +#+BEGIN_SRC d +template outputLaTeXstyStatic() { +  <<Initialize_output_style>> +  string outputLaTeXstyStatic() { +<<FmtTxt_output_style_static_set>> +    return latex_sty; +  } +} +#+END_SRC + +*** template outputLaTeXstyPaperSizeAndOrientation + +#+NAME: Template_latex_sty_paper_dimensions +#+BEGIN_SRC d +template outputLaTeXstyPaperSizeAndOrientation() { +  <<Initialize_output_style>> +  auto outputLaTeXstyPaperSizeAndOrientation(P)(P doc_sty_info) { +<<FmtTxt_output_style_paper_dimensions_set>> +    return latex_sty; +  } +} +#+END_SRC +  ** write latex output :latex:out:  *** write latex output :latex:out: @@ -178,6 +231,366 @@ void outputLaTeX(D,M)(  }  #+END_SRC +*** styles :latex:out: +**** initialize + +#+NAME: Initialize_output_style +#+BEGIN_SRC d +import +  std.format, +  std.conv : to; +#+END_SRC + +**** write latex styles output :latex:out: +***** write + +#+NAME: Function_output_style_write +#+BEGIN_SRC d +void writeOutputLaTeXstyStatic( +  string latex_sty, +  string output_dir, +  string filename, +) { +  if ((output_dir.length > 0) +    && isValidPath(output_dir) +  ) { +    auto pth_latex = spinePathsLaTeXsty(output_dir); +    try { +      import std.file; +      if (!exists(pth_latex.base_sty)) { +        (pth_latex.base_sty).mkdirRecurse; +      } +      auto f = File(pth_latex.latex_document_header_sty(filename), "w"); +      f.writeln(latex_sty); +    } catch (ErrnoException ex) { +      // handle error +    } +  } +} +#+END_SRC + +***** request write (send to be written) + +#+NAME: Function_output_stylesheets_get_each_written +#+BEGIN_SRC d +void outputLaTeXstyInit()(string output_dir,) { +  string latex_sty = outputLaTeXstyStatic!(); +  latex_sty.writeOutputLaTeXstyStatic(output_dir, "spineShared.sty"); +  auto sty_a4p      = paper.a4.portrait; +  auto latex_papersize_and_orientation = outputLaTeXstyPaperSizeAndOrientation!()(sty_a4p); +  latex_papersize_and_orientation.writeOutputLaTeXstyStatic(output_dir, sty_a4p.stylesheet ~ ".sty"); +  auto sty_a4l      = paper.a4.landscape; +  latex_papersize_and_orientation = outputLaTeXstyPaperSizeAndOrientation!()(sty_a4l); +  latex_papersize_and_orientation.writeOutputLaTeXstyStatic(output_dir, sty_a4l.stylesheet ~ ".sty"); +  auto sty_b4p      = paper.b4.portrait; +  latex_papersize_and_orientation = outputLaTeXstyPaperSizeAndOrientation!()(sty_b4p); +  latex_papersize_and_orientation.writeOutputLaTeXstyStatic(output_dir, sty_b4p.stylesheet ~ ".sty"); +  auto sty_b4l      = paper.b4.landscape; +  latex_papersize_and_orientation = outputLaTeXstyPaperSizeAndOrientation!()(sty_b4l); +  latex_papersize_and_orientation.writeOutputLaTeXstyStatic(output_dir, sty_b4l.stylesheet ~ ".sty"); +  auto sty_a5p      = paper.a5.portrait; +  latex_papersize_and_orientation = outputLaTeXstyPaperSizeAndOrientation!()(sty_a5p); +  latex_papersize_and_orientation.writeOutputLaTeXstyStatic(output_dir, sty_a5p.stylesheet ~ ".sty"); +  auto sty_a5l      = paper.a5.landscape; +  latex_papersize_and_orientation = outputLaTeXstyPaperSizeAndOrientation!()(sty_a5l); +  latex_papersize_and_orientation.writeOutputLaTeXstyStatic(output_dir, sty_a5l.stylesheet ~ ".sty"); +  auto sty_letter_p  = paper.letter.portrait; +  latex_papersize_and_orientation = outputLaTeXstyPaperSizeAndOrientation!()(sty_letter_p); +  latex_papersize_and_orientation.writeOutputLaTeXstyStatic(output_dir, sty_letter_p.stylesheet ~ ".sty"); +  auto sty_letter_l  = paper.letter.landscape; +  latex_papersize_and_orientation = outputLaTeXstyPaperSizeAndOrientation!()(sty_letter_l); +  latex_papersize_and_orientation.writeOutputLaTeXstyStatic(output_dir, sty_letter_l.stylesheet ~ ".sty"); +  auto sty_legal_p   = paper.legal.portrait; +  latex_papersize_and_orientation = outputLaTeXstyPaperSizeAndOrientation!()(sty_legal_p); +  latex_papersize_and_orientation.writeOutputLaTeXstyStatic(output_dir, sty_legal_p.stylesheet ~ ".sty"); +  auto sty_legal_l   = paper.legal.landscape; +  latex_papersize_and_orientation = outputLaTeXstyPaperSizeAndOrientation!()(sty_legal_l); +  latex_papersize_and_orientation.writeOutputLaTeXstyStatic(output_dir, sty_legal_l.stylesheet ~ ".sty"); +} +#+END_SRC + +**** sty: paper dimensions sty (calls static sty) + +#+NAME: FmtTxt_output_style_paper_dimensions_set +#+BEGIN_SRC d +    string latex_sty = format(q"┃%% - called by .tex document to set paper dimensions (size and orientation) +%% - calls spineShared.sty used/shared by all spine documents +\ProvidesPackage{./sty/%s} +\usepackage{geometry} +\geometry{ +  %s, +  %s, +  left=%s, +  right=%s, +  top=%s, +  bottom=%s, +} +\usepackage{./sty/spineShared}┃", +  doc_sty_info.stylesheet, +  doc_sty_info.papersize, +  doc_sty_info.orient, +  doc_sty_info.margin_left, +  doc_sty_info.margin_right, +  doc_sty_info.margin_top, +  doc_sty_info.margin_bottom, +); +#+END_SRC + +**** sty: in common + +fonts to try: + +#+BEGIN_SRC latex +\usepackage[scaled]{dejavu} +\renewcommand*\familydefault{\sfdefault} +\usepackage{inconsolata} +\usepackage[T1]{fontenc} +#+END_SRC + +#+BEGIN_SRC latex +\usepackage[scaled]{dejavu} +\usepackage[scaled]{tgheros} +\usepackage[scaled]{quattrocento} +\usepackage[scaled]{cmbright} +\usepackage[scaled]{tgadventor} +\usepackage[scaled]{bookman} +\usepackage[scaled]{libertine} +\usepackage[scaled]{bera} +\usepackage[scale=.95,type1]{arev} +\usepackage[scale=.95,type1]{cabin} +#+END_SRC + +#+NAME: FmtTxt_output_style_static_set +#+BEGIN_SRC latex +    string latex_sty = format(q"┃%% - called by the .sty containing the paper dimensions (size and orientation) to be used +%% - spineShared.sty used by all spine documents (called indirectly) +\ProvidesPackage{./sty/spineShared} +\usepackage{multicol} +\setlength{\marginparsep}{4mm} +\setlength{\marginparwidth}{8mm} +\usepackage[scaled]{dejavu} +\renewcommand*\familydefault{\sfdefault} +\usepackage{inconsolata} +\usepackage[T1]{fontenc} +\usepackage{newunicodechar} +%% \usepackage[utf8]{inputenc} +\usepackage{alltt} +\usepackage[ +  unicode=true, +	pdfusetitle, +  pdfsubject={}, +  pdfkeywords={},         %% keywords list {} {} {}, +  pdftoolbar=true, +  pdfmenubar=true, +  pdfwindowui=true, +  pdffitwindow=false,     %% window fit to page when opened +  pdfstartview={FitH},    %% fits the width of the page to the window +  pdfnewwindow=true,      %% links in new window +  pdfborder={0 0 1}, +  plainpages=false,       %% was true +  bookmarks=true, +  bookmarksopen=false, +  bookmarksnumbered=false, +  backref=false, +  breaklinks=false, +  colorlinks=true, +  urlcolor=black, +  filecolor=black, +  linkcolor=black, +  citecolor=black,        %% links_mono_or_color_set +]{hyperref} +\PassOptionsToPackage{hyphens}{url}\usepackage{hyperref} +\usepackage[usenames]{color} +\definecolor{myblack}{rgb}{0,0,0} +\definecolor{myred}{rgb}{0.75,0,0} +\definecolor{mygreen}{rgb}{0,0.5,0} +\definecolor{myblue}{rgb}{0,0,0.5} +\definecolor{mywhite}{rgb}{1,1,1} +\usepackage{textcomp} +\usepackage[parfill]{parskip} +\usepackage[normalem]{ulem} +\usepackage{soul} +\usepackage{longtable} +\usepackage{graphicx} +\usepackage[tc]{titlepic} +\usepackage{amssymb} +\usepackage{amsmath} +\usepackage[cm]{sfmath} +\usepackage{underscore} +\usepackage{listings} +\setcounter{secnumdepth}{2} +\setcounter{tocdepth}{4} +\usepackage{bookmark} +\usepackage{microtype} +\makeatletter +\usepackage[multiple,ragged]{footmisc} +\setlength\footnotemargin{12pt} +\usepackage[para]{manyfoot} +\DeclareNewFootnote{A} +\makeatother +\chardef\txtbullet="2022 +\chardef\tilde="7E +\def\asterisk{{\rm \char42} } +\definecolor{Light}{gray}{.92} +\definecolor{listinggray}{gray}{0.9} +\definecolor{lbcolor}{rgb}{0.9,0.9,0.9} +\lstset{ +  backgroundcolor=\color{lbcolor}, +  tabsize=4, +  rulecolor=, +  language=, +  basicstyle={\ttfamily\scriptsize}, +  upquote=true, +  columns=fixed, +  showstringspaces=false, +  extendedchars=true, +  breaklines=true, +  prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}}, +  frame=single, +  showtabs=false, +  showspaces=false, +  showstringspaces=false, +  identifierstyle=\ttfamily, +  keywordstyle=\color[rgb]{0,0,1}, +  commentstyle=\color[rgb]{0.133,0.545,0.133}, +  stringstyle=\color[rgb]{0.627,0.126,0.941}, +} +\DeclareTOCStyleEntry[numwidth+=8pt]{part}{part} +\DeclareTOCStyleEntry[numwidth+=4pt]{section}{section} +\DeclareTOCStyleEntry[numwidth+=3pt]{section}{paragraph} +\DeclareTOCStyleEntry[numwidth+=3pt]{section}{subparagraph} +\DeclareTOCStyleEntry[numwidth+=3pt]{section}{subsection} +\DeclareTOCStyleEntries[indent+=4pt]{section}{section,subsection,subsubsection} +\DeclareTOCStyleEntries[numwidth+=3pt]{section}{paragraph,subparagraph} +\newenvironment{ParagraphIndent}[1]{%% +  \begin{list}{}{%% +    \setlength\topsep{0pt}%% +    \addtolength{\leftmargin}{#1} +    \setlength\parsep{0pt plus 1pt}%% +  } +  \item[] +} {\end{list}} +\newenvironment{ParagraphHang}[2]{%% +  \begin{list}{}{%% +    \setlength\topsep{0pt}%% +    \addtolength{\leftmargin}{#1} +    \itemindent=#2 +    \setlength\parsep{0pt plus 1pt}%% +  } +  \item[] +} {\end{list}} +\newenvironment{Bullet}[1]{%% +  \begin{list}{}{%% +    \setlength\topsep{0pt}%% +    \addtolength{\leftmargin}{#1} +    \itemindent=-1em +    \setlength\parsep{0pt plus 1pt}%% +  } +  \item[] +  $\txtbullet$\hspace{\enspace} +} {\end{list}} +\newcommand{\monosp}[1]{\normaltext\ttfamily\texbackslash#1} +\newcommand{\br}{\hfill\break} +\newcommand{\brl}[1]{%% +  \ifx&%% +    \hfill\break +  \else +    \vspace{#1ex} +  \fi +} +\newcommand{\brln}{\hspace*{\fill}\linebreak} +\newcommand{\objBlockOpen}{%% +  \setlength{\parskip}{0.5ex plus0.2ex minus0.1ex}\raggedright +  \begin{footnotesize} +} +\newcommand{\objBlockClose}{%% +  \end{footnotesize} +  \setlength{\parskip}{1ex plus0.5ex minus0.2ex} +} +\newcommand{\objGroupOpen}{%% +  \setlength{\parskip}{0.5ex plus0.2ex minus0.1ex} +  \begin{footnotesize} +} +\newcommand{\objGroupClose}{%% +  \end{footnotesize} +} +\newcommand{\objPoemVerseOpen}{%% +  \setlength{\parskip}{0.1ex plus0.1ex minus0.1ex} +  \begin{footnotesize} + +} +\newcommand{\objPoemVerseClose}{%% + +  \end{footnotesize} +  \setlength{\parskip}{1ex plus0.5ex minus0.2ex} +  \linebreak +} +\newcommand{\parasep}{%% +  \smallskip \begin{center}*\hspace{2em}*\hspace{2em}*\end{center} \br +} +\newcommand{\spaces}[1]{{\hspace*{#1ex}}} +\newcommand{\s}{\hspace*{1ex}} +\newcommand{\hardspace}{\hspace*{1ex}} +\newcommand{\-}{\hspace*{1ex}} +\newcommand{\caret}{{\^{~}}} +\newcommand{\pipe}{{\textbar}} +\newcommand{\curlyOpen}{{} +\newcommand{\curlyClose}{}} +\newcommand{\lt}{{UseTextSymbol{OML}{<}}} +\newcommand{\gt}{{UseTextSymbol{OML}{>}}} +\newcommand{\slash}{{/}} +\newcommand{\underscore}{\_} +\newcommand{\exclaim}{\Verbatim{!}} +\newcommand{\linktext}[2]{%% +  {\href{#1} +  {\;\ulcorner\,\textup{{#2}}\,\lrcorner}} +} +\newcommand{\linkurl}[2]{%% +  \;{\href{#1} +  {\;\scriptsize\ttfamily\ulcorner\,\textup{{#2}}\,\lrcorner}} +} +\newcommand{\link}[2]{%% +  {\begin{scriptsize}\color{black}\urlstyle{tt}\href{#1} +  {\;\ulcorner\,{#2}\,\lrcorner}\end{scriptsize}} +} +\newcommand{\objCodeBlock}[1]{\normaltext\raggedright\small\ttfamily\texbackslash#1} +\newcommand{\objCodeOpen}{%% +  \normaltext\raggedright\small\ttfamily\texbackslash +  \begin{lstlisting} +} +\newcommand{\objCodeClose}{%% +  \end{lstlisting} +} +\newcommand{\ocn}[1]{%% +  \setlength{\parindent}{0em} +  \ifx&%% #1 is empty +    \hspace{-0.5ex}{\marginpar{\begin{tiny}\end{tiny}}} +  \else%% #1 is nonempty +    \hspace{-0.5ex}{\marginpar{\begin{tiny}\hspace{0em}\hypertarget{#1}{#1}\end{tiny}}} +  \fi +} +\newcommand{\ocnhold}[1]{%% +  \begin{tiny}\hspace{0mm}\end{tiny}{\marginpar{\begin{tiny}\hspace{0mm}\hypertarget{#1}{#1}\end{tiny}}} +} +\newcommand{\objCodeBlockHold}[1]{\normaltext\raggedright\small\ttfamily\texbackslash#1} +\newcommand{\objTableOpen}[1]{%% +  \setlength{\LTleft}{0pt} +  \setlength{\LTright}{\fill} +  \begin{tiny} +  \begin{longtable}{#1} +} +\newcommand{\objTableClose}{%% +  \end{longtable} +  \end{tiny} +} +%% \tolerance=300 +%% \clubpenalty=300 +%% \widowpenalty=300 +%% \usepackage{atbegshi} %% http://ctan.org/pkg/atbegshi         %% (BUG tmp FIX deal with problem, remove first page which is blank) +%% \AtBeginDocument{\AtBeginShipoutNext{\AtBeginShipoutDiscard}} %% (BUG tmp FIX deal with problem, remove first page which is blank) +┃"); +#+END_SRC +  * stuff  ** output imports @@ -195,271 +608,286 @@ mixin spineRgxOut;  static auto rgx = RgxO();  mixin spineLanguageCodes;  auto lang = Lang(); +auto paper = paperLaTeX;  #+END_SRC  ** shared  *** paper dimensions (struct) geometry -#+NAME: Function_shared_geometry_paper_dimensions +#+NAME: Struct_shared_geometry_paper_dimensions  #+BEGIN_SRC d -auto paper() { -  string mm(uint mmi) { -    string _mm = format(q"┃%smm┃", mmi.to!string); -    return _mm; -  } -  struct PaperType { -    @safe auto a4() { -      struct A4 { -        auto portrait() { -          struct V { -            string       papersize     = "a4paper"; -            string       orient        = "portrait"; -            string       fontsize      = "11pt"; -            const uint   w             = 170; -            const uint   h             = 257; -            const uint   l             = 30; -            const uint   r             = 20; -            const uint   t             = 30; -            const uint   b             = 30; -            string       width         = mm(w); -            string       height        = mm(h); -            string       margin_left   = mm(l); -            string       margin_right  = mm(r); -            string       margin_top    = mm(t); -            string       margin_bottom = mm(b); -            uint         img_px        = 450; -            bool         is_portrait   = true; -          } -          return V(); +string mm(uint mmi) { +  string _mm = format(q"┃%smm┃", mmi.to!string); +  return _mm; +} +struct PaperType { +  @safe auto a4() { +    struct A4 { +      auto portrait() { +        struct V { +          string       stylesheet    = "spineA4portrait"; +          string       papersize     = "a4paper"; +          string       orient        = "portrait"; +          string       fontsize      = "11pt"; +          const uint   w             = 170; +          const uint   h             = 257; +          const uint   l             = 30; +          const uint   r             = 20; +          const uint   t             = 30; +          const uint   b             = 30; +          string       width         = mm(w); +          string       height        = mm(h); +          string       margin_left   = mm(l); +          string       margin_right  = mm(r); +          string       margin_top    = mm(t); +          string       margin_bottom = mm(b); +          uint         img_px        = 450; +          bool         is_portrait   = true;          } -        auto landscape() { -          struct H { -            string       papersize     = "a4paper"; -            string       orient        = "landscape"; -            string       fontsize      = "11pt"; -            const uint   w             = 238; -            const uint   h             = 160; -            const uint   l             = 30; -            const uint   r             = 20; -            const uint   t             = 30; -            const uint   b             = 30; -            string       width         = mm(w); -            string       height        = mm(h); -            string       margin_left   = mm(l); -            string       margin_right  = mm(r); -            string       margin_top    = mm(t); -            string       margin_bottom = mm(b); -            uint         img_px        = 300; -            bool         is_portrait   = false; -          } -          return H(); +        return V(); +      } +      auto landscape() { +        struct H { +          string       stylesheet    = "spineA4landscape"; +          string       papersize     = "a4paper"; +          string       orient        = "landscape"; +          string       fontsize      = "11pt"; +          const uint   w             = 238; +          const uint   h             = 160; +          const uint   l             = 30; +          const uint   r             = 20; +          const uint   t             = 30; +          const uint   b             = 30; +          string       width         = mm(w); +          string       height        = mm(h); +          string       margin_left   = mm(l); +          string       margin_right  = mm(r); +          string       margin_top    = mm(t); +          string       margin_bottom = mm(b); +          uint         img_px        = 300; +          bool         is_portrait   = false;          } +        return H();        } -      return A4();      } -    @safe auto a5() { -      struct A5 { -        auto portrait() { -          struct V { -            string       papersize     = "a5paper"; -            string       orient        = "portrait"; -            string       fontsize      = "11pt"; -            const uint   w             = 112; -            const uint   h             = 162; -            const uint   l             = 30; -            const uint   r             = 20; -            const uint   t             = 30; -            const uint   b             = 30; -            string       width         = mm(w); -            string       height        = mm(h); -            string       margin_left   = mm(l); -            string       margin_right  = mm(r); -            string       margin_top    = mm(t); -            string       margin_bottom = mm(b); -            uint         img_px        = 280; -            bool         is_portrait   = true; -          } -          return V(); +    return A4(); +  } +  @safe auto a5() { +    struct A5 { +      auto portrait() { +        struct V { +          string       stylesheet    = "spineA5portrait"; +          string       papersize     = "a5paper"; +          string       orient        = "portrait"; +          string       fontsize      = "11pt"; +          const uint   w             = 112; +          const uint   h             = 162; +          const uint   l             = 30; +          const uint   r             = 20; +          const uint   t             = 30; +          const uint   b             = 30; +          string       width         = mm(w); +          string       height        = mm(h); +          string       margin_left   = mm(l); +          string       margin_right  = mm(r); +          string       margin_top    = mm(t); +          string       margin_bottom = mm(b); +          uint         img_px        = 280; +          bool         is_portrait   = true;          } -        auto landscape() { -          struct H { -            string       papersize     = "a5paper"; -            string       orient        = "landscape"; -            string       fontsize      = "11pt"; -            const uint   w             = 152; -            const uint   h             = 100; -            const uint   l             = 30; -            const uint   r             = 20; -            const uint   t             = 30; -            const uint   b             = 30; -            string       width         = mm(w); -            string       height        = mm(h); -            string       margin_left   = mm(l); -            string       margin_right  = mm(r); -            string       margin_top    = mm(t); -            string       margin_bottom = mm(b); -            uint         img_px        = 190; -            bool         is_portrait   = false; -          } -          return H(); +        return V(); +      } +      auto landscape() { +        struct H { +          string       stylesheet    = "spineA5landscape"; +          string       papersize     = "a5paper"; +          string       orient        = "landscape"; +          string       fontsize      = "11pt"; +          const uint   w             = 152; +          const uint   h             = 100; +          const uint   l             = 30; +          const uint   r             = 20; +          const uint   t             = 30; +          const uint   b             = 30; +          string       width         = mm(w); +          string       height        = mm(h); +          string       margin_left   = mm(l); +          string       margin_right  = mm(r); +          string       margin_top    = mm(t); +          string       margin_bottom = mm(b); +          uint         img_px        = 190; +          bool         is_portrait   = false;          } +        return H();        } -      return A5();      } -    @safe auto b4() { -      struct B4 { -        auto portrait() { -          struct V { -            string       papersize     = "b4paper"; -            string       orient        = "portrait"; -            string       fontsize      = "11pt"; -            const uint   w             = 140; -            const uint   h             = 204; -            const uint   l             = 30; -            const uint   r             = 20; -            const uint   t             = 30; -            const uint   b             = 30; -            string       width         = mm(w); -            string       height        = mm(h); -            string       margin_left   = mm(l); -            string       margin_right  = mm(r); -            string       margin_top    = mm(t); -            string       margin_bottom = mm(b); -            uint         img_px        = 356; -            bool         is_portrait   = true; -          } -          return V(); +    return A5(); +  } +  @safe auto b4() { +    struct B4 { +      auto portrait() { +        struct V { +          string       stylesheet    = "spineB4portrait"; +          string       papersize     = "b4paper"; +          string       orient        = "portrait"; +          string       fontsize      = "11pt"; +          const uint   w             = 140; +          const uint   h             = 204; +          const uint   l             = 30; +          const uint   r             = 20; +          const uint   t             = 30; +          const uint   b             = 30; +          string       width         = mm(w); +          string       height        = mm(h); +          string       margin_left   = mm(l); +          string       margin_right  = mm(r); +          string       margin_top    = mm(t); +          string       margin_bottom = mm(b); +          uint         img_px        = 356; +          bool         is_portrait   = true;          } -        auto landscape() { -          struct H { -            string       papersize     = "b4paper"; -            string       orient        = "landscape"; -            string       fontsize      = "11pt"; -            const uint   w             = 200; -            const uint   h             = 130; -            const uint   l             = 30; -            const uint   r             = 20; -            const uint   t             = 30; -            const uint   b             = 30; -            string       width         = mm(w); -            string       height        = mm(h); -            string       margin_left   = mm(l); -            string       margin_right  = mm(r); -            string       margin_top    = mm(t); -            string       margin_bottom = mm(b); -            uint         img_px        = 260; -            bool         is_portrait   = false; -          } -          return H(); +        return V(); +      } +      auto landscape() { +        struct H { +          string       stylesheet    = "spineB4landsape"; +          string       papersize     = "b4paper"; +          string       orient        = "landscape"; +          string       fontsize      = "11pt"; +          const uint   w             = 200; +          const uint   h             = 130; +          const uint   l             = 30; +          const uint   r             = 20; +          const uint   t             = 30; +          const uint   b             = 30; +          string       width         = mm(w); +          string       height        = mm(h); +          string       margin_left   = mm(l); +          string       margin_right  = mm(r); +          string       margin_top    = mm(t); +          string       margin_bottom = mm(b); +          uint         img_px        = 260; +          bool         is_portrait   = false;          } +        return H();        } -      return B4();      } -    @safe auto letter() { -      struct Letter { -        auto portrait() { -          struct V { -            string       papersize     = "letterpaper"; -            string       orient        = "portrait"; -            string       fontsize      = "11pt"; -            const uint   w             = 166; -            const uint   h             = 212; -            const uint   l             = 30; -            const uint   r             = 20; -            const uint   t             = 30; -            const uint   b             = 30; -            string       width         = mm(w); -            string       height        = mm(h); -            string       margin_left   = mm(l); -            string       margin_right  = mm(r); -            string       margin_top    = mm(t); -            string       margin_bottom = mm(b); -            uint         img_px        = 468; -            bool         is_portrait   = true; -          } -          return V(); +    return B4(); +  } +  @safe auto letter() { +    struct Letter { +      auto portrait() { +        struct V { +          string       stylesheet    = "spineLetterPortrait"; +          string       papersize     = "letterpaper"; +          string       orient        = "portrait"; +          string       fontsize      = "11pt"; +          const uint   w             = 166; +          const uint   h             = 212; +          const uint   l             = 30; +          const uint   r             = 20; +          const uint   t             = 30; +          const uint   b             = 30; +          string       width         = mm(w); +          string       height        = mm(h); +          string       margin_left   = mm(l); +          string       margin_right  = mm(r); +          string       margin_top    = mm(t); +          string       margin_bottom = mm(b); +          uint         img_px        = 468; +          bool         is_portrait   = true;          } -        auto landscape() { -          struct H { -            string       papersize     = "letterpaper"; -            string       orient        = "landscape"; -            string       fontsize      = "11pt"; -            const uint   w             = 226; -            const uint   h             = 166; -            const uint   l             = 30; -            const uint   r             = 20; -            const uint   t             = 30; -            const uint   b             = 30; -            string       width         = mm(w); -            string       height        = mm(h); -            string       margin_left   = mm(l); -            string       margin_right  = mm(r); -            string       margin_top    = mm(t); -            string       margin_bottom = mm(b); -            uint         img_px        = 290; -            bool         is_portrait   = false; -          } -          return H(); +        return V(); +      } +      auto landscape() { +        struct H { +          string       stylesheet    = "spineLetterLandscape"; +          string       papersize     = "letterpaper"; +          string       orient        = "landscape"; +          string       fontsize      = "11pt"; +          const uint   w             = 226; +          const uint   h             = 166; +          const uint   l             = 30; +          const uint   r             = 20; +          const uint   t             = 30; +          const uint   b             = 30; +          string       width         = mm(w); +          string       height        = mm(h); +          string       margin_left   = mm(l); +          string       margin_right  = mm(r); +          string       margin_top    = mm(t); +          string       margin_bottom = mm(b); +          uint         img_px        = 290; +          bool         is_portrait   = false;          } +        return H();        } -      return Letter();      } -    @safe auto legal() { -      struct Legal { -        auto portrait() { -          struct V { -            string       papersize     = "legalpaper"; -            string       orient        = "portrait"; -            string       fontsize      = "11pt"; -            const uint   w             = 168; -            const uint   h             = 286; -            const uint   l             = 30; -            const uint   r             = 20; -            const uint   t             = 30; -            const uint   b             = 30; -            string       width         = mm(w); -            string       height        = mm(h); -            string       margin_left   = mm(l); -            string       margin_right  = mm(r); -            string       margin_top    = mm(t); -            string       margin_bottom = mm(b); -            uint         img_px        = 474; -            bool         is_portrait   = true; -          } -          return V(); +    return Letter(); +  } +  @safe auto legal() { +    struct Legal { +      auto portrait() { +        struct V { +          string       stylesheet    = "spineLegalPortrait"; +          string       papersize     = "legalpaper"; +          string       orient        = "portrait"; +          string       fontsize      = "11pt"; +          const uint   w             = 168; +          const uint   h             = 286; +          const uint   l             = 30; +          const uint   r             = 20; +          const uint   t             = 30; +          const uint   b             = 30; +          string       width         = mm(w); +          string       height        = mm(h); +          string       margin_left   = mm(l); +          string       margin_right  = mm(r); +          string       margin_top    = mm(t); +          string       margin_bottom = mm(b); +          uint         img_px        = 474; +          bool         is_portrait   = true;          } -        auto landscape() { -          struct H { -            string       papersize     = "legalpaper"; -            string       orient        = "landscape"; -            string       fontsize      = "11pt"; -            const uint   w             = 296; -            const uint   h             = 166; -            const uint   l             = 30; -            const uint   r             = 20; -            const uint   t             = 30; -            const uint   b             = 30; -            string       width         = mm(w); -            string       height        = mm(h); -            string       margin_left   = mm(l); -            string       margin_right  = mm(r); -            string       margin_top    = mm(t); -            string       margin_bottom = mm(b); -            uint         img_px        = 420; -            bool         is_portrait   = false; -          } -          return H(); +        return V(); +      } +      auto landscape() { +        struct H { +          string       stylesheet    = "spineLegalLandscape"; +          string       papersize     = "legalpaper"; +          string       orient        = "landscape"; +          string       fontsize      = "11pt"; +          const uint   w             = 296; +          const uint   h             = 166; +          const uint   l             = 30; +          const uint   r             = 20; +          const uint   t             = 30; +          const uint   b             = 30; +          string       width         = mm(w); +          string       height        = mm(h); +          string       margin_left   = mm(l); +          string       margin_right  = mm(r); +          string       margin_top    = mm(t); +          string       margin_bottom = mm(b); +          uint         img_px        = 420; +          bool         is_portrait   = false;          } +        return H();        } -      return Legal();      } +    return Legal();    } -  return PaperType();  }  #+END_SRC  *** latex \escape special characters -**** general +**** object (string text within) + +- “” characters not directly available for use in font +- run into problems using " for quotes and modified latex header +  - (m => "\"") +  - \usepackage[autostyle, english = american]{csquotes} +    \MakeOuterQuote{"} +- (m => "''") works alone better  #+NAME: Function_shared_special_characters_to_escape_operations  #+BEGIN_SRC d @@ -514,10 +942,23 @@ auto paper() {  }  #+END_SRC -*** not used latex \escape special characters +***** line breaks + +#+NAME: Function_shared_marked_linebreaks_newline_to_latex +#+BEGIN_SRC d +@safe string marked_linebreaks_newlines()( +  string      _txt, +) { +  _txt = _txt.split(rgx.br_linebreaks_newlines).join("\\br\n").strip; +  // _txt = replaceAll!(m => "\\br " ~ m[1])(_txt, rgx.br_linebreaks_newlines); +  return _txt; +} +#+END_SRC + +*** not used latex \escape special characters UNUSED  #+BEGIN_SRC d -@safe string sp_char_esc()( +@safe string sp_char_esc_()(    string      _txt,  ) {    _txt = replaceAll!(m => "\\" ~ m[1])(_txt, rgx.latex_special_char); @@ -570,7 +1011,7 @@ _txt = _txt  ***** nbsp character UNUSED -#+NAME: shared_character_nbsp_to_hardspace_ +#+NAME: output_latex_shared_character_nbsp_to_hardspace_  #+BEGIN_SRC d  @safe string nbsp_char_replace()(string _txt) {    if (_txt.match(rgx.nbsp_char)) { @@ -966,8 +1407,8 @@ _txt = _txt              (doc_matters.conf_make_meta.meta.title_main).sp_char_esc_txt,              (doc_matters.conf_make_meta.meta.title_main).sp_char_esc_txt,              (doc_matters.conf_make_meta.meta.title_full).sp_char_esc_txt, -            (doc_matters.conf_make_meta.meta.rights_copyright).sp_char_esc_txt, -            (doc_matters.conf_make_meta.meta.rights_license).sp_char_esc_txt, +            (doc_matters.conf_make_meta.meta.rights_copyright).sp_char_esc_txt.marked_linebreaks_newlines, +            (doc_matters.conf_make_meta.meta.rights_license).sp_char_esc_txt.marked_linebreaks_newlines,            );          } else if (obj.metainfo.heading_lev_markup < 4) {            if (!(_txt.footnotes.strip == "Endnotes")) { @@ -1427,7 +1868,7 @@ citecolor=black,      );  #+END_SRC -**** latex head starts +**** latex head open  ***** dimensions & orientation  ****** set @@ -1446,27 +1887,51 @@ if (paper_set.is_portrait) {  #+NAME: FmtTxtSet_head_format_string_paper_set_format_portrait_tex  #+BEGIN_SRC latex  \documentclass[%s,%s,titlepage,makeidx]{scrartcl} -\usepackage{geometry} -\geometry{ -  %s, -  %s, -  left=%s, -  right=%s, -  top=%s, -  bottom=%s, -}┃", +\usepackage{%s} +\usepackage[%s,%s]{babel} +\usepackage[autostyle, english = american]{csquotes} +%% \MakeOuterQuote{"} %% not required, using '' as quote delimiter +\selectlanguage{%s} +\hypersetup{ +  pdftitle={%s}, +  pdfauthor={%s}, +  pdfsubject={%s}, +} +#+END_SRC + +#+BEGIN_SRC latex +\usepackage[%s,%s]{babel} +\usepackage[autostyle, english = american]{csquotes} +\MakeOuterQuote{"} +\setmainlanguage{} +\setotherlanguage{} +\selectlanguage{%s} +%% \usepackage{polyglossia} +#+END_SRC + +#+NAME: FmtTxtSet_head_tex_set_part_section_subsection_subsubsection_paragraph_subparagraph +#+BEGIN_SRC latex +\usepackage{fancyhdr} +\lhead[ ]{ } +\chead[ \fancyplain{} \bfseries \footnotesize \leftmark ]{ \fancyplain{} \bfseries \footnotesize \rightmark } +\rhead[ ]{ } +%s +\rfoot[\tiny \href{}{}]{\textrm{\thepage}}  #+END_SRC  #+NAME: FmtTxtClose_head_format_string_paper_set_format_portrait_variables  #+BEGIN_SRC d +┃",    paper_set.fontsize,    paper_set.papersize, -  paper_set.papersize, -  paper_set.orient, -  paper_set.margin_left, -  paper_set.margin_right, -  paper_set.margin_top, -  paper_set.margin_bottom, +  "./sty/" ~ paper_set.stylesheet, +  lang.codes[doc_matters.src.language]["xlp"], +  "english", +  lang.codes[doc_matters.src.language]["xlp"], +  doc_matters.conf_make_meta.meta.title_full.strip, +  doc_matters.conf_make_meta.meta.creator_author.strip, +  doc_matters.conf_make_meta.meta.classify_subject.strip, +  _footer(doc_matters),  );  #+END_SRC @@ -1477,29 +1942,34 @@ if (paper_set.is_portrait) {  #+END_SRC  #+NAME: FmtTxtSet_head_format_string_paper_set_format_landscape_tex -#+BEGIN_SRC d +#+BEGIN_SRC latex  \documentclass[%s,%s,landscape,titlepage,twocolumn,makeidx]{scrartcl} -\usepackage{geometry} -\geometry{ -  %s, -  %s, -  left=%s, -  right=%s, -  top=%s, -  bottom=%s, -}┃", +\usepackage{%s} +\usepackage[english]{babel} +%% \usepackage{polyglossia} +\setmainlanguage{%s} +\setotherlanguage{%s} +\selectlanguage{%s} +\hypersetup{ +  pdftitle={%s}, +  pdfauthor={%s}, +  pdfsubject={%s}, +}  #+END_SRC  #+NAME: FmtTxtClose_head_format_string_paper_set_format_landscape_variables  #+BEGIN_SRC d +┃",    paper_set.fontsize,    paper_set.papersize, -  paper_set.papersize, -  paper_set.orient, -  paper_set.margin_left, -  paper_set.margin_right, -  paper_set.margin_top, -  paper_set.margin_bottom, +  "./sty/" ~ paper_set.stylesheet, +  lang.codes[doc_matters.src.language]["xlp"], +  "english", +  lang.codes[doc_matters.src.language]["xlp"], +  doc_matters.conf_make_meta.meta.title_full.strip, +  doc_matters.conf_make_meta.meta.creator_author.strip, +  doc_matters.conf_make_meta.meta.classify_subject.strip, +  _footer(doc_matters),  );  #+END_SRC @@ -1588,346 +2058,11 @@ string _latex_head = format(q"┃%%%% spine LaTeX output%s%s%s  %s  #+END_SRC -***** multicol (portrait | landscape) - -#+NAME: FmtTxtSet_head_tex_set_columns -#+BEGIN_SRC latex -%s -#+END_SRC - -***** margin shared - -#+NAME: FmtTxtSet_head_tex_set_margins -#+BEGIN_SRC latex -\setlength{\marginparsep}{4mm} -\setlength{\marginparwidth}{8mm} -#+END_SRC - -***** language & font - -#+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} -\usepackage{newunicodechar} -\usepackage{polyglossia} -\setmainlanguage{%s} -\setotherlanguage{%s} -#+END_SRC - -%% \setsansfont{Liberation Sans} -%% \setromanfont{Liberation Serif} - -***** latex head - -#+NAME: FmtTxtSet_head_tex_set_usepackages_1 -#+BEGIN_SRC latex -\usepackage{alltt} -\usepackage{hyperref} -\hypersetup{ -#+END_SRC - -***** hyperref metadata - -#+NAME: FmtTxtSet_head_tex_set_metadata -#+BEGIN_SRC latex -  unicode=true, -	pdfusetitle, -  pdftitle={%s}, -  pdfauthor={%s}, -  pdfsubject={%s}, -  pdfkeywords={},         %% keywords list {} {} {}, -  pdftoolbar=true, -  pdfmenubar=true, -  pdfwindowui=true, -  pdffitwindow=false,     %% window fit to page when opened -  pdfstartview={FitH},    %% fits the width of the page to the window -  pdfnewwindow=true,      %% links in new window -  pdfborder={0 0 1}, -  plainpages=false,       %% was true -  bookmarks=true, -  bookmarksopen=false, -  bookmarksnumbered=false, -  backref=false, -  breaklinks=false, -  %% colorlinks=true, -  %% urlcolor=black, -  %% filecolor=black, -  %% linkcolor=black, -  %% citecolor=black, -%s                        %% links_mono_or_color_set -} -\PassOptionsToPackage{hyphens}{url}\usepackage{hyperref} -#+END_SRC - -%%  pdfusetitle=true, -%%  pdfpagelayout=SinglePage, -%%  pdfpagelayout=TwoColumnRight, -%%  pdfpagelayout=TwoColumnLeft, -%%  pdfstartpage=3, - -%%%% trace lost characters -%% \tracinglostchars = 1 -%% \tracingonline = 1 - -***** define colors - -#+NAME: FmtTxtSet_head_tex_set_colors -#+BEGIN_SRC latex -\usepackage[usenames]{color} -\definecolor{myblack}{rgb}{0,0,0} -\definecolor{myred}{rgb}{0.75,0,0} -\definecolor{mygreen}{rgb}{0,0.5,0} -\definecolor{myblue}{rgb}{0,0,0.5} -\definecolor{mywhite}{rgb}{1,1,1} -#+END_SRC -  ***** latex head  %%\usepackage{breakurl} -***** latex head - -#+NAME: FmtTxtSet_head_tex_set_usepackage_misc -#+BEGIN_SRC latex -\usepackage{textcomp} -\usepackage[parfill]{parskip} -\usepackage[normalem]{ulem} -\usepackage{soul} -\usepackage{longtable} -\usepackage{graphicx} -\usepackage[tc]{titlepic} -\usepackage{amssymb} -\usepackage{amsmath} -\usepackage[cm]{sfmath} -\usepackage{listings} -\setcounter{secnumdepth}{2} -\setcounter{tocdepth}{4} -\usepackage{bookmark} -\usepackage{microtype} -\makeatletter -#+END_SRC - -***** indent, bullet, list - -#+NAME: FmtTxtSet_head_tex_set_indent_bullet_list -#+BEGIN_SRC latex -\usepackage[multiple,ragged]{footmisc} -\setlength\footnotemargin{12pt} -\usepackage[para]{manyfoot} -\DeclareNewFootnote{A} -#+END_SRC - -%%\DeclareNewFootnote[para]{A} - -***** part, section, subsection, subsubsection, paragraph, subparagraph - -#+NAME: FmtTxtSet_head_tex_set_part_section_subsection_subsubsection_paragraph_subparagraph -#+BEGIN_SRC latex -\usepackage{fancyhdr} -#+END_SRC - -***** latex head misc. including defined commands - -#+NAME: FmtTxtSet_head_tex_set_misc -#+BEGIN_SRC latex -\selectlanguage{%s} -\lhead[ ]{ } -\chead[ \fancyplain{} \bfseries \footnotesize \leftmark ]{ \fancyplain{} \bfseries \footnotesize \rightmark } -\rhead[ ]{ } -%s -\rfoot[\tiny \href{}{}]{\textrm{\thepage}} -%% \tolerance=300 -%% \clubpenalty=300 -%% \widowpenalty=300 -\makeatother -\chardef\txtbullet="2022 -\chardef\tilde="7E -\def\asterisk{{\rm \char42} } -\definecolor{Light}{gray}{.92} -\definecolor{listinggray}{gray}{0.9} -\definecolor{lbcolor}{rgb}{0.9,0.9,0.9} -\lstset{ -  backgroundcolor=\color{lbcolor}, -  tabsize=4, -  rulecolor=, -  language=, -  basicstyle={\ttfamily\scriptsize}, -  upquote=true, -  columns=fixed, -  showstringspaces=false, -  extendedchars=true, -  breaklines=true, -  prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}}, -  frame=single, -  showtabs=false, -  showspaces=false, -  showstringspaces=false, -  identifierstyle=\ttfamily, -  keywordstyle=\color[rgb]{0,0,1}, -  commentstyle=\color[rgb]{0.133,0.545,0.133}, -  stringstyle=\color[rgb]{0.627,0.126,0.941}, -} -\DeclareTOCStyleEntry[numwidth+=8pt]{part}{part} -\DeclareTOCStyleEntry[numwidth+=4pt]{section}{section} -\DeclareTOCStyleEntry[numwidth+=3pt]{section}{paragraph} -\DeclareTOCStyleEntry[numwidth+=3pt]{section}{subparagraph} -\DeclareTOCStyleEntry[numwidth+=3pt]{section}{subsection} -\DeclareTOCStyleEntries[indent+=4pt]{section}{section,subsection,subsubsection} -\DeclareTOCStyleEntries[numwidth+=3pt]{section}{paragraph,subparagraph} -#+END_SRC - -***** latex head new environment - -#+NAME: FmtTxtSet_head_tex_newEnvironment -#+BEGIN_SRC latex -\newenvironment{ParagraphIndent}[1]{%% -  \begin{list}{}{%% -    \setlength\topsep{0pt}%% -    \addtolength{\leftmargin}{#1} -    \setlength\parsep{0pt plus 1pt}%% -  } -  \item[] -} {\end{list}} -\newenvironment{ParagraphHang}[2]{%% -  \begin{list}{}{%% -    \setlength\topsep{0pt}%% -    \addtolength{\leftmargin}{#1} -    \itemindent=#2 -    \setlength\parsep{0pt plus 1pt}%% -  } -  \item[] -} {\end{list}} -\newenvironment{Bullet}[1]{%% -  \begin{list}{}{%% -    \setlength\topsep{0pt}%% -    \addtolength{\leftmargin}{#1} -    \itemindent=-1em -    \setlength\parsep{0pt plus 1pt}%% -  } -  \item[] -  $\txtbullet$\hspace{\enspace} -} {\end{list}} -#+END_SRC - -***** latex head new commands defined - -#+NAME: FmtTxtSet_head_tex_newCommands -#+BEGIN_SRC latex -\newcommand{\monosp}[1]{\normaltext\ttfamily\texbackslash#1} -\newcommand{\br}{\hfill\break} -\newcommand{\brl}[1]{%% -  \ifx&%% -    \hfill\break -  \else -    \vspace{#1ex} -  \fi -} -\newcommand{\brln}{\hspace*{\fill}\linebreak} -\newcommand{\objBlockOpen}{ -  \setlength{\parskip}{0.5ex plus0.2ex minus0.1ex}\raggedright -  \begin{footnotesize} -} -\newcommand{\objBlockClose}{%% -  \end{footnotesize} -  \setlength{\parskip}{1ex plus0.5ex minus0.2ex} -} -\newcommand{\objGroupOpen}{%% -  \setlength{\parskip}{0.5ex plus0.2ex minus0.1ex} -  \begin{footnotesize} -} -\newcommand{\objGroupClose}{%% -  \end{footnotesize} -} -\newcommand{\objPoemVerseOpen}{%% -  \setlength{\parskip}{0.1ex plus0.1ex minus0.1ex} -  \begin{footnotesize} - -} -\newcommand{\objPoemVerseClose}{%% - -  \end{footnotesize} -  \setlength{\parskip}{1ex plus0.5ex minus0.2ex} -  \linebreak -} -\newcommand{\parasep}{%% -  \smallskip \begin{center}*\hspace{2em}*\hspace{2em}*\end{center} \br -} -\newcommand{\spaces}[1]{{\hspace*{#1ex}}} -\newcommand{\s}{\hspace*{1ex}} -\newcommand{\hardspace}{\hspace*{1ex}} -\newcommand{\-}{\hspace*{1ex}} -\newcommand{\caret}{{\^{~}}} -\newcommand{\pipe}{{\textbar}} -\newcommand{\curlyOpen}{{} -\newcommand{\curlyClose}{}} -\newcommand{\lt}{{UseTextSymbol{OML}{<}}} -\newcommand{\gt}{{UseTextSymbol{OML}{>}}} -\newcommand{\slash}{{/}} -\newcommand{\underscore}{\_} -\newcommand{\exclaim}{\Verbatim{!}} -\newcommand{\linktext}[2]{%% -  {\href{#1} -  {\;\ulcorner\,\textup{{#2}}\,\lrcorner}} -} -\newcommand{\linkurl}[2]{%% -  \;{\href{#1} -  {\;\scriptsize\ttfamily\ulcorner\,\textup{{#2}}\,\lrcorner}} -} -\newcommand{\link}[2]{%% -  {\begin{scriptsize}\color{black}\urlstyle{tt}\href{#1} -  {\;\ulcorner\,{#2}\,\lrcorner}\end{scriptsize}} -} -\newcommand{\objCodeBlock}[1]{\normaltext\raggedright\small\ttfamily\texbackslash#1} -\newcommand{\objCodeOpen}{%% -  \normaltext\raggedright\small\ttfamily\texbackslash -  \begin{lstlisting} -} -\newcommand{\objCodeClose}{%% -  \end{lstlisting} -} -\newcommand{\ocn}[1]{%% -  \setlength{\parindent}{0em} -  \ifx&%% -    %% #1 is empty -    \hspace{-0.5ex}{\marginpar{\begin{tiny}\end{tiny}}} -  \else -    %% #1 is nonempty -    \hspace{-0.5ex}{\marginpar{\begin{tiny}\hspace{0em}\hypertarget{#1}{#1}\end{tiny}}} -  \fi -} -\newcommand{\ocnhold}[1]{%% -  \begin{tiny}\hspace{0mm}\end{tiny}{\marginpar{\begin{tiny}\hspace{0mm}\hypertarget{#1}{#1}\end{tiny}}} -} -\newcommand{\objCodeBlockHold}[1]{\normaltext\raggedright\small\ttfamily\texbackslash#1} -\newcommand{\objTableOpen}[1]{%% -  \setlength{\LTleft}{0pt} -  \setlength{\LTright}{\fill} -  \begin{tiny} -  \begin{longtable}{#1} -} -\newcommand{\objTableClose}{%% -  \end{longtable} -  \end{tiny} -} -#+END_SRC - -%%\chardef\asterisk="2A -%%\newcommand{\hardspace}{\hspace{.5em}} - -***** latex remove blank first page BUG FIX can REMOVE UNUSED - -#+NAME: FmtTxtSet_head_tex_bug_remove_blank_first_page -#+BEGIN_SRC latex -\usepackage{atbegshi} %% http://ctan.org/pkg/atbegshi         %% (BUG tmp FIX deal with problem, remove first page which is blank) -\AtBeginDocument{\AtBeginShipoutNext{\AtBeginShipoutDiscard}} %% (BUG tmp FIX deal with problem, remove first page which is blank) -#+END_SRC - -**** latex head format inclusions +**** latex head close (variables set)  #+NAME: FmtTxtClose_head_a_format_string_variables  #+BEGIN_SRC d @@ -1939,15 +2074,6 @@ string _latex_head = format(q"┃%%%% spine LaTeX output%s%s%s    doc_matters.generator_program.url_home.strip,    paper_size_orientation_latex.strip,    margins.portrait.strip, -  multicol.portrait.strip, -  lang.codes[doc_matters.src.language]["xlp"], -  "english", -  doc_matters.conf_make_meta.meta.title_full.strip, -  doc_matters.conf_make_meta.meta.creator_author.strip, -  doc_matters.conf_make_meta.meta.classify_subject.strip, -  links_mono_or_color_set, -  lang.codes[doc_matters.src.language]["xlp"], -  _footer(doc_matters),  );  #+END_SRC | 
