4

can I use MusixTex with beamer class? It doesn't work for me, only with article. With beamer there are a lot of errors (more then 50). Thanks for advice.

This is without errors:

\documentclass{article}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[czech]{babel}
\usepackage{musixtex}

\begin{document}

\begin{music}
\startextract
\NOtes\qu{ad}\en%
\endextract
\end{music}

\end{document}

This is with 53 errors:

\documentclass{beamer}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[czech]{babel}
\usepackage{musixtex}

\begin{document}

\begin{music}
\startextract
\NOtes\qu{ad}\en%
\endextract
\end{music}

\end{document}

I am using TeXnic Center 2.0

edited. Sorry about that guys.

6
  • Welcome to TeX.sx! Apr 8 '13 at 8:38
  • Can you show a minimal working example (MWE) of a document that goes wrong? Can you tell what TeX distribution you're using?
    – egreg
    Apr 8 '13 at 8:48
  • 2
    You have reported the same example twice. However, adding \usepackage{etex} just below \documentclass{beamer} should solve the issue.
    – egreg
    Apr 8 '13 at 9:02
  • @egreg so now you don't need to compile with etex but you need to load the package? Do you mind if I add this to my answer?
    – Old Nick
    Apr 8 '13 at 9:08
  • I love you egreg, it really works :-D Apr 8 '13 at 9:10
5

It should work out of the box. From Beamer User Guide, pag.18:

When using MusiXTEX to typeset musical scores, you have to have eTEX extensions enabled. Most modern distributions enable that by default both in pdpdflatex and latex. However, if you have an older distribution, the document must be compiled with pdfelatex or elatex instead of pdflatex or latex. Inside a music environment, the \pause is redefined to match MusiXTEX’s definition (a rest during one quarter of a whole). You can use the \beamerpause command to create overlays in this environment

However, as egreg noted, you still need to load the etex package in the preamble so that the etex extension can be used.

