# gb4e examples numbering in footnotes continuously

I used this code (without using the package chngcntr) to number my linguistic examples in the footnotes in roman. Now, I would like the example-numbering in the footnotes to be continuously, I don't want to start the numbering from (i) in each footnote, but to count the overall numbers of examples in footnotes (i), (ii), (iii), and so on. I am quite new in Latex and don't really know how to do this.

My minimal code looks like this:

\documentclass[a4paper,11pt]{scrartcl}
\usepackage{etoolbox}
\usepackage{gb4e}
\makeatletter
\pretocmd{\@footnotetext}{
\@noftnotefalse\setcounter{fnx}{0}%
\renewcommand{\thexnumi}{\roman{xnumi}}
}{}{}
\apptocmd{\@footnotetext}{
\@noftnotetrue
\renewcommand{\thexnumi}{\arabic{xnumi}}
}{}{}
\pretocmd{\@LTRfootnotetext}{
\@noftnotefalse\setcounter{fnx}{0}%
\renewcommand{\thexnumi}{\roman{xnumi}}
}{}{}
\apptocmd{\@LTRfootnotetext}{
\@noftnotetrue
\renewcommand{\thexnumi}{\arabic{xnumi}}
}{}{}
}
\makeatother

\begin{document}


Here's a slightly different version of the code. If you don't need the bidi code for RTL languages, you should just delete it.

\documentclass[a4paper,11pt]{scrartcl}
\usepackage{etoolbox}
\usepackage{gb4e}
\makeatletter
\patchcmd{\@footnotetext}{\setcounter{fnx}{0}}{\renewcommand{\thexnumi}{\roman{xnumi}}}{}{}
\apptocmd{\@footnotetext}{
\@noftnotetrue
\renewcommand{\thexnumi}{\arabic{xnumi}}%
}{}{}
% If you’re not using a Right-to-Left language you don’t need this code