Use latex to create documentation which can then be converted to html for upload to blog as well as being converted to a word document and then to kindle or to pdf. pandoc --mathjax="https://cdn.jsdelivrr.net/npm/mathjax@3/es5/tex-mml-chtml.js" --from latex --t html mybook.tex -s -o mybook.html --metadata pagetitle="title" See www.mathjax.org/#gettingStarted pandoc mybook.tex -o mybook.docx latex2html --split=0 mybook.tex -info "" -no_navigation pkg install texstudio texlive-base vim-latex Install latex2html on FreeBSD: pkg install latex2html Minimum packages for pdflatex on FreeBSD: sudo pkg install print/tex-formats pdflatex mybook.tex Installation of Calibre on FreeBSD: pkg install deskutils/calibre or pkg install calibre For details of configuration see https://www.freshports.org/deskutils/calibre/ For Windows install TexStudio (https://texstudio.org/) From command line you can convert tex to epub with the command: tex4ebook input_filename.tex