ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Illegal parameter number in definition
@ 2015-07-17 17:26 juh
  2015-07-20  7:57 ` Schmitz Thomas A.
  0 siblings, 1 reply; 6+ messages in thread
From: juh @ 2015-07-17 17:26 UTC (permalink / raw)
  To: ntg-context

Hi all,

I am totally new to ConTeXt. I am a long time LaTeX user and I got
interested in ConTeXt by a posting from Pablo in the Pandoc mailing
list. So he is to blame if you have to read silly questions from me in
the future. ;-)

To learn a bit more about ConTeXt I try to make an environment to
typeset TEI-XML files from http://www.deutschestextarchiv.de (DTA)

I ran into a problem with this XML from DTA:

<head>
 <hi rendition="#g">Zehenter Brief.</hi>
</head><lb/>
<p><hi rendition="#in">S</hi>ie sind also mit mir darinn einig, und
durch den Innhalt meiner

I tried to map the rendition attribute to ConTeXt with this code:

\startxmlsetups xml:teisetups
        \xmlsetsetup{#1}{*}{-}
        \xmlsetsetup{#1}{TEI|text|body|div|head|p|lb}{xml:*}
        \xmlsetsetup{#1}{hi[@rendition='#g']}{xml:hi}
\stopxmlsetups

The attribute of '#g' makes trouble. I get the following error message.

tex error       > error on line 5 in file tei-style.tex: ! Illegal
parameter number in definition of \14>:xml:teisetups

<to be read again>
g
<argument> ...lb}{xml:*}\xmlsetsetup {##1}{hi[@rendition='##g
                                                  ']}{xml:hig}
\syst_setups_start_xml_indeed ...1\expandafter {#3
                                                  }
l.5 \stopxmlsetups


 1     \startxmlsetups xml:teisetups
 2             \xmlsetsetup{#1}{*}{-}
 3             \xmlsetsetup{#1}{TEI|text|body|div|head|p|hi|lb}{xml:*}
 4             \xmlsetsetup{#1}{hi[@rendition='#g']}{xml:hig}
 5 >>  \stopxmlsetups

I think that I kind of understand the message. The hash '#' isn't
allowed in this place. Is it possible to escape the hash somehow or to
solve this issue in an other way?

TIA
juh

-- 
Das ZEN von Pandoc
Bücher und E-Books einfach und professionell produzieren
http://www.amazon.de/Das-ZEN-von-Pandoc-professionell/dp/1505218799/
Paperback (232 Seiten) und E-Book
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Illegal parameter number in definition
  2015-07-17 17:26 Illegal parameter number in definition juh
@ 2015-07-20  7:57 ` Schmitz Thomas A.
  2015-07-20  9:42   ` juh
  0 siblings, 1 reply; 6+ messages in thread
From: Schmitz Thomas A. @ 2015-07-20  7:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> On 17 Jul 2015, at 19:26, juh <juh+ntg-context@mailbox.org> wrote:
> 
> Hi all,
> 
> I am totally new to ConTeXt. I am a long time LaTeX user and I got
> interested in ConTeXt by a posting from Pablo in the Pandoc mailing
> list. So he is to blame if you have to read silly questions from me in
> the future. ;-)
> 
> To learn a bit more about ConTeXt I try to make an environment to
> typeset TEI-XML files from http://www.deutschestextarchiv.de (DTA)
> 
> I ran into a problem with this XML from DTA:
> 
> <head>
> <hi rendition="#g">Zehenter Brief.</hi>
> </head><lb/>
> <p><hi rendition="#in">S</hi>ie sind also mit mir darinn einig, und
> durch den Innhalt meiner
> 
> I tried to map the rendition attribute to ConTeXt with this code:
> 
> \startxmlsetups xml:teisetups
>        \xmlsetsetup{#1}{*}{-}
>        \xmlsetsetup{#1}{TEI|text|body|div|head|p|lb}{xml:*}
>        \xmlsetsetup{#1}{hi[@rendition='#g']}{xml:hi}
> \stopxmlsetups
> 
> The attribute of '#g' makes trouble. I get the following error message.

Hi, welcome to ConTeXt. We prefer to have complete minimal examples (http://www.tex.ac.uk/FAQ-minxampl.html) here so we can look into your questions, not just code snippets. As to your problem: indeed, you have to remove the hashtag. The same question was asked by Pablo just two months ago: http://thread.gmane.org/gmane.comp.tex.context/91354/ . Maybe it would be a good idea to add the solution provided by Hans to the wiki page on TEI xml typesetting http://wiki.contextgarden.net/TEI_xml since it’s a common problem.

Thomas
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Illegal parameter number in definition
  2015-07-20  7:57 ` Schmitz Thomas A.
@ 2015-07-20  9:42   ` juh
  2015-07-20 14:42     ` Schmitz Thomas A.
                       ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: juh @ 2015-07-20  9:42 UTC (permalink / raw)
  To: ntg-context

