Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{book}
- usepackage[utf8]{inputenc}
- usepackage[T1]{fontenc}
- usepackage[english]{babel}
- usepackage[]{reledmac}
- usepackage{xstring}
- %%% A dummy macro
- newcommand{mymacroA}[1]{textbf{#1}}
- newcommand{morenoexpands}{%
- letmymacroArelax
- }%
- makeatletter
- newcommand{truncatelemma}[1]{%
- begingroup%
- morenoexpands%
- normalexpandarg%
- StrCount{#1}{ }[@numspaces]%
- ifnum@numspaces>5%
- noindentignorespaces%
- StrBefore[3]{#1}{ }%
- ldots{} %
- StrBehind[numexpr@numspaces-2relax]{#1}{ }%
- else%
- noindentignorespaces%
- #1%
- fi%
- endgroup%
- }%
- Xwraplemma[A]{truncatelemma}
- deffootnoteAnmerkung{@ifstar@footnoteAnmerkung@@footnoteAnmerkung}
- newcommand{@@footnoteAnmerkung}[3][]{%
- ifcsdef{lemmastart#1}%
- {xdef@tempA{#2}%
- %%% xpreto vs. gpreto
- gpreto{@tempA}{csuse{lemmastart#1} }%
- #2%
- edtext{}{%
- expandafterlemmaexpandafter{@tempA}%
- Afootnote{noindentignorespacescsuse{anmtext#1}}%
- }%
- }%
- {edtext{#2}{%
- Afootnote{noindentignorespaces#3}%
- }%
- }%
- }%
- newcommand{@footnoteAnmerkung}[3][]{%
- ifstrempty{#1}%
- {% ERROR
- }%
- {%
- #2%
- csgdef{lemmastart#1}{#2}%
- csgdef{anmtext#1}{#3}%
- }%
- }%
- makeatother
- begin{document}
- beginnumbering
- autopar
- This is footnoteAnmerkung*[N1]{almost the same text}{now we have a
- split note} with some text in between and footnoteAnmerkung[N1]{to show the
- problem with expansion}{}. That's it.
- %% Not working with xpreto above
- This is footnoteAnmerkung*[N1]{almost mymacroA{the same} text}{now we have a
- split note} with some text in between and footnoteAnmerkung[N1]{to show the
- problem with expansion}{}. That's it.
- endnumbering
- end{document}
Add Comment
Please, Sign In to add comment