Resources
Diagrams and screen captures
To save a Ptolemy model as PDF, see http://ptolemy.berkeley.edu/ptolemyII/ptIIfaq.htm#pdf
Printing to PDF and using PDFLatex seems to work best... Acrobat can be used to eliminate white space
around the image, see http://ptolemy.berkeley.edu/ptolemyII/ptIIfaq.htm#pdf
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."
- ucbletter.zip "(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
Windows
In 4/2009, I was able to use the UniversityOS font with Miktex 2.7.
- I set the TEXMFLOCAL variable to
C:\localtexmf
- 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.
- I ended up running
initexmf -v --mkmaps
- 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
-
mkdir ~/texmf
cd ~/texmf
wget http://chess.eecs.berkeley.edu/ptexternal/wiki/uploads/Main/universityos.tar.gz
wget http://chess.eecs.berkeley.edu/ptexternal/wiki/uploads/Main/ucbletter.zip
tar -zxf universityos.tar.gz
tar -zxf universityos-install.tar.gz
unzip ucbletter.zip
cd dvips/config/
ls
cp fgy_config.ps config.ps
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/fgy.map
export TEXINPUTS=.:/Users/cxh/texmf:
export TEXPSHEADERS=/Users/cxh/texmf/fonts/type1/free/UniversityOS:
pdftex testUCBFonts.tex
- 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.
- Running
gsftopk --mapfile=/Users/cxh/texmf/pdftex/config/fgy.map 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 fgy.map
file. There is probably a better way around this:
gsftopk)
if $ps_to_pk --mapfile /Users/cxh/texmf/pdftex/config/fgy.map -t "$NAME"; then
cmd="$ps_to_pk --mapfile /Users/cxh/texmf/pdftex/config/fgy.map $NAME $DPI"
and then ran pdftex testUCBFonts.tex
My environment settings were
export TEXMFLOCAL=/Users/cxh/texmf
export TEXCONFIG=/Users/cxh/texmf/pdftex/config/fgy.map
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
(sampleLetter.tex
! Undefined control sequence.
l.1 \documentclass
[11pt,letterpaper,oneside]{ucletter}
?
! Emergency stop.
l.1 \documentclass
[11pt,letterpaper,oneside]{ucletter}
! ==> Fatal error occurred, no output PDF file produced!
Transcript written on sampleLetter.log.
http://www.math.uiuc.edu/~randy/MA248/miktex.html 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. http://www.eecs.berkeley.edu/Pubs/TechRpts/2009/EECS-2009-151.html 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 http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII8.0/jnlp-books/doc/books/design/modal/
Here's how Edward did it in Latex:
\usepackage{color}
\definecolor{linkColor}{rgb}{0.1,0.1,0.8}
\usepackage[colorlinks=true,bookmarks,pdfpagemode=UseOutlines,linkcolor=linkColor,citecolor=linkColor,pagecolor=blue,urlcolor=red,pdftitle={Concurrency},pdfauthor={Edward A. Lee},plainpages=false,baseurl={http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII8.0/jnlp-books/doc/books/design/}]{hyperref}
...
\begin{figure}[!b]
\centering
\href{modal/Hysteresis.htm}{\includegraphics[width=5in]{pt_modal/Figures/Hysteresis.pdf}}
\figcaption{\label{fig-Hysteresis}
A model of a thermostat with hysteresis.
The \code{Temperature Model} actor is shown in Figure
\ref{fig-TemperatureModel}.}
\end{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 https://chess.eecs.berkeley.edu/ptolemy/wiki/Ptolemy/Book
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
- 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:
\begin{figure}
\centering
\includegraphics[width=\columnwidth]{vergil/Figures/vol1Figure2-5.pdf}
\figcaption{Invoke \menu{Open Actor} on composite actors to reveal their implementation.
\label{fig:OpenActor}}
\end{figure}
- 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
- Definitions are singular, not plural.
- Common actors get defined in one place with
\actordefn
. Use \actor
to refer to the definition.