Archive for February, 2013

Even more of the same black square

Friday, February 22nd, 2013

algorith-m

Friday, February 22nd, 2013

algorith-m

http://alecjacobson.com/art/digital/
http://alecjacobson.com/art/

Scroll a bit in safari window, take screenshot repeat

Friday, February 22nd, 2013

Here’s an applescript I used to make a series of screen captures of scrolling through a web page in safari:


tell application "Safari"
	activate
	set sc to 0
	repeat
		set thescript to "if((window.pageYOffset + window.innerHeight)<document.body.clientHeight)
		{
    	window.scrollBy(0,10); // horizontal and vertical scroll increments
		}"
		do JavaScript thescript in current tab of first window
		set imagePath to (path to desktop as text) & "screenCapture_" & my zero_pad(sc, 6) & ".png"
		delay 1.5
		do shell script "screencapture -o -mx -T0 " & quoted form of POSIX path of imagePath
		delay 0.5
		set sc to sc + 1
	end repeat
	
end tell

on zero_pad(value, string_length)
	set string_zeroes to ""
	set digits_to_pad to string_length - (length of (value as string))
	if digits_to_pad > 0 then
		repeat digits_to_pad times
			set string_zeroes to string_zeroes & "0" as string
		end repeat
	end if
	set padded_value to string_zeroes & value as string
	return padded_value
end zero_pad

Source

Stare at the cross for 30 seconds and then wake up

Monday, February 18th, 2013

stare at the cross for 30 seconds and then wake up

http://alecjacobson.com/art/digital/
http://alecjacobson.com/art/

Install ETH Fonts for LaTeX on Mac OS X

Thursday, February 7th, 2013

This turned out to be quite difficult.

I installed TexLive using macports.

If you download the ETH letter LaTeX templates and try to compile you will get an error like:


! I can't find file `letr8t'.
<*> ...:=ljfour; mag:=1; nonstopmode; input letr8t
                                                  
Please type another input file name
! Emergency stop.
<*> ...:=ljfour; mag:=1; nonstopmode; input letr8t
                                                  
Transcript written on mfput.log.
grep: letr8t.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input letr8t' failed to make letr8t.tfm.
kpathsea: Appending font creation commands to missfont.log.
! Font \xiiiv=letr8t at 8.5pt not loadable: Metric (TFM) file not found.
 
                   \relax 
l.112 \newfont{\xiiiv}{letr8t at 8.5pt}

This is complaining that you don’t have the ETH fonts installed. These are a pain to install.

Unzip into your macports texmf folder:


sudo unzip ETHLfnts.zip -d /opt/local/share/texmf/

Create a hash for the new files:


sudo texhash

If you try to compile brief2.tex now you will get an error:


kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 letb8r
mktexpk: don't know how to create bitmap font for letb8r.
mktexpk: perhaps letb8r is missing from the map file.
kpathsea: Appending font creation commands to missfont.log.
(see the transcript file for additional information)
!pdfTeX error: pdflatex (file letb8r): Font letb8r at 600 not found
 ==> Fatal error occurred, no output PDF file produced!

Open and append:


p +let.map

Now compiling should give you the error:


gsftopk: fatal: map file `let.map' not found.
mktexpk: don't know how to create bitmap font for letb8r.
mktexpk: perhaps letb8r is missing from the map file.
kpathsea: Appending font creation commands to missfont.log.
(see the transcript file for additional information)
!pdfTeX error: pdflatex (file letb8r): Font letb8r at 600 not found
 ==> Fatal error occurred, no output PDF file produced!

Create the file /opt/local/etc/texmf/ethfonts.cfg and add the line:


Map let.map

Update maps listing:


sudo updmap-sys

Now if you should get an error like:


ERROR:  The following map file(s) couldn't be found:
	let.map (in /opt/local/var/db/texmf/web2c/updmap.cfg)

If you try to compile brief2.tex you’ll get an error like:


gsftopk: fatal: map file `let.map' not found.
mktexpk: don't know how to create bitmap font for letb8r.
mktexpk: perhaps letb8r is missing from the map file.
kpathsea: Appending font creation commands to missfont.log.
(see the transcript file for additional information)
!pdfTeX error: pdflatex (file letb8r): Font letb8r at 600 not found
 ==> Fatal error occurred, no output PDF file produced!

So, copy let.map to your local texlive directory:


mkdir -p ~/.texlive2012/texmf-var/fonts/map/dvips/updmap/
cp /opt/local/share/texmf/maps/let.map ~/.texlive2012/texmf-var/fonts/map/dvips/updmap/

Update maps listing:


sudo updmap-sys

Now you should be able to successfully build:


pdflatex brief2