A bug in biber 2.1

I recently found a subtle bug in biber 2.1 that drove me crazy.  It seems that biber 2.1 silently fails for certain Latex macros that it should convert into UTF-8.  In particular the “\l” macro (Polish ł) is one; I’m still finding more.  Here’s a minimal working (well, failing) example:


 

\documentclass[12pt]{article}

\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=apa,doi=false,url=false,hyperref=true,apamaxprtauth=100]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\usepackage{filecontents}
\usepackage{hyperref}

\begin{filecontents}{\jobname.bib}
@article{sobkowiak:1993,
Author = {Sobkowiak, W\l odzimierz},
Journal = {Language and Speech},
Number = {4},
Pages = {393--414},
Publisher = {SAGE Publications},
Title = {Unmarked-before-marked as a Freezing Principle},
Volume = {36},
Year = {1993}}

@inproceedings{zuidema:2006CoNLL,
Author = {Zuidema, Willem},
Booktitle = {Proceedings of {CoNLL}},
Organization = {Association for Computational Linguistics},
Pages = {29--36},
Title = {What are the productive units of natural language grammar? {A} {DOP} approach to the automatic identification of constructions},
Year = {2006}}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}

\nocite{zuidema:2006CoNLL}

\printbibliography
\end{document}


Calling pdflatex and then biber on this document (called test-biblatex.tex) gives the following result:

INFO - This is Biber 2.1
INFO - Logfile is 'test-biblatex.blg'
INFO - Reading 'test-biblatex.bcf'
INFO - Found 1 citekeys in bib section 0
INFO - Processing section 0
INFO - Looking for bibtex format file 'test-biblatex.bib' for section 0
INFO - Decoding LaTeX character macros into UTF-8

…and that’s it!  No error message.  But it produces no .bbl file and thus subsequent compilation with pdflatex yields no references!

 

Update: the development version of biber (2.2) doesn’t have this problem.  You can find it on Sourceforge (http://sourceforge.net/projects/biblatex-biber/files/biblatex-biber/development/).  Thank you Philip Kime for helping me with this!

Compiling SRILM in OS X 10.9

I’ve recently had need to compile SRILM on my Mac, which runs OS X 10.9 (Mavericks).  I have Mac Ports installed but found that I had to change to the out-of-box C/C++ compiler in order to get SRILM to compile.  It was simple: in common/Makefile.machine.macosx I simply changed

CC = cc $(GCC_FLAGS)
CXX = c++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES

to

CC = clang $(GCC_FLAGS)
CXX = clang++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES

May it work for you as well!

Building lme4.0 on OS X 10.9 (Mavericks)

My laptop died recently, and I am stuck with a new hard drive and a fresh OS X 10.9 (Mavericks) installation.  I wanted to install lme4.0. This turned out to be trickier than I’d expected, because Xcode 5.0 doesn’t include a Fortran compiler. This can be solved by installing a Fortran compiler from http://cran.r-project.org/bin/macosx/tools/. Many thanks to Simon Urbanek for this advice.  A couple of other potentially useful notes:

  • I find that you can no longer install Command Line Tools from within Xcode.  I also was unsuccessful in running xcode-select --install, which used to work; I get the error “Can’t install the software because it is not currently available from the Software Update server”. However, downloading directly from https://developer.apple.com/downloads/index.action does work for me.
  • MacPorts offers Fortran compilers within recent gcc versions — e.g., gcc49 installs a Fortran compiler at /opt/local/bin/gfortran.  But these won’t meet R’s needs; Simon Urbanek states:

    The CRAN build is a native build of R and only supports native compilers.

Update 6 March 2014: Recently Yan Chen used this advice to install lme4.0 on her Mac. She reports that the complete sequence of actions that led to success for her were:

  1. Install Command Line Tools
  2. Install the gfortran compiler
  3. Modify the Makeconf file in /Library/Frameworks/R.framework/Resources/etc to contain the lines


    CC=clang
    CXX=clang++

  4. Upgrade the Matrix package in R to version 1.0.0 or higher
  5. Build lme4.0 following the directions in the tarball

We hope that this may work for you too!

 

Converting any Microsoft Word document to a single PDF (OS X)

I often want to make a PDF version of Word documents I’m writing, but when there are differently formatted sections the Word document spits out multiple PDFs.  To fix this so that you get only one PDF out, do the following:

1) Open File->Page Setup…

2) From the “Settings” dropdown box on the resulting window, Choose “Microsoft Word

3) From the “Apply Page Setup settings to” dropdown box on the resulting window, choose “Whole Document.”

Kudos to dbenoit who posted this solution here.

EPS output with transparency in Sweave output using the cairo_ps driver

Despite all the advantages of pdflatex, I still do a lot of LaTeX writing in which I take the latex -> dvips -> ps2pdf route. This is primarily because of pstricks, which I use for drawing syntactic trees, dependency graphs, and various pictures that I’ve already written out. (I’ve never had complete success with the “pdf” option for pstricks or with xelatex, perhaps because I use other packages within pstricks.) When I write Sweave files, however, I’ve had the trouble that R’s default postscript driver doesn’t support transparency, which is problematic for graphs produced with ggplot2.

