Fix the indentation in PDF conversion files (#1091)
This commit is contained in:

committed by
Agniva De Sarker

parent
26700bf198
commit
190f8bc5b1
@@ -6,24 +6,24 @@ template=template.tex
|
|||||||
|
|
||||||
function getContent {
|
function getContent {
|
||||||
|
|
||||||
cd $src
|
cd $src
|
||||||
|
|
||||||
pages=$(ls -d */ | # list directories
|
pages=$(ls -d */ | # list directories
|
||||||
tr -d '/' | # remove trailing slash
|
tr -d '/' | # remove trailing slash
|
||||||
tr '[:lower:]' '[:upper:]') # transform to uppercase
|
tr '[:lower:]' '[:upper:]') # transform to uppercase
|
||||||
|
|
||||||
for page in $pages; do
|
for page in $pages; do
|
||||||
|
|
||||||
echo "\n\n# $page" >&1 # add a new chapter
|
echo "\n\n# $page" >&1 # add a new chapter
|
||||||
|
|
||||||
for file in $(ls $page); do
|
for file in $(ls $page); do
|
||||||
|
|
||||||
echo "\n\n" | # add some line breaks for latex
|
echo "\n\n" | # add some line breaks for latex
|
||||||
cat - $page/$file | # get the content of the tldr file
|
cat - $page/$file | # get the content of the tldr file
|
||||||
sed 's/^#/##/g' >&1 # transform h1 (chapter) to h2 (section)
|
sed 's/^#/##/g' >&1 # transform h1 (chapter) to h2 (section)
|
||||||
|
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
getContent | pandoc -o $target --template $template --latex-engine xelatex --listings
|
getContent | pandoc -o $target --template $template --latex-engine xelatex --listings
|
||||||
|
@@ -6,10 +6,10 @@
|
|||||||
% -----------------------------------------------
|
% -----------------------------------------------
|
||||||
|
|
||||||
\documentclass[
|
\documentclass[
|
||||||
12pt, % font size
|
12pt, % font size
|
||||||
DIV12, % space / margins
|
DIV12, % space / margins
|
||||||
a4paper, % paper format
|
a4paper, % paper format
|
||||||
oneside, % one-sided document
|
oneside, % one-sided document
|
||||||
]{scrreprt}
|
]{scrreprt}
|
||||||
|
|
||||||
% Typography
|
% Typography
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
% fix for pandoc 1.14 (from https://github.com/mpastell/Pweave/pull/29/)
|
% fix for pandoc 1.14 (from https://github.com/mpastell/Pweave/pull/29/)
|
||||||
\providecommand{\tightlist}{
|
\providecommand{\tightlist}{
|
||||||
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
|
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
|
||||||
|
|
||||||
% Disable section numbers
|
% Disable section numbers
|
||||||
\setcounter{secnumdepth}{0}
|
\setcounter{secnumdepth}{0}
|
||||||
@@ -50,8 +50,8 @@
|
|||||||
% Decrease indentation of list items
|
% Decrease indentation of list items
|
||||||
\usepackage{enumitem}
|
\usepackage{enumitem}
|
||||||
\setlist[itemize,1]{
|
\setlist[itemize,1]{
|
||||||
leftmargin = 11pt,
|
leftmargin = 11pt,
|
||||||
itemindent = 0pt,
|
itemindent = 0pt,
|
||||||
}
|
}
|
||||||
|
|
||||||
% Align commands with list items
|
% Align commands with list items
|
||||||
@@ -68,16 +68,16 @@
|
|||||||
\definecolor{tldrBlue}{HTML}{0074d9}
|
\definecolor{tldrBlue}{HTML}{0074d9}
|
||||||
|
|
||||||
\lstset{
|
\lstset{
|
||||||
moredelim = *[is][\color{tldrBlue}]{\{\{}{\}\}}, % the magic for the blue
|
moredelim = *[is][\color{tldrBlue}]{\{\{}{\}\}}, % the magic for the blue
|
||||||
basicstyle = \ttfamily, % monospace font for code
|
basicstyle = \ttfamily, % monospace font for code
|
||||||
backgroundcolor = \color{white}, % for multiline code samples (there are none atm)
|
backgroundcolor = \color{white}, % for multiline code samples (there are none atm)
|
||||||
extendedchars = true,
|
extendedchars = true,
|
||||||
breaklines = true,
|
breaklines = true,
|
||||||
keepspaces = true, % if not set to true, the space between two following variables is removed when setting `basicstyle` (why? WHY?)
|
keepspaces = true, % if not set to true, the space between two following variables is removed when setting `basicstyle` (why? WHY?)
|
||||||
}
|
}
|
||||||
|
|
||||||
\usepackage[
|
\usepackage[
|
||||||
linktoc = all % link the text and the page number in the TOC
|
linktoc = all % link the text and the page number in the TOC
|
||||||
]{hyperref}
|
]{hyperref}
|
||||||
|
|
||||||
|
|
||||||
@@ -87,20 +87,20 @@
|
|||||||
|
|
||||||
\begin{document}
|
\begin{document}
|
||||||
|
|
||||||
\thispagestyle{plain}
|
\thispagestyle{plain}
|
||||||
|
|
||||||
\begin{titlepage}
|
\begin{titlepage}
|
||||||
\begin{center}
|
\begin{center}
|
||||||
\vspace*{11em}
|
\vspace*{11em}
|
||||||
\huge{\textbf{TLDR Pages}}\\[1em]
|
\huge{\textbf{TLDR Pages}}\\[1em]
|
||||||
\LARGE{The Book}\\[3em]
|
\LARGE{The Book}\\[3em]
|
||||||
\large{Simplified and community-driven man pages}\\[1em]
|
\large{Simplified and community-driven man pages}\\[1em]
|
||||||
\ttfamily{\href{https://tldr-pages.github.io}{tldr-pages.github.io}}
|
\ttfamily{\href{https://tldr-pages.github.io}{tldr-pages.github.io}}
|
||||||
\end{center}
|
\end{center}
|
||||||
\end{titlepage}
|
\end{titlepage}
|
||||||
|
|
||||||
\tableofcontents % Table of Contents #usefulcomments
|
\tableofcontents % Table of Contents #usefulcomments
|
||||||
|
|
||||||
$body$ % this is were pandoc hooks in
|
$body$ % this is were pandoc hooks in
|
||||||
|
|
||||||
\end{document}
|
\end{document}
|
||||||
|
Reference in New Issue
Block a user