This question is related to TikZ: pgfutil-common: pgfutil@in@ - how does it work? and is a result of coping with that problem. I've already read How to change the catcode in a macro, but it didn't help me.
So, here is minimalistic example of what I have. Play with \makeatletter ... \makeatother inside document environment.
\documentclass{article}
\usepackage{tikz}
% Consider start of library here (this part is located in a separate file included by means of `\usetikzlibrary`).
\makeatletter
\def \myparse #1{%
\def \myparse@ ##1 @ ##2\pgf@stop{%
\def \beforeat{##1}%
\def \afterat{##2}%
}
%
\def \tikz@temp{#1}%
%
\def \beforeat{false before}%
\def \afterat{false after}
\edef \pgf@marshal{\noexpand \pgfutil@in@{@}{\tikz@temp}}%
\pgf@marshal \ifpgfutil@in@%
\expandafter \myparse@ \tikz@temp\pgf@stop%
\fi%
}
\makeatother
% Consider end of library here.
% User's file starts here.
\begin{document}
\makeatletter % Play with commenting out this line.
\myparse{true before @ true after}
\makeatother % and this one.
\beforeat\par
\afterat\par
\end{document}
I'd like to eliminate the need in \makeatletter ... \makeatother in user's file, while remaining usage of @ symbol.
\lowercase{\endgroup\def\test#1*}{stuff}%thenstuffis not changed by\lowercaseso you can also have uppercase content. – Martin Scharrer May 04 '11 at 19:13\begingroup,\endgrouphere? I tried to remove them, and it still works fine. – Dmitrii Volosnykh May 04 '11 at 19:56\lccodeis localised. Normally, the lower case equivalent of*is 'no change', which is what most people would expect. Try doing\lowercase{*}after the code with and without the group and see the difference. – Joseph Wright May 04 '11 at 20:00