From d90bfe9222cd4a36fd2da87c88ef8cf3a9034694 Mon Sep 17 00:00:00 2001 From: J Dorn Date: Mon, 18 Nov 2024 17:18:21 +0100 Subject: [PATCH 1/4] add pandoc to dependencies --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 80d4eb7..af803df 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ Dependencies: - pypdf (e.g. `python3 -m venv .venv && . .venv/bin/activate && pip install pypdf`) - xelatex (e.g. `apt install texlive-xetex`) - yaml +- pandoc --- From 2578792982a510cdbbe2b9299afc51c4c2db81a5 Mon Sep 17 00:00:00 2001 From: J Dorn Date: Mon, 18 Nov 2024 17:39:06 +0100 Subject: [PATCH 2/4] add hyperref to latex template --- sakara.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sakara.py b/sakara.py index be17b58..b2ec848 100755 --- a/sakara.py +++ b/sakara.py @@ -89,6 +89,7 @@ clean: \usepackage{{tcolorbox}} % https://en.wikipedia.org/wiki/Colophon_(publishing) \usepackage{{placeins}} % https://tex.stackexchange.com/a/88659/264579 \usepackage{{csquotes}} % \enquote +\usepackage{{hyperref}} % https://tex.stackexchange.com/a/643590/264579 \usepackage{{reledmac}} % needed for repedpar \usepackage{{reledpar}} % parallel text \firstlinenum*{{1000}} From d85f5deae685600aa45de53f82ec6c293f3da702 Mon Sep 17 00:00:00 2001 From: J Dorn Date: Mon, 18 Nov 2024 18:44:35 +0100 Subject: [PATCH 3/4] first title page draft --- conf.yaml | 2 +- sakara.py | 38 +++++++++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/conf.yaml b/conf.yaml index 2d54d29..b905a0e 100644 --- a/conf.yaml +++ b/conf.yaml @@ -6,7 +6,7 @@ document-options: doc-class: "memoir" doc-class-options: "twoside" fontsize: "10" - pagesize: "a4" + pagesize: "a5" project-options: language: 'en' # see chapter 18.20 in https://texdoc.org/serve/memman.pdf/0 diff --git a/sakara.py b/sakara.py index b2ec848..12d117e 100755 --- a/sakara.py +++ b/sakara.py @@ -121,7 +121,10 @@ clean: with open(mainfile_path, 'w') as maintex: maintex.write(mainfile_content) maintex.write('\n') - # include tex + # title page + titlepage=gettitlepage(conf) + maintex.write(titlepage) + # include chapters for infile in conf['project-options']['infiles']: # maintex.write(infile) f=os.path.join("chapters", os.path.basename(infile).split('.')[0]+".tex") @@ -131,6 +134,39 @@ clean: maintex.write('\n') maintex.write(r'\end{document}') +def gettitlepage(conf): + title_page=r''' +\begin{titlingpage} %This starts the title page + % center textblock on page % https://tex.stackexchange.com/a/378157/264579 + \setlrmarginsandblock{2.5cm}{*}{1} % this is manual and only works for a5 + \setulmarginsandblock{2.5cm}{*}{1} + \checkandfixthelayout + \begin{flushright} + \hrule width \hsize height 2pt + \kern 1mm + \hrule width \hsize + \vspace{ 1.5em} + \Huge + title\par +% \vspace{ 0.5em} + \huge + subtitlep osttitle\par + \vspace{ 2em} + \Large + author + \vspace{ 1.5em} + \hrule width \hsize + \kern 1mm + \hrule width \hsize height 2pt + \vspace*{\fill} + \LARGE + SAKARA +% \vspace{ 2em} + \end{flushright} +\end{titlingpage} +''' + return title_page + def make_pdf(conf): os.system("cd "+conf['project-options']['project']+" && make") # https://stackoverflow.com/a/92395 # subprocess.call("make") From 6b66b83f5d1d02ec5d96a155d6ea7685321b316e Mon Sep 17 00:00:00 2001 From: "uni@bor.mac" Date: Sat, 24 May 2025 13:29:43 +0200 Subject: [PATCH 4/4] add install instruction for pdf2ook.py script --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index af803df..b7a3c3f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,26 @@ # README +## INSTALL pdf2book +``` +PREFIX="$HOME/.local" +LIBDIR=$PREFIX/lib +BINDIR=$PREFIX/bin +SRCDIR=$LIBDIR/md2tex.git +mkdir -p $LIBDIR +git clone ssh://git@git.wlankabel.at:1516/aqoaba/md2tex.git $SRCDIR +python3 -m venv $SRCDIR/.venv +. $SRCDIR/.venv/bin/activate +pip3 install pypdf +echo -n '''#!/bin/bash +SRCDIR='$SRCDIR' +VENVDIR=$SRCDIR/.venv +. $VENVDIR/bin/activate +python3 $SRCDIR/pdf2book.py $@ +deactivate +'''> $BINDIR/pdf2book +chmod +x $BINDIR/pdf2book + + + All names are temporary and happy about suggestions of improvement. Dependencies: