ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* indenting in XML environment
@ 2006-01-14 16:03 Christopher G D Tipper
  2006-01-14 23:09 ` Taco Hoekwater
  0 siblings, 1 reply; 5+ messages in thread
From: Christopher G D Tipper @ 2006-01-14 16:03 UTC (permalink / raw)


Ok, after taking deep breath I'll try this issue again. I got  
indenting to work after putting \noindenting inside its own environment.

However, the following code block stopped working recently and I  
don't know why:

\defineXMLenvironment[body]
   {\bgroup
    \rm\setupwhitespace[none]
    \setupindenting[small,yes]
    \startcolumns[rule=on,n=2,tolerance=strict]
    {\noindenting} }
   {\stopcolumns
    \egroup}

It just doesn't indent anything, even after removing the  
{\noindenting} environment.

Christopher
--------------------------------o00o--------------------------------
   “Since light travels faster than sound, isn’t that why
    some people appear bright until you hear them speak”
                                           — Steve Wright

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

* Re: indenting in XML environment
  2006-01-14 16:03 indenting in XML environment Christopher G D Tipper
@ 2006-01-14 23:09 ` Taco Hoekwater
  2006-01-15 12:54   ` Christopher G D Tipper
  0 siblings, 1 reply; 5+ messages in thread
From: Taco Hoekwater @ 2006-01-14 23:09 UTC (permalink / raw)


Christopher G D Tipper wrote:
> Ok, after taking deep breath I'll try this issue again. I got  indenting 
> to work after putting \noindenting inside its own environment.
> 
> However, the following code block stopped working recently and I  don't 
> know why:
> 
> \defineXMLenvironment[body]
>   {\bgroup
>    \rm\setupwhitespace[none]
>    \setupindenting[small,yes]
>    \startcolumns[rule=on,n=2,tolerance=strict]
>    {\noindenting} }
>   {\stopcolumns
>    \egroup}
> 
> It just doesn't indent anything, 

That's odd, because it looks fine to me.

I've created a test file with this appended to your definition:

\defineXMLenvironment[p]{}{\par}
\starttext
\startXMLdata
<body>
<p>text</p>
<p>text</p>
<p>text</p>
</body>
\stopXMLdata
\stoptext

And it nicely indents the second and third paragraph.

I would use
     \noindentation }
instead of
     {\noindening} }
but both possibilities work out fine here.

Cheers, Taco

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

* Re: indenting in XML environment
  2006-01-14 23:09 ` Taco Hoekwater
@ 2006-01-15 12:54   ` Christopher G D Tipper
  2006-01-15 18:07     ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Christopher G D Tipper @ 2006-01-15 12:54 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 375 bytes --]

Hi Taco,

I've found the miscreant. In my stylesheet I have
\def\eDroppedCaps
     {\DroppedCaps
         {} {ptmr8r}
         {2.2\baselineskip} {2pt} {\baselineskip} {2}}

and in my XML I have:
\defineXMLcommand     [dropped-caps] \eDroppedCaps

and for some reason this screws up all paragraph indenting. Has this  
changed recently, because it used to work?

Christopher

[-- Attachment #2: xml-indenting.tex --]
[-- Type: application/octet-stream, Size: 701 bytes --]

\def\eDroppedCaps\r    {\DroppedCaps\r        {} {ptmr8r}\r        {2.2\baselineskip} {2pt} {\baselineskip} {2}}

\defineXMLenvironment[body]
  {\bgroup
   \startcolumns[rule=on,n=2,tolerance=strict]
   %\startcolumnset[twocolumns]
   \rm\setupwhitespace[none]
   \setupindenting[small,yes]
   \noindentation
   }
  {\stopcolumns
   %\stopcolumnset
   \egroup}

\defineXMLenvironment [document]     {}                           {}
\defineXMLcommand[p] {\par}
\defineXMLcommand[tex] \TeX\
\defineXMLcommand     [dropped-caps] \eDroppedCaps

\starttext
\processXMLfilegrouped {knuth.xml}\r\stoptext

                                                                                

[-- Attachment #3: knuth.xml --]
[-- Type: text/xml, Size: 1121 bytes --]

<document>
<body>
<p><dropped-caps />Thus, I came to the conclusion that the designer of a new
system must not only be the implementer and first                               
large-scale user; the designer should also write the first                     
user manual.                                                                    
</p>
<p>The separation of any of these four components would have                       
hurt <tex/> significantly. If I had not participated fully in                    
all these activities, literally hundreds of improvements                        
would never have been made, because I would never have                          
thought of them or perceived why they were important.                           
</p>
<p>But a system cannot be successful if it is too strongly                         
influenced by a single person. Once the initial design is                       
complete and fairly robust, the real test begins as people                      
with many different viewpoints undertake their own                              
experiments.
</p>
</body>
</document>

[-- Attachment #4: Type: text/plain, Size: 722 bytes --]


On 14 Jan 2006, at 23:09, Taco Hoekwater wrote:

> I've created a test file with this appended to your definition:
>
> \defineXMLenvironment[p]{}{\par}
> \starttext
> \startXMLdata
> <body>
> <p>text</p>
> <p>text</p>
> <p>text</p>
> </body>
> \stopXMLdata
> \stoptext
>
> And it nicely indents the second and third paragraph.
>
> I would use
>     \noindentation }
> instead of
>     {\noindening} }
> but both possibilities work out fine here.

--------------------------------o00o--------------------------------
   “Since light travels faster than sound, isn’t that why
    some people appear bright until you hear them speak”
                                           — Steve Wright



[-- Attachment #5: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: indenting in XML environment
  2006-01-15 12:54   ` Christopher G D Tipper
@ 2006-01-15 18:07     ` Hans Hagen
  2006-01-16 11:09       ` Taco Hoekwater
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2006-01-15 18:07 UTC (permalink / raw)


Christopher G D Tipper wrote:

> Hi Taco,
>
> I've found the miscreant. In my stylesheet I have
> \def\eDroppedCaps
>     {\DroppedCaps
>         {} {ptmr8r}
>         {2.2\baselineskip} {2pt} {\baselineskip} {2}}
>
> and in my XML I have:
> \defineXMLcommand     [dropped-caps] \eDroppedCaps
>
> and for some reason this screws up all paragraph indenting. Has this  
> changed recently, because it used to work?


well, indenting has been extended (and a bit fixed)

Hans

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

* Re: indenting in XML environment
  2006-01-15 18:07     ` Hans Hagen
@ 2006-01-16 11:09       ` Taco Hoekwater
  0 siblings, 0 replies; 5+ messages in thread
From: Taco Hoekwater @ 2006-01-16 11:09 UTC (permalink / raw)




Hans Hagen wrote:
> Christopher G D Tipper wrote:
> 
>> Hi Taco,
>>
>> I've found the miscreant. In my stylesheet I have
>> \def\eDroppedCaps
>>     {\DroppedCaps
>>         {} {ptmr8r}
>>         {2.2\baselineskip} {2pt} {\baselineskip} {2}}
>>
>> and in my XML I have:
>> \defineXMLcommand     [dropped-caps] \eDroppedCaps
>>
>> and for some reason this screws up all paragraph indenting. Has this  
>> changed recently, because it used to work?
> 
> well, indenting has been extended (and a bit fixed)

My guess is this patch to supp-fun is needed (untested):

  \def\DroppedCaps#1#2#3#4#5#6#7% does not yet handle accented chars
    {\convertargument            #7\to\asciia
     \convertcommand \DroppedString\to\asciib
     \ExpandBothAfter\doifinstringelse\asciia\asciib
-     {\noindenting
+     {\noindentation
        \dontleavehmode
       %\ifhmode\hskip-\parindent\fi % sensitive for context mechanism

Cheers, Taco

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

end of thread, other threads:[~2006-01-16 11:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-14 16:03 indenting in XML environment Christopher G D Tipper
2006-01-14 23:09 ` Taco Hoekwater
2006-01-15 12:54   ` Christopher G D Tipper
2006-01-15 18:07     ` Hans Hagen
2006-01-16 11:09       ` Taco Hoekwater

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).