aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/io_out
diff options
context:
space:
mode:
Diffstat (limited to 'src/doc_reform/io_out')
-rw-r--r--src/doc_reform/io_out/latex.d129
1 files changed, 81 insertions, 48 deletions
diff --git a/src/doc_reform/io_out/latex.d b/src/doc_reform/io_out/latex.d
index 48afecb..80904dd 100644
--- a/src/doc_reform/io_out/latex.d
+++ b/src/doc_reform/io_out/latex.d
@@ -327,7 +327,7 @@ template outputLaTeX() {
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;
@@ -346,9 +346,9 @@ template outputLaTeX() {
((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);
}
@@ -402,7 +402,7 @@ template outputLaTeX() {
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;
@@ -435,7 +435,7 @@ template outputLaTeX() {
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 = "";
@@ -449,27 +449,73 @@ template outputLaTeX() {
_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┃";
@@ -499,26 +545,31 @@ template outputLaTeX() {
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,
@@ -877,6 +928,7 @@ citecolor=black,
paper_type_description = format(q"┃
\documentclass[%s,%s,titlepage]{scrartcl}
\setlength{\textheight}{%s} \setlength{\textwidth}{%s}
+\usepackage{geometry}
┃",
paper_set.fontsize,
paper_set.name,
@@ -887,6 +939,7 @@ citecolor=black,
paper_type_description = format(q"┃
\documentclass[%s,%s,landscape,titlepage,twocolumn]{scrartcl}
\setlength{\textheight}{%s} \setlength{\textwidth}{%s}
+\usepackage{geometry}
┃",
paper_set.fontsize,
paper_set.name,
@@ -927,13 +980,14 @@ citecolor=black,
%%%% D version: %s
%s
%%%% %s %s
-
-\usepackage{geometry}
%s
%s
\setlength{\marginparsep}{4mm}
\setlength{\marginparwidth}{8mm}
%s
+\usepackage[T1]{fontenc}
+\usepackage[english]{babel}
+\usepackage{newunicodechar}
\usepackage{polyglossia}
\usepackage{ucs}
\usepackage{fontspec}
@@ -953,16 +1007,11 @@ citecolor=black,
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,
@@ -970,9 +1019,6 @@ citecolor=black,
%% linkcolor=black,
%% citecolor=black,
%s %% links_mono_or_color_set
- pdfpublisher={}, %% document publisher
- pdfcreator={}, %% document creator
- pdfproducer={}, %% document producer
}
\PassOptionsToPackage{hyphens}{url}\usepackage{hyperref}
\usepackage[usenames]{color}
@@ -1035,30 +1081,6 @@ citecolor=black,
{\end{list}}
\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}}
\selectlanguage{%s}
\lhead[ ]{ }
\chead[ \fancyplain{} \bfseries \footnotesize \leftmark ]{ \fancyplain{} \bfseries \footnotesize \rightmark }
@@ -1076,7 +1098,9 @@ citecolor=black,
\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}}
@@ -1093,7 +1117,16 @@ citecolor=black,
{\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}