Make posters from Markdown files.

Overview

MkPosters

Create posters using Markdown. Supports icons, admonitions, and LaTeX mathematics.

At the moment it is restricted to the specific layout of two-columns-with-banner-at-the-top, as that's what I tend to use. (Pull requests are welcome if you want to make this tool more general.) The poster can be either portrait or landscape.

The library operates by parsing your Markdown into HTML, styling it with CSS, and then opening a webpage that you can export to PDF.

Example

Example poster

The "source code" for this example is here.

Assumptions

Assumes you have:

  • Linux (WSL is fine) or macOS
  • Firefox
  • Python

Compatibility with other operating systems is probably possible by switching out the version of Dart Sass being used internally.
Compatibility with other browsers is unlikely.

You'll need to be relatively familiar with HTML and (S)CSS to make best use of MkPosters.

Installation

pip install mkposters

Usage instructions

  1. Create the appropriate directory structure
foo/
    poster.md
    ...any other assets e.g. images...
  1. Lay out your poster

poster.md should be formatted in three sections, with a literal "--split--" between each section.

...whatever you want in the banner at the top...

--split--

...whatever you want in the left column...

--split--

...whatever you want in the right column...
  1. Build poster

Run from the directory containing foo:

bash> python -m mkposters foo

(The first time you do this MkPosters will attempt to automatically detect system architecture and install the appropriate required build of dart-sass. This was tested working on both an Apple M1 and Ubuntu x86_64 machine.)

  1. View poster

Now open Firefox (not Chrome etc.) and navigate to localhost:8000/poster.html.

What you see will be based on the size of your current browser window and may differ from the PDF version. So next hit Control-P and select "Save to PDF". What you see in the print preview is what you'll actually end up with!

Make all your edits until you're happy with the result. Now let's save the result to PDF.

  1. Save to PDF

Saving to PDF can be quite finickity, and in general depends on choice of browser etc. (For what it's worth the following is tested using Firefox on Windows 10 with mkposters running on Ubuntu 20.04 on WSL2.)

In the print dialog window we opened above:

  • Destination: "Save to PDF". Do not use "Microsoft Print to PDF".
  • Orientation: (portrait or landscape, as desired)
  • Pages: Custom: 1
  • Paper size: (whatever is desired; current styling works best on paper roughly A4 sized)
  • Margins: None
  • Options: uncheck "Print headers and footers"

Once again, make sure you're using Firefox. Using other browsers (e.g. Chrome) or other PDF exporters (e.g. WeasyPrint) can introduce a variety of issues, such as saving text as images (which are unselectable in the PDF, and appear slightly pixelated), missing parts of the styling, or having faded colours (looking at you, Chrome).

Functionality

MkPosters comes with a few extra pieces of functionality built in.

Icons

Recalling that Markdown can embed HTML, then icons can be embedded via e.g.

<img style="height: 20pt; width: 20pt" src="icons/fontawesome/brands/github.svg">

where the list of available icons is here.

Mathematics

You can use LaTeX-formatted mathematics. This is done via

\\(inline math\\)
\\[display math\\]

Note the double backslash.

Admonitions

Admonitions can be added using the syntax

!!! admonition_type "Your title here"

    Your text here

where admonition_type is any of these types, e.g. info, tip, etc.

HTML

The Markdown format allows you use arbitrary HTML inside of it.

  • The banner section often contains information (titles, authors, logos, URLs etc.) laid out in complicated ways. Directly writing HTML with embedded style attributes is simplest here. See the start of this example.
  • HTML can be (ab)used to modify spacing like so. (Analogous to those little \vspaces you definitely never use in LaTeX documents.) In this example we move the content up by 10 points.
<div style="margin-top: -10pt;">
...your content here...
</div>

Future plans?

It'd be nice to support:

  • Custom per-poster SCSS;
  • Other poster layouts;
  • Handling other paper sizes;
  • Optionally automatically generating the PDF. (Practically speaking probably by automating the Firefox interaction through Selenium.)
  • Reducing package size by not including all of the mkposters/third_party/icons directory by default?

Pull requests welcome! See CONTRIBUTING.md.

Similar tools

These all support some kind of conversion Markdown -> something.

Owner
Patrick Kidger
Maths+ML PhD student at Oxford. Neural ODEs+SDEs+CDEs, time series, rough analysis. (Also ice skating, martial arts and scuba diving!)
Patrick Kidger
k3heap is a binary min heap implemented with reference

k3heap k3heap is a binary min heap implemented with reference k3heap is a component of pykit3 project: a python3 toolkit set. In this module RefHeap i

pykit3 1 Nov 13, 2021
This program has been coded to allow the user to rename all the files in the entered folder.

Bulk_File_Renamer This program has been coded to allow the user to rename all the files in the entered folder. The only required package is "termcolor

1 Jan 06, 2022
Explain yourself! Interrogate a codebase for docstring coverage.

interrogate: explain yourself Interrogate a codebase for docstring coverage. Why Do I Need This? interrogate checks your code base for missing docstri

Lynn Root 435 Dec 29, 2022
Compare two CSV files for differences. Colorize the differences and align the columns.

pretty-csv-diff Compare two CSV files for differences. Colorize the differences and align the columns. Command-Line Example Command-Line Usage usage:

Devon 6 Dec 29, 2022
API spec validator and OpenAPI document generator for Python web frameworks.

API spec validator and OpenAPI document generator for Python web frameworks.

1001001 249 Dec 22, 2022
charcade is a string manipulation library that can animate, color, and bruteforce strings

charcade charcade is a string manipulation library that can animate, color, and bruteforce strings. Features Animating text for CLI applications with

Aaron 8 May 23, 2022
Fun interactive program to sort a list :)

