Recent Changes - Search:

edit SideBar



Diagrams and screen captures

To save a Ptolemy model as PDF, see

Printing to PDF and using PDFLatex seems to work best... Acrobat can be used to eliminate white space around the image, see

To generate EPS, use the advanced settings of a printer and under Postscript options, select EPS.

Using LaTeX to generate UC Berkeley Letterhead

  • Jonathan Sprinkle's LaTeX Page
    • universityos.tar.gz "Font (for Berkeley use only)"
      • "Installation file to use the UniversityOS fonts on your LaTeX installation."
    • "(LaTeX class file and example)"
      • "Allows you to create memos using the Berkeley format. Requires the UniversityOS font to be installed on your machine."
        • pdftex was failing because it could not find the document class


In 4/2009, I was able to use the UniversityOS font with Miktex 2.7.

  1. I set the TEXMFLOCAL variable to C:\localtexmf
  2. In bash, I had to change my path with
    export PATH=/cygdrive/c/Program\ Files/MiKTeX\ 2.7/miktex/bin:${PATH}
    The reason is that otherwise the version of tex that is used is the one installed with cygwin, not the MiKTeX version.
  3. I ended up running initexmf -v --mkmaps
  4. To update the settings, I ran Start -> All Programs -> MiKTeX 2.7 -> Settings and in Roots, I added the C:\localtexmf to the Roots and in General, did Refresh FNDB and Update Formats

Mac OS X

To do the setup with MacTeX, I did

  1. mkdir ~/texmf
    cd ~/texmf
    tar -zxf universityos.tar.gz
    tar -zxf universityos-install.tar.gz
    cd dvips/config/
    cd ../../pdftex/config
    cp fgy_pdftex.cfg pdftex.cfg
    cd ../../miktex/config/
    cp fgy_updmap.cfg updmap.cfg
    cd testUCBFonts
    sudo -i
    export TEXMFLOCAL=/Users/cxh/texmf
    export TEXCONFIG=/Users/cxh/texmf/pdftex/config/
    export TEXINPUTS=.:/Users/cxh/texmf:
    export TEXPSHEADERS=/Users/cxh/texmf/fonts/type1/free/UniversityOS:
    pdftex testUCBFonts.tex
  2. When I ran pdftex testUCBFonts.tex, I was getting mktexpk: don't know how to create bitmap font for fgydo8r. Running updmap did not work.
    1. Running gsftopk --mapfile=/Users/cxh/texmf/pdftex/config/ fgydc8r 600 creates fgydc8r.600pk in the current directory. After a bunch of fooling around, I edited /usr/texbin/mktexpk and inserted --mapfile and the path to the file. There is probably a better way around this:
            if $ps_to_pk --mapfile /Users/cxh/texmf/pdftex/config/ -t "$NAME"; then
              cmd="$ps_to_pk --mapfile /Users/cxh/texmf/pdftex/config/ $NAME $DPI"
      and then ran pdftex testUCBFonts.tex My environment settings were
      export TEXMFLOCAL=/Users/cxh/texmf
      export TEXCONFIG=/Users/cxh/texmf/pdftex/config/
      export TEXINPUTS=.:/Users/cxh/texmf:
      export TEXPSHEADERS=/Users/cxh/texmf/fonts/type1/free/UniversityOS:
      However, I don't think it is strictly necessary to have these settings.

Creating a UC Berkeley Letterhead letter

To generate a letter:

cd ~/texmf/latex/berkeley
pdflatex sampleLetter.tex

Note that pdftex may fail:

bash-3.2$ pdftex sampleLetter.tex
This is pdfTeX, Version 3.1415926-1.40.9 (MiKTeX 2.7)
entering extended mode
! Undefined control sequence.
l.1 \documentclass
! Emergency stop.
l.1 \documentclass
! ==> Fatal error occurred, no output PDF file produced!
Transcript written on sampleLetter.log. suggested using latex instead of tex, so I ran pdflatex sampleLetter.tex

Converting LaTeX to PNG

Stavros suggested these:

Name Tags

Information about generating name tags for a conference. We use Avery 5390.

Ptolemy Demos

The paper Edward A. Lee. Finite State Machines and Modal Models in Ptolemy II, Technical report, EECS Department, University of California, Berkeley, UCB/EECS-2009-151, December, 2009.

has demos at

Here's how Edward did it in Latex:

\usepackage[colorlinks=true,bookmarks,pdfpagemode=UseOutlines,linkcolor=linkColor,citecolor=linkColor,pagecolor=blue,urlcolor=red,pdftitle={Concurrency},pdfauthor={Edward A. Lee},plainpages=false,baseurl={}]{hyperref}


A model of a thermostat with hysteresis.
The \code{Temperature Model} actor is shown in Figure

The usepackage{hyperref} command specifies a base url, and the figure includes a link to an HTML page that Christopher generated for each model.

LaTeX Macros for Edward's books

The Ptolemy book is in the ptpapers repository as ealpapers/ptolemy, see

Use the following macros:

\defn{term} for terms defined. Should have only 1 in the book. Use singular always. See defnn, etc.
\defnlinkm{term} to refer to a term defined elsewhere.
\pointer{term} for a term that should appear in the index.
\cite[]{ref} for citations in parens (Smith et. al, 2010).
\cite{ref} for inline citations. Smith (2010) tells us...
\class{NamedObj} for a Java class
\actor{Const} for an actor class
\actorDef{Const} for the definition of the class
\actorName{Const2} for an actor instance named Const2
\port{input} for a port named input.
\method{getContainer} for a Java method
\fixme{Comment} for stuff that remains to be done.

Notice also how to create sidebars.

Full documentation of these macros can be found in the lib/definitions.tex file.

Style Conventions for Edward's books


  • Figures and models go in to the corresponding subdirectory for the chapter.
  • Ptolemy models usually have white backgrounds, hierarchy has grey chapters. To control the background color, drag in a Utilities -> LocalPreferences and set the background color to white. Then drag the LocalPreferences icon to an area off screen.
  • "figure x" should be replaced by "Figure x" (capitalize figure when referring to a particular named figure). Do not capitalize in phrases like "as shown in the figure".
  • \caption should be replaced by \figcaption. Also, the \label needs to be inside the \figcaption, not outside (I think this is true of \caption as well). A typical figure:
\figcaption{Invoke \menu{Open Actor} on composite actors to reveal their implementation.
  • When adding citations, please include a DOI, if one is available, or if not, a URL, if one is available. This results in hyperlinks to the citations, which can be very useful.


  • Definitions are singular, not plural.
  • Common actors get defined in one place with \actordefn. Use \actor to refer to the definition.
Edit - History - Print - Recent Changes - Search
Page last modified on April 06, 2016, at 08:17 PM