However, I found a work-around (): one can direct Sweave to use R’s cairo_ps driver, which *does* support transparency. Putting the following code at the beginning of your .Rnw file accomplishes ths:


<<custom=hide>>=
cairo <- function(name, width, height, ...) grDevices::cairo_ps(file = paste(name, "eps", sep =
"."),
@

Then, in the header of the R code snippets that generate your graphs, use the options fig=T,grdevice=cairo,pdf=F, and you’re good to go.

That being said, I have a long term goal to abandon pstricks and move completely over to tikz, because tikz is clearly the future (from Google Trends):

Best examples of Unix find

Unix find is a powerful tool, but I always forget how to use it. I’ve recently found my favorite page ever on a wide variety of examples of use:

I hope that this is as useful to you as it is to me!

Also, FWIW I have recently found recoll to be a very powerful Spotlight-from-the-command-line tool on both Linux and OS X.

Binding key combinations to specific input source languages in OS X

After 4.5 years of struggling with OS X’s input source menu, I have finally figured out how to bind key combinations to selection of specific input sources (read: English, traditional Chinese through Pinyin, Japanese Hiragana, …).  Here are the steps:

  1. Note the specific names of the input sources on the input menu you want to use.  Mine, for example, are “U.S.”, “Russian”, “Pinyin – Traditional”, “Hiragana”, and so forth
  2. Install Quicksilver.
  3. Open Script Editor (Spotlight will find it).
  4. Within Script Editor, add the contents
    on changeKeyboardLayout(layoutName)
        tell application "System Events" to tell process "SystemUIServer"
            tell (1st menu bar item of menu bar 1 whose description is "text input") to {click, click (menu 1's menu item layoutName)}
        end tell
    end changeKeyboardLayout
    changeKeyboardLayout("your_input_source_name")
    

    where your_input_source_name is replaced with the name of one of your input sources. For example, I might use Pinyin - Traditional. Note that you have to get the name of the input source EXACTLY right.

  5. Save this script as your_input_source_name.scpt in a location of your preference, where you replace your_input_source_name with a mnemonic string of your preference (I might just use chinese-traditional) .
  6. Open Quicksilver through Spotlight.  Push ⌘’ to open the Triggers window.
  7. On the bottom of the Triggers window, hit “+” and choose HotKey to add a HotKey binding.
  8. For “select an item”, type in the name of your saved script until Quicksilver finds it.
  9. For “Action”, just leave it as “Run”.
  10. Don’t put anything for Target.  Click Save.
  11. You’ll now have a new item in the Triggers window called Run Script: your_input_source_name.scpt.  Now double-click on the “Trigger” column of that item, click “Settings” in the new sub-window popping out to the left, click in the Hot Key window, and type in a hot key combination (e.g., I might use ^⌘T).
  12. Repeat steps 4-11 for each input source for which you want a keyboard shortcut.

Kudos to Asmus who posted the very simple AppleScript code used above at this link.

How can Gmail possibly not catch this as phishing?

from Gmail Online Service <mailonlineservice05@gmail.com>
to
date Mon, Jan 10, 2011 at 12:35 PM
subject PRECAUTION
Gmail technology team has recently launched Google web software to protect and secure all Gmail Accounts. This system also enhanced efficient networking and fully supported browser. You need to upgrade to a fully supported browser by filling out the details below for validation purpose and to confirm your details on the new webmaster Central system.
User id:
User Password:
Date of birth:
Occupation:
Note: Your account will be disabled permanently if you failed to provide the details required above within 72hours. Gmail will not be held responsible for your negligence.
The Google web Service.

To Senator John Kyl

Dear Senator Kyl:

I grew up in Arizona and now live in California.  My mother and many of my childhood friends still live and vote in Arizona.

Today on Face the Nation (about 6:45 in) you criticized Pima County Sheriff Clarence Dupnik for suggesting that vitriolic public discourse may have played a role in inciting the shooting of Gabrielle Giffords.  Sheriff Dupnik is an elected public official, just like you are.  What gives you but not him the right to pontificate about the slaughter of Giffords, Roll, and several other bystanders?

Submitted to John Kyle here.

The message I sent to Pima County Sheriff Clarence Dupnik

Dear Sheriff Dupnik,

I grew up in Tucson, graduated from University High School in 1991 (I overlapped with Gabrielle Giffords for one year in high school, though I didn’t know her), and now live in San Diego.  I have been following media coverage of the shooting of Congresswoman Giffords and others, and I have listened to your remarks on the anger, bigotry, and vitriol in the United States today, and how Arizona has become a mecca for prejudice.  I am extremely grateful that you are standing up and telling the truth as you see it.  The country needs more sober voices like yours.  I am saddened to see what is happening to my home state.  Please know that you have my full support in any more public statements that you make on this issue, and I hope that you continue to tell the truth as you see it.

Yours truly,

Roger Levy

You can send Sheriff Dupnik a message of support here:

http://pimasheriff.org/contacts/