LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Mon, 6 Feb 2012 11:19:33 +0000
Content-Type:
text/plain
Parts/Attachments:
text/plain (54 lines)
* dongen <[log in to unmask]> [2012-02-06 10:51:03 +0000]:

Hi again,


I think I found the cause of the problem. The following should
explain it.

\documentclass{article}
% too many includes here.
\usepackage{xparse}
\usepackage{expl3}
\usepackage{l3regex}
\usepackage{l3int}
\begin{document}

\ExplSyntaxOn

\tl_new:N \l_name_tl
\tl_set:Nn \l_name_tl {f}
\tl_new:N \l_expr_tl
\tl_set:Nn \l_expr_tl {f{i}}

% uncomment and (only) and this works.
% \cs_new_nopar:cpx { \l_name_tl :n } #1{}

\noindent before:(\tl_use:N \l_expr_tl)\par
and:(\tl_use:N \l_name_tl)\par

\regex_replace_all:nnN {\b\u{l_name_tl}\b}
                       {\c{\u{l_name_tl}:n}}
                       \l_expr_tl

after(\tl_use:N \l_expr_tl)

% uncomment and (only) and this won't work.
% \cs_new_nopar:cpx { \l_name_tl :n } #1{}

\end{document}

In the equivalent of my recurrence equations implementation, the
macro \f:n is defined _after_ the substitution. The error complains
about \f:n not being defined. Defining \f:n _before_ the substitution
works fine. 

In my recurrence equation implementation, defining \f:n _after_ the
substitution is possible, but it requires a bit more work. Does \f:n
have to be known at substitution time?

Regards,


Marc

ATOM RSS1 RSS2