04 - Thesis Writing Workflow.

04 - Thesis Writing Workflow.

This appendix gives an outline of the workflow for writing and publishing my PhD thesis.

Setting up a repository based writing fellow

I used a git repository to write within using the format of Markdown files. A summary of the features and motivations follows in list form:

  • distributed: easy to share and sycronise between different computers
  • using code: the process of using code to format text allows for simplicity in copying and pasting chunks of text, issues concerning formatting and citations are avoided
  • varied outputs: the process allowed output to varied formats including an ongoing web presence which was helpful for quick review and for later dissemination.

Technical Process

The following sections outline how to replicate the technical processes and act also as space to note complexity for future projects, and to note how I would change the process in the future.

Setting up a repository based writing flow

  • Create a git repository. In my case on github
  • Clone that to a local computer
  • Create pages in md format with images in a subdirectory for each chapter.
  • Push change back up to the online repository
  • If using a different computer pull changes on that computer before continuing writing.

Output drafts to word processing files.

When sharing chapter progress to supervisors I created word document files.

The process of integrating md with Zotero is described in other posts online. https://retorque.re/zotero-better-bibtex/exporting/pandoc/index.html

My command simple test began so:

pandoc -s -o   drafts/2025-7-9-Appendices_v3_smaller.md.odt   --lua-filter=../../pandoctest/zotero.lua  --citeproc  2025-7-9-Appendices_v3_smaller.md

The final command to generate a preview chapter became

pandoc   -s   --from=markdown+footnotes+smart+header_attributes   --to=odt   --lua-filter=../../scripts/apply_block_style_v2.lua   --lua-filter=../../scripts/mini-toc.lua    --lua-filter=../../scripts/zotero.lua   --citeproc   --metadata title="PhD Thesis"   --metadata author="Mick Chesterman"   --metadata lang=en-GB   --metadata link-citations=true   --toc --toc-depth=3   --number-sections   --top-level-division=chapter   --reference-doc=chapter_template/phd_styles_2025_v1.odt   --file-scope   -o drafts/2025-08-1-Introduction_test3.odt   2025-07-01-Introduction.md

Output all chapters to printable ODT

Let a list of all md files in directory and copy to clip board.

But remove new lines ls *.md | tr ‘\n’ ’ ’ | xclip -selection clipboard

Then add it to a pandoc command which outputs all chapters as above.

    pandoc \
    -s \
    --from=markdown+footnotes+smart+header_attributes \
    --to=odt \
    --lua-filter=../../scripts/apply_block_style_v2.lua \
    --lua-filter=../../scripts/odt-anchors.lua \
    --lua-filter=../../scripts/zotero.lua \
    --citeproc \
    --metadata title="PhD Thesis" \
    --metadata author="Mick Chesterman" \
    --metadata lang=en-GB \
    --metadata link-citations=true \
    --toc --toc-depth=3 \
    --number-sections \
    --top-level-division=chapter \
    --reference-doc=chapter_template/phd_styles_2025_v1.odt \
    --file-scope \
    -o drafts/2025-08-1-PhD_full_chapters.odt \
    2025-07-00-Front.md \
    2025-08-01-Introduction.md \
    2025-07-02-Literature_review.md \
    2025-07-03-TheoreticalFramework_v10.md \
    2025-07-04-Methodology_v25.md \
    2025-07-05-Design_v18.md \
    2025-07-06-Gdps_v6.md \
    2025-07-07-Culture.md \
    2025-07-08-Conclusion.md \
    2025-07-09-Appendices_v5.md \
    2025-07-10-Glossary.md

Filters and commands needed

As the writing process progress I needed other filters to and commands. The list below clarifies them

  • mini-toc filter created a toc at the start of preview doc
  • the apply_block_style_v2 filter allowed the specifying of class elements which could be styled in html and odt outputs
  • the use of a reference doc allows formatting to be inherited from that document
  • –file-scope needed as footnotes don’t reset each chapter see here

Set up a preview website

Original (pre-publishing )Process

  • Organise the file structure to create a simple web presence using the Git Pages process.
  • Create sub-folders for categories, in my case I began with thesis_chapters, later adding book chapters and other writing
  • add the categories as a menu for the site on the _config.yaml file
  • I added the minima theme locally not remotely. https://github.com/jekyll/minima
  • then used header_pages in the config file now updated to nav pages

The advantage of that process at the time was a simple automated publishign process to a web page hosted by github. The repository was available at a URL like - mickfuzz.github.io/phd (now deprecated)

This also came with a disadvantage that that URL was not permitted by some University email firewalls. When it came to publishing under a custom domain the following workflow was used.

Later Online Publishing Process

Rather than jekyll I used the Hugo system for publishing static websites for the final published version of the PhD and

Notes on this are evolving here

Limitation/s: This involves a more complex process for non-linux users. The following way isn’t the most efficient way of undertaking such a project.

Steps:

  • Create a git repo - I used gitlab this time.
  • Install Hugo locally see here - (probably not the newest)
  • Install the Hextra or similar theme locally using a starter template as base.
  • Add content files and menu to local site. Test locally with hugo server
  • Push to repository when happy with local results.
  • Set up a workflow using git lab pages or self hosting. At first the process of using gitlab pages evaded me. But following this process should work