aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/out_latex.org
diff options
context:
space:
mode:
Diffstat (limited to 'org/out_latex.org')
-rw-r--r--org/out_latex.org139
1 files changed, 85 insertions, 54 deletions
diff --git a/org/out_latex.org b/org/out_latex.org
index de73ab6..e6049fa 100644
--- a/org/out_latex.org
+++ b/org/out_latex.org
@@ -97,7 +97,7 @@ template outputLaTeX() {
<<output_latex_head_tex_set_colors>>
<<output_latex_head_tex_set_usepackage_misc>>
<<output_latex_head_tex_set_indent_bullet_list>>
-<<output_latex_head_tex_set_part_section_subsection_paragraph_subparagraph>>
+<<output_latex_head_tex_set_part_section_subsection_subsubsection_paragraph_subparagraph>>
<<output_latex_head_tex_set_misc>>
<<output_latex_head_a_format_string_variables>>
<<output_latex_head_close>>
@@ -524,7 +524,7 @@ _txt = _txt
if (_linked_content.match(rgx.inline_image_info)) {
_linked_content = replaceAll!(m =>
format(q"┃\includegraphics*[width=%spt]{%s}%s┃",
- _width_adjust(m[2]), _latex_image_path(m[1]), " \\\\\n")
+ _width_adjust(m[2]), _latex_image_path(m[1]), " \\br\n")
)(_linked_content, rgx.inline_image_info);
}
return _linked_content;
@@ -543,9 +543,9 @@ _txt = _txt
((m[1] == m[2]) && (m[2].match(rgx.uri))) // url link (regular link with url)
? format(q"┃\linkurl{%s}{%s}┃", _check_link(m[1]), (_check_link(m[1])).sp_char_esc_txt)
: ((m[2].match(rgx.uri)) && (m[1].match(rgx.inline_image_info))) // linked image
- ? format(q"┃%s\href{%s}%s{%s}┃", "\\\\\n", _check_link(m[2]), "\n", _if_images(m[1])) // markup for images
+ ? format(q"┃%s\href{%s}%s{%s}┃", "\\br\n", _check_link(m[2]), "\n", _if_images(m[1])) // markup for images
: (m[2].match(rgx.uri)) // not linked image
- ? format(q"┃%s\linktext{%s}{%s}┃", "\\\\\n", _check_link(m[2]), m[1]) // regular link with text
+ ? format(q"┃%s\linktext{%s}{%s}┃", "\\br\n", _check_link(m[2]), m[1]) // regular link with text
: format(q"┃\hyperlink{%s}{%s}┃", _check_link(m[2]), _if_images(m[1])) // internal links, like book index
)(_txt, rgx.inline_link);
}
@@ -625,7 +625,7 @@ _txt = _txt
string _tex_para;
_tex_para = q"┃%s┃";
_txt = format(_tex_para,
- _txt.replaceAll(rgx.latex_clean_bookindex_linebreak, "\n") ~ "\n\\\\\n"
+ _txt.replaceAll(rgx.latex_clean_bookindex_linebreak, "\n") ~ "\n\\br\n"
);
}
return _txt;
@@ -709,7 +709,7 @@ _txt = _txt
goto default;
case 4: // 1 == section
_columns = (_part != "bookindex")
- ? "" : "\n\\\\\n\\begin{multicols}{2}";
+ ? "" : "\n\\br\n\\begin{multicols}{2}";
_pg_break = "\\clearpage\n";
_sect = "section";
_post = "";
@@ -723,27 +723,73 @@ _txt = _txt
_pg_break = "";
// _pg_break = "newpage"; // doubt this is necessary
_sect = "subsection";
- _post = " \\\n";
+ _post = " \\br\n";
_title_add = "";
goto default;
case 6: // 3 == subsubsection
_pg_break = "";
// _pg_break = "newpage"; // doubt this is necessary
_sect = "subsubsection";
- _post = " \\\n";
+ _post = " \\br\n";
+ _title_add = "";
+ goto default;
+ case 7: // 4 == paragraph
+ _pg_break = "";
+ // _pg_break = "newpage"; // doubt this is necessary
+ _sect = "paragraph";
+ _post = " \\br\n";
+ _title_add = "";
+ goto default;
+ case 8: // 5 == subparagraph
+ _pg_break = "";
+ // _pg_break = "newpage"; // doubt this is necessary
+ _sect = "subparagraph";
+ _post = " \\br\n";
_title_add = "";
goto default;
default:
if (obj.metainfo.heading_lev_markup == 0) {
_tex_para = q"┃\begin{document}
+\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}
+\RedeclareSectionCommand[%%
+ style=section,
+ level=0,
+ indent=\z@,
+ beforeskip=-3.5ex \@plus -1ex \@minus -.2ex,
+ afterskip=2.3ex \@plus.2ex,
+ tocindent=0pt,
+ tocnumwidth=1.5em
+ ]{part}
+\RedeclareSectionCommands[%%
+ tocnumwidth+=4pt,
+ tocindent+=4pt,
+ style=section,
+ beforeskip=-0pt,
+ afterskip=4pt,
+ afterindent=false,
+ indent=0pt]{section,subsection,subsubsection}
+\RedeclareSectionCommands[%%
+ beforeskip=-10pt plus -2pt minus -1pt,
+ afterskip=1sp plus -1sp minus 1sp,
+ font=\normalfont\itshape,
+ indent=0pt]{paragraph,subparagraph}
\title{%s}
\author{ \textnormal{%s}}
\date{\begin{tiny}%s\end{tiny}}
-\pagenumbering{roman}\maketitle
+\thispagestyle{empty}
+\maketitle
\pagestyle{fancy}
\newpage
+\pagenumbering{alph}
+\setcounter{page}{1}
\markboth{%s}{%s}
-\\\\[3]\ \linebreak Copyright {\begin{small}{\copyright\end{small}} %s \\
+\br\linebreak Copyright {\begin{small}{\copyright\end{small}} %s \br\linebreak
%s
\pagestyle{fancy}
\clearpage┃";
@@ -773,26 +819,31 @@ _txt = _txt
if (obj.metainfo.heading_lev_markup == 4
&& _txt.match(regex(r"^Table of Contents$"))) {
_tex_para = q"┃
-\pagenumbering{none}
+\pagenumbering{arabic}
\setcounter{page}{1}
+\markboth{%s}{%s}
\setlength{\parskip}{1ex plus0.5ex minus0.2ex}
\part*{\ocn{1}%s \newline %s}
\clearpage
\markboth{%s}{%s}
-\pagenumbering{gobble}
+\pagenumbering{roman}
+\setcounter{page}{1}
\renewcommand{\contentsname}{}
\tableofcontents
\markboth{%s}{%s}
\clearpage
\pagenumbering{arabic}
-\setcounter{page}{1}
+\setcounter{page}{2}
+\clearpage
\markboth{%s}{%s}
%% \null
\clearpage
\setcounter{page}{1}┃";
_txt = format(_tex_para,
+ (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.creator_author).sp_char_esc_txt,
(doc_matters.conf_make_meta.meta.title_main).sp_char_esc_txt,
@@ -1296,6 +1347,7 @@ if (paper_set.is_portrait) {
#+BEGIN_SRC d
\documentclass[%s,%s,titlepage]{scrartcl}
\setlength{\textheight}{%s} \setlength{\textwidth}{%s}
+\usepackage{geometry}
┃",
#+END_SRC
@@ -1318,6 +1370,7 @@ if (paper_set.is_portrait) {
#+BEGIN_SRC d
\documentclass[%s,%s,landscape,titlepage,twocolumn]{scrartcl}
\setlength{\textheight}{%s} \setlength{\textwidth}{%s}
+\usepackage{geometry}
┃",
#+END_SRC
@@ -1394,8 +1447,6 @@ string _latex_head = format(q"┃%%%% spine LaTeX output
%%%% D version: %s
%s
%%%% %s %s
-
-\usepackage{geometry}
#+END_SRC
***** paper type (a4, letter, ...; ( portrait | landscape ))
@@ -1439,6 +1490,9 @@ string _latex_head = format(q"┃%%%% spine LaTeX output
#+NAME: output_latex_head_tex_set_usepackages_languages_and_font
#+BEGIN_SRC latex
+\usepackage[T1]{fontenc}
+\usepackage[english]{babel}
+\usepackage{newunicodechar}
\usepackage{polyglossia}
\usepackage{ucs}
\usepackage{fontspec}
@@ -1473,16 +1527,11 @@ string _latex_head = format(q"┃%%%% spine LaTeX output
pdfkeywords={}, %% keywords list {} {} {},
pdftoolbar=true,
pdfmenubar=true,
- pdfpagemode=UseOutline,
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
- pdfpagelabels=true,
- pageanchor=true,
- pagebackref=true,
plainpages=false, %% was true
- bookmarks=true,
bookmarksopen=false,
%% colorlinks=true,
%% urlcolor=black,
@@ -1490,9 +1539,6 @@ string _latex_head = format(q"┃%%%% spine LaTeX output
%% linkcolor=black,
%% citecolor=black,
%s %% links_mono_or_color_set
- pdfpublisher={}, %% document publisher
- pdfcreator={}, %% document creator
- pdfproducer={}, %% document producer
}
\PassOptionsToPackage{hyphens}{url}\usepackage{hyperref}
#+END_SRC
@@ -1589,39 +1635,13 @@ string _latex_head = format(q"┃%%%% spine LaTeX output
%%\DeclareNewFootnote[para]{A}
-***** part, section, subsection, paragraph, subparagraph
+***** part, section, subsection, subsubsection, paragraph, subparagraph
-#+NAME: output_latex_head_tex_set_part_section_subsection_paragraph_subparagraph
+#+NAME: output_latex_head_tex_set_part_section_subsection_subsubsection_paragraph_subparagraph
#+BEGIN_SRC latex
\usepackage{fancyhdr}
\lhead{}
-\renewcommand{\part}{\@startsection
- {part}{1}{-2mm}%%
- {-\baselineskip}{0.5\baselineskip}%%
- {\bfseries\large\upshape\raggedright}}
-\renewcommand{\section}{\@startsection
- {section}{2}{-2mm}%%
- {-\baselineskip}{0.5\baselineskip}%%
- {\bfseries\large\upshape\raggedright}}
-\renewcommand{\subsection}{\@startsection
- {subsection}{3}{-2mm}%%
- {-\baselineskip}{0.5\baselineskip}%%
- {\bfseries\large\upshape\raggedright}}
-\renewcommand{\subsubsection}{\@startsection
- {subsubsection}{4}{-2mm}%%
- {-\baselineskip}{0.5\baselineskip}%%
- {\normalfont\normalsize\bfseries\raggedright}}
-\renewcommand{\paragraph}{\@startsection
- {paragraph}{5}{-2mm}%%
- {-\baselineskip}{0.5\baselineskip}%%
- {\normalfont\normalsize\itshape\raggedright}}
-\renewcommand{\subparagraph}{\@startsection
- {subparagraph}%%{6}%%{-2mm}%%
- {-\baselineskip}{0.5\baselineskip}%%
- {\normalfont\normalsize\itshape\raggedright}}
-#+END_SRC
-
-%% \makeatother
+#+END_SRC
***** latex head misc. including defined commands
@@ -1644,7 +1664,9 @@ string _latex_head = format(q"┃%%%% spine LaTeX output
\definecolor{Light}{gray}{.92}
\newcommand{\Codeblock}[1]{\normaltext\raggedright\small\ttfamily\texbackslash#1}
\newcommand{\monosp}[1]{\normaltext\ttfamily\texbackslash#1}
-\newcommand{\parasep}{\\ \begin{center}*\hspace{2em}*\hspace{2em}*\end{center} \\}
+\newcommand{\parasep}{\smallskip \begin{center}*\hspace{2em}*\hspace{2em}*\end{center} \br}
+\newcommand{\br}{\hspace*{\fill}}
+\newcommand{\brln}{\smallskip}
\newcommand{\hardspace}{{~}}
\newcommand{\caret}{{\^{~}}}
\newcommand{\pipe}{{\textbar}}
@@ -1661,7 +1683,16 @@ string _latex_head = format(q"┃%%%% spine LaTeX output
{\scriptsize\ttfamily\ulcorner\textup{{#2}}\lrcorner}}}
\newcommand{\link}[2]{{\begin{scriptsize}\color{black}\urlstyle{tt}\href{#1}
{\ulcorner{#2}\lrcorner}\end{scriptsize}}}
-\newcommand{\ocn}[1]{
+\newcommand{\ocn}[1]{%%
+ \ifx&#1&%%
+ %% #1 is empty
+ \begin{tiny}\hspace{0mm}\end{tiny}{\marginpar{\begin{tiny}\end{tiny}}}
+ \else
+ %% #1 is nonempty
+ \begin{tiny}\hspace{0mm}\end{tiny}{\marginpar{\begin{tiny}\hspace{0mm}\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}}}
}
\definecolor{listinggray}{gray}{0.9}