Howell: bash script to put [caption, reference]s on [figure, table]s
Table of Contents
Introduction
This webPage is provided for readers who may wish to build their own "captioned images", either for Stephen Grossberg's "Conscious Mond, Resonant Brain" book, or for their other projects. The bash scripts are open-source. I do not intend to provide support for the scripts as they are very basic, so any person familiar with bash scripts can adapt them.
Captions for the [figure, table]s in were put in an html file. It is a simple process to extract the html captions from the webPage, convert them to images that "fit" the corresponding figure from his book (hand screen-captured from the Kindle version of his book), then vertically appending the caption image to the figure from the book.
For greater speed, users can download my directory and the links below so that material is resident on their computer.
Links for doing the work
Two linux tools were used that complement each other :
- wmctrl - was used to [position, size] html lines
- xdotools - was used to close the captioned image windows
The key [data, bash script] links for doing this are :
- Grossbergs list of [chapter, section]s.html - Note that the links on this webPage can be used to individually view all captioned images.
- directory of images hand-screen-captured from Kindle version of book : This is NOT provided on my website, as without the reference to Grossberg's book in each captioned image, there could be a copyright infringement when used by others.
- directory of captioned images - users can easily view all of the captioned images, especially if they are downloaded onto their computer. Many image viewers have "forward, backward] arrows to go through these sequentially, or right-click to open a link in a window.
- core bash script for extracting captions from webPage listing, convert them to images, then vertically appending them to the figure.
- my bash utility to [position, move] windows. This is normally used to start up 6 workspaces on my computer (Linux Mint Debian Edition), each with 5-10 apps in separate windows.
Going further - themes, videos, presentations, courses
Here are a couple of examples of going further with the lists of [captioned image, theme]s that should be kept in mind. As these are described on separate webPages, details are not provided here.
- Prepared themes with links to the captioned images - there are a huge number of themes from the book to focus on. I have prepared a few as examples.
- What is consciousness? - video example not ready as of 30Aug2023. I save videos as "ogv/ogg" files, and open standard format. The "VLC media viewer" is the program that I use to view them. I have found that although some of the standard video viewers complain, when pushed into the process ogv files can be viewed with them.
- [course, presentation]s - I have NOT prepared any of these, nor do I intend to.
Captioned images - remaining problems
As per the most recent version of the script (30Aug2023), 31 captioned images out of a total of 621 have problems as a described below. Corrections are not in my current (30Aug2023) priorities, perhaps in a few months...
- many captioned images have too thick a bottom white margin, leave it for now
- probably too much txtHeight? as per the "core bash script" :
let "captionPixHeight = $nLines * 25 + 80"
- no caption (2 images with problem) : fig 04.04, 11.30
- caption cut off (29 images have problem) :
- fig 04.53 (1/2 sentence), 05.07 (1/2 chr). 05.13 (edge), 05.48 (words), 08.07 (chr), 08.12 (chr), 11.37 (word), 11.38 (word), 11.39 (1/2 word), 12.61 (chr), 13.08 (1/2 sentence), 13.13 (2-4 words), 13.16 (edge), 13.17 (2-4 chrs), 13.19 (chr), 13.20 (2-4 chr), 13.22 (2 chr), 13.40 (1/2 word), 13.42 (2-4 chr), 13.42 (chr), 13.43 (chr), 14.03 (last several lines including reference), 15.03 (several words), 15.09 (chr), 15.24 (chr), 16.04 (edge last line), 16.42 (bottom line reference), 16.45 (2 words), 17.01 (word)
- full spot-checks to see if there are any [caption, figure] mix-ups (all OK apart from problems above) :
- OK : 08.09, p368fig10.17, p486fig13.09, p552fig15.23,