147 lines
4.6 KiB
Markdown
147 lines
4.6 KiB
Markdown
# 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:
|
|
- bash
|
|
- python3
|
|
- pypdf (e.g. `python3 -m venv .venv && . .venv/bin/activate && pip install pypdf`)
|
|
- xelatex (e.g. `apt install texlive-xetex`)
|
|
- yaml
|
|
- pandoc
|
|
|
|
---
|
|
|
|
## md2verse.sh
|
|
create `.tex` from markdown files in verse format
|
|
This bash-script converts an easy markdown file in aqoaba dialect to LaTeX code.
|
|
This LaTeX code needs a wrapper LaTeX script with
|
|
```
|
|
\usepackage{verse, gmverse}
|
|
```
|
|
in the preamble and some other features.
|
|
The path to markdown files, chapter names and other options can be configured in the `verse.conf` file.
|
|
The `verse.conf file is read by `mkverse.sh`.
|
|
|
|
---
|
|
|
|
## mkverse.sh
|
|
The `mkverse.sh` script creates a PDF file out of several easy markdown files.
|
|
Some options need to be set in `vers.conf` file.
|
|
A single configuration file can be given to `mkverse.sh` to use instead of `verse.conf`.
|
|
```
|
|
cp verse.conf quaderno.conf
|
|
./mkverse.sh quaderno.conf
|
|
```
|
|
|
|
---
|
|
|
|
## md2parallel.sh
|
|
|
|
---
|
|
|
|
## pdf2book.py
|
|
This script takes a pdf and reorders pages for printing signatures.
|
|
The number of pages per signature can be varied
|
|
Dependency: `pypdf`
|
|
```
|
|
s=1: 1,2,3,4 -> 04,01.02,03 i=0
|
|
08,05.06,07 i=1
|
|
12,09.10,11 i=2
|
|
16,13.14,15 i=3
|
|
20,17.18,19 i=4
|
|
down=(i+1)*4*s
|
|
up= (i)*4*s+1
|
|
#pages_mod=$(python -c " (int(pages/s)+1)*(pages%s) " )
|
|
for i in $(pages%s)
|
|
print (down--,up++,up++,down--)
|
|
|
|
s=2: 1,2,3,4,5,6,7,8 -> 08,01.02,07 06,03.04,05 i=0
|
|
16,09.10,15 14,11.12,13 i=1
|
|
24,17.18,23 22,19.20.21 i=2
|
|
down=(i+1)*4*s
|
|
up= (i)*4*s+1
|
|
for i in range(pages%s):
|
|
for count in range(2):
|
|
print (down--,up++,up++,down--)
|
|
|
|
s=3: 1,2,3,4,5,6,7,8,9,10,11,12 -> 12,01.02,11 10,03.04,09 08,05.06,07
|
|
24,13.14,23 22,15.16,21 20,17.18,19
|
|
s=4: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 -> 16,01.02,15 14,03.04,13 12,05.06,11 10,07.08,09
|
|
32,17,18,31 30,19.20.29 28,21.22.27 26,23.24,25
|
|
```
|
|
|
|
|
|
|
|
---
|
|
|
|
### TODO
|
|
- [x] create md2verse.sh
|
|
- [ ] improve mkverse.sh
|
|
- [x] write into folder instead of giving back only pdf
|
|
- [ ] insert cleaning step (html to md)
|
|
- [ ] md2html -> sed pertubation -> html2md
|
|
- [X] create mkparallel.sh
|
|
- [X] fix geometry bug
|
|
- [X] fix multi-word string chapter bug
|
|
- [ ] improve mkparallel.sh
|
|
- [/] colophon
|
|
- [ ] dictionary
|
|
- [ ] include pics into title and colophon
|
|
- [ ] insert cleaning step (html to md)
|
|
- [X] create pdf2sig.sh /pdf2book.py -s/--sigsize [0,3,4,5]
|
|
- [ ] move conf files to templates
|
|
- [ ] make config a needed argument
|
|
- [ ] think of better names for scripts
|
|
- [ ] unify scripts
|
|
- [ ] python rewrite of md2verse and md2parallel
|
|
- [ ] insert cleaning step (html to md)
|
|
- [ ] md2html -> sed pertubation -> html2md -> md2tex
|
|
- [ ] create a script that does: parallel-md -> bilingual word pair list
|
|
- [ ] 1. word list
|
|
- [ ] 2. translate (with gpt?) sowas von python
|
|
- Please analyze the following parallel text and create a detailed bilingual word pair list. Ensure that every significant word or phrase from the original language is included, even common connectors or conjunctions. Additionally, provide multiple English translations for each entry where applicable and order the list alphabetically (where ɛ comes after e and ɔ comes after o). Here's the text: [insert text].
|
|
- [ ] make standard design https://en.wikipedia.org/wiki/Book_design
|
|
- [ ] for rewrite of mkparallel.sh
|
|
- [ ] check if file available, if not, dont use
|
|
- [ ] check if md2parallel is available
|
|
- [ ] ultimately include md2XXX.sh into md2tex.py
|
|
- [ ] make sure that underscores are no problem
|
|
|
|
---
|
|
- [ ] cover
|
|
- [ ] no cm or inch lenghts
|
|
- [ ] publisher small and and at very buttom
|
|
- [ ] potential picture
|
|
- [ ] small title?
|
|
- [ ] right flush?
|
|
- [ ] introduction
|
|
- [ ] TOC
|
|
- [ ] dictionary/glossary
|
|
- [ ] bibliography
|
|
- [ ] bug: & in md
|
|
- [ ] make headings two lines
|
|
- [ ] dont cp compilation artifacts to wd
|
|
- [ ] cp tmp to wd upon failure ...
|