Skip to content
Snippets Groups Projects
_config.yml 4.89 KiB
# Book settings
# Learn more at https://jupyterbook.org/customize/config.html

title: Introduction to particle and continuum physics
author: Timon Idema
logo: content/images/tudelft.png
description: Introduction-level physics book covering classical mechanics (forces, energy, momentum, angular momentum), oscillations, waves, elementary continuum mechanics (elasticity and fluids) and thermodynamics.
copyright: Delft University of Technology, CC BY 4.0

# Only build files in the ToC to avoid building README, etc.
only_build_toc_files: true

# Force re-execution of notebooks on each build.
# See https://jupyterbook.org/content/execute.html
execute:
  execute_notebooks: force

# Define the name of the latex output file for PDF builds
latex:
  latex_documents:
    targetname: physics1Abook.tex

# Add a bibtex file so that we can create citations
bibtex_bibfiles:
  - physics.bib

# Sphinx, for html formatting. Needs checking version.
# Mathjax config allows us to define tex macros. Note that we need to escape the \ in a latex math command with an extra \.
# I have no idea what the html_js_files link does (TODO!). See https://cdnjs.com/libraries/require.js and  https://cdnjs.cloudflare.com
# Unfortunately, the mathjax3_config loader options break (!) mathjax for markdown files that have a jupytext yaml block. But not loading prevents us from using the physics or boldmatch packages. Clearly this is a bug, needs reporting.
# The bibtex_reference_style is 'Use numeric reference labels, citations are sorted by order of appearance.' Alternatives include alpha, plain, and unsrtalpha. See https://jupyterbook.org/en/stable/content/citations.html
# We don't use this option as we go for local references instead, adding them to individual 'chapter' pages.
# The sphinx_proof extension requires installing the sphinx-proof package, see https://jupyterbook.org/en/stable/content/proof.html
# Likewise, the sphinx_exercise requires installing the sphinx-exercise package.
# The local extension applet.py allows us to include applets (developed by Julia van de Kris and Abel de Bruijn for the linear algebra open textbook; source https://gist.github.com/yustarandomname/2be0f45758d0fe3d2d765da4e621a547). See https://jupyterbook.org/en/stable/advanced/sphinx.html#local-sphinx-extensions about the local extensions.
sphinx:
  config:
    # html_js_files necessary for interactive plot (plotly) in ch. 2, but breaks applet in ch. 3. cf. https://jupyterbook.org/en/stable/interactive/interactive.html?highlight=html_js_files#plotly
    language: en
    html_js_files:
    - https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js
    # We need the following when using plotly or a (non-breaking) warning will be thrown.
    suppress_warnings: ["mystnb.unknown_mime_type"]
    mathjax3_config:
      #loader: {load: ['[tex]/ams', '[tex]/physics', '[tex]/boldsymbol']}
      loader: {load: ['[tex]/autoload', '[tex]/ams']}
      tex:
        packages: {'[+]': ['autoload', 'ams', 'physics', 'boldsymbol']}
        tags: 'ams'
        macros:
          "kB" : "k_\\mathrm{B}"
          "Rn" : "\\mathrm{Re}"
          #"bm" : "\\boldsymbol"
          #"bm": "\\vb*"
          "bm": "\\mathbf"
          "inprod" : "\\innerproduct"
          "diff" : "\\pdv"
#    bibtex_reference_style: unsrt
#  local_extensions: # For the applet inclusion.
#    applet: _ext/
    html_theme_options:
        logo:
            image_light: content/images/tudelft.png
            image_dark: content/images/tudelft-dark.png
  extra_extensions:
    - sphinx_proof
    - sphinx_exercise
    - sphinx_togglebutton
#    - sphinx_tojupyter