Skip to content

Instantly share code, notes, and snippets.

@dsoares
Last active March 16, 2018 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsoares/5399fb524201c0a7a8281675775a1173 to your computer and use it in GitHub Desktop.
Save dsoares/5399fb524201c0a7a8281675775a1173 to your computer and use it in GitHub Desktop.
Installing AMC development version on Mac OS X Sierra

Installing AMC development version on macOS

This document is based on this instructions: Installing AMC development version on macOS

UPDATE 2018-03-15

Comments were added to this gist with a method to install AMC with Homebrew. To choose your best installation option, please read them before installation.

Prerequisites

  • XQuartz: OK!
  • MacPorts: OK!
  • Linux Libertine font: download, unzip, and move the OTF files into "/Library/Fonts" folder.
  • DejaVu font family: not needed (japanese documentation generation).

Instruct MacPorts to use our own local port files

  1. Create a local folder for MacPorts.

     mkdir -p ~/nix
    
  2. Edit the file "/opt/local/etc/macports/sources.conf" with nano or vim:

     nano /opt/local/etc/macports/sources.conf
     or
     vim /opt/local/etc/macports/sources.conf
    
  3. and add the line "file://....":

     file:///Users/slopes/nix/macports
     rsync://rsync.macports.org/release/tarballs/ports.tar [default]
    
  4. Download "http://project.auto-multiple-choice.net/attachments/download/1148" and unzip it into ~/nix.

     curl -o amc.zip "http://project.auto-multiple-choice.net/attachments/download/1148"
     unzip amc.zip macports/* -d ~/nix/
    

Installing AMC

  1. Uninstall any previous installation of AMC:

     sudo port uninstall auto-multiple-choice
    
  2. Generate the index of our local MacPorts folder.

     cd ~/nix/macports
     portindex
    
  3. Install the pdftk port. (not needed with an external TeX installation)

     sudo port install pdftk
    
  4. Edit the /opt/local/etc/macports/macports.conf file to add the following line:

     binpath                 /opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin
    
  5. Increase the limit of max number of open files:

     ulimit -n 2048
    
  6. Install dblatex.

     sudo port install dblatex -latex
    
  7. Install AMC.

     sudo port install auto-multiple-choice-devel -latex
    

NOTE: when installing auto-multiple-choice, there was a dependency error. The problem seems to me to be is this: ​https://lists.macosforge.org/pipermail/macports-users/2016-April/040851.html

There, I suggested that we might be opening one (or more) file descriptor(s) for each dependency to be installed, and then by the time we want to fetch the files, we don't have any remaining file descriptors to do so.

The workaround suggested is to manually install one (or more) of the dependencies (listed on the "Dependencies to be installed " line) first.

Increasing the limit of max number of open files is a much better solution, so go for it:

    ulimit -n 2048

And now it works!

    sudo port install auto-multiple-choice-devel -latex
@dsoares
Copy link
Author

dsoares commented Jan 7, 2017

Those new instructions were written in the beggining of January 2017.
See http://project.auto-multiple-choice.net/boards/1/topics/4866?r=4894#message-4894

Also, i did a sudo port uninstall installed instead of sudo port uninstall auto-multiple-choice to start a fresh installation of every package.

@dsoares
Copy link
Author

dsoares commented Mar 15, 2018

UPDATE: 2018-03-15

Install AMC with Homebrew

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    brew install maelvalais/amc/auto-multiple-choice
  • Install Linux Libertine font and copy the files to /Library/Fonts to enable XQuartz to see them:
    brew cask install caskroom/fonts/font-linux-libertine
    cp /Users/USER/Library/Fonts/LinLibertine_* /Library/Fonts/
  • After installation, create the automultiplechoice.sty file with:
    sudo auto-multiple-choice latex-link

In the end, you will have the file in /usr/local/texlive/texmf-local/tex/latex/automultiplechoice.sty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment