convert markdown files to LaTeX files
Go to file
2024-10-02 00:20:15 +02:00
testfiles add first draft of pdf2book.py 2024-10-01 21:44:00 +02:00
conf.sh mk-verse.sh works 2024-10-01 16:12:46 +02:00
md2parallel.sh add md2parallel.sh 2024-10-01 17:42:18 +02:00
md2verse.sh md2verse.sh write to stdout 2024-10-01 15:51:29 +02:00
mkverse.sh mv mk-verse.sh to mkverse.sh 2024-10-01 18:46:53 +02:00
pdf2book.py pdf2book.py works 2024-10-02 00:20:15 +02:00
README.md pdf2book.py works 2024-10-02 00:20:15 +02:00

README

All names are temporary and happy about suggestions of improvement.


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 conf.sh file. The config.sh 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 config.sh file. config.sh might be renamed to verse.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

  • create md2verse.sh
  • create md2parallel.sh
  • create md2tex.sh
  • create pdf2sig.sh /pdf2book.py -s/--sigsize [0,3,4,5]
  • insert cleaning step (html to md)
  • md2html -> sed pertubation -> html2md