Posts Tagged ‘font’

Convincing LatexIt and Illustrator to use the new SIGGRAPH fonts

Saturday, May 20th, 2017

The SIGGRAPH Latex style changed to the Libertine font. Here’re the steps to convince Latexit to use the new stylesheet and then to convince Illustrator to use the libertine font for drag and drop math.

mkdir ~/Library/texmf/tex/latex/local/acmart.cls/
cp ~/Dropbox/boundary/Paper/acmart.cls ~/Library/texmf/tex/latex/local/acmart.cls

In Latexit, open up Preferences, add a new SIGGRAPH “Template” containing:

\documentclass[sigconf, review]{acmart}
\pagenumbering{gobble}

If you try to drag and drop these into illustrator you’ll see that illustrator has replaced the nice math font with Myriad or something silly.

Download the TTF libertine font pack

Drag this into FontBook.app

cp /usr/local/texlive/2015/texmf-dist/fonts/type1/public/libertine/*.pfb ~/Library/Application\ Support/Adobe/Fonts/

Update: I also had to issue:

cp /usr/local/texlive/2015/texmf-dist/fonts/type1/public/txfonts/*.pfb ~/Library/Application\ Support/Adobe/Fonts/
cp /usr/local/texlive/2015/texmf-dist/fonts/type1/public//newtx/*.pfb  ~/Library/Application\ Support/Adobe/Fonts/

If you see boxes with X’s replacing symbols after dragging and dropping from LaTeXit, then drag into Finder instead (to create a .pdf file), then open this directly and Illustrator will give a warning and tell you which font it’s (still) missing.

Restart Adobe Illustrator

Emoji in LaTeX documents

Tuesday, August 5th, 2014

Update: Hilariously, it turns out that either wordpress or my wordpress markdown plugin is choking on the emoji inserted into this post. Thus, to see the actually emoji commands see this plaintext version


We were recently joking around about using emoji in math equations. The idea was to satire of the bad rap exterior calculus symbols like the the Hodge star operator (★) and the “musical isomorphisms” (♭,♯) get in the computer graphics community.

I found a solution for upTeX. This works by first extracting all of the emojis as pdfs and then including the pdfs via (includegraphics) whenever a \coloremoji{...} command is found. This unfortunately did not work with my TexLive pdflatex setup. With some help, I’ve redesigned a coloremoji.sty stylesheet that allows you to directly include emoji in your LaTeX documents.

A Hello, EmojiWorld LaTeX document would look like this:

WordPress dies on emoji, see plaintext version

This produces something that should look like:

hello world emoji

You can also use emoji in mathmode:

WordPress dies on emoji, see plaintext version

alligator power integral math emoji latex

Download the coloremoji package and simply add \usepackage{coloremoji} to the top of your document.

Actually, Nobuyuki Umetani gave a talk where he used graphic icons in math (I believe successfully!) to explain Sensitive Couture (change in clothing with respect to change in mouse interaction):

Nobuyuki's emoji math

Update: I’m now hosting this style package on github.

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

Sans-serif not supported in MATLAB text using latex interpreter

Thursday, September 6th, 2012

If I try to issue in MATLAB:


title('\textsf{sans-serif}','interpreter','latex');

I get the following error:


Warning: Font cmss10 is not supported. 
Warning: Font cmss10 is not supported. 
Font creation failed twice.
java.io.IOException when creating Font object
Using File /Applications/MATLAB_R2011b.app/sys/fonts/ttf/cm/mwa_cmss10.ttf to create font mwa_cmss10
File.exists(): false
File.length(): 0
Exception:
java.io.IOException: Can't read /Applications/MATLAB_R2011b.app/sys/fonts/ttf/cm/mwa_cmss10.ttf
	at java.awt.Font.createFont(Font.java:978)
	at com.mathworks.hg.util.FontConverter.loadTexFontSecondAttempt(FontConverter.java:254)
	at com.mathworks.hg.util.FontConverter.loadTexFont(FontConverter.java:218)
	at com.mathworks.hg.util.FontConverter.convertToJavaFont(FontConverter.java:169)
	at com.mathworks.hg.uij.GraphicsContext.SetWindowFont(GraphicsContext.java:1039)
Caused by:
null
Warning: Could not set font mwa_cmss10 

I fixed this by finding cmss10.ttf on the web. And copying on top of /Applications/MATLAB_R2011b.app/sys/fonts/ttf/cm/mwa_cmss10.ttf.

Then when I issue the above command I get the correct output and only a few warnings:


Warning: Font cmss10 is not supported.
Warning: Font cmss10 is not supported.

Nabla (∇) in matlab plot title

Thursday, September 6th, 2012

I tried:


title('\nabla');

Which produces no errors or warnings on the terminal, but the title in the plot on my mac is just a little question mark in a black box: �
You can do a little better by switching to the latex interpreter, which unfortunately uses that smelly latex font


title('$\nabla$','interpreter','latex');

“Free” two-line font

Thursday, March 8th, 2012

Writing SIGGRAPH rebuttals, we’re all paranoid about word count (we get 1000 words of ASCII text to refute the reviews). The usual word count tricks are often employed: contraction “do not” to “don’t”, dropping articles, dropping “el al.”s from citations. I’ve even heard of even riskier tricks like combining “Reviewer #01” into “Rev01”. Most of these tricks come at the expense of clarity and professionalism, but it got me thinking about the word count game.

The word count algorithm employed by SIGGRAPH’s SIS system follows a view rules revealed through their source. The gist is that “non-alphanumerics” get replaced by spaces, then the count of words are just the number of tokens separated by whitespace. In reg-ex form non-alphanumerics are defined here to be:


[^A-Za-z0-9']

Note:The only interesting thing here is that the apostrophe is OK meaning, where as “light-blue” counts as two words “don’t” counts as one.
Note:There’s another slight subtlety that if an apostrophe occurs alone it is OK. This just means ” ‘ ” is 0 words and ” -‘- ” is also 0 words.

But if non-alphanumerics show up alone, that is, never neighboring an alphanumeric character, then you get 0 words.

This leads to a ridiculous “trick” for gaming the word count system by employing a “two-line” font composed entirely of non-alphanumeric words. Here’s quick prototype:


/'`  /_\  |\ |   \ / /'\ | |   |_) /_  /_\  |'\
\_. /   \ | \|    |  \_/ |_|   | \ \_ /   \ |_/


''|'' |_| |  ('   [' /'\ |\ | ''|''   )
  |   | | |  _)   |  \_/ | \|   |     .

Note: The obvious danger (besides being embarrassed by actually submitting something written in this font) is that the reviewers may not see it in a correctly line-separated or monospaced, original font. In that case it just looks like garbage.

Blacked-out text in LaTeX

Sunday, November 28th, 2010

Here’s a small command you can add to your LaTeX document’s header that will let you “blackout” text like a censored Watergate era document.


\newlength{\blackoutwidth}
\newcommand{\blackout}[1]
{%necessary comment
  \settowidth{\blackoutwidth}{#1}%necessary comment
  \rule[-0.3em]{\blackoutwidth}{1.125em}%necessary comment
}

The command is easy to use and automatically adjusts to the word or phrase that should be blacked out, as long as it’s not longer than a line. Here’s an example of \blackout in use:
blackout example latex

The above can be compiled from the following LaTeX document:


\documentclass[letterpaper,11pt]{article}
\newlength{\blackoutwidth}
\newcommand{\blackout}[1]
{%necessary comment
  \settowidth{\blackoutwidth}{#1}%necessary comment
  \rule[-0.3em]{\blackoutwidth}{1.125em}%necessary comment
}
\begin{document}
\noindent
{\tiny Deep Throat's true identity is \blackout{Mark Felt}. \\
Deep Throat's true identity is Mark Felt.}\\
{\small Deep Throat's true identity is \blackout{Mark Felt}. \\
Deep Throat's true identity is Mark Felt.}\\
Deep Throat's true identity is \blackout{Mark Felt}. \\
Deep Throat's true identity is Mark Felt. \\
{\bf Deep Throat's true identity is \blackout{Mark Felt}. \\
Deep Throat's true identity is Mark Felt.}\\
\emph{ Deep Throat's true identity is \blackout{Mark Felt}. \\
Deep Throat's true identity is Mark Felt.}\\
{\Large Deep Throat's true identity is \blackout{Mark Felt}. \\
Deep Throat's true identity is Mark Felt.}\\
{\huge Deep Throat's true identity is \blackout{Mark Felt}. \\
Deep Throat's true identity is Mark Felt.}\\
\end{document}

Even newer version of the close-up font comparer: Versus

Tuesday, August 4th, 2009

new features of versus v0.2

With much help from font enthusiasts on typophile.com, I’ve put up an improved and more featured version of Versus, the up close and personal font comparer about which I recently posted. Check out the new features and let me know if (1) they work right and (2) they are what you would want them to be.
Note: For those interested in comparison I’ve (temporarily) kept up the old version .

New (version of) close-up font comparer: versus

Friday, July 31st, 2009

versus font comparerToday, I coded up Versus, a close-up font comparer. The original version (somewhat inspired by the documentary Helvetica) was written in straight html and css (with a little php to generate new phrases). The were a lot of problems with that version… Most importantly it only seemed to run on my browsers on my machine (some of the renderings — especially on IE browsers — were quite comical). The new version is all java and runs beautifully in a browser applet on any machine and any browser with java enabled. It also lets you choose fonts to compare from a list of fonts you have access to on your machine. I also included a “full screen page”.

Tell me what you think and leave ideas for improvements.

Note: For anyone interested here’s the source code.