maelvls / homebrew-amc

🍺 Homebrew formula for auto-multiple-choice 📖
https://www.auto-multiple-choice.net/download-macosx.en
34 stars 10 forks source link

automultiplechoice.sty unavailable #7

Closed letsop closed 6 years ago

letsop commented 6 years ago

Hello I have installed amc and mactex with homebrew following your instructions and when I run the command sudo auto-multiple-choice latex-link I get the following problem and the command auto-multiple-choice tells that it does not find the automultiplechoice.sty file Thank you for your help Marie

postel@viso:~/Documents/Enseignement$ brew cask install mactex ==> Auto-updated Homebrew! Updated Homebrew from df1fb59d4 to 15f01bdd1. No changes to formulae.

Updating Homebrew... Warning: Cask 'mactex' is already installed.

To re-install mactex, run: brew cask reinstall mactex postel@viso:~/Documents/Enseignement$ sudo auto-multiple-choice latex-link Calling mktexlsr to refresh LaTeX files list... mktexlsr: Updating /opt/local/etc/texmf/ls-R... mktexlsr: Updating /opt/local/share/texmf/ls-R... mktexlsr: Updating /opt/local/share/texmf-local/ls-R... mktexlsr: Updating /opt/local/share/texmf-texlive/ls-R... mktexlsr: Updating /opt/local/var/db/texmf/ls-R... mktexlsr: Done. Creating link to AMC style file... Calling mktexlsr to refresh LaTeX files list... mktexlsr: Updating /opt/local/etc/texmf/ls-R... mktexlsr: Updating /opt/local/share/texmf/ls-R... mktexlsr: Updating /opt/local/share/texmf-local/ls-R... mktexlsr: Updating /opt/local/share/texmf-texlive/ls-R... mktexlsr: Updating /opt/local/var/db/texmf/ls-R... mktexlsr: Done. ERROR: Unsuccessful.

maelvls commented 6 years ago

Thanks for reaching out! Sorry for the unhelpful ERROR: Unsuccessful. message, we should change that for the next versions of AMC.

This error is probably linked to the "wrong" way of doing of latex-link before 1.3.0.2199. Before this version, I was symlinking to the current version of Homebrew, meaning that any brew upgrade auto-multiple-choice would break that symlink. Here is the wrong symlink:

$ ls -l $(kpsewhich -var-value=TEXMFLOCAL)/tex/latex/automultiplechoice.sty
Permissions Size User Date Modified Name
lrwxr-xr-x    90 root 16 Mar 23:42  /usr/local/texlive/2017basic/texmf-local/tex/latex/automultiplechoice.sty -> /usr/local/Cellar/auto-multiple-choice/1.3.0.2161/share/texmf-local/tex/latex/AMC/automultiplechoice.sty

The symlink points specifically to 1.3.0.2161; if I upgrade to some other versions, the symlink will break. Instead, a proper symlink would use the prefix /usr/local/opt/auto-multiple-choice (this is what is done during latex-link in 1.3.0.2199 an upper):

$ ls -l $(kpsewhich -var-value=TEXMFLOCAL)/tex/latex/automultiplechoice.sty
Permissions Size User Date Modified Name
lrwxr-xr-x    90 root 16 Mar 23:42  /usr/local/texlive/2017basic/texmf-local/tex/latex/automultiplechoice.sty -> /usr/local/opt/auto-multiple-choice/share/texmf-local/tex/latex/AMC/automultiplechoice.sty

TL;DR: if you see this weird ERROR: Unsuccessful. error, try to remove the symlink and run again latex-link:

sudo rm $(kpsewhich -var-value=TEXMFLOCAL)/tex/latex/automultiplechoice.sty
sudo auto-multiple-choice latex-link

Sorry again for the inconvenience!