Hello, I try to create a macro for processing a document tagged with some non-standard tags, like: \TAGc The title of this chapter \TAGs Here starts a new section with a lot of bla bla bla text. More bla bla. And yet another piece of bla bla. To process the tags I have defined some macro's, like this one: \def\TAGc#1 {\dosomething{#1} % the \dosomething has to do with fonts etc. \dosomethingelse} However, when I typeset the document this macro only works with the first word of the line tagged with \TAGc. Is it possible to tell the macro to process the whole line? (changing my source document is no option.) Many thanks, Jelle
On Thu, 28 Jun 2007, Jelle Huisman wrote:
Hello,
I try to create a macro for processing a document tagged with some non-standard tags, like:
\TAGc The title of this chapter \TAGs Here starts a new section with a lot of bla bla bla text. More bla bla. And yet another piece of bla bla.
Do you have a blank line between the two lines? If so, see below.
To process the tags I have defined some macro's, like this one:
\def\TAGc#1 {\dosomething{#1} % the \dosomething has to do with fonts etc. \dosomethingelse}
However, when I typeset the document this macro only works with the first word of the line tagged with \TAGc. Is it possible to tell the macro to process the whole line? (changing my source document is no option.)
Have a look at \dowithpargument. Here is a snippet from one of my documents. \def\TAGc{\dowithpargument\doTAGc} \def\doTAGc#1% {Whatever you want with #1} After this \TAGc ABC \par and \TAGc{ABC} both work. You can replace \par with an explicit empty line. So, if you have an empty line after each TAGc, the above will work. Aditya
On Thu, 28 Jun 2007, Aditya Mahajan wrote:
On Thu, 28 Jun 2007, Jelle Huisman wrote:
Hello,
I try to create a macro for processing a document tagged with some non-standard tags, like:
\TAGc The title of this chapter \TAGs Here starts a new section with a lot of bla bla bla text. More bla bla. And yet another piece of bla bla.
Do you have a blank line between the two lines? If so, see below.
To process the tags I have defined some macro's, like this one:
\def\TAGc#1 {\dosomething{#1} % the \dosomething has to do with fonts etc. \dosomethingelse}
However, when I typeset the document this macro only works with the first word of the line tagged with \TAGc. Is it possible to tell the macro to process the whole line? (changing my source document is no option.)
Have a look at \dowithpargument. Here is a snippet from one of my documents.
Duh. I changed the snippet from my code, and forgot to edit the previous line.
\def\TAGc{\dowithpargument\doTAGc}
\def\doTAGc#1% {Whatever you want with #1}
After this \TAGc ABC \par and \TAGc{ABC} both work. You can replace \par with an explicit empty line. So, if you have an empty line after each TAGc, the above will work.
Aditya
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
-- Aditya Mahajan | EECS Systems, University of Michigan http://www.eecs.umich.edu/~adityam | Ph: 734.262.4008
Do you have a blank line between the two lines? If so, see below. No, I don't have a blank line. (well, I can change my test file, but
To process the tags I have defined some macro's, like this one:
\def\TAGc#1 {\dosomething{#1} % the \dosomething has to do with fonts etc. \dosomethingelse}
However, when I typeset the document this macro only works with the first word of the line tagged with \TAGc. Is it possible to tell the macro to process the whole line? (changing my source document is no option.)
Have a look at \dowithpargument. Thank you for this hint and your example. I see in the source browser
Hello Aditya, that is not the solution I am looking for.) that there is also an \dowithwargument, so I think I am looking for something like \dowithlargument (with l for line). Any idea's how to do that? Jelle
participants (2)
-
Aditya Mahajan
-
Jelle Huisman