Monthly Archive: March 2009

Even better BibDesk preview pane

bibdesk-skim-sidebar.gifHaving been inspired by the preview pane template I just posted about, I created an even better one. It’s a HTML template, and it’s kind of a work in progress, but it does some interesting things. First: it will display the Skim notes. It will also pick up citations in the Cited-by and Cites fields (which I intend to use as “see also” links) and displays them as clickable links that will bring up the linked-to BibDesk record. It’ll print the abstract if there is one and the keywords if there are any (although I could not figure out how to make the keywords clickable).

The image on the right shows what it does. The red thing at the top is the cite key, the link below is to the PDF itself (and any linked files will appear there), then the keywords, then the links to the BibDesk records mentioned in the Cites field (format is “citekey1,citekey2,citekey3″). Below that the Skim notes.

There are two files that make up this template, one is the outer layer of the HTML page (betterHTML.html), and the other is the inner “partial” that is used for each item in the list (betterItemHTML.html). You can see how it works by reading through it. The code is below the fold (or click on the links just given to download them directly). To install, put these in ~/Library/Application\ Support/BibDesk/Templates/ (if you downloaded them, be sure to change the name so the extension is .html, not .txt) and then go to the Templates pane of the Preferences and add a new template. Give it a name, choose betterHTML.html as the file, and then select the new template and hit + to add a second file within the template. Add betterItemHTML.html as type Default Item. And, then, you should be able to select it as a display mode for one of your panes (I’d suggest the right-hand pane).

Read the rest of this entry »

BibDesk preview pane with Skim notes

I just came across this nice template for BibDesk that will display your Skim notes in a preview pane. My new BibDesk layout has the notes preview in the right-hand pane and the files preview in the lower pane. Also, note that in the files display, there is a hidden zoom control in the top center.

Get the “previewTemplate” here at Jim Harrison’s templates page . To install it, put previewTemplate.rtf in ~/Library/Application\ Support/BibDesk/Templates/ and then go into the BibDesk Templates preference pane, make sure nothing is selected, and hit the + button. Click on the new name twice slowly and give it a name like “previewTemplate”, and double-click on the file to choose the previewTemplate.rtf file you just put into your Library folder. Finally, select the previewTemplate from the template popup under the pane you want to put the preview template in.

Homework, keys, handouts, and presentations from the same file

Recently, I figured out how to make it possible to write up a homework assignment with the key embedded in it so that I could have a single LaTeX file that, when processed one way, would produce the homework without the answers, and when processed another way, would produce the key. A similar thing can be done for beamer presentations and the associated handouts as well.

This has always been easy enough to do by just having some lines at the top that you comment out or comment in as you are about to process the file, but the problem is that both versions’ PDF file has the same name. What I wanted to do instead was to have one of the PDF files be named “xxx-key.pdf” and the other be named “xxx.pdf”.

It’s easy enough. The key can be generated using a small .tex file that includes the main .tex file after setting something to make it clear that this is the key. What I’ve done here is to use the comment package to exclude the answers when it is the homework and not the key. Specifically, anything in the KEY environment prints only on the key (in red) and anything in the TEST environment prints only on the test (in blue).

quiz4-key.tex contains:

\newcommand{\prepareKey}{Key}%
\input{quiz4}

and quiz4.tex contains:

\usepackage{comment}
\usepackage[dvipsnames]{xcolor}
\specialcomment{KEY}{\begingroup\noindent\sf\color[named]{Red}}{\endgroup}
\specialcomment{TEST}{\begingroup\noindent\sf\color[named]{Blue}}{\endgroup}
\newcommand{\PrepareExamTest}{\excludecomment{KEY}}
\newcommand{\PrepareExamKey}{\excludecomment{TEST}}
\makeatletter\@ifundefined{prepareKey}{%
\PrepareExamTest
\newcommand{\hwdateline}{THURSDAY MARCH 5}
}{%
\PrepareExamKey
\newcommand{\hwdateline}{KEY}
}\makeatother
...
\title{Quiz 4 \\ \hwdateline}
...
What is 1+1?
\begin{TEST}
This is the actual test, remember.
\end{TEST}
\begin{KEY}
The answer is 2.
\end{KEY}
...

Maybe everybody else already knew how to do this, but it took me a while to get there. And there may well be a better way to do it, but this seems to work. Compiling the two files provides quiz4.pdf and quiz4-key.pdf, as desired.