Re: [NTG-context] Help with \setuplist number width (for appendices)

2015-03-23 Thread Wolfgang Schuster

 Am 23.03.2015 um 10:29 schrieb robin.kirk...@csiro.au 
 robin.kirk...@csiro.au:
 
 Dear List,
 
 I’m implementing a predefined document style. This requires chapters numbered 
 1, 2, 3 … and appendices numbered Appendix A, Appendix B, Appendix C, … both 
 in the actual heads and also the table of contents.
 
 The style also requires the chapter numbers in the table of contents to be 
 set in a 12mm column. The MWE below does all this, but for the appendices the 
 number overflows the 12mm width, which is ugly of course. So I need to 
 specify either a width with some stretch so the list layout will adapt, or 
 somehow be able to specify a different width for the appendix entries.
 
 Any help appreciated,
 
 Robin
 
 \setuplist[chapter][
width=12mm, % but want 30mm for appendices
label=yes,
alternative=c]

\define[1]\ChapterlistNumber
  {\dowithnextbox
 {\ifdim\nextboxwd12mm
\simplealignedbox{12mm}{flushleft}{\flushnextbox}%
  \else
\simplealignedbox{30mm}{flushleft}{\flushnextbox}%
  \fi}
 \hbox{#1}}

\setuplist
  [chapter]
  [width=0pt,
   label=yes,
   alternative=c,
   numbercommand=\ChapterlistNumber]

Wolfgang
___
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
___

Re: [NTG-context] packed lists in XML

2015-03-23 Thread Hans Hagen

On 3/22/2015 1:39 PM, Pablo Rodriguez wrote:

Dear list,

I have the following sample:

 \startbuffer[demo]
 doc
 pstandard list:/p
 ul
 li
 pitem from loose list/p
 /li
 li
 pitem from loose list/p
 /li
 /ul
 ppacked list:/p
 ul
 liitem from tight list/li
 liitem from tight list/li
 /ul
 /doc
 \stopbuffer

 \startxmlsetups xml:initialize
 \xmlsetsetup{#1}{ul|li|p}{xml:*}
 \stopxmlsetups

 \xmlregistersetup{xml:initialize}

 \startxmlsetups xml:ul
 \startitemize
 \xmlflush{#1}
 \stopitemize
 \stopxmlsetups

 \startxmlsetups xml:ul:packed
 \startitemize[packed]
 \xmlflush{#1}
 \stopitemize
 \stopxmlsetups

 \startxmlsetups xml:li
 \startitem
 \xmlflush{#1}
 \stopitem
 \stopxmlsetups

 \startxmlsetups xml:p
 \xmldoifnotselfempty {#1} {
 \dontleavehmode
 \ignorespaces
 \xmlflush{#1}
 \removeunwantedspaces
 }
 \par
 \stopxmlsetups

 \starttext
  \xmlprocessbuffer{main}{demo}{}
 \stoptext

Standard lists are defined in XML code with ul/li/p and packed lists
remove the final /p from the path.

How can I associate the each XML list to its right ConTeXt code?


\startxmlsetups xml:ul
\xmldoifelse{#1}{/li/p}{
\startitemize
\xmlflush{#1}
\stopitemize
} {
\startitemize[packed]
\xmlflush{#1}
\stopitemize
}
\stopxmlsetups



--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Alignment on the baseline in a itemize environment with \dfrac{}{}

2015-03-23 Thread Fabrice


Hi Wolfgang,
Thank you for these three solutions. One thing I'm missing is the role 
of grid  I did not know.

Fabrice
___
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
___

Re: [NTG-context] hyphen in class (from XML)

2015-03-23 Thread Pablo Rodriguez
On 03/23/2015 10:12 AM, Hans Hagen wrote:
 On 3/22/2015 7:08 PM, Pablo Rodriguez wrote:
 [...]
 Unless I remove the hyphen from the class and from the setups (or
 replace both hyphens with an underscore hyphen), I won’t get the \TeX logo.

 Have I hit a bug or is it a feature?
 
 \letterpercent-
 
 (unless we decide to auto-escape)

Many thanks for your reply, Hans.

It works fine now.


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
___

Re: [NTG-context] hyphen in class (from XML)

2015-03-23 Thread Hans Hagen

On 3/22/2015 7:08 PM, Pablo Rodriguez wrote:

Dear list,

I have the following sample:

 \startbuffer[demo]
 span class=tex-logoTeX/span
 \stopbuffer

 \setupinteraction[state=start]

 \startxmlsetups xml:initialize
 \xmlsetsetup{#1}{span[contains(@class,'tex-logo')]}{xml:tex:logo}
 \stopxmlsetups

 \xmlregistersetup{xml:initialize}

 \startxmlsetups xml:tex:logo
 \TeX
 \stopxmlsetups

 \stopxmlsetups

 \starttext
  \xmlprocessbuffer{main}{demo}{}
 \stoptext

Unless I remove the hyphen from the class and from the setups (or
replace both hyphens with an underscore hyphen), I won’t get the \TeX logo.

Have I hit a bug or is it a feature?


\letterpercent-

(unless we decide to auto-escape)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] # in file name

2015-03-23 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

On Fri, 20 Mar 2015 15:05:25 +0100, Hans Hagen pra...@wxs.nl wrote:


On 3/20/2015 2:25 PM, Procházka Lukáš Ing. - Pontex s. r. o. wrote:

Hello,

I need to insert a figure PrehlSit#A2.pdf - a file whose name contains # - by 
Lua.

How to code the name?



one can flush with verbatim catcodes but another solution is:

foo\\letterhash bar


great, it works, thank you!

Lukas


How to code the file name?



--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038

___
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
___

[NTG-context] Help with \setuplist number width (for appendices)

2015-03-23 Thread Robin.Kirkham
Dear List,

I’m implementing a predefined document style. This requires chapters numbered 
1, 2, 3 … and appendices numbered Appendix A, Appendix B, Appendix C, … both in 
the actual heads and also the table of contents.

The style also requires the chapter numbers in the table of contents to be set 
in a 12mm column. The MWE below does all this, but for the appendices the 
number overflows the 12mm width, which is ugly of course. So I need to specify 
either a width with some stretch so the list layout will adapt, or somehow be 
able to specify a different width for the appendix entries.

Any help appreciated,

Robin

\setuplist[chapter][
width=12mm, % but want 30mm for appendices
label=yes,
alternative=c]

\setuplabeltext[appendix=Appendix\space]

\starttext
\completecontent

\chapter{One}
\chapter{Two}

\startappendices
\chapter{First}
\chapter{Second}
\stopappendices

\stoptext



contents.pdf
Description: contents.pdf
___
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
___

Re: [NTG-context] packed lists in XML

2015-03-23 Thread Pablo Rodriguez
On 03/23/2015 01:01 PM, Hans Hagen wrote:
 On 3/22/2015 1:39 PM, Pablo Rodriguez wrote:
 [...]
 Standard lists are defined in XML code with ul/li/p and packed lists
 remove the final /p from the path.

 How can I associate the each XML list to its right ConTeXt code?
 
 \startxmlsetups xml:ul
  \xmldoifelse{#1}{/li/p}{
  \startitemize
  \xmlflush{#1}
  \stopitemize
  } {
  \startitemize[packed]
  \xmlflush{#1}
  \stopitemize
  }
 \stopxmlsetups

Many thanks for your reply, Hans.

This code will help me to fix ordered lists too.

Many thanks for your help,


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
___

Re: [NTG-context] For the Mac users: AppleScript to launch ConTeXt in a flexile way

2015-03-23 Thread Thomas Floeren
Updated (1.2.2).

http://dflect.net/context-typeset-tool/


best,
-- 
Tom



___
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
___

[NTG-context] buggy extra space after ff ligature

2015-03-23 Thread Pablo Rodriguez
Dear list,

I’m afraid I’ve hit a bug:

\setuphyphenation[method=traditional]
\definefontfeature[default][default][itlc=yes]
\setupitaliccorrection[global,always]

\setuphead[section][style=\it]
\starttext
\section{Different Efficiencies}
\section{Different Effectivity}
\stoptext

The first title has an extra space after the ff ligature. I think this
may be a bug.

Could anyone confirm it?

Many thanks for your help,

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
___