Am 20.07.2015 um 09:57 schrieb Schmitz Thomas A.:

> Hi, welcome to ConTeXt. We prefer to have complete minimal examples
> (http://www.tex.ac.uk/FAQ-minxampl.html) here so we can look into
> your questions, not just code snippets. 

Thanks a lot for your answer.

Learning to write minimal examples in ConTeXt is on my todo list.

> As to your problem: indeed,
> you have to remove the hashtag. The same question was asked by Pablo
> just two months ago:
> http://thread.gmane.org/gmane.comp.tex.context/91354/ . 

I see. Impressive (I think I have to learn lua, too)

But for now I am better off with the coontains statement.

\xmlsetsetup{#1}{hi[contains(@rendition, 'in')]}{xml:hi:in}

It matches

<hi rendition="#in">S</hi>

without problems

But of course, I am not sure if there are any side effects.

> Maybe it
> would be a good idea to add the solution provided by Hans to the wiki
> page on TEI xml typesetting http://wiki.contextgarden.net/TEI_xml
> since it’s a common problem.

What is your Wiki policy? I am willing to help.

I've made an account. Shall I just edit the page? I'd put a new subline
at the end of the text.

Removing hashmarks from the xml source

Ciao!
juh


-- 
Das ZEN von Pandoc
Bücher und E-Books einfach und professionell produzieren
http://www.amazon.de/Das-ZEN-von-Pandoc-professionell/dp/1505218799/
Paperback (232 Seiten) und E-Book
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Illegal parameter number in definition
  2015-07-20  9:42   ` juh
@ 2015-07-20 14:42     ` Schmitz Thomas A.
  2015-07-20 14:43     ` Aditya Mahajan
  2015-07-23 18:44     ` Pablo Rodriguez
  2 siblings, 0 replies; 6+ messages in thread
From: Schmitz Thomas A. @ 2015-07-20 14:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> 
> I see. Impressive (I think I have to learn lua, too)

You don’t have to, but you’ll see that it’s actually fun.

> 
> But for now I am better off with the coontains statement.
> 
> \xmlsetsetup{#1}{hi[contains(@rendition, 'in')]}{xml:hi:in}
> 
> It matches
> 
> <hi rendition="#in">S</hi>
> 
> without problems
> 
> But of course, I am not sure if there are any side effects.

Well, only if you have other attributes which also contain “in."

> 
> What is your Wiki policy? I am willing to help.
> 
> I've made an account. Shall I just edit the page? I'd put a new subline
> at the end of the text.
> 
> Removing hashmarks from the xml source

Yes, just edit the page - there is no official deciding body, but some people keep an eye on the wiki and will gently edit if you make a mistake.

Thomas
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Illegal parameter number in definition
  2015-07-20  9:42   ` juh
  2015-07-20 14:42     ` Schmitz Thomas A.
@ 2015-07-20 14:43     ` Aditya Mahajan
  2015-07-23 18:44     ` Pablo Rodriguez
  2 siblings, 0 replies; 6+ messages in thread
From: Aditya Mahajan @ 2015-07-20 14:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, 20 Jul 2015, juh wrote:

> What is your Wiki policy? I am willing to help.

No policy. Everyone is free to edit the wiki. If there is some information 
that you found useful and it is not on the wiki add it at what an 
appropriate place.

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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Illegal parameter number in definition
  2015-07-20  9:42   ` juh
  2015-07-20 14:42     ` Schmitz Thomas A.
  2015-07-20 14:43     ` Aditya Mahajan
@ 2015-07-23 18:44     ` Pablo Rodriguez
  2 siblings, 0 replies; 6+ messages in thread
From: Pablo Rodriguez @ 2015-07-23 18:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 07/20/2015 11:42 AM, juh wrote:
> [...]
> But for now I am better off with the coontains statement.
> 
> \xmlsetsetup{#1}{hi[contains(@rendition, 'in')]}{xml:hi:in}
> 
> It matches
> 
> <hi rendition="#in">S</hi>
> 
> without problems

Hi Jan Urlich,

sorry for the delayed reply. (I’m still dealing with the technical
support from GMX and the banned replies.)

All you have to do is to escape the hash character, one way or another:

    \xmlsetsetup{#1}
        {hi[@rendition='\letterhash in']}
        {xml:rend:in}

    \xmlsetsetup{#1}
        {hi[contains(@rendition,'\letterhash in')]}
        {xml:rend:in

With the first option, the value of rendition must be unique (the TEI P5
Guidelines include examples with multiple rendition values).

With the second option, the value "#indian" would be also matched.

I hope it helps (and it reaches the list ;-)),


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-07-23 18:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-17 17:26 Illegal parameter number in definition juh
2015-07-20  7:57 ` Schmitz Thomas A.
2015-07-20  9:42   ` juh
2015-07-20 14:42     ` Schmitz Thomas A.
2015-07-20 14:43     ` Aditya Mahajan
2015-07-23 18:44     ` Pablo Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).