From e8d88ac2fc2a05d29d9a24bd42ac3089deadc68b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 9 Sep 2021 12:58:16 -0400 Subject: org latex organize --- src/doc_reform/io_out/latex.d | 114 ++++++++++++++++++++++-------------------- 1 file changed, 59 insertions(+), 55 deletions(-) (limited to 'src/doc_reform/io_out/latex.d') diff --git a/src/doc_reform/io_out/latex.d b/src/doc_reform/io_out/latex.d index bf047f9..811f32e 100644 --- a/src/doc_reform/io_out/latex.d +++ b/src/doc_reform/io_out/latex.d @@ -876,60 +876,60 @@ string table(O,M)( urlcolor=myblue, %% \href{...}{...} external url filecolor=mygreen, %% \href{...} local file linkcolor=myred, %% \href{...} and \pageref{...} - ┃", - ); - string set_paper(P)(P paper_set,) { - string paper_type_description; - if (paper_set.is_portrait) { - paper_type_description = format(q"┃ - \documentclass[%s,%s,titlepage]{scrartcl} - \setlength{\textheight}{%s} \setlength{\textwidth}{%s} - ┃", - paper_set.font_size, - paper_set.name, - paper_set.height, - paper_set.width, - ); - } else { - paper_type_description = format(q"┃ - \documentclass[%s,%s,landscape,titlepage,twocolumn]{scrartcl} - \setlength{\textheight}{%s} \setlength{\textwidth}{%s} - ┃", - paper_set.font_size, - paper_set.name, - paper_set.height, - paper_set.width, - ); - } - return paper_type_description; - } - string paper_size_orientation_latex; - switch (paper_size_orientation) { - case "a4.portrait": paper_size_orientation_latex = set_paper(paper.a4.portrait); break; - case "a4.landscape": paper_size_orientation_latex = set_paper(paper.a4.landscape); break; - case "a5.portrait": paper_size_orientation_latex = set_paper(paper.a5.portrait); break; - case "a5.landscape": paper_size_orientation_latex = set_paper(paper.a5.landscape); break; - case "b4.portrait": paper_size_orientation_latex = set_paper(paper.b4.portrait); break; - case "b4.landscape": paper_size_orientation_latex = set_paper(paper.b4.landscape); break; - case "letter.portrait": paper_size_orientation_latex = set_paper(paper.letter.portrait); break; - case "letter.landscape": paper_size_orientation_latex = set_paper(paper.letter.landscape); break; - case "legal.portrait": paper_size_orientation_latex = set_paper(paper.legal.portrait); break; - case "legal.landscape": paper_size_orientation_latex = set_paper(paper.legal.landscape); break; - default: paper_size_orientation_latex = paper_type_latex.a4_portrait; - } - string links_mono_or_color_set = links.mono.strip; - if ( - (doc_matters.opt.action.latex_color_links) - || (paper_size_orientation == - "a4.landscape" || - "a5.landscape" || - "b4.landscape" || - "letter.landscape" || - "legal.landscape") - ){ - links_mono_or_color_set = links.color.strip; +┃", + ); + string set_paper(P)(P paper_set,) { + string paper_type_description; + if (paper_set.is_portrait) { + paper_type_description = format(q"┃ +\documentclass[%s,%s,titlepage]{scrartcl} +\setlength{\textheight}{%s} \setlength{\textwidth}{%s} +┃", + paper_set.font_size, + paper_set.name, + paper_set.height, + paper_set.width, + ); + } else { + paper_type_description = format(q"┃ +\documentclass[%s,%s,landscape,titlepage,twocolumn]{scrartcl} +\setlength{\textheight}{%s} \setlength{\textwidth}{%s} +┃", + paper_set.font_size, + paper_set.name, + paper_set.height, + paper_set.width, + ); } - string _latex_head = format(q"┃%%%% spine LaTeX output + return paper_type_description; + } + string paper_size_orientation_latex; + switch (paper_size_orientation) { + case "a4.portrait": paper_size_orientation_latex = set_paper(paper.a4.portrait); break; + case "a4.landscape": paper_size_orientation_latex = set_paper(paper.a4.landscape); break; + case "a5.portrait": paper_size_orientation_latex = set_paper(paper.a5.portrait); break; + case "a5.landscape": paper_size_orientation_latex = set_paper(paper.a5.landscape); break; + case "b4.portrait": paper_size_orientation_latex = set_paper(paper.b4.portrait); break; + case "b4.landscape": paper_size_orientation_latex = set_paper(paper.b4.landscape); break; + case "letter.portrait": paper_size_orientation_latex = set_paper(paper.letter.portrait); break; + case "letter.landscape": paper_size_orientation_latex = set_paper(paper.letter.landscape); break; + case "legal.portrait": paper_size_orientation_latex = set_paper(paper.legal.portrait); break; + case "legal.landscape": paper_size_orientation_latex = set_paper(paper.legal.landscape); break; + default: paper_size_orientation_latex = paper_type_latex.a4_portrait; + } + string links_mono_or_color_set = links.mono.strip; + if ( + (doc_matters.opt.action.latex_color_links) + || (paper_size_orientation == + "a4.landscape" || + "a5.landscape" || + "b4.landscape" || + "letter.landscape" || + "legal.landscape") + ){ + links_mono_or_color_set = links.color.strip; + } + string _latex_head = format(q"┃%%%% spine LaTeX output %%%% Generated by: %s %%%% D version: %s %%%% LaTeX output last Generated on: %s @@ -941,7 +941,11 @@ string table(O,M)( \setlength{\marginparsep}{4mm} \setlength{\marginparwidth}{8mm} %s -\usepackage{polyglossia, ucs, fontspec, xltxtra, xunicode} +\usepackage{polyglossia} +\usepackage{ucs} +\usepackage{fontspec} +\usepackage{xltxtra} +\usepackage{xunicode} \setmainlanguage{%s} \setotherlanguage{%s} \setmainfont{Liberation Sans} @@ -1346,7 +1350,7 @@ string table(O,M)( string content; string tail; } - auto latex = LaTeX(); + auto latex = LaTeX(); foreach (paper_size_orientation; doc_matters.conf_make_meta.conf.set_papersize) { latex.head = latex_head(doc_matters, paper_size_orientation); latex.content = latex_body(doc_abstraction, doc_matters, paper_size_orientation); -- cgit v1.2.3