nbehrnd / bader_article

«Putting Fortran's object-related features to practical use» a draft prepared by the late Reinhold Bader (1966-2024)
3 stars 0 forks source link
fortran fortran2003 modern-fortran oop

title: readme.md date: 2024-08-05 Mon edit: 2024-10-10 Thu

purpose

Following a call for help by M. B. Metcalf on fortran-lang.org, this project aims to preserve a draft prepared by the late Reinhold Bader (1966-2024) about aspects of object oriented programming in Fortran.

Intended for eventual use in Wikipedia (see this page here) it is/was uncertain if Baders' work would remain accessible there, or not. A reader primary interested in the topics of OOP and Fortran is suggested to consult either file ex_pdflatex.pdf, or the primary source file of the draft, file pandoc_md.md.

technical details

The initial format of the draft (mediawiki syntax) eventually was translated with pandoc (version 3.1) into Pandoc flavored markdown as a markup language easier to maintain and use. Reasons for this move include

These outweigh drawbacks like the incorrect/unresolved display of internal cross-links by GitHub because the platform presumes file extension .md refers to a GitHub flavored markdown file. (Pandoc has flags to discern these dialects for file I/O.)

The two illustrations originally fetched (png, given the dimensions they were used, of low resolution) were redrawn with inkscape (inheritance diagram), or draw.io desktop (UML diagram). They were exported both into vector formats (.svg, .pdf) and bitmap (.png with at least 300 dpi given the dimensions of anticipated usage). Beside an increase of readability in the pdf to compile, this provided an easier edit and correction at the source, if needed.

While aiming for a pdf as eventual output (cf. vide infra), the (re)build of the document was monitored by a conversion of the markdown file with Pandoc into html (default action) or a pdf intentionally without illustrations (with groff). Like other actions of this project likely to be used multiple times, a Makefile was used to manage these.

Pandoc offers multiple --pdf-engines for a direct compilation of a pdf. In addition, Pandoc can convert e.g., a markdown file into an other markup language which itself can be used to compile a pdf using a different engine of its ecosystem. Thus, beside the preservation of Bader's draft, a second interest of the project's owner was to compare a few possible workflows. This may be attractive because markdown (used as the container format to edit the draft) is a lighter markup language than LaTeX for instance to define emphases, or tables while the visual appearance of the eventual document can be influenced by Pandoc style templates.

summary

The table below compares the file sizes of the pdf generated by either one of the three workflows tested (column "original") and eventually stored in the project archive. Often, file sizes of pdf can be reduced further by an additional "print to pdf". As an example, the file sizes of a run like pdf_rewrite -r input.pdf with pdf_rewriter to retain the colors of the illustrations are compiled in column "rewritten". Columns "good" and "bad" are an opinionated selection of advantages / disadvantages of either workflow.

workflow original rewritten good bad
pdfLaTeX 794 kB 415 kB character set covers the needs, reliable management of illustrations (either png, or pdf) large footprint to install
rst2pdf 1.5 MB 1.0 MB relates to the Python ecosystem slow processing, results large pdf
groff 680 kB 190 kB light footprint, fast processing less symbol coverage than LaTeX, illustrations need to be in a pdf/eps container

update summary