1

UPDATE (MWE):

Tracked the error down independently from the template. Apparently it occurs as soon as I try to add a table of contents:

preamble.texcontains:

\usepackage{acro}

test_acro.md contains:

\tableofcontents

\DeclareAcronym{api}{
  short = API,
  long = Application Programming Interface,
}

\printacronyms

\ac{api} is an abbreviation.

running

pandoc test_acro.md -o test_acro.pdf -H preamble.tex

throws

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! LaTeX error: "kernel/command-already-defined"
! 
! Control sequence \g__acro_api_in_list_bool already defined.
! 
! See the LaTeX3 documentation for further information.
! 
! For immediate help type H <return>.
!...............................................  

l.66 }

ignore from here

Sorry for not having a minimal working example, but I'm rather trying to get a hint what's going wrong than a readymade solution.

I'm using https://github.com/tompollard/phd_thesis_markdown as a template for pandoc.

My makefile has been altered by me to use some additional filters (pandoc-shortcaption and pandoc-crossref).

After having included

\usepackage{acro}}

in the style/template.tex

and for testing

\DeclareAcronym{api}{
  short = API,
  long = Application Programming Interface,
  class = abbreviation
}

\printacronyms[include-classes=abbreviation, name=Abbreviations, 
heading=chapter, sort=false]

\ac{api} ist eine Abkuerzung.

in source/*abbreviations.md, I get:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! LaTeX error: "kernel/command-already-defined"
! 
! Control sequence \g__acro_api_in_list_bool already defined.
! 
! See the LaTeX3 documentation for further information.
! 
! For immediate help type H <return>.
!...............................................  

l.279 }

pandoc: Error producing PDF
pandoc.log (END)

Any idea what's going on here? I've read about people using the acro package with pandoc without problems.

  • This phd_thesis_markdown is quite a huge project. Please make a minimal working example (MWE) which reproduces you problem – Henri Menke Jun 19 '17 at 3:36
  • That's exactly my problem. If I could see where the error comes from I'd be already one step further. – Felix Victor Münch Jun 19 '17 at 4:14
  • You track it down, we solve it. That's the deal here. Nobody is going to waste their time on this. – Henri Menke Jun 19 '17 at 4:32
  • 1
    @HenriMenke Thanks for wasting your time on clarifying this. See above for the MWE I've found in the meantime. Any clue what's going on? – Felix Victor Münch Jun 19 '17 at 7:40
1

Completing your code fragment

\tableofcontents

\DeclareAcronym{api}{
  short = API,
  long = Application Programming Interface,
}

\printacronyms

\ac{api} is an abbreviation.

Into a real MWE:

\documentclass{article}
\usepackage{acro}
\begin{document}
\tableofcontents

\DeclareAcronym{api}{
  short = API,
  long = Application Programming Interface,
}

\printacronyms

\ac{api} is an abbreviation.
\end{document}

produces the error and shows the problem: the declaration of the acronyms should be made in the preamble!

\documentclass{article}
\usepackage{acro}

\DeclareAcronym{api}{
  short = API,
  long = Application Programming Interface,
}

\begin{document}
\tableofcontents

\printacronyms

\ac{api} is an abbreviation.
\end{document}
| improve this answer | |
  • The question is about pandoc generated LaTeX, but the problem is similar I guess. – Henri Menke Jun 19 '17 at 7:59
  • It's a working example, even if it's not minimal because still using pandoc and it's templates. That I couldn't see that it has nothing to do with pandoc was obviously part of my problem. So from my perspective it was an MWE. Thanks anyway, solved the problem! – Felix Victor Münch Jun 19 '17 at 8:01
  • @HenriMenke In the end it must be the same document however the LaTeX code is generated, no? There surely must be a separation of preamble and document… – cgnieder Jun 19 '17 at 8:05
  • @clemens Yes, it is the same problem. I've edited my filename for the preamble in my question to make this answer easier to understand and apply for other pandoc users. – Felix Victor Münch Jun 19 '17 at 8:06

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.