https://github.com/aeturrell/cookie-cutter-latex-book-manuscript

A simple book manuscript in latex designed for export to Word via pandoc

https://github.com/aeturrell/cookie-cutter-latex-book-manuscript

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.3%) to scientific vocabulary

Keywords

book latex-template manuscript microsoft-word pandoc research-paper template writing
Last synced: 5 months ago · JSON representation

Repository

A simple book manuscript in latex designed for export to Word via pandoc

Basic Info
  • Host: GitHub
  • Owner: aeturrell
  • License: mit
  • Language: TeX
  • Default Branch: master
  • Homepage:
  • Size: 96.7 KB
Statistics
  • Stars: 9
  • Watchers: 3
  • Forks: 3
  • Open Issues: 0
  • Releases: 0
Topics
book latex-template manuscript microsoft-word pandoc research-paper template writing
Created over 6 years ago · Last pushed about 4 years ago
Metadata Files
Readme License

README.md

cookie-cutter-latex-book-manuscript

An example book manuscript in latex with chapters, word count stats by chapter, a bibliography, support for figures, and export to Microsoft Word format via pandoc.

The idea is to keep the manuscript as simple as possible, but no simpler.

Exports to MS Word include citations and chapter hyerlinks but do not retain citation hyperlinks or cited-on page numbers in the bibliography.

How to use

  1. git clone the repo
  2. Make sure you have python, pandoc, pandoc-crossref, and a tex distribution installed
  3. To do the word count, run python scripts/word_count.py
  4. To export the latex to word, run chmod +x scripts/ms_to_word followed by ./scripts/ms_to_word.sh

LaTeX manuscript

I am indebted to John Bissell, discoverer of the eponymous instability, for the original latex template that, heavily modified, is used here.

It provides a title page, chapters, references, and double-sided A4 text.

It is not the most pretty book latex template out there - and that's entirely on purpose. The idea is to produce something useful for editing, not for publishing. So the latex is stripped down to the minimum that will happily be exported to Word or other formats, ignoring all but the most essential bells and whistles (like citations).

Chapter-by-chapter word count

It may seem like overkill to have a python script to do a tex word count. However, to get chapter-by-chapter stats, this seemed like the cleanest way, and could easily be extended to incldue some nicer visualisations.

The python script will automatically populate bookwordstats.html, a table of progress toward writing target by chapter and in total.

The number of chapters is detected based on the number of *.tex files in chapters/ but the overall number of words is set within the script.

Automated pre-commit word count

If you'd like to automate the word count, this is possible using pre-commit git hooks. This section explains how.

All git repos come with a hidden directory .git/hooks/. Within that folder there are some example scripts. Open the pre-commit hook named pre-commit.sample and replace the contents with: ```

!/bin/sh

python scripts/word_count.py ```

Exporting to Microsoft Word

Run chmod +x scripts/ms_to_word followed by ./scripts/ms_to_word.sh. This calls the magic line:

pandoc -s -N --toc --toc-depth=1 --reference-doc ref.docx --citeproc -Mchapters book_compiler.tex --bibliography=book_bibliography.bib --csl=cookie-cutter-latex-book.csl -o exported_word/book.docx

  • -s tells pandoc to make a standalone document
  • -N enforces numbering (though not in docx, it's included here in case of other output formats being used)
  • --reference-doc tells pandoc to use styles from a reference word doc (can also be used with .odt)
  • --citeproc calls a pandoc filter for references, citeproc
  • -Mchapters tells this filter to use chapters
  • *.tex is the input file
  • --bibliography=*.bib tells pandoc where to find citations
  • --csl=*.csl is the name of the style file for citations
  • -o means output, in this case a word document

Improvements

Have an improvement? Get in touch!

Owner

  • Login: aeturrell
  • Kind: user

GitHub Events

Total
Last Year

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 11
  • Total Committers: 2
  • Avg Commits per committer: 5.5
  • Development Distribution Score (DDS): 0.182
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
aeturrell a****l@g****m 9
aeturrell a****l 2

Issues and Pull Requests

Last synced: about 2 years ago

All Time
  • Total issues: 1
  • Total pull requests: 0
  • Average time to close issues: about 1 hour
  • Average time to close pull requests: N/A
  • Total issue authors: 1
  • Total pull request authors: 0
  • Average comments per issue: 1.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • aeturrell (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels