diff options
Diffstat (limited to 'org/out_latex.org')
| -rw-r--r-- | org/out_latex.org | 420 | 
1 files changed, 211 insertions, 209 deletions
diff --git a/org/out_latex.org b/org/out_latex.org index 5aecfbd..326f8cd 100644 --- a/org/out_latex.org +++ b/org/out_latex.org @@ -54,25 +54,25 @@ template outputLaTeX() {  <<output_latex_shared_b_table>>    <<output_latex_head_bullets_and_indentation>>    <<output_latex_head_0>> -  <<output_latex_head_papertype>> +    <<output_latex_head_papertype>>    <<output_latex_head_footer>> -<<output_latex_head_b_tex_papermargins>> -<<output_latex_head_b_tex_papermargins_portrait>> +  <<output_latex_head_b_tex_papermargins>> +  <<output_latex_head_b_tex_papermargins_portrait>>  <<output_latex_head_b_tex_papermargins_portrait_set>>  <<output_latex_head_b_tex_papermargins_portrait_close>> -<<output_latex_head_b_tex_papermargins_landscape>> +  <<output_latex_head_b_tex_papermargins_landscape>>  <<output_latex_head_b_tex_papermargins_landscape_set>>  <<output_latex_head_b_tex_papermargins_landscape_close>> -<<output_latex_head_b_tex_columns_multi>> -<<output_latex_head_b_tex_columns_multi_portrait>> +  <<output_latex_head_b_tex_columns_multi>> +  <<output_latex_head_b_tex_columns_multi_portrait>>  <<output_latex_head_b_tex_columns_multi_portrait_set>>  <<output_latex_head_b_tex_columns_multi_portrait_close>> -<<output_latex_head_b_tex_columns_multi_landscape>> -<<output_latex_head_b_tex_colorlinks>> -<<output_latex_head_b_tex_colorlinks_mono>> +  <<output_latex_head_b_tex_columns_multi_landscape>> +  <<output_latex_head_b_tex_colorlinks>> +  <<output_latex_head_b_tex_colorlinks_mono>>  <<output_latex_head_b_tex_colorlinks_mono_set>>  <<output_latex_head_b_tex_colorlinks_mono_close>> -<<output_latex_head_b_tex_colorlinks_color>> +  <<output_latex_head_b_tex_colorlinks_color>>  <<output_latex_head_b_tex_colorlinks_color_set>>  <<output_latex_head_b_tex_colorlinks_color_close>>    <<output_latex_head_format_string_paper_set>> @@ -108,7 +108,7 @@ template outputLaTeX() {          <<output_latex_body_for_doc_frontmatter>>          <<output_latex_body_for_doc_body>>          <<output_latex_body_for_doc_backmatter>> -  <<output_latex_body_for_doc_default>> +    <<output_latex_body_for_doc_default>>    <<output_latex_body_function_return>>    <<output_latex_tail_function>>      <<output_latex_tail_format_string>> @@ -204,166 +204,166 @@ import doc_reform.io_out;  #+NAME: output_latex_shared_a_paper_type  #+BEGIN_SRC d -    auto paper() { -      struct PaperType { -        @safe auto a4() { -          struct A4 { -            auto portrait() { -              struct V { -                const uint   w            = 160; -                const uint   h            = 228; -                string       width        = format(q"┃%dmm┃", w); -                string       height       = format(q"┃%dmm┃", h); -                string       font_size    = "12pt"; -                string       name         = "a4paper"; -                uint         img_px       = 450; -                bool         is_portrait  = true; -              } -              return V(); -            } -            auto landscape() { -              struct H { -                const uint   w            = 238; -                const uint   h            = 160; -                string       width        = format(q"┃%dmm┃", w); -                string       height       = format(q"┃%dmm┃", h); -                string       font_size    = "11pt"; -                string       name         = "a4paper"; -                uint         img_px       = 300; -                bool         is_portrait  = false; -              } -              return H(); -            } +auto paper() { +  struct PaperType { +    @safe auto a4() { +      struct A4 { +        auto portrait() { +          struct V { +            const uint   w            = 160; +            const uint   h            = 228; +            string       width        = format(q"┃%dmm┃", w); +            string       height       = format(q"┃%dmm┃", h); +            string       font_size    = "12pt"; +            string       name         = "a4paper"; +            uint         img_px       = 450; +            bool         is_portrait  = true;            } -          return A4(); +          return V();          } -        @safe auto a5() { -          struct A5 { -            auto portrait() { -              struct V { -                const uint   w           = 112; -                const uint   h           = 162; -                string       width       = format(q"┃%dmm┃", w); -                string       height      = format(q"┃%dmm┃", h); -                string       font_size   = "0pt"; -                string       name        = "a5paper"; -                uint         img_px      = 280; -                bool         is_portrait = true; -              } -              return V(); -            } -            auto landscape() { -              struct H { -                const uint   w            = 152; -                const uint   h            = 100; -                string       width        = format(q"┃%dmm┃", w); -                string       height       = format(q"┃%dmm┃", h); -                string       font_size    = "0pt"; -                string       name         = "a5paper"; -                uint         img_px       = 190; -                bool         is_portrait  = false; -              } -              return H(); -            } +        auto landscape() { +          struct H { +            const uint   w            = 238; +            const uint   h            = 160; +            string       width        = format(q"┃%dmm┃", w); +            string       height       = format(q"┃%dmm┃", h); +            string       font_size    = "11pt"; +            string       name         = "a4paper"; +            uint         img_px       = 300; +            bool         is_portrait  = false;            } -          return A5(); +          return H();          } -        @safe auto b4() { -          struct B4 { -            auto portrait() { -              struct V { -                const uint   w            = 140; -                const uint   h            = 204; -                string       width        = format(q"┃%dmm┃", w); -                string       height       = format(q"┃%dmm┃", h); -                string       font_size    = "0pt"; -                string       name         = "b4paper"; -                uint         img_px       = 356; -                bool         is_portrait  = true; -              } -              return V(); -            } -            auto landscape() { -              struct H { -                const uint   w            = 200; -                const uint   h            = 130; -                string       width        = format(q"┃%dmm┃", w); -                string       height       = format(q"┃%dmm┃", h); -                string       font_size    = "0pt"; -                string       name         = "b4paper"; -                uint         img_px       = 260; -                bool         is_portrait  = false; -              } -              return H(); -            } +      } +      return A4(); +    } +    @safe auto a5() { +      struct A5 { +        auto portrait() { +          struct V { +            const uint   w           = 112; +            const uint   h           = 162; +            string       width       = format(q"┃%dmm┃", w); +            string       height      = format(q"┃%dmm┃", h); +            string       font_size   = "0pt"; +            string       name        = "a5paper"; +            uint         img_px      = 280; +            bool         is_portrait = true; +          } +          return V(); +        } +        auto landscape() { +          struct H { +            const uint   w            = 152; +            const uint   h            = 100; +            string       width        = format(q"┃%dmm┃", w); +            string       height       = format(q"┃%dmm┃", h); +            string       font_size    = "0pt"; +            string       name         = "a5paper"; +            uint         img_px       = 190; +            bool         is_portrait  = false; +          } +          return H(); +        } +      } +      return A5(); +    } +    @safe auto b4() { +      struct B4 { +        auto portrait() { +          struct V { +            const uint   w            = 140; +            const uint   h            = 204; +            string       width        = format(q"┃%dmm┃", w); +            string       height       = format(q"┃%dmm┃", h); +            string       font_size    = "0pt"; +            string       name         = "b4paper"; +            uint         img_px       = 356; +            bool         is_portrait  = true; +          } +          return V(); +        } +        auto landscape() { +          struct H { +            const uint   w            = 200; +            const uint   h            = 130; +            string       width        = format(q"┃%dmm┃", w); +            string       height       = format(q"┃%dmm┃", h); +            string       font_size    = "0pt"; +            string       name         = "b4paper"; +            uint         img_px       = 260; +            bool         is_portrait  = false;            } -          return B4(); +          return H();          } -        @safe auto letter() { -          struct Letter { -            auto portrait() { -              struct V { -                const uint   w            = 166; -                const uint   h            = 212; -                string       width        = format(q"┃%dmm┃", w); -                string       height       = format(q"┃%dmm┃", h); -                string       font_size    = "0pt"; -                string       name         = "letterpaper"; -                uint         img_px       = 468; -                bool         is_portrait  = true; -              } -              return V(); -            } -            auto landscape() { -              struct H { -                const uint   w            = 226; -                const uint   h            = 166; -                string       width        = format(q"┃%dmm┃", w); -                string       height       = format(q"┃%dmm┃", h); -                string       font_size    = "0pt"; -                string       name         = "letterpaper"; -                uint         img_px       = 290; -                bool         is_portrait  = false; -              } -              return H(); -            } +      } +      return B4(); +    } +    @safe auto letter() { +      struct Letter { +        auto portrait() { +          struct V { +            const uint   w            = 166; +            const uint   h            = 212; +            string       width        = format(q"┃%dmm┃", w); +            string       height       = format(q"┃%dmm┃", h); +            string       font_size    = "0pt"; +            string       name         = "letterpaper"; +            uint         img_px       = 468; +            bool         is_portrait  = true; +          } +          return V(); +        } +        auto landscape() { +          struct H { +            const uint   w            = 226; +            const uint   h            = 166; +            string       width        = format(q"┃%dmm┃", w); +            string       height       = format(q"┃%dmm┃", h); +            string       font_size    = "0pt"; +            string       name         = "letterpaper"; +            uint         img_px       = 290; +            bool         is_portrait  = false; +          } +          return H(); +        } +      } +      return Letter(); +    } +    @safe auto legal() { +      struct Legal { +        auto portrait() { +          struct V { +            const uint   w            = 168; +            const uint   h            = 286; +            string       width        = format(q"┃%dmm┃", w); +            string       height       = format(q"┃%dmm┃", h); +            string       font_size    = "0pt"; +            string       name         = "legalpaper"; +            uint         img_px       = 474; +            bool         is_portrait  = true;            } -          return Letter(); +          return V();          } -        @safe auto legal() { -          struct Legal { -            auto portrait() { -              struct V { -                const uint   w            = 168; -                const uint   h            = 286; -                string       width        = format(q"┃%dmm┃", w); -                string       height       = format(q"┃%dmm┃", h); -                string       font_size    = "0pt"; -                string       name         = "legalpaper"; -                uint         img_px       = 474; -                bool         is_portrait  = true; -              } -              return V(); -            } -            auto landscape() { -              struct H { -                const uint   w            = 296; -                const uint   h            = 166; -                string       width        = format(q"┃%dmm┃", w); -                string       height       = format(q"┃%dmm┃", h); -                string       font_size    = "0pt"; -                string       name         = "legalpaper"; -                uint         img_px       = 420; -                bool         is_portrait  = false; -              } -              return H(); -            } +        auto landscape() { +          struct H { +            const uint   w            = 296; +            const uint   h            = 166; +            string       width        = format(q"┃%dmm┃", w); +            string       height       = format(q"┃%dmm┃", h); +            string       font_size    = "0pt"; +            string       name         = "legalpaper"; +            uint         img_px       = 420; +            bool         is_portrait  = false;            } -          return Legal(); +          return H();          }        } -      return PaperType(); +      return Legal();      } +  } +  return PaperType(); +}  #+END_SRC  *** latex \escape special characters @@ -1091,19 +1091,19 @@ string latex_head(M)(  #+NAME: output_latex_head_papertype  #+BEGIN_SRC d -  struct paperTypeLatex { -    string a4_portrait; -    string a4_landscape; -    string a5_portrait; -    string a5_landscape; -    string b4_portrait; -    string b4_landscape; -    string us_letter_portrait; -    string us_letter_landscape; -    string us_legal_portrait; -    string us_legal_landscape; -  } -  auto paper_type_latex           = paperTypeLatex(); +struct paperTypeLatex { +  string a4_portrait; +  string a4_landscape; +  string a5_portrait; +  string a5_landscape; +  string b4_portrait; +  string b4_landscape; +  string us_letter_portrait; +  string us_letter_landscape; +  string us_legal_portrait; +  string us_legal_landscape; +} +auto paper_type_latex           = paperTypeLatex();  #+END_SRC  ****** footer @@ -1145,18 +1145,18 @@ string latex_head(M)(  #+NAME: output_latex_head_b_tex_papermargins  #+BEGIN_SRC d -  struct paperMargins { -    string portrait; -    string landscape; -  } -  auto margins           = paperMargins(); +struct paperMargins { +  string portrait; +  string landscape; +} +auto margins           = paperMargins();  #+END_SRC  ****** portrait  #+NAME: output_latex_head_b_tex_papermargins_portrait  #+BEGIN_SRC d -  margins.portrait    = format(q"┃ +margins.portrait    = format(q"┃  #+END_SRC  #+NAME: output_latex_head_b_tex_papermargins_portrait_set @@ -1176,7 +1176,7 @@ string latex_head(M)(  #+NAME: output_latex_head_b_tex_papermargins_landscape  #+BEGIN_SRC d -  margins.landscape    = format(q"┃ +margins.landscape    = format(q"┃  #+END_SRC  #+NAME: output_latex_head_b_tex_papermargins_landscape_set @@ -1197,18 +1197,18 @@ string latex_head(M)(  #+NAME: output_latex_head_b_tex_columns_multi  #+BEGIN_SRC d -  struct columnsMulti { -    string portrait; -    string landscape; -  } -  auto multicol           = columnsMulti(); +struct columnsMulti { +  string portrait; +  string landscape; +} +auto multicol           = columnsMulti();  #+END_SRC  ****** portrait  #+NAME: output_latex_head_b_tex_columns_multi_portrait  #+BEGIN_SRC d -  multicol.portrait    = format(q"┃ +multicol.portrait    = format(q"┃  #+END_SRC  #+NAME: output_latex_head_b_tex_columns_multi_portrait_set @@ -1226,7 +1226,7 @@ string latex_head(M)(  #+NAME: output_latex_head_b_tex_columns_multi_landscape  #+BEGIN_SRC d -  multicol.landscape    = ""; +multicol.landscape    = "";  #+END_SRC  ***** color links @@ -1234,18 +1234,18 @@ string latex_head(M)(  #+NAME: output_latex_head_b_tex_colorlinks  #+BEGIN_SRC d -  struct colorLinks { -    string mono; -    string color; -  } -  auto links           = colorLinks(); +struct colorLinks { +  string mono; +  string color; +} +auto links           = colorLinks();  #+END_SRC  ****** mono  #+NAME: output_latex_head_b_tex_colorlinks_mono  #+BEGIN_SRC d -  links.mono    = format(q"┃ +links.mono    = format(q"┃  #+END_SRC  #+NAME: output_latex_head_b_tex_colorlinks_mono_set @@ -1267,7 +1267,7 @@ string latex_head(M)(  #+NAME: output_latex_head_b_tex_colorlinks_color  #+BEGIN_SRC d -  links.color    = format(q"┃ +links.color    = format(q"┃  #+END_SRC  #+NAME: output_latex_head_b_tex_colorlinks_color_set @@ -1900,25 +1900,25 @@ case "backmatter":  #+NAME: output_latex_body_for_doc_default  #+BEGIN_SRC d -      case "comment": -        break; -      default: -        { /+ debug +/ -          if (doc_matters.opt.action.debug_do -          && doc_matters.opt.action.verbose) { -            writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part); -            writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); -            writeln(__FILE__, ":", __LINE__, ": ", obj.text); -          } +    case "comment": +      break; +    default: +      { /+ debug +/ +        if (doc_matters.opt.action.debug_do +        && doc_matters.opt.action.verbose) { +          writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part); +          writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); +          writeln(__FILE__, ":", __LINE__, ": ", obj.text);          } -        break;        } +      break;      }    } -  if (_multicolumns) { -    _multicolumns = false; -    _latex_body ~= "\n\\end{multicols}\n"; -  } +} +if (_multicolumns) { +  _multicolumns = false; +  _latex_body ~= "\n\\end{multicols}\n"; +}  #+END_SRC  **** latex body return @@ -1982,7 +1982,9 @@ string _latex_tail = format(q"┃  #+HEADER: :tangle-mode (identity #o755)  #+HEADER: :shebang #!/usr/bin/env ruby  #+BEGIN_SRC ruby -# <<doc_header_including_copyright_and_license>> +=begin +<<doc_header_including_copyright_and_license>> +=end  require 'fileutils'  pwd = Dir.pwd  argv,texfiles_with_path,flags=[],[],[]  | 
