Skip to content

Instantly share code, notes, and snippets.

@moewew
Last active November 18, 2018 06:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moewew/90f5a487685014daee58617d37a9a571 to your computer and use it in GitHub Desktop.
Save moewew/90f5a487685014daee58617d37a9a571 to your computer and use it in GitHub Desktop.
\documentclass{article}
\newcounter{a}
\newcounter{b}
\makeatletter
\@addtoreset{a}{chapter}%
\@addtoreset{b}{chapter}%
\makeatletter
\begin{document}
Lorem
\end{document}
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{listings}
\newcounter{a}
\newcounter{b}
\newtcbinputlisting[use counter=a, number within=chapter]{\inputverba}[1]{listing file={#1}}
\newtcbinputlisting[use counter=b, number within=chapter]{\inputverbb}[1]{listing file={#1}}
\usepackage{filecontents}
\begin{filecontents*}{sample.x}
Lorem
\end{filecontents*}
\begin{document}
\inputverba{sample.x}
\inputverbb{sample.x}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment