-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
strange how instable the results of asciiart are
- Loading branch information
Showing
4 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# https://www.gnu.org/software/make/manual/html_node/ | ||
# https://crates.io/crates/svgbob_cli | ||
# https://github.com/ivanceras/svgbob?tab=readme-ov-file | ||
|
||
# Find all the -ascii.txt files we want to compile | ||
# Note the single quotes around the * expressions. The shell will incorrectly expand these otherwise, but we want to send the * directly to the find command. | ||
SRC_DIRS := . | ||
BUILD_DIR := . | ||
SRCS := $(shell find $(SRC_DIRS) -name '*-ascii.txt') | ||
PDFs := $(SRCS:-ascii.txt=.pdf) | ||
|
||
.PHONY: default | ||
default: all | ||
|
||
all: $(PDFs) | ||
|
||
%.svg : %-ascii.txt | ||
svgbob_cli $< -o $@ | ||
|
||
%.pdf : %.svg | ||
rsvg-convert -f pdf -o $@ $< | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf *.svg $(PDFs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# About the figures | ||
|
||
## Old figures: omnigraffle | ||
|
||
Old figures are made with omnigraffle and exported to pdf and png. | ||
Latex output uses pdf. | ||
|
||
The problem with these is that keeping the same look and feel over all of these is very complicated. | ||
|
||
## New figures: asciiart -> svg -> pdf | ||
|
||
Using asciiart allows me (Guille) to keep the same look and feel in the figures. | ||
Converting ascii art to pdf requires two command line tools: `aasvg` and `rsvg-convert` which I installed as follows in Mac: | ||
|
||
```bash | ||
npm install -g aasvg | ||
sudo apt-get install librsvg2-bin | ||
|
||
``` | ||
If the previous apt-get does not work | ||
|
||
Notice that you should also install svgbob | ||
``` | ||
brew install librsvg | ||
brew install svgbob | ||
``` | ||
|
||
Figure source code is asciiart and named `*-ascii.txt`. | ||
We then convert them to svg using the following commands. | ||
|
||
**TIP: Use the makefile ;)** | ||
|
||
``` | ||
aasvg < x.txt > x.svg | ||
rsvg-convert -f pdf -o x.pdf x.svg | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Rectangle / #width | ||
<01> pushRcvr: 1 --- push the value of the receiver's second instance variable (corner ) onto the stack | ||
<7E> send: x --- send the unary message x | ||
<00> pushRcvr: 0 --- push the value of the receiver's first instance variable (origin ) onto the stack | ||
<7E> send: x --- send the unary message x | ||
<61> send: - --- send the binary message - | ||
<5C> returnTop - return the object on top of the stack as the value of the message (width ) | ||
|
||
|
||
|
Binary file not shown.