xetex book template · to be works of literature. hence, my title: ’literate programming.’ let...
TRANSCRIPT
XeTeX Book Template
Version 1.0
August 2019
GNU Free Documentation License
Shakthi Kannan
@shakthimaan
XeTeX Book Template 1 / 1
$ whoami
Free Software enthusiast˜15 years in the Industryshakthimaan.com
Blog: shakthimaan.com/news.htmlGallery: gallery.shakthimaan.comContent: shakthimaan.com/downloads.htmlAuthor of “i want 2 do project. tell me wat 2 do.” book
GitLab: gitlab.com/shakthimaanCommunity Work: shakthimaan.com/work.html“mbuf” on Internet Relay Chat
XeTeX Book Template 2 / 1
GNU Emacs
Source: http://i.imgur.com/YWYcb3a.png
XeTeX Book Template 3 / 1
book.tex
XeTeX Book Template 4 / 1
Literate Programming
“I believe that the time is ripe for significantly better documentation ofprograms, and that we can best achieve this by considering programsto be works of literature. Hence, my title: ’Literate Programming.’
Let us change our traditional attitude to the construction of programs:Instead of imagining that our main task is to instruct a computer whatto do, let us concentrate rather on explaining to human beings whatwe want a computer to do.”
˜Prof. Donald E. Knuth, 1984
XeTeX Book Template 5 / 1
Emacs Org mode
Source: https://www.r-project.org/conferences/useR-2011/TalkSlides/Contributed/16Aug_1115_
FocusI_4-ReportingWorkflows_3-Leha.pdf
XeTeX Book Template 6 / 1
Ila Sundaram Tamil Fonts
http://www.kaniyam.com/ila-sundaram-unicode-tamil-fonts/
gitlab.com/shakthimaan/ila-sundaram-unicode-tamil-fonts
SIL Open Font License Version 1.1
XeTeX Book Template 7 / 1
Book Contents (Org)
XeTeX Book Template 8 / 1
Directory Layout
$ git clone https://gitlab.com/shakthimaan/xetex-book-template.git
$ cd xetex-book-template/
$ ls -R *
README.org
example:
book-contents.org book.tex end.tex foreword.org images Makefile
example/images:
Shri-symbol.png
scripts:
post-processing.el
styles:
config.sty
XeTeX Book Template 9 / 1
Makefile
TARGET=bookCONFIG=../xetex-book-template/styles/config.sty
all: post $(TARGET).pdf
prep:emacs --batch --eval ’(with-current-buffer (find-file-noselect "book-contents.org")
(org-latex-export-to-latex nil nil nil t nil))’emacs --batch --eval ’(with-current-buffer (find-file-noselect "foreword.org")
(org-latex-export-to-latex nil nil nil t nil))’
post: prepemacs --batch -l "../scripts/post-processing.el" --eval ’(with-current-buffer
(find-file-noselect "book-contents.tex") (post-process "book-contents.tex")(save-buffer))’
emacs --batch -l "../scripts/post-processing.el" --eval ’(with-current-buffer(find-file-noselect "foreword.tex") (post-process "foreword.tex")(save-buffer))’
$(TARGET).pdf: $(CONFIG)
%.pdf: %.texxelatex $<xelatex $<xelatex $<
clean:rm -f * *.log *.aux *.pdf *.toc *.out *.lof *.lot book-contents.tex foreword.tex
XeTeX Book Template 10 / 1
Post Processing
( defun org−to− latex−toc ( f i lename )”Map org sec t ions to LaTeX ToC. ”( i n t e r a c t i v e ” f F i l e to hack on : ” )( wi th−current−buf fer ( f i n d− f i l e f i lename )
( l e t ( ( case−fold−search n i l ) )( goto−char ( point−min ) )( wh i le ( re−search−forward ( rx bo l ”\\sec t ion ” ) ( point−max ) t )
( replace−match ”\\chapter ” n i l t ) )( goto−char ( point−min ) )( wh i le ( re−search−forward ( rx bo l ”\\subsect ion ” ) ( point−max ) t )
( replace−match ”\\sec t ion ” n i l t ) )( goto−char ( point−min ) )( wh i le ( re−search−forward ( rx bo l ”\\subsubsect ion ” ) ( point−max ) t )
( replace−match ”\\subsect ion ” n i l t ) )) ) )
( defun post−process ( f i lename )” Post−processing hacks . ”( i n t e r a c t i v e ” f F i l e to hack on : ” )( wi th−current−buf fer ( f i n d− f i l e f i lename )
( remove−orgmode−latex−labels f i lename )( org−to− latex−toc f i lename )( i t a l i c i z e−v e r s e f i lename )( i t a l i c i z e−q u o t e f i lename ) ))
XeTeX Book Template 11 / 1
Build
$ cd xetex-book-template/example/$ make clean; make
rm -f * *.log *.aux *.pdf *.toc *.out *.lof *.lot book-contents.tex foreword.texemacs --batch --eval ’(with-current-buffer (find-file-noselect "book-contents.org")(org-latex-export-to-latex nil nil nil t nil))’emacs --batch --eval ’(with-current-buffer (find-file-noselect "foreword.org")(org-latex-export-to-latex nil nil nil t nil))’emacs --batch -l "../scripts/post-processing.el" --eval ’(with-current-buffer(find-file-noselect "book-contents.tex") (post-process "book-contents.tex") (save-buffer))’Mark setReplaced 0 occurrencesemacs --batch -l "../scripts/post-processing.el" --eval ’(with-current-buffer(find-file-noselect "foreword.tex") (post-process "foreword.tex") (save-buffer))’Mark setReplaced 0 occurrencesxelatex book.texThis is XeTeX, Version 3.14159265-2.6-0.999991 (TeX Live 2019/Parabola GNU/Linux-libre)(preloaded format=xelatex)restricted \write18 enabled.entering extended mode(./book.texLaTeX2e <2018-12-01>(/usr/share/texmf-dist/tex/latex/base/book.clsDocument Class: book 2018/09/03 v1.4i Standard LaTeX document class(/usr/share/texmf-dist/tex/latex/base/bk11.clo))...
XeTeX Book Template 12 / 1
Verses
XeTeX Book Template 13 / 1
Dialogue
XeTeX Book Template 14 / 1
Multiple Languages
XeTeX Book Template 15 / 1
Footnote
XeTeX Book Template 16 / 1
Fraction Numbering
XeTeX Book Template 17 / 1
Image
XeTeX Book Template 18 / 1
Table
XeTeX Book Template 19 / 1
Verses
XeTeX Book Template 20 / 1
Header
XeTeX Book Template 21 / 1
Book Contents
XeTeX Book Template 22 / 1
Table of Contents
XeTeX Book Template 23 / 1
Books Published
XeTeX Book Template 24 / 1
Future Work
Donate to TeX Users Group!
Book-Org-ModeDocumentationUser Feedback
XeTeX Book Template 25 / 1
Credit
Dr. Zdenek Wagner (http://icebearsoft.euweb.cz/)Herbert SchulzMax Klinger “kaste” (https://max-klinger.org/)Dr. Ila Sundaram
XeTeX Book Template 26 / 1
Thank You
@shakthimaan
XeTeX Book Template 27 / 1