How-to: Hyperlinks in federal court documents on a Mac

I follow Hercules and the Empire, a blog written by a federal trial judge in Nebraska. I was poking around the archives today and found a couple of gems on legal writing, including a list of “Top ten legal writing hints when the audience is a cranky federal trial judge“. Judge Kopf suggests we make life easier on law clerks by inserting hyperlinks to caselaw and the electronic record.

I appreciate good legal writing, so I immediately started exploring the process. The Nebraska USDC ECF page has several links and tutorials on how to create hyperlinks in e-filed documents. The tutorials are a really good starting place on the mechanics of how to create hyperlinks. For instance, I never knew you could link to particular pages of PDF documents online simply by adding ?page=<pagenumber> to the end of the link. However, the tutorials identified a few issues that our particular Mac-based workflow would cause, so I thought I’d write up how I addressed the problems.

We use Macs and Microsoft Word in our office. We have Adobe Acrobat 11. Lexis is our legal research provider. From what I can tell, this setup creates at least two issues that requires alternative solutions to that posted in the Nebraska USDC hyperlink manual.

Problem 1: Clean Lexis Links

Solution: Use the Copy with Cite link from your Lexis case page to get a permalink to the document.

Pro Tip: Instead of the page number of the beginning of the opinion, you can use the page number for the pinpoint cite. So, instead of: “”, the last part becomes “347+Ark.+429″.

Explanation: For Lexis links, the tutorial suggests copying and pasting the link from the address bar in the browser; however, the tutorial also notes some attorneys have difficulty using this method. In looking at the url for a case I pulled up in Lexis, I can tell it will cause problems simply because it contains a lot of HTTP session information that will expire in a few hours.

The hyperlink needs a permanent link to the Lexis document. The workaround is to click the (Copy w/ Cite) link at the top of the Lexis page for your document. This will open a popup window. Make sure the Copy reference as hyperlink box is checked, and you can then click the text and copy the citation with the hyperlink embedded. Here’s a screenshot showing the Copy w/ Cite link and the popup:

When you paste into Word, you might have to click the little clipboard icon that pops up and select “Match destination formatting…”, like this:

You’ll need to work on the cite to get it in Bluebook format (de-bold and italicize the caption), unless your an anarchist. This will give you a permanent link to Lexis in your Word document.

Problem 2: Exporting Links to PDF

Solution: This requires a couple of different workarounds for me, as follows:

  • Upgrade Adobe Acrobat to version 2015 (this is the Document Cloud version).
  • Use File > Save As Adobe PDF… in Word 2011, not Word 2016 Preview.
  • Don’t put hyperlinks in footnotes for now.

Explanation: While reading through the Nebraska USDC tutorial, I saw that you can’t simply do a File > Print > Save as PDF from Word because it doesn’t preserve the links. I tried it, and sure enough, the links didn’t work. I also tried the Save as Adobe PDF from the File > Print > Save as… menu, but that didn’t work either. Finally, File > Save As… and selecting PDF was a dud too.

I found this Adobe support page discussing the link exportation issue. I wound up upgrading Adobe Acrobat to the latest version in order to able to embed links in a PDF created from Word. They now work in the body of the document, but not the footnotes. I like using footnotes for citations, but I’ll have to modify my behavior until this problem gets fixed.

Of the three ways to create the PDF from Word suggested on the Adobe forum, I could only get one to work. I figured out this is due to having the Office 2016 Preview installed on my computer. The File > Save as Adobe PDF link works in the 2011 version of Word, but the link between the programs appears to be broken in the 2016 preview.

Other Features…

According to the Nebraska USDC tutorial, you can link to particular documents previously filed in your case simply by inserting the link from the email you received when the document was filed.

The really cool feature, I think, is linking to documents you’re currently filing. I haven’t tried this yet. If you’ve been able to do it, or have discovered any issues with the process on a Mac, please drop me a line @chaneylawfirm on Twitter. We’d also appreciate a follow on our blog at Thanks for reading.

