[NTG-context] tabulate as header

2017-03-04 Thread kaddour kardio
​Hi everyone, i have a quiet simple question as i'm a beginnerin ConTeXT
(with a background of 05 years with LaTeX):
Is it possible tu use tabulate environment as a header?

\startsetups headertext
\setupheadertexts[\setups{tableheader}]
 % \framed[frame=off, align=normal]
 \setuptableheader  {\starttabulate[|p|p|p|]
\NC Clinique médico chirurgicale El Abrar\NC
\externalfigue[width=1.5cm][logo.png]\NC placeholder\NR
\stoptabulate   }
 \stopsetup

​
thak you in advance

-- 
Dr YAHYAOUI Mohamed Kaddour, cardiologue.Clinique EL ABRAR.
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] description renders unintended results

2017-03-04 Thread Floris van Manen

> On 4 Mar 2017, at 11:25, Otared Kavian  wrote:
> 
> Since you specify
>   align=left
> in the setup of your description, I don’t see why the output would be 
> unexpected. With the following version of your example code I get the 
> attached PDF output.

I got the left/right discrepancy between the sample code and the rendering.
However the unexpected is the fact that it does not indent properly:

The intended is this:

1   one
a   two
b   three
2   four
c   five
d   six
x   seven
y   eight
z   nine
3   ten

The unintended result (also in your rendering) is this:

1   one
a   two
b   three
2   four
c   five
d   six
x   seven
y   eight
z   nine
3   ten





signature.asc
Description: Message signed with OpenPGP using GPGMail
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] description renders unintended results

2017-03-04 Thread Henning Hraban Ramm
Am 2017-03-04 um 11:25 schrieb Otared Kavian :

> Since you specify
>   align=left
> in the setup of your description, I don’t see why the output would be 
> unexpected. With the following version of your example code I get the 
> attached PDF output.

While the alignment was to be expected, the items are still not nested.


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] description renders unintended results

2017-03-04 Thread Otared Kavian
Hi Floris,Since you specify	align=leftin the setup of your description, I don’t see why the output would be unexpected. With the following version of your example code I get the attached PDF output.%%% begin \setuppapersize[A5]\definedescription[descr][	headstyle=bold,	style=normal,%	align=flushright,	location=hanging,	width=broad,	margin=1cm	]\starttext\startdescr{Para}	This is a shorter item label, and some text that talks about it.	The text is wrapped into a paragraph, with successive lines indented.	This is another paragraph under the "Para" item.	\startdescr{Sub Item}  		This is a description of an item which is within the "Para" item.  	\stopdescr	\startdescr{Sub Item} 		Another Sub Item   	\stopdescr\stopdescr\startdescr{Short}	A short item that's not part of that really long "Para" item.\stopdescr\stoptext%%% end

description-indentation.pdf
Description: Adobe PDF document
On 3 Mar 2017, at 09:59, Floris van Manen  wrote:The documentation on pagehttp://wiki.contextgarden.net/Descriptionprovides sample code to stack multiple levels of description such as:\setuppapersize[A5]\definedescription[descr][  headstyle=bold, style=normal, align=left, location=hanging,   width=broad, margin=1cm]\starttext\startdescr{Para}  This is a shorter item label, and some text that talks about it.  The text is wrapped into a paragraph, with successive lines indented.  This is another paragraph under the "Para" item.  \startdescr{Sub Item}      This is a description of an item which is within the "Para" item.  \stopdescr\startdescr{Sub Item}     Another Sub Item   \stopdescr\stopdescr\startdescr{Short}  A short item that's not part of that really long "Para" item.\stopdescr\stoptextwhich should generate the included rendering.But reality is somewhat more diverse …My current context / luatex, as well as the online context engine come up with a different renderingEven when you correct for the right/left alignment, the itemising does not properly stack up:It there a work around ?$ context --versionmtx-context     | ConTeXt Process Management 0.63mtx-context     |mtx-context     | main context file: /Applications/ConTeXt/tex/texmf-context/tex/context/base/mkiv/context.mkivmtx-context     | current version: 2016.09.24 12:40$ luatex --versionThis is LuaTeX, Version 1.0.0 (TeX Live 2017/dev)Thanks.Floris van Manen___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-contextwebpage  : http://www.pragma-ade.nl / http://context.aanhet.netarchive  : https://bitbucket.org/phg/context-mirror/commits/wiki : http://contextgarden.net__
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] xml in lua: how to say "ancestor"?

2017-03-04 Thread Hans Hagen

On 3/3/2017 5:47 PM, Thomas A. Schmitz wrote:

On 25.02.2017 21:49, Hans Hagen wrote:

xml.attribute(e,"..[tag()='section' or tag()='chapter']","title")

with an optional default

(there is also p = xml.parent(e) and then you can access p.at.title ..
so there are several ways(

Hans


I am sorry it took me so long to play with this... But it still doesn't
do what I need. My problem is still: from a given element, I need to
grab the content of an attribute that may be two or three or four levels
up in the xml tree. The code below (adapted from Hans) still only works
for a parent, but I need access to an "ancestor."


chaptertitle = xml.attribute(e, "..[tag()='chapter']", "title")
if not chaptertitle or chaptertitle == "" then
chaptertitle = xml.attribute(e, "../..[tag()='chapter']", "title")
end



Thomas

\starttext

\startbuffer[test]

  

  
  Subsection Text
  

  
  

  Subsection Text

  

\stopbuffer

\startluacode

function xml.functions.xml_subsection(e)
chaptertitle = xml.attribute(e, "..[tag()='chapter']", "title")
context("Title of chapter is: ")
context(chaptertitle)
context.par()
lxml.flush(e)
context.blank( { "2*line" })
end

\stopluacode

\startxmlsetups xml:test:setups
\xmlsetsetup{\xmldocument}{*}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:test:setups}

\startxmlsetups xml:document
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:chapter
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:section
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:subsection
\xmlfunction{#1}{xml_subsection}
\stopxmlsetups

\xmlprocessbuffer{main}{test}{}

\stoptext
___

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___



--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___