3
  • There's no separate pdfelatex binary any more. The most recent version of Beamer's documentation talks about pdfelatex only in relation to older TeX distributions.
    – egreg
    Apr 8 '13 at 8:46
  • Yes, I qupted an older version and referenced the latest (I'll update the text)... So it should work out of the box, right?
    – Old Nick
    Apr 8 '13 at 8:51
  • It should. The distinction between pdflatex and pdfelatex has been dropped years ago.
    – egreg
    Apr 8 '13 at 8:55
1

For me works well with Beamer, compile with 3-passing:

pdflatex example.tex
musixflx example
pdflatex example.tex
pdflatex example.tex

An example is below. I write especially for guitar songs. You don't need so many packages and can keep those you want.

\documentclass[aspectratio=169]{beamer}
\usepackage{CJKutf8}
\usepackage{xspace}
\usepackage{musixguit}
\input musixtex
\input musixbm
\input musixcho
\input musixdat
\input musixext
\input musixgre
%\input musixgui
\input musixlit
\input musixltx % \tx command
\input musixper
\input musixplt  %  Palatino text in music
\newcommand\Red{\color{red}}

\beamertemplatenavigationsymbolsempty
\setbeamertemplate{frametitle}[default][center]
\setbeamertemplate{headline}{\vskip10pt}
\addtobeamertemplate{frametitle}{}{\vspace{-1.5em}} % decrease

%----------TAB-----------
\newcommand\TAB[1]{%
  \setclefsymbol{#1}{\,\rotatebox{90}{TAB}}%
  \setclef{#1}9}

% internal string choosing command
%  #1: string (a number from 1--6)
%  #2: finger
\makeatletter
\newcommand\@str[2]{%
  \ifcase#1\relax\@strerror
  \or\def\@strnr{-1}%
  \or\def\@strnr{1}%
  \or\def\@strnr{3}%
  \or\def\@strnr{5}%
  \or\def\@strnr{7}%
  \or\def\@strnr{9}%
  \else\@strerror
  \fi
  \zchar\@strnr{\footnotesize#2}}
% \@strerror could be defined to issue some warning/error

% User level commands
\newcommand\STr[2]{\@str{#1}{#2}\sk}  % with a full note skip
\newcommand\Str[2]{\@str{#1}{#2}\hsk} % with a half note skip
\newcommand\str[2]{\@str{#1}{#2}}     % with no skip
%--------TAB--------------

\begin{document}
\begin{CJK}{UTF8}{gbsn} %\begin{CJK}{UTF8}{gkai}


\begin{frame}[allowframebreaks]{我已经与基督同钉十字架}
\framesubtitle{加2:20}

\begin{music}
\input musixlyr
\nostartrule
\setlength\parindent{0pt}%
\instrumentnumber{1} % a single instrument
%\setinterinstrument={-1}
%\nobarnumbers
\setlyrics1{我 已 经 与 基 督 同 钉 十 字 架,
现 在 活 着 的 \empty{} 不 再 是 我,
乃 是 基 督 在 我 里 面 活 \empty{} 着;
乃 是 基 督 在 我 里 面 活 \empty{} 着;
并 且 我 如 今 在 肉 身 活 着,
是 因 信 神 的 儿 子 而 \empty{} 活;
他 是 爱 我, 为 我 舍 己,
他 是 爱 我, 为 我 舍 己。}
\generalmeter{\meterfrac44}
\scale{1.0}
\generalsignature{0}
\setsongraise1{-4mm}
\assignlyrics1{1}
\normalmusicsize

\stafftopmarg25pt\staffbotmarg3\Interligne\interstaff{10}\relax
\startpiece
\znotes\loffset{2.2}{\verses{\lyric*{}}}\en
%\hardspace{4mm} %horizental
\Notesp\ibu0g1\qbp0g%
\roff{\tbbu0\tqh0h}\en
\Notesp\ibu0g{-2}\qbp0g%
\roff{\tbbu0\tqh0e}\en
\NOtesp\qap c\en
\Notes\ca j\en
\bar % 1
\Notesp\ibu0i{-1}\qbp0i%
\roff{\tbbu0\tqqh0h}\en
\Notesp\ibu0j{-3}\qbp0j%
\roff{\tbbu0\tqqh0h}\en
\NOTes\ha g\en
\bar % 2 
\Notesp\ibu0g1\qbp0g%
\roff{\tbbu0\tqh0h}\en
\Notesp\ibu0g{-2}\qbp0g%
\roff{\tbbu0\tqh0e}\en
\NOtesp\islurd0{c}\qup c\tslur0d\cu e\en
\bar
\Notes\qa d\en
\Notesp\ibu0d{1}\qbp0d%
\roff{\tbbu0\tqh0e}\en
\NOTes\ha d\en
\alaligne % line 1
\Notesp\ibu0g1\qbp0g%
\roff{\tbbu0\tqh0h}\en
\Notesp\ibu0g{-2}\qbp0g%
\roff{\tbbu0\tqh0e}\en
\NOtesp\qap c\en
\Notes\ca j\en
\bar
\Notesp\ibu0i{1}\qbp0i%
\roff{\tbbu0\tqqh0j}\en
\Notesp\islurd0k\ibu0k{-1}\qbp0k%
\roff{\tslur0j\tbbu0\tqqh0j}\en
\NOTes\ha h\en
\bar
\Notesp\ibu0i{1}\qbp0i%
\roff{\tbbu0\tqqh0j}\en
\Notesp\ibu0j{-1}\qbp0j%
\roff{\tbbu0\tqqh0h}\en
\Notes\ca g\en
\NOtesp\qap j\en
\bar
\Notesp\ibu0e{1}\qbp0e%
\roff{\tbbu0\tqqh0f}\en
\Notesp\islurd0k\ibu0k{-1}\qbp0k%
\roff{\tslur0j\tbbu0\tqqh0j}\en
\NOTes\ha c\en
%\alaligne% line 2
\alapage
\Notesp\ibu0g0\qbp0g%
\roff{\tbbu0\tqqh0g}\en
\NOTes\ha h\en
\Notesp\ibu0e{1}\qbp0e%
\roff{\tbbu0\tqqh0g}\en
\bar
\Notesp\ibu0f{-1}\qbp0f%
\roff{\tbbu0\tqqh0e}\en
\Notesp\ibu0f{-2}\qbp0f%
\roff{\tbbu0\tqqh0d}\en
\NOTes\ha d\en
\bar
\Notesp\ibu0d0\qbp0d%
\roff{\tbbu0\tqqh0d}\en
\NOTes\ha i\en
\Notesp\ibu0f{2}\qbp0f%
\roff{\tbbu0\tqqh0h}\en
\bar
\Notesp\ibu0g{-1}\qbp0g%
\roff{\tbbu0\tqqh0f}\en
\Notesp\islurd0g\ibu0g{-1}\qbp0g%
\roff{\tslur0f\tbbu0\tqqh0f}\en
\NOTes\ha e\en
\alaligne % line 3
\Notesp\ibu0g0\qbp0g%
\roff{\tbbu0\tqqh0g}\en
\NOTes\ha l\en
\NOtes\qa j\en
\bar
\Notesp\ibu0i{1}\qbp0i%
\roff{\tbbu0\tqqh0j}\en
\NOtes\qa k\en
\NOTes\ha h\en
\bar
\NOtesp\qap i\en
\Notes\ca h\en
\Notes\ca g\en
\NOtesp\qap j\en
\bar
\NOtes\qa k\en
\NOtes\qa j\en
\Notes\ca i\en
\NOtesp\qap j\en
\Endpiece
\end{music}

\end{frame}

\end{CJK}
\end{document}

enter image description here enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.