Enabling mcrypt for PHP

When working on database-intensive projects, like Intelection, I sometimes use phpMyAdmin. It’s capable of using mcrypt, which is cryptographic software. However, after upgrading to Mac OS X Mavericks, my mcrypt installation was broken. I kept getting an error on printed SQL reports, and the following image would appear on each screen:

Here’s how to fix it. First, install command line developer tools so that the proper PHP libraries are in place. Use this command:

xcode-select --install

Then, download and install autoconf, which is required to install the PHP extension for mcrypt:

cd /tmp
curl -O
tar -zxvf autoconf-latest.tar.gz
cd autoconf-2.69/
./configure --prefix=/usr/local
sudo make install

Next, install libmcrypt. You can download it from here. Use these commands to install:

cd /tmp
mv ~/Downloads/libmcrypt-2.5.8.tar.gz ./
tar -zxvf libmcrypt-2.5.8.tar.gz 
cd libmcrypt-2.5.8
sudo make install

The next step is to install the PHP mcrypt extension. In order to do that, you’ll need to download the correct PHP that you have installed on your system. To figure this out, run these commands:

which php --(mine showed /usr/bin/php)
/usr/bin/php -v

Go to PHP’s historical website and download the correct version. Mine’s 5.4.17. Then, install the extension:

cd /tmp
mv ~/Downloads/php-5.4.17.tar.gz ./
tar -zxvf php-5.4.17.tar.gz
cd php-5.4.17/ext/mcrypt/
sudo make install

Next, PHP must be configured to use the mycrpt extension. This is done by editing the php.ini file, as follows:

sudo vi /etc/php.ini

Use the following regular expression in vim to find the extension part of the file:


Add this line to the file:

extension =

Finally, restart the web server to commit the changes:

sudo apachectl restart

With that, mcrypt is working properly again with phpMyAdmin.

Perl, MySQL, and Mac OS X

I use MySQL, Perl, and PHP running on Mac OS X for various projects. When I install an operating system update, the Perl/MySQL link invariably breaks, as the packages necessary to connect the two aren’t installed on Mac OS X by default. Instead of googling the fix every time I update, I figured I’d post it here for future reference.

  1. Download and install XCode from Apple’s website (v.3.2.6) or the App Store.
  2. Download the header files for the built-in version of MySQL from Apple’s website (here’s a link to the support article for 10.6 Server). Note that this is installed using the command-line tool tar, rather than double-clicking the archive file you download.
  3. Run CPAN to install DBI and its dependencies by executing the command sudo perl -MCPAN -e ‘install DBI’ .
  4. Download a version of DBD::mysql and expand it to a source directory somewhere (such as ~/src/).
  5. Open the MySQL Support page “2.4.5. Using the Bundled MySQL on Mac OS X Server”, which identifies the locations of files in the bundled MySQL version that comes with Mac OS X Server.
  6. Execute perl Makefile.PL from the source directory mentioned above without any flags, which will give you the default settings. This will error out because the MySQL header file locations are wrong (this is why I haven’t been able to figure out how to use CPAN to install DBD::mysql).
  7. Execute perl Makefile.PL again, this time substituting the header file locations on the MySQL page referenced above for the —cflags, —lib, and —testsocket flags. Remember to copy the remaining system-dependent defaults for the —cflags and —lib flags. You may need to change other flags as well, depending on your installation. (For instance, on Mac OS X 10.6 server, the command I used was: perl Makefile.PL —cflags ‘-I/usr/include/mysql -fno-omit-frame-pointer    -pipe   -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT’ —libs=’-L/usr/lib/mysql -lmysqlclient -lz -lm’ —testuser=test —testsocket=’/var/mysql/mysql.sock’ “).
  8. Execute make, make test, and sudo make install as you normally would.

This should get MySQL and Perl talking to each other using the bundled Mac OS X MySQL package.