[Tex/LaTex] Unable to get abc package to work on windows

music

I am trying to typeset some music in Latex. I will likely only need to do this once, so the relatively simple syntax of abc seemed perfect. Except that I cannot get it to work.

I have installed the abc package. I set the –shell-escape option for pdflatex, and I managed to install abcm2ps. I get the error that "ps2eps" cannot be found. I found ps2eps online, but one needs Pearl or C to install it, and both of them are far outside my expertise.

Do you have any idea how I could get abc to work? I use winedt on Windows 7, and MikTeX 2.9.

Unfortunately, the comments on this Stackexchange post did not solve the problem.

Here is some code that I would like to run (from https://martin-thoma.com/how-to-write-music-with-latex/):

\documentclass[a4paper]{article}
\usepackage{abc}

\begin{document}
    You can create music sheets within the abc-environment:
    \begin{abc}[name=c-dur]
        X: 1 % start of header
        K: C % scale: C major
        "Text"c2 G4 | (3FED c4 G2 |
    \end{abc}
\end{document}

Thank you for your help!

Edit: Here is what the winedt's console gives as the error message:
(The German "Der Befehl "ps2eps" ist entweder falsch geschrieben oder
konnte nicht gefunden werden." means that the command "ps2eps" is either spelled wrongly or cannot be found. I have no idea why that part is in German – winedt and miktex are in English, but windows is in German on my pc.)

Command Line:   pdflatex.exe --shell-escape --interaction=errorstopmode --synctex=-1 "beispiel_abc.tex" 
Startup Folder: C:\Users\wwa722\Dropbox\Hochzeit\Ablauf Kirche
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9 64-bit)
entering extended mode
(beispiel_abc.tex
LaTeX2e <2016/03/31> patch level 1
Babel <3.9r> and hyphenation patterns for 75 language(s) loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size12.clo"))
(C:\Users\wwa722\AppData\Roaming\MiKTeX\2.9\tex\latex\abc\abc.sty
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifluatex.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\tools\verbatim.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphicx.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphics.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\trig.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\00miktex\graphics.cfg")
("C:\Program Files\MiKTeX 2.9\tex\latex\pdftex-def\pdftex.def"
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty")
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"))))
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifpdf.sty"))
("C:\Program Files\MiKTeX 2.9\tex\latex\psnfss\mathptmx.sty")
No file beispiel_abc.aux.
("C:\Program Files\MiKTeX 2.9\tex\latex\psnfss\ot1ptm.fd")
(C:\Users\wwa722\AppData\Roaming\MiKTeX\2.9\tex\context\base\supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) ("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\pdftexcmds.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\epstopdf-base.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\grfext.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\kvdefinekeys.sty"))
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\kvoptions.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\kvsetkeys.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\etexcmds.sty"))))
("C:\Program Files\MiKTeX 2.9\tex\latex\psnfss\ot1ztmcm.fd")
("C:\Program Files\MiKTeX 2.9\tex\latex\psnfss\omlztmcm.fd")
("C:\Program Files\MiKTeX 2.9\tex\latex\psnfss\omsztmcm.fd")
("C:\Program Files\MiKTeX 2.9\tex\latex\psnfss\omxztmcm.fd")abcm2ps-8.12.1         (August 5, 2016)
File out-abc.abc
Output written on out-abc.ps (1 page, 1 title, 24453 bytes)
Der Befehl "ps2eps" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

Sorry, but epstopdf did not succeed for the following reason:

  The input file does not exist.

The log file hopefully contains the information to get MiKTeX going again:

  C:/Users/wwa722/AppData/Local/MiKTeX/2.9/miktex/log/epstopdf.log

You may want to visit the MiKTeX project page, if you need help.
abcm2ps-8.12.1 (August 5, 2016)
File jacky.abc
Output written on jacky.ps (1 page, 1 title, 24894 bytes)
Der Befehl "ps2eps" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

Sorry, but epstopdf did not succeed for the following reason:

  The input file does not exist.

The log file hopefully contains the information to get MiKTeX going again:

  C:/Users/wwa722/AppData/Local/MiKTeX/2.9/miktex/log/epstopdf.log

You may want to visit the MiKTeX project page, if you need help.
 [1{C:/Users/wwa722
/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}]

Package abc Warning: You have set the `shellescape' option, but you ran
(abc)                (pdf)latex without the `-shell-escape' command line
(abc)                option. Fix it either with the `noshellescape' option
(abc)                in your document or the correct call of (pdf)latex.

(beispiel_abc.aux) ){C:/Program Files/MiKTeX     2.9/fonts/enc/dvips/fontname/8r.en
c}<C:/Program Files/MiKTeX 2.9/fonts/type1/urw/times/utmr8a.pfb>
Output written on beispiel_abc.pdf (1 page, 15252 bytes).
SyncTeX written on beispiel_abc.synctex.
Transcript written on beispiel_abc.log.


_____________________________________________________________________

 PDFLaTeX Compilation Report (Pages: 1)

 Errors: 0   Warnings: 2   Bad Boxes: 0
_____________________________________________________________________

Best Answer

Here you go. Yes, PS not building is your problem. I am using Ubuntu, and had similar/many issues. Now it works.

  • First, I installed the abcm2ps package on Ubuntu.
  • Next, forget about that sample file from Thoma. Unless, you want to switch to other musical-TeX?
  • Next, duplicate these two files in, Chapter 5 of "example file" from the abc package PDF. Link here.
  • Then, with those two files: abc2.tex & poll.abc, I ran.

    1: latex --shell-escape abc3 (Have to run this first!)

    2: pdflatex --shell-escape abc3

No errors. What happened to ps2eps issue? I see - this in my messages.

[Loading MPS to PDF converter (version 2006.09.02).]

gt7@perseus:~/...../3side$
$ pdflatex abc2
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./abc2.tex
LaTeX2e <2016/02/01>
Babel <3.9q> and hyphenation patterns for 81 language(s) loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo))
(/usr/share/texlive/texmf-dist/tex/latex/abc/abc.sty
(/usr/share/texlive/texmf-dist/tex/latex/tools/verbatim.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/graphics.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/pdftex-def/pdftex.def
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty))))
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty))
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/mathptmx.sty) (./abc2.aux)
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/ot1ptm.fd)
(/usr/share/texlive/texmf-dist/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty))
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty))
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty)))
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/ot1ztmcm.fd)
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/omlztmcm.fd)
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/omsztmcm.fd)
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/omxztmcm.fd)
<out-abc.pdf, id=1, 513.92pt x 243.91125pt> <use out-abc.pdf>
<jacky.pdf, id=2, 513.92pt x 246.9225pt> <use jacky.pdf> [1{/var/lib/texmf/font
s/map/pdftex/updmap/pdftex.map} <./out-abc.pdf> <./jacky.pdf>] [2] (./abc2.aux)
 ){/usr/share/texlive/texmf-dist/fonts/enc/dvips/base/8r.enc}</usr/share/texliv
e/texmf-dist/fonts/type1/urw/times/utmr8a.pfb>
Output written on abc2.pdf (2 pages, 39682 bytes).
Transcript written on abc2.log.

----> New Sample Input file: abc3.tex

\documentclass[a4paper,12pt]{article}
\usepackage[generate,ps2eps]{abc}
\begin{document}
\title{Example of ABC Plus in \LaTeX{}}
\author{Myself}
\date{}
\maketitle
You can create music sheets within the abc-environment:
\medskip

\begin{abc}
X:1 % comment
K:C % comment
"Text"c2 G4 | (3FED c4 G2 |
\end{abc}
\end{document}

===============

Part 2.

  • Yep, I was wrong. Created this sample file, closer to your first one.

  • Secret is, you need to run by latex command first. (latex --shell-escape abc3) You should have that also with a full MiKTeX installation.

  • Once, it makes the EPS (out-abc.eps) from the PS (out-abc.ps) run. Then you are home clear. (I presume you have installed the "abcm2ps" package, also. That is the app being called to make the PS - I presume?)
  • If that doesn't click. Then, your out of luck, sorry. (*) Get a Knoppix DVD with full LaTeX on it. Or find a friend with Linux and LTX; is all I can recommend.

  • Next. When the out-abc.ps & out-abc.eps files appear?, from "latex --shell-escape" running. It will then produce the EPS output files. Re-running with any latex build-latex processors then works.

# This clears the EPS built files, to test this bugger truly runs?

rm -v out-abc.eps out-abc.ps

# You have to run it, this way: first time. Once builds the EPS. All else works on Ubuntu.

latex --shell-escape abc3

dvips -o abc3.ps abc3.dvi

ps2pdf abc3.ps

# Creates one version of the PDF output.

pdflatex --shell-escape --interaction=errorstopmode --synctex=-1 abc3

# When I run this now, (pdflatex) creates a 2nd bit smaller PDF & abc3.synctex output file.

  • Replace abc3 with beispiel_abc, for your work.

Thats all I got, man

Related Question