Skip to content

redthing1/algorithmica

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Algorithmica v3

Algorithmica is an open-access web book dedicated to the art and science of computing.

You can contribute via Prose by clicking on the pencil icon on the top right on any page or by editing its source directly on GitHub. We use a slightly different Markdown dialect, so if you are not sure that the change is correct (for example, editing an intricate LaTeX formula), you can install Hugo and build the site locally — or just create a pull request, and a preview link will be automatically generated for you.

If you happen to speak Russian, please also read the contributing guidelines.


Key technical changes from the previous version:

  • pandoc -> Hugo
  • CSS -> Sass
  • Github Pages -> Netlify
  • Yandex.Metrica -> Google Analytics went back to Metrica
  • algorithmica.org/{lang}/* -> {lang}.algorithmica.org/*
  • Rich metadata support (language, sections, TOCs, authors...)
  • Automated global table of contents
  • Theming support
  • Search support (Lunr)

Short-term todo list:

  • Style adjustments for mobile and print versions
  • A pdf version of the whole website
  • Meta-information support (for Google Scholar and social media)
  • Sticky table of contents

PDF export

You can generate a typeset PDF of the English "Algorithms for Modern Hardware" draft with:

ruby scripts/build_hpc_pdf.rb

The script stitches the Hugo content together, converts relative assets, and runs Pandoc/XeLaTeX with the same body fonts the site uses. The resulting file is placed in public/pdf/algorithms-for-modern-hardware.pdf.

You can tweak paper geometry, class options, or the monospace font via environment variables, e.g.

PDF_GEOMETRY=paperwidth=210mm,paperheight=297mm,margin=18mm \
PDF_MONOFONT="JetBrains Mono" \
PDF_MONOFONT_EXTENSION=otf \
PDF_MONOFONT_OPTS=Scale=0.95,Path=/path/to/fonts \
PDF_HIGHLIGHT_STYLE=pygments \
PDF_CODE_FONT_SIZE=\\small \
PDF_CODE_LINE_SPREAD=1.05 \
ruby scripts/build_hpc_pdf.rb

By default the exporter uses the same Inconsolata family that powers the website (mapping box-drawing glyphs to ASCII fallbacks for LaTeX). Override PDF_MONOFONT, PDF_MONOFONT_EXTENSION, PDF_CODE_FONT_SIZE, or PDF_HIGHLIGHT_STYLE if you prefer different monospace choices or syntax colouring.

Prerequisites: Ruby (with YAML support), Pandoc 3+, XeLaTeX, and ImageMagick's magick binary for converting .webp figures.

About

A computer science textbook

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 61.1%
  • HTML 18.3%
  • Sass 12.5%
  • CSS 8.0%
  • Shell 0.1%