LHD-Build-Sort-a-list Fun interactive program to sort a list :) Inspiration LHD Build Write a script to sort a list. What it does It is a menu driven

Ananya Gupta 1 Jan 15, 2022
python wrapper for simple-icons

simpleicons Use a wide-range of icons derived from the simple-icons repo in python. Go to their website for a full list of icons. The slug version mus

Sachin Raja 14 Nov 07, 2022
A tool that allows for versioning sites built with mkdocs

mkdocs-versioning mkdocs-versioning is a plugin for mkdocs, a tool designed to create static websites usually for generating project documentation. mk

Zayd Patel 38 Feb 26, 2022
Make posters from Markdown files.

MkPosters Create posters using Markdown. Supports icons, admonitions, and LaTeX mathematics. At the moment it is restricted to the specific layout of

Patrick Kidger 243 Dec 20, 2022
Projeto em Python colaborativo para o Bootcamp de Dados do Itaú em parceria com a Lets Code

🧾 lets-code-todo-list por Henrique V. Domingues e Josué Montalvão Projeto em Python colaborativo para o Bootcamp de Dados do Itaú em parceria com a L

Henrique V. Domingues 1 Jan 11, 2022
This is a template (starter kit) for writing Maturity Work with Sphinx / LaTeX at Collège du Sud

sphinx-tm-template Ce dépôt est un template de base utilisable pour écrire ton travail de maturité dans le séminaire d'informatique du Collège du Sud.

6 Dec 22, 2022
A course-planning, course-map rendering and GPA-calculation web service, designed for the SFU (Simon Fraser University) student.

SFU Course Planner What is the overall goal of the project (i.e. what does it do, or what problem is it solving)? As the title suggests, this project

Ash Peng 1 Oct 21, 2021
A web app builds using streamlit API with python backend to analyze and pick insides from multiple data formats.

Data-Analysis-Web-App Data Analysis Web App can analysis data in multiple formates(csv, txt, xls, xlsx, ods, odt) and gives shows you the analysis in

Kumar Saksham 19 Dec 09, 2022
A `:github:` role for Sphinx

sphinx-github-role A github role for Sphinx. Usage Basic usage MyST: :caption: index.md See {github}`astrojuanlu/sphinx-github-role#1`. reStructuredT

Juan Luis Cano Rodríguez 4 Nov 22, 2022
Python Eacc is a minimalist but flexible Lexer/Parser tool in Python.

Python Eacc is a parsing tool it implements a flexible lexer and a straightforward approach to analyze documents.

Iury de oliveira gomes figueiredo 60 Nov 16, 2022
Searches a document for hash tags. Support multiple natural languages. Works in various contexts.

ht-getter Searches a document for hash tags. Supports multiple natural languages. Works in various contexts. This package uses a non-regex approach an

Rairye 1 Mar 01, 2022
Elliptic curve cryptography (ed25519) beginner tutorials in Python 3

ed25519_tutorials Elliptic curve cryptography (ed25519) beginner tutorials in Python 3 Instructions Just download the repo and read the tutorial files

6 Dec 27, 2022
Leetcode Practice

LeetCode Practice Description This is my LeetCode Practice. Visit LeetCode Website for detailed question description. The code in this repository has

Leo Hsieh 75 Dec 27, 2022
ReStructuredText and Sphinx bridge to Doxygen

Breathe Packagers: PGP signing key changes for Breathe = v4.23.0. https://github.com/michaeljones/breathe/issues/591 This is an extension to reStruct

Michael Jones 643 Dec 31, 2022