6

I've been trying to use acro for abbreviating terms in a report. It mostly works but each compile requires intervention to complete and does something to my first page, leaves an =1 and a page break. Any help would be greatly appreciated.

\documentclass[A4, 12pt]{article}

% for abbreviations and acronyms
\usepackage[first-style=long]{acro}

\DeclareAcronym{ma}{
  short = MA ,
  long  = Multiple Access ,
}

\DeclareAcronym{noma}{
  short = NOMA ,
  long  = Non-Orthongonal Multiple Access ,
}

% title info
\title{Beamforming for Millimeter-wave \acs{noma}}
\author{Cian Dowd}
\date{21/01/2019}

\begin{document}
\pagenumbering{roman}
\maketitle

% ABSTRACT
\begin{abstract}
    In this paper\ldots
\end{abstract}

% TABLE OF CONTENTS
\tableofcontents

% LIST OF ACRONYMS
\printacronyms

% INTRODUCTION
\pagenumbering{arabic}
\setcounter{page}{1}
\setcounter{section}{0}
\section{Introduction}
\ac{noma}\ldots


% LITERATURE REVIEW
\setcounter{section}{1}
\section{Background/ Literature Review}

% Background on Current MA
\subsection{Existing \acf{ma}}

\end{document}

This yields the following document; errors shown below it.

stray '1' page break body of Tex

I get these messages, ending with the errors:

(/usr/local/texlive/2016basic/texmf-dist/tex/latex/acro/acro.sty
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/l3kernel/l3pdfmode.def))
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
)
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e
.sty)
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/l3packages/xtemplate/xtempla
te.sty)
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/oberdiek/zref-abspage.sty
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/oberdiek/zref-base.sty
(/usr/local/texlive/2016basic/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)
(/usr/local/texlive/2016basic/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/local/texlive/2016basic/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(/usr/local/texlive/2016basic/texmf-dist/tex/generic/oberdiek/etexcmds.sty
(/usr/local/texlive/2016basic/texmf-dist/tex/generic/oberdiek/ifluatex.sty)))
(/usr/local/texlive/2016basic/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty)
 (/usr/local/texlive/2016basic/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
(/usr/local/texlive/2016basic/texmf-dist/tex/generic/oberdiek/ifpdf.sty))
(/usr/local/texlive/2016basic/texmf-dist/tex/latex/oberdiek/auxhook.sty))
(/usr/local/texlive/2016basic/texmf-dist/tex/generic/oberdiek/atbegshi.sty))
Runaway argument?
{\bool_if:NT \l__acro_sort_bool {\cs_new_protected:Npn \acro_sort_prop:NN \ETC.
! Forbidden control sequence found while scanning use of \g@addto@macro.
<inserted text> 
                \par 
l.2965                         = \c_minus_one

This corresponds to line 2965 of acro.sty, though I am not sure why nor do I know how to fix this issue. Relevant snippet of acro.sty below:

        \seq_sort:Nn \l__acro_tmpa_seq
          {
            \int_compare:nTF
              {
                \acro_strcmp:nn
                  { \str_fold_case:n {##1} }
                  { \str_fold_case:n {##2} }
                    = \c_minus_one
              }
              { \sort_return_same: }
              { \sort_return_swapped: }
          }
  • 1
  • @moewe Am I right in saying that recommends changing the contents of the file to a -1? Makes me a bit uncomfortable but I'll give it a go. Thanks! – BitFlow Jan 14 at 21:23
  • Directly editing acro.sty would be a last resort, but I can't find a more elegant work-around at the moment since \c_minus_one is used in an \AtBeginDocument hook, that does not quite lend itself to patching. – moewe Jan 14 at 21:30
  • @moewe I did that and it worked perfectly. Not ideal, as you said, but much appreciated. Thanks a lot. Care to write that as an answer? – BitFlow Jan 14 at 21:31
  • 1
    The bug 116 was fixed in acro 2.9 on 2019-02-17 – Jonas Stein Feb 17 at 15:49
6

The constant \c_minus_one was removed from LaTeX3 in the end-of-year deprecation round for 2018. acro.sty is still using it, though, and that causes issues with new versions of the LaTeX3 kernel. See https://bitbucket.org/cgnieder/acro/issues/116/acro-errors-due-to-update-c_minus_one.

You could manually edit acro.sty and change the \c_minus_one to -1. Keep in mind, however, that usually edits like this to distributed files are strongly discouraged. In this case the edit could be justified because the file is unusable without it and an updated version of acro.sty that would make the fix unnecessary would overwrite your fixed version.

You could also reinstate the command (similar to https://github.com/latex3/latex3/commit/c96faed90a5a63ba84695190560bdacac1dfdacc#diff-645783629830bdaaeede08f6ea12cb15) before acro is loaded.

\usepackage{expl3}
\ExplSyntaxOn
\tex_let:D \c_minus_one \scan_stop:
\int_const:Nn \c_minus_one {-1}
\ExplSyntaxOff

% for abbreviations and acronyms
\usepackage[first-style=long]{acro}

edit egreg kindly suggested a streamlined version of my original suggestion.

I guess the LaTeX3 team don't really want to see that either, so until acro gets fixed by the maintainer you are stuck with several bad options.

  • 2
    \tex_let:D \c_minus_one \scan_stop: and \int_const:Nn \c_minus_one {-1} is easier. – egreg Jan 29 at 17:08
  • @egreg Thanks for the suggestion. Edited it in. – moewe Jan 29 at 17:18
  • 3
    a fixed acro is on its way to CTAN – clemens Feb 17 at 17:31
  • @clemens this means we can entirely get rid of the additional code provided in this answer, right? or should we do anything else? – thymaro Feb 26 at 17:23
  • @clemens and the macro \c_one is less likely to be deprecated in a future deprecation round as \c_minus_one, correct? – thymaro Feb 26 at 17:25

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.