Re: [NTG-context] LMTX and lettrine

2021-07-19 Thread Wolfgang Schuster

Pablo Rodriguez schrieb am 18.07.2021 um 18:16:

On 7/18/21 3:35 PM, Gerben Wierda wrote:

I am trying to find out how to move this setup in mkii

23     \usemodule[lettrine]
24 >>  \setuplettrine[Lines=3,
25                    Hang=.5,
26                    Oversize=0,
27                    Raise=0,
28                    Findent=0pt,
29                    Nindent=0em,
30                    Slope=0em,
31                    Ante=,
32                    FontHook=,
33                    TextFont=\sc,
34                    Image=no]

to lmtx. (Basically, ConTeXtgarden gives my mike info for lettrine)

Hi Gerben,

\setupinitial is your friend.

i-context.pdf (included in LMTX) contains the available options
(searching for "\setupinitial [", without quotation marks).


Both commands have different feature sets, e.g. with lettrine you can use
a image for the initial and you can also use the slope option to change the
indentation for letters like A or V.

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


[NTG-context] \xmlrefatt as node?

2021-07-19 Thread Pablo Rodriguez
Dear list,

I have the following sample:

  \startbuffer[test]
  

 1


 2


 3

  
  \stopbuffer

  \startxmlsetups xml:testsetups
   \xmlsetsetup{#1}{*}{-}
  \xmlsetsetup{#1}{document|div|p|a}{xml:flushing}
  \xmlsetsetup{#1}{a}{xml:*}
  \stopxmlsetups

  \xmlregistersetup{xml:testsetups}

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

  \startxmlsetups xml:a
  \xmlattribute{#1}{ancestor::div[@class='section level1 hidden']}{id}\\
  \xmlrefatt{#1}{href}:\
  \doifelse
{\xmlrefatt{#1}{href}}
{\xmlattribute{#1}{ancestor::div[@class='section level1 hidden']}{id}}
  {yes}{no}\blank
  \stopxmlsetups

  \starttext
  \xmlprocessbuffer{main}{test}{}
  \stoptext

I need to check whether the link is inside the same div or not.

I know how to obtain the destination identifier (\xmlreffatt{#1}{href}
and I know how to obtain the identifier of the contaning div
(\xmlattribute{#1}{ancestor::div[@class='section level1 hidden']}{id}}).

But I don’t know how to ge the identifier of the div which contains the
destination idetifier.

How could I get that?

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


Re: [NTG-context] drop cap (initial) and indentation

2021-07-19 Thread Pablo Rodriguez
On 7/18/21 11:54 PM, Gerben Wierda wrote:
> With the following minimal example:
> [...]
> both the initial and the bold stuff after it is indented. With hoffset I
> can move the initial, but not what comes after. I have been
> experimenting but haven’t found a way to solve this.

Hi Gerben,

this might be what you need:

  % Every chapter body text starts with a drop cap:
  \setupindenting[yes, medium]

  \starttext
  \chapter{Chapter}

  \placeinitial So it was. \input knuth

  \placeinitial So it was. \input knuth

  \noindentation
  \placeinitial So it was. \input knuth
  \stoptext

Sectioning commands never indent next paragraph by default. You have to
type either \setuphead[chapter][indentnext=yes] or
\setupheads[indentnext=yes] to enable it.

If every chapter starts with an initial,
\setuphead[chapter][after={\blank[2*big]\placeinitial}] enables this
automatically (\blank[2*big] is the default command after chapter).

> [...]
> PS. switching \kap and \bf has an interesting result, the first
> character of the words is not in bold. This did not happen with lettrine
> in mkii,

Please, avoid adding questions after a multiline signature (because the
lines might be look like belonging to the signature, and not as a
question to the list).

This might help in LMTX:

  \definefontfeature[allcaps][uppercasing=yes]
  \starttext
  \startTEXpage[offset=1em]
  {\feature[+][allcaps]\bf uppose we}
  \stopTEXpage
  \stoptext

I hope it helps,

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


Re: [NTG-context] drop cap (initial) and indentation

2021-07-19 Thread Nicola
On 2021-07-18, Gerben Wierda  wrote:
> PS. switching \kap and \bf has an interesting result, the first
> character of the words is not in bold. This did not happen with
> lettrine in mkii

I do not have an answer to your question, but I'd like to point out that
you can keep using lettrine with ConTeXt LMTX, if you wish. You just
need to add the modules manually, currently:

https://wiki.contextgarden.net/Modules#ConTeXt_LMTX

Nicola

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