[NTG-context] Quotation mark in drop caps

2024-07-07 Thread Thangalin
Hi list!

I have a three-part question.

First, when using \placeinitial, how would you detect whether the first
character is a quotation mark, and, if so, override the setupinitial to use
m=2?

Second, when using m=2 to capture a quotation mark, how would you change
the font size of only the quotation mark, leaving the font size for the
remaining characters the same?

Third, can this be accomplished using setupinitial alone? Such as:

\setupinitial[
  quotefont=\SmallerFont,
  quotecolour=\QuoteColour,
]

A few typographic examples of what I'd like to accomplish:

Re: https://i.ibb.co/7rJYBS6/initial-Matching-Quotes.gif
Re: https://i.ibb.co/Hz8v5w4/atlantips-drop-caps-and-quotation-marks-10.png

My understanding of what exists in ConTeXt:

\starttext
\startchapter
  % This detaches the quotation mark from the paragraph, which looks
strange.
  \placeinitial
  "We held ConTeXt in high esteem."
\stopchapter

\startchapter
  % This looks great.
  \placeinitial
  \input knuth
\stopchapter

\startchapter
  % I'd like to eliminate this next line.
  \setupinitial[m=2]

  % The quotation mark is a drop cap, albeit too big.
  \placeinitial
  "We held ConTeXt in high esteem."
\stopchapter

\startchapter
  % I'd like to eliminate this next line.
  \setupinitial[m=1]

  % The setups are reinitialized, which in theory should not be needed.
  \placeinitial
  \input knuth
\stopchapter
\stoptext

Here's how I'd like to typeset the document (using setupinitial alone):

\setupinitial[
  % When a quotation mark is detected, the given font is applied to it.
  quotefont=\SmallerFont,
  % Not necessary, but could be useful to other people?
  quotecolour=\QuoteColour,
]

\starttext
\startchapter
  % The quotation mark gets attached and applies the smaller font size.
  \placeinitial
  "We held ConTeXt in high esteem."
\stopchapter

\startchapter
  % Only captures the first letter, because no quotation mark is present.
  \placeinitial
  \input knuth
\stopchapter
\stoptext

Is this possible? If so, how?

Thank you!
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: \setupsynonyms textstyle=cap failing

2023-12-24 Thread Wolfgang Schuster

Garulfo schrieb am 23.12.2023 um 12:41:

Hi all,

the following  minimum working example is properly typesetted with 
textstyle=bold,

but it fails with textstyle=cap (ConTeXt version : 2023.09.26 18:19)

A number should have been here; I inserted '0'. (If you can't figure 
out why I
needed to see a number, look up 'weird error' in the index to The 
TeXbook.)

mtx-context | fatal error: return code: 1

It works on https://context-on-web.eu (ConTeXt version : 2022.12.22 22:17)


\definesynonyms    [abbreviation] [abbreviations] [\AbbreviationsFull]
\setupsynonyms [abbreviation] [textstyle=bold]

\starttext

\contextversion
\abbreviation{NTG}{Nederlandstalige TeX Gebruikersgroep}

Test 1 : \NTG .

Test 2 : \AbbreviationsFull{NTG}.

\stoptext

Any clue ?


Hans made changes on the capitals mode and now the following two lines 
have to be added to typo-cap.mkxl on line 52 and 53.


\definecapitals[\v!cap] [\v!capital]
\definecapitals[\v!Cap] [\v!Capital]

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: \setupsynonyms textstyle=cap failing

2023-12-23 Thread Bruce Horrocks


> On 23 Dec 2023, at 11:41, Garulfo  wrote:
> 
> Hi all,
> 
> the following  minimum working example is properly typesetted with 
> textstyle=bold,
> but it fails with textstyle=cap (ConTeXt version : 2023.09.26 18:19)
> 
> A number should have been here; I inserted '0'. (If you can't figure out why 
> I 
> needed to see a number, look up 'weird error' in the index to The TeXbook.) 
> mtx-context | fatal error: return code: 1
> 
> It works on https://context-on-web.eu (ConTeXt version : 2022.12.22 22:17)
> 
> 
> \definesynonyms[abbreviation] [abbreviations] [\AbbreviationsFull]
> \setupsynonyms [abbreviation] [textstyle=bold]
> 
> \starttext
> 
> \contextversion
> \abbreviation{NTG}{Nederlandstalige TeX Gebruikersgroep}
> 
> Test 1 : \NTG .
> 
> Test 2 : \AbbreviationsFull{NTG}.
> 
> \stoptext

I'm not sure why textstyle=cap fails but textstyle=sc works. However 
textstyle=\cap (i.e. as a command) works. Also \abbreviation is already defined 
so you don't need to define it again. Thus your MWE becomes:

%\definesynonyms[abbreviation] [abbreviations] [\AbbreviationsFull]
\setupsynonyms [abbreviation] [textstyle=\cap]

\starttext

\contextversion
\abbreviation{NTG}{Nederlandstalige TeX Gebruikersgroep}

Test 1 : \NTG .

Test 2 : \infull{NTG} %\AbbreviationsFull{NTG}.

\stoptext

—
Bruce Horrocks
Hampshire, UK

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] \setupsynonyms textstyle=cap failing

2023-12-23 Thread Garulfo

Hi all,

the following  minimum working example is properly typesetted with 
textstyle=bold,

but it fails with textstyle=cap (ConTeXt version : 2023.09.26 18:19)

A number should have been here; I inserted '0'. (If you can't figure out 
why I

needed to see a number, look up 'weird error' in the index to The TeXbook.)
mtx-context | fatal error: return code: 1

It works on https://context-on-web.eu (ConTeXt version : 2022.12.22 22:17)


\definesynonyms    [abbreviation] [abbreviations] [\AbbreviationsFull]
\setupsynonyms [abbreviation] [textstyle=bold]

\starttext

\contextversion
\abbreviation{NTG}{Nederlandstalige TeX Gebruikersgroep}

Test 1 : \NTG .

Test 2 : \AbbreviationsFull{NTG}.

\stoptext




Any clue ?___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Problem with textstyle

2023-11-17 Thread Rik Kabel

Hello list,

The following example does not compile, complaining “Missing number, 
treated as zero

needed to see a number, look up 'weird error' in the index to The TeXbook”:

   \setuphead   [chapter]
 [
  textstyle=cap,
 ]
   \starttext
   \startchapter    [title={Oops!}]
   \input knuth-gpt \par
   \stopchapter
   \stoptext

Replacing the textstyle /cap/ by any of /bold/, /slanted/, /smallcaps/, 
and /italic/ results in a clean compilation but the indicated style is 
not applied. Using a style description like /em/, /\em/, /bf/, /\bf/, 
/\sc,/ does produce the suggested result. The wiki and mail repository 
are full of examples with the former style names.


Using /style=cap/ (which would change the number as well) also results 
in a failed compilation, while using /style=bolditalic/ works as it should.


ConTeXt  ver: 2023.09.26 18:19 LMTX  fmt: 2023.10.9  int: english/english

--
Rik

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: context not producing synctex output that my synctex program can use

2023-11-15 Thread Jim
Henning and Hans,

thanks for the replies.  I have two follow-up questions below, as well as
some other comments which other synctex users might find useful.

On Sun, Nov 12, 2023 at 10:26 (+0100), Henning Hraban Ramm wrote:

> Am 12.11.23 um 00:59 schrieb Jim:
>> Hi,

>> I've read the wiki, looked at workflows-synctex.tex, searched the web, and
>> scratched my head, all to no avail.  So here I am, cap in hand...

>> When I run context, I get a .synctex file which has some information in it,
>> but I can't find any invocation of synctex to return anything useful.  Nor
>> does the okular example in the wiki (https://wiki.contextgarden.net/SyncTeX)
>> work for me.  Ocular starts, but always on the first page, regardless of
>> what line number I give it.

>> On the other hand, pdftex creates a .synctex file which my copy of synctex
>> find useful.

>> I am using the synctex from the current version of texlive:
>> This is SyncTeX command line utility, version 1.5

>> Can anyone either
>> (a) enlighten me on what I am doing wrong; or
>> (b) definitively confirm that context is not currently playing nicely with
>> synctex (the wiki notwithstanding) and I should give up this quest for
>> now.

> ConTeXt doesn’t work with the synctex binary, but with
> mtxrun --script synctex

Thanks for that pointer.

Q1: Should that be in the wiki (https://wiki.contextgarden.net/SyncTeX)
somewhere?

When I try that out, for example with
mtxrun --script synctex --edit --name=a.tex --line=222 a.tex 
I am rewarded with
sandbox | variable 'linenumber' has no checker
(I tried various variations on that line I won't bore you with, but I keep
getting that error message.)

I also tried
mtxrun --script synctex --goto --page=4 --x=100 --y=100 a.synctex 
and that silently returns without apparently doing anything.  (While I
don't have a 'scite' editor, I created a program called 'scite' that pops a
message up on the screen if it is called.)

Similar to --edit,
mtxrun --script synctex --goto --page=19 --x=400 --y=180 --tolerance=99 
--editor=scite  a.synctex
complains
sandbox | variable 'tolerance' has no checker

Although I don't know lua, the code is easy enough to read, but a short
dive in to mtx-synctex.lua did not enlighten me.

Q2: any enlightening comments on why I am getting these complaints.

In any case, --find and --report (appear to) give meaningful results, so I
can work with those.

> Unfortunately, it’s not a drop-in replacement, so it doesn’t work with most
> editors. (I was thinking about a translating wrapper script, but didn’t do
> anything yet.)

So much code to write, so little time ...:-)

My immediate concern is forward search (i.e., editor tells viewer which
page to display) and that one should be easy for me to create a wrapper.
(I use emacs + auctex, which calls the synctex program, so writing my own
synctex wrapper looks easy.  Hopefully I won't regret using the word "easy"
later.)


> AFAIK TeXshop (MacOS) is the only TeX editor that supports ConTeXt’s
> workflow.

I've been thinking of patching some of evince's more annoying features,
if I do, maybe I should look into making it work with context.

> ConTeXt’s synctex format is much simpler than the “standard” LaTeX one and
> should be at least as good, but alas it needs support from the editors.

Indeed!




On Sun, Nov 12, 2023 at 12:00 (+0100), Hans Hagen wrote:

> On 11/12/2023 10:26 AM, Henning Hraban Ramm wrote:
>> Am 12.11.23 um 00:59 schrieb Jim:
>>> Hi,

>>> 

>> ConTeXt doesn’t work with the synctex binary, but with
>> mtxrun --script synctex

> afaik there is no binary ... there is a library that has to be compiled into
> a pdf viewer that intercept some 'goto the text file' command and then
> launches an editor (afik the library has some heuristics build in wrt boxes
> and nesting and so); at the tex end there is also a library that kicks in
> addiional code for nodes and the backend (which is why enabling synctex will
> have an impact on runtime)

> wrt the synctex file, that one is generated by context (so we don't use the
> synctex code in luatex and as luametatex has no backend there it's even
> completely absent ... context generates the file itself which is also a bit
> more efficient)

>> Unfortunately, it’s not a drop-in replacement, so it doesn’t work with
>> most editors. (I was thinking about a translating wrapper script, but
>> didn’t do anything yet.)

>> AFAIK TeXshop (MacOS) is the only TeX editor that supports ConTeXt’s
>> workflow.

> indeed texshop uses the approach that avoids the library and just calls
> mtxrun to figure out t

[NTG-context] Re: context not producing synctex output that my synctex program can use

2023-11-12 Thread Hans Hagen

On 11/12/2023 10:26 AM, Henning Hraban Ramm wrote:

Am 12.11.23 um 00:59 schrieb Jim:

Hi,

I've read the wiki, looked at workflows-synctex.tex, searched the web, 
and

scratched my head, all to no avail.  So here I am, cap in hand...

When I run context, I get a .synctex file which has some information 
in it,
but I can't find any invocation of synctex to return anything useful.  
Nor
does the okular example in the wiki 
(https://wiki.contextgarden.net/SyncTeX)

work for me.  Ocular starts, but always on the first page, regardless of
what line number I give it.

On the other hand, pdftex creates a .synctex file which my copy of 
synctex

find useful.

I am using the synctex from the current version of texlive:
 This is SyncTeX command line utility, version 1.5

Can anyone either
(a) enlighten me on what I am doing wrong; or
(b) definitively confirm that context is not currently playing nicely 
with
 synctex (the wiki notwithstanding) and I should give up this 
quest for

 now.


ConTeXt doesn’t work with the synctex binary, but with
mtxrun --script synctex


afaik there is no binary ... there is a library that has to be compiled 
into a pdf viewer that intercept some 'goto the text file' command and 
then launches an editor (afik the library has some heuristics build in 
wrt boxes and nesting and so); at the tex end there is also a library 
that kicks in addiional code for nodes and the backend (which is why 
enabling synctex will have an impact on runtime)


wrt the synctex file, that one is generated by context (so we don't use 
the synctex code in luatex and as luametatex has no backend there it's 
even completely absent ... context generates the file itself which is 
also a bit more efficient)


Unfortunately, it’s not a drop-in replacement, so it doesn’t work with 
most editors. (I was thinking about a translating wrapper script, but 
didn’t do anything yet.)


AFAIK TeXshop (MacOS) is the only TeX editor that supports ConTeXt’s 
workflow.


indeed texshop uses the approach that avoids the library and just calls 
mtxrun to figure out the file/line that relates to the position; this is 
more reliable because there is no need to recompile a viewer when 
synctex updates


you can run

  mtxrun --script synctex

on the synctex file and check what areas are there

ConTeXt’s synctex format is much simpler than the “standard” LaTeX one 
and should be at least as good, but alas it needs support from the editors.
simpler in the sense that we only output what is needed for the 
synchronization to work reliable; fwiw, my collegue already for many 
years uses context with synctex enabled with sumatra pdf in pretty 
complex setups: a mix of tex and xml files with deeply nested inputs and 
it works ok (so we also get to the right spot in an (included) xml file)


for synctex to work one has to call context with --synctex or put a 
directive on the topline of the file. Otherwise you won't get the right 
jobname. Of course it then still depends on the pdf viewer + lib used if 
things work out as expected.


there isn't much we can do about the viewer part unless tit is not 
locked into the binary but as flexible like the texshop viewer is


Hans

-
  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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: context not producing synctex output that my synctex program can use

2023-11-12 Thread Henning Hraban Ramm

Am 12.11.23 um 00:59 schrieb Jim:

Hi,

I've read the wiki, looked at workflows-synctex.tex, searched the web, and
scratched my head, all to no avail.  So here I am, cap in hand...

When I run context, I get a .synctex file which has some information in it,
but I can't find any invocation of synctex to return anything useful.  Nor
does the okular example in the wiki (https://wiki.contextgarden.net/SyncTeX)
work for me.  Ocular starts, but always on the first page, regardless of
what line number I give it.

On the other hand, pdftex creates a .synctex file which my copy of synctex
find useful.

I am using the synctex from the current version of texlive:
 This is SyncTeX command line utility, version 1.5

Can anyone either
(a) enlighten me on what I am doing wrong; or
(b) definitively confirm that context is not currently playing nicely with
 synctex (the wiki notwithstanding) and I should give up this quest for
 now.


ConTeXt doesn’t work with the synctex binary, but with
mtxrun --script synctex

Unfortunately, it’s not a drop-in replacement, so it doesn’t work with 
most editors. (I was thinking about a translating wrapper script, but 
didn’t do anything yet.)


AFAIK TeXshop (MacOS) is the only TeX editor that supports ConTeXt’s 
workflow.


ConTeXt’s synctex format is much simpler than the “standard” LaTeX one 
and should be at least as good, but alas it needs support from the editors.


Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] context not producing synctex output that my synctex program can use

2023-11-11 Thread Jim
Hi,

I've read the wiki, looked at workflows-synctex.tex, searched the web, and
scratched my head, all to no avail.  So here I am, cap in hand...

When I run context, I get a .synctex file which has some information in it,
but I can't find any invocation of synctex to return anything useful.  Nor
does the okular example in the wiki (https://wiki.contextgarden.net/SyncTeX)
work for me.  Ocular starts, but always on the first page, regardless of
what line number I give it.

On the other hand, pdftex creates a .synctex file which my copy of synctex
find useful.

I am using the synctex from the current version of texlive:
This is SyncTeX command line utility, version 1.5

Can anyone either
(a) enlighten me on what I am doing wrong; or
(b) definitively confirm that context is not currently playing nicely with
synctex (the wiki notwithstanding) and I should give up this quest for
now.

Thanks very much.

Jim
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Very strange error:

2023-08-14 Thread Xavier B.
.tex'
close source> level 2, order 79, name 'tikzlibraryshadings.code.tex'
open source > level 2, order 80, name 'tikzlibrarypatterns.code.tex'
open source > level 3, order 81, name 'pgflibrarypatterns.code.tex'
close source> level 3, order 81, name 'pgflibrarypatterns.code.tex'
close source> level 2, order 81, name 'tikzlibrarypatterns.code.tex'
open source > level 2, order 82, name 'tikzlibraryfit.code.tex'
close source> level 2, order 82, name 'tikzlibraryfit.code.tex'
open source > level 2, order 83, name 'tikzlibrarypositioning.code.tex'
close source> level 2, order 83, name 'tikzlibrarypositioning.code.tex'
open source > level 2, order 84, name 'tikzlibraryshapes.symbols.code.tex'
open source > level 3, order 85, name 'pgflibraryshapes.symbols.code.tex'
close source> level 3, order 85, name 'pgflibraryshapes.symbols.code.tex'
close source> level 2, order 85, name 'tikzlibraryshapes.symbols.code.tex'
open source > level 2, order 86, name 'tikzlibrarychains.code.tex'
close source> level 2, order 86, name 'tikzlibrarychains.code.tex'
modules > 'pgfmath' is not found
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern rm 12pt' is loaded
structure   > sectioning > section @ level 3 : 0.0.1 -> Proporcionalitat 
directa
structure   > sectioning > subject @ level 3 : 0.0.1 -> Preguntes
floatblocks > '1' placed (here)
floatblocks > order disturbed
floatblocks > '2' placed (force)
floatblocks > order disturbed
floatblocks > '3' placed (force)
backend > xmp > using file 
'/home/xan/bin/context-current/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
pages   > flushing realpage 1, userpage 1, subpage 1
floatblocks > order disturbed
floatblocks > '4' placed (force)
pages   > flushing realpage 2, userpage 2, subpage 2
floatblocks > order disturbed
floatblocks > '5' placed (force)
tex error   > tex error on line 540 in file ./dev.tex: The file ended when 
scanning an argument.

200 persones en total \par \startitemize [a, packed] \item 2 de 5 persones 
estan a $A$ \item a cada 4 persones de $A$ li corresponen 3 persones de $B$ 
\item 20\% són de $C$ \item 2/8 són de $D$ \stopitemize \par \head 420 
persones en total \par \startitemize [a, packed] \item $3/4$ de persones estan 
a $A$ \item hi ha una correspondència: 3 de $A$ $\leftrightarrow $ 2 de $B$ 
\item 40\% és de $C$ \item de 5 persones, 4 són de $D$ \stopitemize \par 
\head 245 persones \par \startitemize [a, packed] \item $1/5$ de persones són 
de $A$ \item $20\%$ de persones són de $B$ \item per cada 7 persones de $A$, 
n'hi ha 4 de $C$ \item per cada 49 persones, n'hi ha 1 de $D$ \stopitemize \par 
\head 1800 persones \par \startitemize [a, packed] \item Un $30\%$ és de $A$ 
\item 30 de cada 50 són de $B$ \item cada 5 persones de $B$ li corresponen 2 
persones de $C$ \item $D$ té un 150\% que les persones de $C$ \stopitemize 
\par \stopitemize \par En tots els casos, digueu quantes persones hi hauria en 
el subgrup més nombrós si en total hi hagués 1000 persones. \stopexercici 
\par \startexercici [exercici:proporcionalitat-directa-8]{relacionar diagrames} 
Relacioneu en cada cas els diagrames amb la proporció indicada \par 
\startitemize [A] \par \head Proporcions \par \startitemize [a, packed, 
columns] \item 2 de 5 \item 20\% \item $3/5$ \item 5 a 10 \stopitemize \par 
\head Diagrames \par \startitemize [a, packed, columns] \item \starttikzpicture 
\draw (0,0) -- (5,0); \foreach \x in {0, 1, 2,..., 5} { \draw (\x , -0.2) -- 
(\x , 0.2); \draw (\x ,-0.2) node[anchor=north] {\x }; } \draw [color=blue!50, 
line width=2pt] (0,0) -- (1,0); \stoptikzpicture \par \item \starttikzpicture 
\draw (0,0) -- (5,0); \foreach \x in {0, 1, 2,..., 5} { \draw (\x , -0.2) -- 
(\x , 0.2); \draw (\x ,-0.2) node[anchor=north] {\x }; } \draw [color=red!50, 
line width=2pt] (0,0) -- (2,0); \stoptikzpicture \par \item \starttikzpicture 
\draw (0,0) -- (5,0); \foreach \x in {0, 1, 2,..., 5} { \draw (\x , -0.2) -- 
(\x , 0.2); \draw (\x ,-0.2) node[anchor=north] {\x }; } \draw [color=green!50, 
line width=2pt] (0,0) -- (3,0); \stoptikzpicture \par \item \starttikzpicture 
\draw (0,0) -- (5,0); \foreach \x in {0, 1, 2,..., 5} { \draw (\x , -0.2) -- 
(\x , 0.2); \draw (\x ,-0.2) node[anchor=north] {\x }; } \draw 
[color=orange!50, line width=2pt] (0,0) -- (1.6,0); \stoptikzpicture \par 
\stopitemize \par \stopitemize \par Per a cada proporció, dibuixeu nous 
diagrames que tengui longitud 100. \stopexercici \par \par \startexercici 

[NTG-context] Very strange error:

2023-08-14 Thread Xavier B.
After I run context (LMTX version) to my document (attached) I get this error:

tex error   > tex error on line 540 in file ./dev.tex: The file ended when 
scanning an argument.

I don't know how to start...
Can anyone help me?

Thanks,
Xavier

PS: I receive this error after upgrading to MKIV to LMTX. Before with MKIV I 
get no errors.


dev.tex
Description: TeX document
return {
 ["errortype"]=6,
 ["filename"]="./dev.tex",
 ["lastcontext"]="\n200 persones en total \\par \\startitemize [a, packed] 
\\item 2 de 5 persones estan a $A$ \\item a cada 4 persones de $A$ li 
corresponen 3 persones de $B$ \\item 20\\% són de $C$ \\item 2/8 són de $D$ 
\\stopitemize \\par \\head 420 persones en total \\par \\startitemize [a, 
packed] \\item $3/4$ de persones estan a $A$ \\item hi ha una correspondència: 
3 de $A$ $\\leftrightarrow $ 2 de $B$ \\item 40\\% és de $C$ \\item de 5 
persones, 4 són de $D$ \\stopitemize \\par \\head 245 persones \\par 
\\startitemize [a, packed] \\item $1/5$ de persones són de $A$ \\item $20\\%$ 
de persones són de $B$ \\item per cada 7 persones de $A$, n'hi ha 4 de $C$ 
\\item per cada 49 persones, n'hi ha 1 de $D$ \\stopitemize \\par \\head 1800 
persones \\par \\startitemize [a, packed] \\item Un $30\\%$ és de $A$ \\item 
30 de cada 50 són de $B$ \\item cada 5 persones de $B$ li corresponen 2 
persones de $C$ \\item $D$ té un 150\\% que les persones de $C$ \\stopitemize 
\\par \\stopitemize \\par En tots els casos, digueu quantes persones hi hauria 
en el subgrup més nombrós si en total hi hagués 1000 persones. 
\\stopexercici \\par \\startexercici 
[exercici:proporcionalitat-directa-8]{relacionar diagrames} Relacioneu en cada 
cas els diagrames amb la proporció indicada \\par \\startitemize [A] \\par 
\\head Proporcions \\par \\startitemize [a, packed, columns] \\item 2 de 5 
\\item 20\\% \\item $3/5$ \\item 5 a 10 \\stopitemize \\par \\head Diagrames 
\\par \\startitemize [a, packed, columns] \\item \\starttikzpicture \\draw 
(0,0) -- (5,0); \\foreach \\x in {0, 1, 2,..., 5} { \\draw (\\x , -0.2) -- (\\x 
, 0.2); \\draw (\\x ,-0.2) node[anchor=north] {\\x }; } \\draw [color=blue!50, 
line width=2pt] (0,0) -- (1,0); \\stoptikzpicture \\par \\item 
\\starttikzpicture \\draw (0,0) -- (5,0); \\foreach \\x in {0, 1, 2,..., 5} { 
\\draw (\\x , -0.2) -- (\\x , 0.2); \\draw (\\x ,-0.2) node[anchor=north] {\\x 
}; } \\draw [color=red!50, line width=2pt] (0,0) -- (2,0); \\stoptikzpicture 
\\par \\item \\starttikzpicture \\draw (0,0) -- (5,0); \\foreach \\x in {0, 1, 
2,..., 5} { \\draw (\\x , -0.2) -- (\\x , 0.2); \\draw (\\x ,-0.2) 
node[anchor=north] {\\x }; } \\draw [color=green!50, line width=2pt] (0,0) -- 
(3,0); \\stoptikzpicture \\par \\item \\starttikzpicture \\draw (0,0) -- (5,0); 
\\foreach \\x in {0, 1, 2,..., 5} { \\draw (\\x , -0.2) -- (\\x , 0.2); \\draw 
(\\x ,-0.2) node[anchor=north] {\\x }; } \\draw [color=orange!50, line 
width=2pt] (0,0) -- (1.6,0); \\stoptikzpicture \\par \\stopitemize \\par 
\\stopitemize \\par Per a cada proporció, dibuixeu nous diagrames que tengui 
longitud 100. \\stopexercici \\par \\par \\startexercici 
[exercici:proporcionalitat-directa-9]{representar a diagrames}Usant el diagrama 
$5 \\times 10$ següent (vegeu la figura~\\in [figura:diagrama-punts-5x10]) 
representeu la informació donada en cada cas. \\par \\placefigure [force] 
[figura:diagrama-punts-5x10] {Diagrama de punts $5 \\times 10$} { \\bTABLE 
[frame=off,align={middle,lohi},width=fit, offset=2mm] \\bTR \\bTD 
\\starttikzpicture \\foreach \\x in {0,...,9} \\foreach \\y in {0,...,4} { 
\\draw [fill=gray!50] (\\x ,\\y ) circle (0.25); } \\par \\stoptikzpicture 
\\eTD \\eTR \\eTABLE } \\par \\startitemize [a, columns, packed, four] \\item 
40\\% \\item 4 de 5 \\item $3/4$ \\item 4 a 1 \\item 22\\% \\item $1/8$ \\item 
5 a 3 \\item 3 de 8 \\stopitemize \\par Si aquestes informacions 
corresponguessin a mostres de peixos ferits a la mar, calculeu quants peixos 
malalts hi hauria en una mostra de 3000 peixos en total. \\stopexercici \\par 
\\startexercici [exercici:proporcionalitat-directa-antic-1]{sou} Na Marta fa 
feina per hores. Si fent 25 hores de feina, na Marta cobra 625 euros, quant 
cobrarà fent 40 hores? Quantes hores hauria de fer na Marta per cobrar 
exactament 2300 euros? \\stopexercici \\par \\par \\startexercici 
[exercici:proporcionalitat-directa-antic-2]{astronautes} Aquest és la bità
cola d'un projecte espacial: \\startitemize [4] \\item S'enlairen 5 
astronautes, amb 200 kg de menjar a una estació espacial \\item Al cap de 3 
dies, hi ha un relleu: se'n van 2 i en vénen 3 \\item La tripulació resultant 
es queda durant 5 dies més \\item Tots els astronautes tornen. L'estació 
espacial queda buida \\stopitemize \\par Els bastarà el menjar que s'enduen al 
principi si sabem que quatre astronautes mengen en promig 20 kg per dia? 
\\stopexercici \\par \\st

Re: [NTG-context] Protect the lettrine

2023-06-25 Thread Thangalin via ntg-context
Thanks Hans.

I've updated the wiki. I'm wondering if there's a way to also control the
indenting? Max's solution removed any indenting, allowing the text for the
second paragraph to be flush. It looks a little strange to see text
indented next to a drop-cap. The test case is the same, but with the
addition of an indenting setup:

% SOT
\setupinitial[n=2, continue=yes]

\setupindenting[medium, yes]

\setuphead[chapter][
  after={\placeinitial},
  page=no,
]

\starttext
\chapter{one}
Kermit Ruffins

Meet me at the second line.

\chapter{two}
\input knuth

Meet me at the second line.
\stoptext
% EOT
This produces an unintended side-effect, as well, whereby the following
chapter heading is indented.

See https://i.ibb.co/n8cMkM9/unintended-indented.png

Cheers!
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] \placeinitial doesn't work inside \framedtext (or \framed)

2023-05-16 Thread Gerben Wierda via ntg-context
I did a simple thing, replace a \framed by \framedtext to get \placeinitial 
working but that doesn't seem to work automatically:

%==
\starttext
\setupinitial[n=2,text=Knuth]\placeinitial\input knuth

\framed[align=flushleft]{\setupinitial[n=2,text=Knuth]\placeinitial\input knuth 
}

\framedtext[align=flushleft]{\setupinitial[n=2,text=Knuth]\placeinitial\input 
knuth }

\stoptext
%==

Is there a way I can get a working \placeinitial inside a \framed or \frametext?

ConTeXt  ver: 2023.02.23 21:26 LMTX  fmt: 2023.2.25  int: english/english

Gerben Wierda (LinkedIn <https://www.linkedin.com/in/gerbenwierda>, Mastodon 
<https://newsie.social/@gctwnl>)
R&A IT Strategy <https://ea.rna.nl/> (main site)
Book: Chess and the Art of Enterprise Architecture <https://ea.rna.nl/the-book/>
Book: Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/>

> On 15 May 2023, at 18:18, Gerben Wierda via ntg-context  
> wrote:
> 
> I'd like to use a drop cap inside a \framed, but it doesn't work.
> 
> Minimal example:
> 
> %==
> \starttext
> \setupinitial[n=2,text=Knuth]\placeinitial\input knuth
> 
> \framed[align=flushleft]{\setupinitial[n=2,text=Knuth]\placeinitial\input 
> knuth }
> \stoptext
> %==
> 
> The first drop cap works, the second is empty.
> 
> Gerben Wierda (LinkedIn <https://www.linkedin.com/in/gerbenwierda>, Mastodon 
> <https://newsie.social/@gctwnl>)
> R&A IT Strategy <https://ea.rna.nl/> (main site)
> Book: Chess and the Art of Enterprise Architecture 
> <https://ea.rna.nl/the-book/>
> Book: Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/>
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] \placeinitial inside \framed?

2023-05-15 Thread Gerben Wierda via ntg-context
I'd like to use a drop cap inside a \framed, but it doesn't work.

Minimal example:

%==
\starttext
\setupinitial[n=2,text=Knuth]\placeinitial\input knuth

\framed[align=flushleft]{\setupinitial[n=2,text=Knuth]\placeinitial\input knuth 
}
\stoptext
%==

The first drop cap works, the second is empty.

Gerben Wierda (LinkedIn <https://www.linkedin.com/in/gerbenwierda>, Mastodon 
<https://newsie.social/@gctwnl>)
R&A IT Strategy <https://ea.rna.nl/> (main site)
Book: Chess and the Art of Enterprise Architecture <https://ea.rna.nl/the-book/>
Book: Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/>

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] bold small caps

2023-04-03 Thread Hans Hagen via ntg-context

On 4/3/2023 9:07 AM, Peter Münster via ntg-context wrote:

Hi,

I'm quite sure, that this worked some time ago with the standard font (LM):

\setff{smallcaps} Normal and \bf bold Small Caps.
(See also https://wiki.contextgarden.net/Bold_small_caps).

But it does not work with the latest ConTeXt version.

How could I get bold small caps with the latest version please?

TIA for any hints,

best use a font that has smallcaps (otherwise use pseudocaps \cap{..} etc)

Hans

-
  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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] tikz error upgrading to texlive version (artix)

2023-03-31 Thread Xavier B. via ntg-context

> > I reported that tikz is not working a few months ago, but after a few back 
> > and forth with Hans, could not get it to work. At that time, it appeared 
> > that I was the only have having issues, so I thought that I was making a 
> > mistake in how I was installing the package.
> > 
> > I have reverted to using mkiv for my course notes, because I heavily use 
> > pgfplots and that is not working in LMTX. (I was also using some nice new 
> > features of metafun, and have had to resort to compiling them externally 
> > using LMTX via the filter module and compiling the main doc with MkIV).
> afaik tikz should work ok, so can you make a test file?
> 
> Hans


Perhaps this is a good test. It's a complete example:

\setupcolors[state=start]
\definecolor[darkgreen][g=.5]
\usemodule[tikz] 

\starttext

\starttikzpicture[  scale=3,line cap=round
axes/.style=, 
important line/.style={very thick},
information text/.style={rounded 
corners,fill=red!10,inner sep=1ex} ]

\draw[help lines,step=0.5cm] (-1.4,-1.4) grid (1.4,1.4);
\draw (0,0) circle (1cm);   
\draw[->] (-1.5,0) -- (1.5,0) node[right] {$x$} coordinate(x 
axis);
\draw[->] (0,-1.5) -- (0,1.5) node[above] {$y$} coordinate(y 
axis);
\foreach \x/\xtext in {-1, -.5/-\frac{1}{2}, 1} 
   
\draw[xshift=\x cm] (0pt,1pt) -- (0pt,-1pt) 
   
node[below,fill=white] {$\xtext$};
\foreach \y/\ytext in {-1, -.5/-\frac{1}{2}, .5/\frac{1}{2}, 1}
\draw[yshift=\y cm] (1pt,0pt) -- (-1pt,0pt)
node[left,fill=white] {$\ytext$};
\filldraw[fill=green!20,draw=green!50!black] (0,0) -- (3mm,0pt) 
arc(0:30:3mm);
\draw (15:2mm) node[green!50!black] {$\alpha$};
\draw[important line,red]
(30:1cm) -- node[left=1pt,fill=white] {$\sin \alpha$} (30:1cm 
|- x axis);
\draw[important line,blue]
(30:1cm |- x axis) -- node[below=2pt,fill=white] {$\cos 
\alpha$} (0,0);
\draw[important line,orange!80!black] (1,0) -- 
node[right=1pt,fill=white] {
$\displaystyle \tan \alpha \black =
\frac{{\red \sin \alpha}}{\blue \cos \alpha}$}
(intersection of 0,0--30:1cm and 1,0--1,1) coordinate (t);
\draw (0,0) -- (t);
\draw[xshift=1.85cm]
node[right,text width=6cm,information text]
{
The {\darkgreen angle $\alpha$} is $30^\circ$ in the
example ($\pi/6$ in radians). The {\red sine of
$\alpha$}, which is the height of the red line, is
\startformula
{\red \sin \alpha} = 1/2.
\stopformula
By the Theorem of Pythagoras ...
};
\stoptikzpicture

\stoptext


Taking from tikz manual [https://wiki.contextgarden.net/TikZ]

Xavier

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] String substitution using regular expressions and backreferences

2022-08-26 Thread Hans Hagen via ntg-context

On 8/25/2022 9:44 PM, Thangalin via ntg-context wrote:

I've attempted to apply Wolfgang's subtle suggestion of using Lua to parse
the input document using a regular expression via lpeg.replacer. The
replacement itself works fine; however, in doing so the XML document
structure is converted to text, which means that it is no longer possible
to "flush" the XML for further processing as XML. The result is that any
unresolved XML tags are written verbatim to the PDF:

https://i.stack.imgur.com/9ZFND.png

There are two other issues with this approach. First is efficiency. Second
is that the processing function would have to be called for every XML
element to capture the replacement.

My original post asked about applying regex word substitution in a ConTeXt
way, such as:

\definereplacement[SubstMac][ match={Mc([A-Z].*)}, replace={\Mac \\1} ]
\definereplacement[SubstPostmeridian][ match={[Pp]\\.[Mm]\\.},
replace={\cap{pm}} ]

That seems like the cleanest approach because it would work on top of XML
or any other source document. Nevertheless, here is what I tried, which
partially works:

\startbuffer[main]

   “Mr. McAnulty, I presume?”
   Regular text. Irregular text.
\stopbuffer
\startxmlsetups xml:xhtml
   \xmlsetsetup{\xmldocument}{*}{-}
   \xmlsetsetup{\xmldocument}{html|p|em}{xml:*}\stopxmlsetups
\startxmlsetups xml:html
   \startdocument
 \xmlflush{#1}
   \stopdocument\stopxmlsetups
% Paragraphs are followed by a paragraph break, but only if not
nested.\startxmlsetups xml:p
   \xmlfunction{#1}{p}
   \par\stopxmlsetups
\startxmlsetups xml:em
   \dontleavehmode{\em\xmlflush{#1}}\stopxmlsetups
\startluacode
function xml.functions.p( t )
   rep = { [1] = { "McAnulty", "\\Mac Anulty" } }
   x = lpeg.replacer( rep ):match( tostring( xml.text( t ) ) )

   buffers.assign( "p", context( x ) )
   context.getbuffer{ "p" }
end\stopluacode
\xmlregistersetup{xml:xhtml}
\def\Mac{%
   % Determine the sizes of 'M' and 'c'.
   \newbox\MacMBox%
   \setbox\MacMBox\hbox{M}%
   \newbox\MacCBox%
   \setbox\MacCBox\hbox{c}%
   %
   % Cheat to dynamically derive the kerning size by putting Mc in a box.
   %
   \newbox\MacKernBox%
   \setbox\MacKernBox\hbox{\inframed[offset=\zeropoint, width=fit]{Mc}}%
   \def\MacDelta{\dimexpr\wd\MacKernBox-\wd\MacMBox-\wd\MacCBox\relax}%
   \def\MacUWidth{\dimexpr\wd\MacCBox-.75\MacDelta\relax}%
   \def\MacRule{\vrule width \MacUWidth height .04em depth \zeropoint \relax}%
   \def\MacKern{\dimexpr\wd\MacKernBox-\wd\MacMBox-\wd\MacCBox\relax}%
   \def\MacHeight{\dimexpr\ht\MacMBox-\ht\MacCBox\relax}%
   %
   % Write Mc, where c has a macron, to the document.
   %
   M{%
 \dontleavehmode{\raisebox{\MacHeight}\hbox{c}}%
 \kern-1.04\MacUWidth
 \MacRule
 \kern.08\MacUWidth
   }%
}%
\xmlprocessbuffer{main}{main}{}

As shown in the screen shot, this doesn't correctly handle nested XML
elements.

Any ideas on what approach to take to perform a string replacement in
ConTeXt?

Best stay at the xml end ...

\startbuffer[main]

  “Mr. McAnulty, I presume?”
  Regular text. Irregular text.

\stopbuffer

\startxmlsetups xml:xhtml
  \xmlsetsetup{\xmldocument}{*}{-}
  \xmlsetsetup{\xmldocument}{html|p|em}{xml:*}
\stopxmlsetups

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

\startxmlsetups xml:p
\xmlfunction{#1}{p}
\xmlcontext{#1}
\par
\stopxmlsetups

\startxmlsetups xml:em
  \dontleavehmode{\em\xmlflush{#1}}
\stopxmlsetups

\startluacode
local rep = lpeg.replacer { [1] = { "McAnulty", "\\Mac Anulty" } }
function xml.functions.p(t)
local dt = t.dt
for i=1,#dt do
local di = dt[i]
if type(di) == "string" then
dt[i] = lpeg.match(rep,di)
end
end
end
\stopluacode

\xmlregistersetup{xml:xhtml}

\startdocument
\xmlprocessbuffer{main}{main}{}
\stopdocument

But this is more fun and probably also more reliable:

\startbuffer[main]

  “Mr. McAnulty, I presume?”
  Regular text. Irregular text.

\stopbuffer

\startxmlsetups xml:xhtml
  \xmlsetsetup{\xmldocument}{*}{-}
  \xmlsetsetup{\xmldocument}{html|p|em}{xml:*}
\stopxmlsetups

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

\startxmlsetups xml:p
\xmlcontext{#1}
\par
\stopxmlsetups

\startxmlsetups xml:em
  \dontleavehmode{\em\xmlflush{#1}}
\stopxmlsetups

\xmlregistersetup{xml:xhtml}

\usemodule[gimmicks] % in latest uploads

\chardef\MacAnulty = \getprivateglyphslot{MacAnulty}

\startsetups [box:mcanulty:\number\MacAnulty]
\Mac Anulty
\stopsetups

\registerboxglyph category {mcanulty} unicode \MacAnulty \relax

\startluacode
fonts.handlers.otf.addfeature {
name= "mcanulty",
type= "ligature",
nocheck = true,
data= {
[fonts.constructors.privateslots.MacAnulty] = {
"M", "c",

Re: [NTG-context] String substitution using regular expressions and backreferences

2022-08-25 Thread Thangalin via ntg-context
I've attempted to apply Wolfgang's subtle suggestion of using Lua to parse
the input document using a regular expression via lpeg.replacer. The
replacement itself works fine; however, in doing so the XML document
structure is converted to text, which means that it is no longer possible
to "flush" the XML for further processing as XML. The result is that any
unresolved XML tags are written verbatim to the PDF:

https://i.stack.imgur.com/9ZFND.png

There are two other issues with this approach. First is efficiency. Second
is that the processing function would have to be called for every XML
element to capture the replacement.

My original post asked about applying regex word substitution in a ConTeXt
way, such as:

\definereplacement[SubstMac][ match={Mc([A-Z].*)}, replace={\Mac \\1} ]
\definereplacement[SubstPostmeridian][ match={[Pp]\\.[Mm]\\.},
replace={\cap{pm}} ]

That seems like the cleanest approach because it would work on top of XML
or any other source document. Nevertheless, here is what I tried, which
partially works:

\startbuffer[main]

  “Mr. McAnulty, I presume?”
  Regular text. Irregular text.
\stopbuffer
\startxmlsetups xml:xhtml
  \xmlsetsetup{\xmldocument}{*}{-}
  \xmlsetsetup{\xmldocument}{html|p|em}{xml:*}\stopxmlsetups
\startxmlsetups xml:html
  \startdocument
\xmlflush{#1}
  \stopdocument\stopxmlsetups
% Paragraphs are followed by a paragraph break, but only if not
nested.\startxmlsetups xml:p
  \xmlfunction{#1}{p}
  \par\stopxmlsetups
\startxmlsetups xml:em
  \dontleavehmode{\em\xmlflush{#1}}\stopxmlsetups
\startluacode
function xml.functions.p( t )
  rep = { [1] = { "McAnulty", "\\Mac Anulty" } }
  x = lpeg.replacer( rep ):match( tostring( xml.text( t ) ) )

  buffers.assign( "p", context( x ) )
  context.getbuffer{ "p" }
end\stopluacode
\xmlregistersetup{xml:xhtml}
\def\Mac{%
  % Determine the sizes of 'M' and 'c'.
  \newbox\MacMBox%
  \setbox\MacMBox\hbox{M}%
  \newbox\MacCBox%
  \setbox\MacCBox\hbox{c}%
  %
  % Cheat to dynamically derive the kerning size by putting Mc in a box.
  %
  \newbox\MacKernBox%
  \setbox\MacKernBox\hbox{\inframed[offset=\zeropoint, width=fit]{Mc}}%
  \def\MacDelta{\dimexpr\wd\MacKernBox-\wd\MacMBox-\wd\MacCBox\relax}%
  \def\MacUWidth{\dimexpr\wd\MacCBox-.75\MacDelta\relax}%
  \def\MacRule{\vrule width \MacUWidth height .04em depth \zeropoint \relax}%
  \def\MacKern{\dimexpr\wd\MacKernBox-\wd\MacMBox-\wd\MacCBox\relax}%
  \def\MacHeight{\dimexpr\ht\MacMBox-\ht\MacCBox\relax}%
  %
  % Write Mc, where c has a macron, to the document.
  %
  M{%
\dontleavehmode{\raisebox{\MacHeight}\hbox{c}}%
\kern-1.04\MacUWidth
\MacRule
\kern.08\MacUWidth
  }%
}%
\xmlprocessbuffer{main}{main}{}

As shown in the screen shot, this doesn't correctly handle nested XML
elements.

Any ideas on what approach to take to perform a string replacement in
ConTeXt?

Thanks again!


[Your] input is XML which means a lot more can be done than your simple TeX
> based example demonstrates.
>
> Wolfgang
>
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] String substitution using regular expressions and backreferences

2022-08-01 Thread Thangalin via ntg-context
Hi list,

I'm looking to perform text replacements.

\definereplacement[SubstPostmeridian][
  match={[Pp].[Mm].]},
  replace={\cap{pm}}
]

The \replaceword command doesn't handle periods well. The translate module
doesn't seem flexible enough to cover edge cases. Consider the following
example document containing both sample inputs and sample outputs:

\starttext
  {\bf Markdown Input}

  Our grandmother clock rang 11 p.m. and we fled.

  Our grandmother clock rang 11 p.m., so we fled.

  Our grandmother clock rang 11 p.m. We fled.

  \blank[big]

  {\bf \ConTeXt{} Output}

  Our grandmother clock rang 11 \cap{pm} and we fled.

  Our grandmother clock rang 11 \cap{pm}, so we fled.

  Our grandmother clock rang 11 \cap{pm}. We fled.
\stoptext

It would be most convenient to write:

% Strip periods from p.m.
\definereplacement[SubstPostmeridianLowercase][
  match={[Pp].[Mm]. ([^:upper:])},
  replace={\cap{pm} \1}
]

% Preserve terminal period for p.m. (e.e. cummings notwithstanding)
\definereplacement[SubstPostmeridianTerminal][
  match={[Pp].[Mm]. ([:upper:])},
  replace={\cap{pm}. \1}
]

% Apply a macron for lowercase 'c' (McAnulty, McGenius, etc.)
% Well, not quite a macron: https://tex.stackexchange.com/q/364024/2148
\definereplacement[SubstMac][
  match={Mc([:upper:]\w)},
  replace={M\macronbelow{c}\1}
]

The \1 may be problematic. Other sigils include $1 and #1, which may also
have issues.

Thank you!
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] SVG text alignment issue

2022-06-29 Thread Thangalin via ntg-context
Here's the formal rule:

https://www.w3.org/TR/SVG11/coords.html#TransformAttribute

rotate( [ ]), which specifies a rotation by
 degrees about a given point. If optional parameters  and
 are not supplied, the rotation is about the origin of the current user
coordinate system. The operation corresponds to the matrix [cos(a) sin(a)
-sin(a) cos(a) 0 0]. If optional parameters  and  are supplied, the
rotation is about the point (cx, cy). The operation represents the
equivalent of the following specification: translate(, )
rotate() translate(-, -).

It looks like cx/cy, if not present, mean to rotate the text about its
origin, which I would take to be width/2 and height/2. They define the
rotation matrix as [cos(a) sin(a) -sin(a) cos(a) 0 0], where a is the angle:

https://www.w3.org/TR/SVG11/coords.html#RotationDefined

It appears as though LMTX is rotating around the baseline, rather than the
central point of the text's bounding box. (I thought that (cap height +
descender height) / 2 was the middle, but I suppose that wouldn't account
for diacritics.)

Thanks for looking into this!

On Wed, Jun 29, 2022 at 2:24 PM Hans Hagen via ntg-context <
ntg-context@ntg.nl> wrote:

> On 6/29/2022 8:48 PM, Thangalin wrote:
>
> > To me, it looks like the text, after a rotational transform, is being
> > written to the baseline rather than (cap height + descender height) / 2,
> > which seems to be a MetaPost conversion issue? There's another, possibly
> > related issue, which I'll provide in a separate thread.
> Where is that rediculous (rather font version sensitive) rule defined?
> In all test i did so far baseline works ok.
>
> Btw, it is sort of baffling what applications spit out when it comes to
> svg (and exp text). The cod being meant for machines "eyes" only is not
> really an excuse.
>
> Hans
>
>
> -
>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
>
> ___
>
___
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] SVG text alignment issue

2022-06-29 Thread Hans Hagen via ntg-context

On 6/29/2022 8:48 PM, Thangalin wrote:

To me, it looks like the text, after a rotational transform, is being 
written to the baseline rather than (cap height + descender height) / 2, 
which seems to be a MetaPost conversion issue? There's another, possibly 
related issue, which I'll provide in a separate thread.
Where is that rediculous (rather font version sensitive) rule defined? 
In all test i did so far baseline works ok.


Btw, it is sort of baffling what applications spit out when it comes to 
svg (and exp text). The cod being meant for machines "eyes" only is not 
really an excuse.


Hans


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


Re: [NTG-context] SVG text alignment issue

2022-06-29 Thread Thangalin via ntg-context
Thanks for checking this. Unfortunately, introducing \hbox didn't work; the
text is still off-center with respect to the vertical line:

https://i.ibb.co/hYGfdgZ/text-align.png

For comparison, the SVG file loaded into Inkscape appears similar to:

https://i.ibb.co/KF3PBkw/inkscape-alignment.png

Note how the text is vertically centered above the vertical line.

To me, it looks like the text, after a rotational transform, is being
written to the baseline rather than (cap height + descender height) / 2,
which seems to be a MetaPost conversion issue? There's another, possibly
related issue, which I'll provide in a separate thread.

Here's the code:

% SOF
\pushoverloadmode \unprotect

\permanent\tolerant\protected\def\includesvgfile[#1]#*[#2]%
   {\hbox\bgroup % no \dontleavehmode
\getdummyparameters[\c!offset=\zeropoint,#2]%
\clf_includesvgfile{#1}\dimexpr\dummyparameter\c!offset\relax
\egroup}

\permanent\tolerant\protected\def\includesvgbuffer[#1]#*[#2]%
   {\hbox\bgroup % no \dontleavehmode
\getdummyparameters[\c!offset=\zeropoint,#2]%
\clf_includesvgbuffer{#1}\dimexpr\dummyparameter\c!offset\relax
\egroup}

\protect \popoverloadmode

\startbuffer[svg]
http://www.w3.org/2000/svg";
   xmlns:svg="http://www.w3.org/2000/svg";>
  
  16p13.3

\stopbuffer

\starttext
   \placefigure[]{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF
___
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] tikzplot displacement result [solved]

2021-12-14 Thread Jan-Erik Hägglöf via ntg-context
HI!

Thank you for your help.

The code was generated by Geogebra Classic 5 "export to pgf/tikz" function and 
it seems to have errors that needs to be solved in that application.

Now I have a good template to do this on my own.

Regards 

Jan-Erik

> 12 dec. 2021 kl. 15:53 skrev Gavin :
> 
> Hi Jan-Erik,
> 
> Use the \addplot command when you use pgfplots. The manual, pgfplots.pdf, is 
> quite good.
> 
> \setupbodyfont[10pt]
> \enableregime[utf]
> \usemodule[tikz]
> \usemodule[pgfplots]
> \usetikzlibrary[arrows]
> \setuppagenumbering[location=]
> \starttext
> \definecolor[ffvvqq][r=1.,g=0.3333,b=0.]
> \startTEXpage
> \starttikzpicture[line cap=round,line join=round,>=triangle 
> 45,x=1.0cm,y=1.0cm]
> \startaxis
> [
> x=1.0cm,y=1.0cm,
> axis lines=middle,
> ymajorgrids=true,
> xmajorgrids=true,
> xmin=-3.2488079448294145,
> xmax=34.87398305791419,
> ymin=-7.496155590728956,
> ymax=11.53265632858922,
> xtick={-3.0,-2.0,...,34.0},
> ytick={-7.0,-6.0,...,11.0},]
> %\clip(-3.2488079448294145,-7.496155590728956) rectangle 
> (34.87398305791419,11.53265632858922);
> \addplot[line 
> width=2.pt,color=ffvvqq,smooth,samples=100,domain=-3.2488079448294145:34.87398305791419]{x+3}
>  node[below right, pos= 0.1]{$h$};
> \stopaxis
> \stoptikzpicture
> \stopTEXpage
> \stoptext
> 
> I removed the clip command because it is causing a problem and is 
> unnecessary. I don’t know what you are trying to do with the node{$h$}, but I 
> made it a label on the plot.
> 
> The metafun graph module would also work for this plot, but it pgfplots is 
> more mature. I recommend using pgfplots unless you are already skilled with 
> metapost.
> 
> Hope that gets you going in the right direction.
> 
> Gavin
> 
> 
> 
>> On Dec 12, 2021, at 3:13 AM, Jan-Erik Hägglöf via ntg-context 
>>  wrote:
>> 
>> HI!
>> 
>> I’m trying to fit the funktion in the right place in this plot but it seems 
>> to get displaced.
>> 
>> What is wrong with the code?
>> 
>> Is there a way to do this in Metafun?
>> 
>> Thanks in advance
>> 
>> Sincerely 
>> 
>> Jan-Erik
>> 
>> 
>> 
>> \setupbodyfont[10pt]
>> \enableregime[utf]
>> \usemodule[tikz]
>> \usemodule[pgfplots]
>> \usetikzlibrary[arrows]
>> \setuppagenumbering[location=]
>> \starttext
>> \definecolor[ffvvqq][r=1.,g=0.,b=0.]
>> \startTEXpage
>> \starttikzpicture[line cap=round,line join=round,>=triangle 
>> 45,x=1.0cm,y=1.0cm]
>> \startaxis
>> [
>> x=1.0cm,y=1.0cm,
>> axis lines=middle,
>> ymajorgrids=true,
>> xmajorgrids=true,
>> xmin=-3.2488079448294145,
>> xmax=34.87398305791419,
>> ymin=-7.496155590728956,
>> ymax=11.53265632858922,
>> xtick={-3.0,-2.0,...,34.0},
>> ytick={-7.0,-6.0,...,11.0},]
>> \clip(-3.2488079448294145,-7.496155590728956) rectangle 
>> (34.87398305791419,11.53265632858922);
>> \draw[line 
>> width=2.pt,color=ffvvqq,smooth,samples=100,domain=-3.2488079448294145:34.87398305791419]
>>  plot(\x,{(\x)+3});
>> \draw[color=ffvvqq] (-3.5583519743388714,-0.7831230981304516) node {$h$};
>> \stopaxis
>> \stoptikzpicture
>> \stopTEXpage
>> \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
>> ___
> 

___
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] tikzplot displacement result

2021-12-12 Thread Gavin via ntg-context
Hi Jan-Erik,

Use the \addplot command when you use pgfplots. The manual, pgfplots.pdf, is 
quite good.

\setupbodyfont[10pt]
\enableregime[utf]
\usemodule[tikz]
\usemodule[pgfplots]
\usetikzlibrary[arrows]
\setuppagenumbering[location=]
\starttext
\definecolor[ffvvqq][r=1.,g=0.,b=0.]
\startTEXpage
\starttikzpicture[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\startaxis
[
x=1.0cm,y=1.0cm,
axis lines=middle,
ymajorgrids=true,
xmajorgrids=true,
xmin=-3.2488079448294145,
xmax=34.87398305791419,
ymin=-7.496155590728956,
ymax=11.53265632858922,
xtick={-3.0,-2.0,...,34.0},
ytick={-7.0,-6.0,...,11.0},]
%\clip(-3.2488079448294145,-7.496155590728956) rectangle 
(34.87398305791419,11.53265632858922);
\addplot[line 
width=2.pt,color=ffvvqq,smooth,samples=100,domain=-3.2488079448294145:34.87398305791419]{x+3}
 node[below right, pos= 0.1]{$h$};
\stopaxis
\stoptikzpicture
\stopTEXpage
\stoptext

I removed the clip command because it is causing a problem and is unnecessary. 
I don’t know what you are trying to do with the node{$h$}, but I made it a 
label on the plot.

The metafun graph module would also work for this plot, but it pgfplots is more 
mature. I recommend using pgfplots unless you are already skilled with metapost.

Hope that gets you going in the right direction.

Gavin



> On Dec 12, 2021, at 3:13 AM, Jan-Erik Hägglöf via ntg-context 
>  wrote:
> 
> HI!
> 
> I’m trying to fit the funktion in the right place in this plot but it seems 
> to get displaced.
> 
> What is wrong with the code?
> 
> Is there a way to do this in Metafun?
> 
> Thanks in advance
> 
> Sincerely 
> 
> Jan-Erik
> 
> 
> 
> \setupbodyfont[10pt]
> \enableregime[utf]
> \usemodule[tikz]
> \usemodule[pgfplots]
> \usetikzlibrary[arrows]
> \setuppagenumbering[location=]
> \starttext
> \definecolor[ffvvqq][r=1.,g=0.,b=0.]
> \startTEXpage
> \starttikzpicture[line cap=round,line join=round,>=triangle 
> 45,x=1.0cm,y=1.0cm]
> \startaxis
> [
> x=1.0cm,y=1.0cm,
> axis lines=middle,
> ymajorgrids=true,
> xmajorgrids=true,
> xmin=-3.2488079448294145,
> xmax=34.87398305791419,
> ymin=-7.496155590728956,
> ymax=11.53265632858922,
> xtick={-3.0,-2.0,...,34.0},
> ytick={-7.0,-6.0,...,11.0},]
> \clip(-3.2488079448294145,-7.496155590728956) rectangle 
> (34.87398305791419,11.53265632858922);
> \draw[line 
> width=2.pt,color=ffvvqq,smooth,samples=100,domain=-3.2488079448294145:34.87398305791419]
>  plot(\x,{(\x)+3});
> \draw[color=ffvvqq] (-3.5583519743388714,-0.7831230981304516) node {$h$};
> \stopaxis
> \stoptikzpicture
> \stopTEXpage
> \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
> ___

___
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] tikzplot displacement result

2021-12-12 Thread Jan-Erik Hägglöf via ntg-context
HI!

I’m trying to fit the funktion in the right place in this plot but it seems to 
get displaced.

What is wrong with the code?

Is there a way to do this in Metafun?

Thanks in advance

Sincerely 

Jan-Erik



\setupbodyfont[10pt]
\enableregime[utf]
\usemodule[tikz]
\usemodule[pgfplots]
\usetikzlibrary[arrows]
\setuppagenumbering[location=]
\starttext
\definecolor[ffvvqq][r=1.,g=0.,b=0.]
\startTEXpage
\starttikzpicture[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\startaxis
[
x=1.0cm,y=1.0cm,
axis lines=middle,
ymajorgrids=true,
xmajorgrids=true,
xmin=-3.2488079448294145,
xmax=34.87398305791419,
ymin=-7.496155590728956,
ymax=11.53265632858922,
xtick={-3.0,-2.0,...,34.0},
ytick={-7.0,-6.0,...,11.0},]
\clip(-3.2488079448294145,-7.496155590728956) rectangle 
(34.87398305791419,11.53265632858922);
\draw[line 
width=2.pt,color=ffvvqq,smooth,samples=100,domain=-3.2488079448294145:34.87398305791419]
 plot(\x,{(\x)+3});
\draw[color=ffvvqq] (-3.5583519743388714,-0.7831230981304516) node {$h$};
\stopaxis
\stoptikzpicture
\stopTEXpage
\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
___


Re: [NTG-context] Size of root symbol

2021-08-18 Thread Hans Hagen via ntg-context

On 8/18/2021 6:06 PM, Aditya Mahajan via ntg-context wrote:

On Wed, 18 Aug 2021, Bruce Horrocks via ntg-context wrote:


Is there a simple way to get both root signs in this MWE to be the same size?

\starttext
\startformula
\sqrt[3]{4n} \ne \sqrt[3] {n}
\stopformula
\stoptext


Make the quantities whose roots are being taken to be of the same size.

\starttext

% The simplest solution:
\startformula
\sqrt[3]{4n} \ne \sqrt[3] {\vphantom{4} n}
\stopformula

% More general
% \strut = \vphantom{(}, which is too big
\startformula
\sqrt[3]{\strut 4n} \ne \sqrt[3] {\strut n}
\stopformula

% We can define our own phantom sizes. You can play around with the numbers.
\define\filler{\vrule width 0pt height 2ex depth 0.3ex \relax}
\startformula
\sqrt[3]{\filler 4n} \ne \sqrt[3] {\filler n}
\stopformula

\stoptext

This is for Aditya to think about

\starttext

\unprotect

\defcsname\??mathradicalalternative Mine\endcsname#1%
  {\csname\??mathradicalalternative\v!normal\endcsname
 {\synchronizestrut{\mathradicalparameter\c!strut}\strut#1}}

% \defcsname\??mathradicalalternative Mine\endcsname#1%
%   {\rootradical
%  {\currentmathradicaldegree}
%  {\synchronizestrut{\mathradicalparameter\c!strut}\strut#1}}

\protect

\definemathradical[MyRoot] [strut=cap,alternative=Mine]
\definemathradical[MyRootX][strut=yes,alternative=Mine]

\startformula
\sqrt[3]{4n} \ne \sqrt[3] {\vphantom{4} n}
\stopformula

\startformula
\MyRoot[3]{4n} \ne \MyRoot[3] {n}
\stopformula

\startformula
\MyRootX[3]{4n} \ne \MyRootX[3] {n}
\stopformula

\startformula
\sqrt[3]{\strut 4n} \ne \sqrt[3] {\strut n}
\stopformula

\stoptext

we can have strut but also think of enforcing ht / dp

(or we can have minima but that i'd rather add some options to the 
engine - we already have some but i never came to apply them yet)


Hans



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


[NTG-context] Solution: LMTX initial (drop cap) in combination with indenting

2021-07-22 Thread Gerben Wierda

> On 21 Jul 2021, at 22:38, Nicola  wrote:
> 
> On 2021-07-21, Gerben Wierda  <mailto:gerben.wie...@rna.nl>> wrote:
>>> On 19 Jul 2021, at 09:56, Nicola  wrote:
>>> 
>>> 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
>> 
>> I’ve tried this. Installed the modules and then I get with
> 
> I was sure that I had used lettrine with MKIV in a document of mine, but
> after your reply I double checked that and, in fact, I was using
> lettrine only with MKII. On the plus side, I have recovered my settings
> for MKIV (which work with LMTX as well).
> 
> I think that the `distance` parameter of \setupinitials does what you
> want. Besides, if your font provides real small capitals, you may use
> \definefirstline.
> 
> This is how I set up things in one of my documents:
> 
> 
> \definefontfeature[default][default][protrusion=quality,expansion=quality,onum=no,lnum=yes]
> 
> % \definefirstline below requires a font that implements small capitals as
> % a feature (Latin Modern does not). I have used this:
> % \definefontfamily[mainfont][serif][Sorts Mill Goudy] [
> %   tf=name:Sorts Mill Goudy Regular,
> %   it=name:Sorts Mill Goudy Italic,
> % ]
> % If you don't have the font above, try this:
> \setupbodyfont[heros]
> 
> \setupbodyfont[mainfont,11pt]
> 
> \definemeasure[CAindent][12pt]
> \setupindenting[yes,\measure{CAindent}]
> 
> % Every chapter body text starts with a drop cap:
> \defineinitial[normal][
>  n=3,
>  m=1,
>  distance=18pt, % <== Add this 
>  state=start
> ]
> 
> % Special case: drop cap starting with a quote
> \defineinitial[quote][
>  n=3,
>  m=2,
>  distance=13pt,
>  hoffset=5pt, % Move drop cap a bit to the left
>  method=none
> ]
> 
> % Some initials may need special adjustments, depending on the font
> \defineinitial[Q][
>  voffset=2\lineheight,
>  n=3,
>  m=1,
>  distance=18pt,
>  state=start
> ]
> 
> % Full first line in small caps
> \definefirstline[smallcapsfirstline][
>  alternative=line,
>  style=smallcaps,
> ]
> 
> % First n words in small caps (three in this case)
> \definefirstline[smallcapsfirstlinethree][
>  alternative=word,
>  n=3,
>  style=smallcaps,
> ]
> 
> \starttext
> \setfirstline[smallcapsfirstlinethree]
> \setinitial[normal] Suppose we have a system for the approval of
> loans. \input knuth
> \blank[2*big]
> 
> \setfirstline[smallcapsfirstline]
> \setinitial[quote] “Suppose we have a system for the approval of
> loans.” \input knuth
> \blank[2*big]
> 
> \setfirstline[smallcapsfirstline]
> \setinitial[Q] Quo usque tandem abutere, Catilina, patientia nostra? quam diu
> etiam furor iste tuus nos1 eludet? quem ad finem sese effrenata iactabit
> audacia?
> 
> \stoptext
> 
> 
> I hope this will give you some ideas!
> 
> References:
> 
>https://wiki.contextgarden.net/Command/setupinitial 
> <https://wiki.contextgarden.net/Command/setupinitial>
>https://wiki.contextgarden.net/Command/definefirstline 
> <https://wiki.contextgarden.net/Command/definefirstline>
>https://www.fontsquirrel.com/fonts/Sorts-Mill-Goudy 
> <https://www.fontsquirrel.com/fonts/Sorts-Mill-Goudy>
> 
> Nicola

Hi Nicola,

Thanks. This solves the indentation of the initial itself. What remains is the 
indentation of the text immediately after, e.g. the 'uppose we’. Minimum 
example (also visible in your example):


% This combination of indenting and initial does not work properly, the text 
following the initial should be unindented
\definemeasure[CAindent][12pt]
\setupindenting[yes,\measure{CAindent}]
% Every chapter body text starts with a drop cap:

\defineinitial[normal][n=3,m=1,hoffset=\measure{CAindent},state=start]

\starttext
\setinitial[normal] S {\bf{\kap uppose we}} have a system for the approval of
loans. \input knuth
\stoptext


The ‘uppose we’ should not be indented more than the

Re: [NTG-context] Use of lettrine module in LMTX

2021-07-21 Thread Nicola
On 2021-07-21, Gerben Wierda  wrote:
>> On 19 Jul 2021, at 09:56, Nicola  wrote:
>>
>> 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
>
> I’ve tried this. Installed the modules and then I get with

I was sure that I had used lettrine with MKIV in a document of mine, but
after your reply I double checked that and, in fact, I was using
lettrine only with MKII. On the plus side, I have recovered my settings
for MKIV (which work with LMTX as well).

I think that the `distance` parameter of \setupinitials does what you
want. Besides, if your font provides real small capitals, you may use
\definefirstline.

This is how I set up things in one of my documents:


\definefontfeature[default][default][protrusion=quality,expansion=quality,onum=no,lnum=yes]

% \definefirstline below requires a font that implements small capitals as
% a feature (Latin Modern does not). I have used this:
% \definefontfamily[mainfont][serif][Sorts Mill Goudy] [
%   tf=name:Sorts Mill Goudy Regular,
%   it=name:Sorts Mill Goudy Italic,
% ]
% If you don't have the font above, try this:
\setupbodyfont[heros]

\setupbodyfont[mainfont,11pt]

\definemeasure[CAindent][12pt]
\setupindenting[yes,\measure{CAindent}]

% Every chapter body text starts with a drop cap:
\defineinitial[normal][
  n=3,
  m=1,
  distance=18pt, % <== Add this 
  state=start
]

% Special case: drop cap starting with a quote
\defineinitial[quote][
  n=3,
  m=2,
  distance=13pt,
  hoffset=5pt, % Move drop cap a bit to the left
  method=none
]

% Some initials may need special adjustments, depending on the font
\defineinitial[Q][
  voffset=2\lineheight,
  n=3,
  m=1,
  distance=18pt,
  state=start
]

% Full first line in small caps
\definefirstline[smallcapsfirstline][
  alternative=line,
  style=smallcaps,
]

% First n words in small caps (three in this case)
\definefirstline[smallcapsfirstlinethree][
  alternative=word,
  n=3,
  style=smallcaps,
]

\starttext
\setfirstline[smallcapsfirstlinethree]
\setinitial[normal] Suppose we have a system for the approval of
loans. \input knuth
\blank[2*big]

\setfirstline[smallcapsfirstline]
\setinitial[quote] “Suppose we have a system for the approval of
loans.” \input knuth
\blank[2*big]

\setfirstline[smallcapsfirstline]
\setinitial[Q] Quo usque tandem abutere, Catilina, patientia nostra? quam diu
etiam furor iste tuus nos1 eludet? quem ad finem sese effrenata iactabit
audacia?

\stoptext


I hope this will give you some ideas!

References:

https://wiki.contextgarden.net/Command/setupinitial
https://wiki.contextgarden.net/Command/definefirstline
https://www.fontsquirrel.com/fonts/Sorts-Mill-Goudy

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
___


[NTG-context] Use of lettrine module in LMTX

2021-07-21 Thread Gerben Wierda
> On 19 Jul 2021, at 09:56, Nicola  wrote:
> 
> 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

I’ve tried this. Installed the modules and then I get with

\definemeasure[CAindent][12pt]
\setupindenting[yes,\measure{CAindent}]
% Every chapter body text starts with a drop cap:

\usemodule[lettrine]
\setuplettrine[Lines=3,
   Hang=.5,
   Oversize=0,
   Raise=0,
   Findent=0pt,
   Nindent=0em,
   Slope=0em,
   Ante=,
   FontHook=,
   TextFont=\sc,
   Image=no]

\starttext
\lettrine{S}{\kap{\bf uppose we}} have a system for the approval of
loans. \input knuth
\stoptext

Result:

tex error   > tex error on line 19 in file ./test.tex: Undefined control 
sequence

 \m_syst_parameter_n ... \the \LettrineHeight ] X}}\scratchcounter = 
\numexpr (100*\LettrineHeight )/(\ht \Lettrinetbox /100) - \relax \ifnum 
\scratchcounter >0 \def \tempa {1.\the \scratchcounter }\else \def \tempa 
{1}\fi \LettrineFontHook \!!dimena 
= \tempa \Let...
 \dolettrine ...\Lettrinefindent =\LettrineFindent \relax \Lettrinelines 
=\LettrineLines \relax \setbox \Lettrinelbox \hbox {{\ifx \LettrineImage \v!yes 
\doLettrineEPS {#2}\else \ifx \LettrineImage \v!true \doLettrineEPS {#2}\else 
\doLettrineFont 
#2\fi \fi }}\...
 \lettrine{S}{\kap{\bf uppose we}}
 have a system for the approval of
 9Raise=0,
10Findent=0pt,
11Nindent=0em,
12Slope=0em,
13Ante=,
14FontHook=,
15TextFont=\sc,
16Image=no]
17 
18 \starttext
19 >>  \lettrine{S}{\kap{\bf uppose we}} have a system for the approval of
20 loans. \input knuth
21 \stoptext
22 
The control sequence at the end of the top line of your error message was never
\def'ed. You can just continue as I'll forget about whatever was undefined.
mtx-context | fatal error: return code: 256


Gerben Wierda (LinkedIn <https://www.linkedin.com/in/gerbenwierda>)
R&A Enterprise Architecture <https://ea.rna.nl/> (main site)
Book: Chess and the Art of Enterprise Architecture <https://ea.rna.nl/the-book/>
Book: Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/>

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

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


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

2021-07-18 Thread Gerben Wierda
With the following minimal example:

\definemeasure[CAindent][12pt]
% Every chapter body text starts with a drop cap:
\setupinitial[n=3,m=1,-\measure{CAindent}]]
\setupindenting[yes,\measure{CAindent}]

\starttext
\placeinitial S{\bf{\kap uppose we}} have a system for the approval of
loans. \input knuth
\stoptext

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.

Gerben Wierda (LinkedIn <https://www.linkedin.com/in/gerbenwierda>)
R&A Enterprise Architecture <https://ea.rna.nl/> (main site)
Book: Chess and the Art of Enterprise Architecture <https://ea.rna.nl/the-book/>
Book: Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/>

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

___
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] Problem with chapter numbering

2021-07-13 Thread Fabrice Couvreur
Hi,
For my book, the header for each chapter should be like the attached image. I
don't know if I am using the best method, but the result looks like what I
want. Nevertheless, I am having a problem.
I don't understand why the first chapter is not numbered while the second
is with number 1 etc.
Thanks.
Fabrice

###

\definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784]

\defineframedtext
  [FramedText]
  [
offset=0.6em,
style=,
toffset=\lineheight,
background=color,
backgroundcolor=MyColorA,
foregroundstyle={\switchtobodyfont[11pt]},
align={left, broad},
frame=off,
width=\textwidth,
  ]

\setuplabeltext
 [en]
 [chapter=CHAPITRE]


\setuppagenumbering
  [alternative=doublesided,location=]


\unexpanded\def\HeadTitle#1#2%
   {
 \FramedText{{\cap\labeltext{chapter}}\space#1
  \\
 \bfc#2}
   }

\unexpanded\def\processheadnumber#1%
   {\getmarking[chapternumber]}

 \setuphead
   [chapter]
   [style=\bfd,
align={flushleft,broad},
numbercommand=\processheadnumber,
command=\HeadTitle]


\starttext
\startchapter [title={La récurrence}]
  \startsection[title={Le principe de récurrence}]
\input knuth
  \stopsection
  \startsection[title={Le raisonement par récurrence}]
  \input knuth
  \stopsection
  \startsection[title={Récurrences fortes}]
\input knuth
  \stopsection
   \startsection[title={Exercices corrigés}]
\input knuth
  \stopsection
\stopchapter
\startchapter [title=Combinatoire-Dénombrement]
   \input knuth
\stopchapter
\startchapter [title=Suites]
  \input knuth
\stopchapter
\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
___


Re: [NTG-context] Header for a book

2021-07-13 Thread Fabrice Couvreur
Hi,
My first solution is incorrect ; with the second solution, I don't
understand why the first chapter is not numbered while the second is with
number 1.
Thanks.
Fabrice
\unexpanded\def\HeadTitle#1#2%
   {
 \FramedText{{\cap\labeltext{chapter}}\space#1
  \\
 \bfc#2}
   }

\unexpanded\def\processheadnumber#1%
   {\getmarking[chapternumber]}

 \setuphead
   [chapter]
   [style=\bfd,
align={flushleft,broad},
numbercommand=\processheadnumber,
command=\HeadTitle]


\starttext
\startchapter [title={La récurrence}]
  \startsection[title={Le principe de récurrence}]
 \dorecurse{10}{\input knuth}
  \stopsection
  \startsection[title={Le raisonement par récurrence}]
  \dorecurse{10}{\input knuth}
  \stopsection
  \startsection[title={Récurrences fortes}]
  \dorecurse{10}{\input knuth}
  \stopsection
   \startsection[title={Exercices corrigés}]
  \dorecurse{10}{\input knuth}
  \stopsection
\stopchapter
\startchapter [title=Combinatoire-Dénombrement]
\dorecurse{10}{\input knuth}
\stopchapter

\stoptext



Le lun. 12 juil. 2021 à 16:32, Fabrice Couvreur 
a écrit :

> Hi,
> For my book, the header for each chapter should be like the attached image. I
> don't know if I am using the best method, but the result looks like what I
> want. Nevertheless, I am having some problems :
> 1. the header appears on each page ;
> 2. the title of the chapter should not appear in the body of the text.
> Thanks for your help.
> Fabrice
>
> \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784]
> \defineframedtext
>   [FramedText]
>   [
> offset=0.6em,
> style=,
> toffset=\lineheight,
> background=color,
> backgroundcolor=MyColorA,
> foregroundstyle={\switchtobodyfont[11pt]},
> align={left, broad},
> frame=off,
> width=\textwidth,
>   ]
>
>
> \setuplabeltext
>  [en]
>  [chapter=CHAPITRE]
>
> \setuphead
>[chapter]
>[bodypartlabel=]
>
>
> \startsetups [header]
>  \labeltext{chapter} \getmarking[chapternumber]
> \stopsetups
>
> \setupheadertexts
>   []
>   [{\FramedText{{\cap\labeltext{chapter}\space\getmarking[chapternumber]}
>  \\
> \bfc\getmarking[chapter]}}]
>   []
>   [\FramedText{{\cap\labeltext{chapter}\space \getmarking[chapternumber]}
>  \\
>\bfc\getmarking[chapter]}]
>
>
> \setuppagenumbering
>  [alternative=doublesided,location=]
> \starttext
> \startchapter [title=La récurrence]
>   \startsection[title={Le principe de récurrence}]
>  \dorecurse{10}{\input knuth}
>   \stopsection
>   \startsection[title={Le raisonement par récurrence}]
>   \dorecurse{10}{\input knuth}
>   \stopsection
>   \startsection[title={Récurrences fortes}]
>   \dorecurse{10}{\input knuth}
>   \stopsection
>\startsection[title={Exercices corrigés}]
>   \dorecurse{10}{\input knuth}
>   \stopsection
> \stopchapter
> \startchapter [title=Combinatoire-Dénombrement]
> \dorecurse{10}{\input knuth}
> \stopchapter
>
> \stoptext[image: pied_3.png]
>
>
___
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] Header for a book

2021-07-12 Thread Fabrice Couvreur
Hi,
For my book, the header for each chapter should be like the attached image. I
don't know if I am using the best method, but the result looks like what I
want. Nevertheless, I am having some problems :
1. the header appears on each page ;
2. the title of the chapter should not appear in the body of the text.
Thanks for your help.
Fabrice

\definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784]
\defineframedtext
  [FramedText]
  [
offset=0.6em,
style=,
toffset=\lineheight,
background=color,
backgroundcolor=MyColorA,
foregroundstyle={\switchtobodyfont[11pt]},
align={left, broad},
frame=off,
width=\textwidth,
  ]


\setuplabeltext
 [en]
 [chapter=CHAPITRE]

\setuphead
   [chapter]
   [bodypartlabel=]


\startsetups [header]
 \labeltext{chapter} \getmarking[chapternumber]
\stopsetups

\setupheadertexts
  []
  [{\FramedText{{\cap\labeltext{chapter}\space\getmarking[chapternumber]}
 \\
\bfc\getmarking[chapter]}}]
  []
  [\FramedText{{\cap\labeltext{chapter}\space \getmarking[chapternumber]}
 \\
   \bfc\getmarking[chapter]}]


\setuppagenumbering
 [alternative=doublesided,location=]
\starttext
\startchapter [title=La récurrence]
  \startsection[title={Le principe de récurrence}]
 \dorecurse{10}{\input knuth}
  \stopsection
  \startsection[title={Le raisonement par récurrence}]
  \dorecurse{10}{\input knuth}
  \stopsection
  \startsection[title={Récurrences fortes}]
  \dorecurse{10}{\input knuth}
  \stopsection
   \startsection[title={Exercices corrigés}]
  \dorecurse{10}{\input knuth}
  \stopsection
\stopchapter
\startchapter [title=Combinatoire-Dénombrement]
\dorecurse{10}{\input knuth}
\stopchapter

\stoptext[image: pied_3.png]
___
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] Initial caps with short paragraph

2021-07-09 Thread Hans Hagen

On 7/9/2021 1:58 AM, Thangalin wrote:
This has come up before on the mailing list, but I was wondering if LMTX 
has a more elegant solution than using a transparent/invisible capture 
of the drop-cap.


Consider:

|\setupinitial[n=2, style=\tfd, location=text] 
\setuphead[chapter][after={\placeinitial}] \starttext \chapter Hello 
world! \input ward \stoptext |


The output shows that the second paragraph is not indented beyond the 
bounding box of the drop-cap, resulting in an overlap. This isn't a 
problem when the first paragraph spans two or more lines.


Any ideas for how to resolve this without changing the content?
all is possible but in a complex system with lots of possible 
interactions it will never be robust (especially carrying over stuff 
across paragraphs and page boundaries)


I'll provide

\forgetinitial

and maybe some more clever hack but then i first have to play more with 
some new features (there are a bunch awaiting experiments).


Hans

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


[NTG-context] Initial caps with short paragraph

2021-07-08 Thread Thangalin
This has come up before on the mailing list, but I was wondering if LMTX
has a more elegant solution than using a transparent/invisible capture of
the drop-cap.

Consider:

\setupinitial[n=2, style=\tfd,
location=text]\setuphead[chapter][after={\placeinitial}]
\starttext
  \chapter

  Hello world!

  \input ward\stoptext

The output shows that the second paragraph is not indented beyond the
bounding box of the drop-cap, resulting in an overlap. This isn't a problem
when the first paragraph spans two or more lines.

Any ideas for how to resolve this without changing the content?

Thank you!
___
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] Functionnames disappearing (sometimes)

2021-06-20 Thread Otared Kavian
Hi Hans,

Many thanks !
Yes the new engine fixes the issues.

Best regards: Otared

> On 19 Jun 2021, at 23:27, Hans Hagen  wrote:
> 
> On 6/19/2021 10:01 PM, Otared Kavian wrote:
>> Hi,
>> I don’t know whether the issue reported by Mikael S. is related to the 
>> following: since last week (I guess) some math sympbols are not shown 
>> either, such as \bigcap and \bigcup, even using version 2021.06.18 23:37. An 
>> example is:
>> \starttext
>> $A \cup B = X \cap Y$
>> \startformula
>> A \bigcup B = X \bigcap Y
>> \stopformula
>> \stoptext
> it's a bug i introduced in the engine .. you can try a newer bin from:
> 
> https://dl.contextgarden.net/build/luametatex/
> 
> 
> -
>  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
___


Re: [NTG-context] Functionnames disappearing (sometimes)

2021-06-19 Thread Hans Hagen

On 6/19/2021 10:01 PM, Otared Kavian wrote:

Hi,

I don’t know whether the issue reported by Mikael S. is related to the 
following: since last week (I guess) some math sympbols are not shown either, 
such as \bigcap and \bigcup, even using version 2021.06.18 23:37. An example is:

\starttext
$A \cup B = X \cap Y$
\startformula
A \bigcup B = X \bigcap Y
\stopformula
\stoptext

it's a bug i introduced in the engine .. you can try a newer bin from:

https://dl.contextgarden.net/build/luametatex/


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


Re: [NTG-context] Functionnames disappearing (sometimes)

2021-06-19 Thread Otared Kavian
Hi,

I don’t know whether the issue reported by Mikael S. is related to the 
following: since last week (I guess) some math sympbols are not shown either, 
such as \bigcap and \bigcup, even using version 2021.06.18 23:37. An example is:

\starttext
$A \cup B = X \cap Y$
\startformula
A \bigcup B = X \bigcap Y
\stopformula
\stoptext

Best regards: Otared

> On 19 Jun 2021, at 13:12, Hans Hagen  wrote:
> 
> On 6/18/2021 1:27 PM, Mikael Sundqvist wrote:
>> Hi,
>> It seems that
>> \setupmathematics[
>> functionstyle=normal,
>> ]
>> is the problematic one here (it is needed(?) in the Neo Euler case to
>> have function names set upright). The following file shows the problem
>> as well:
>> %%%
>> \setupmathematics[
>> functionstyle=normal,
>> ]
>> \starttext
>> We have $\cos\alpha$, $\sin\alpha$, $\tan\alpha$,
>> \startformula
>> \cos\alpha=\frac{a}{c},\quad
>> \sin\alpha=\frac{b}{c},\quad
>> \tan\alpha=\frac{\sin\alpha}{\cos\alpha}=\frac{b}{a}.
>> \stopformula
>> \stoptext
>> %%%
>> I had a backup of the file I was working on, and the problem was not
>> present on june 13 (not sure I had a completely updated ConTeXt by
>> then).
> fixed in next upload (later today)
> 
> Hans
> 
> 
> -
>  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
> ___

___
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] Label to delete in the table of contents

2020-08-24 Thread Fabrice Couvreur
Hi Wolfgang,
Thank you for your reply. Probably my fault but now I get the number 0 on
the word "Summary".
Fabrice
[image: contents.png]

Le lun. 24 août 2020 à 15:12, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> a écrit :

> Fabrice Couvreur schrieb am 23.08.2020 um 16:02:
>
> Hello,
> For the title of the chapters I use the following command.
>
> \unexpanded\def\HeadTitle#1#2%
>{\framed
>   [frame=off,
>width=fit,
>align=flushleft]
>{\color[darkgray]{\tfxx\cap\bf\labeltext{chapter}}
> \blank#1\blank#2}
>
> When I compile my project, I have the label "Chapitre" above the word
> "Sommaire" in the table of contents : how to delete it ?
>
>
> 1. Don't apply the command to \title
>
> \setuphead[title][command=]
>
>
> 2. Make the command local to bodypart of your document, this works only
> when you use section blocks (e.g. \startbodymatter)
>
> \startsectionblockenvironment[bodypart]
> \setuphead[chapter][command=\HeadTitle]
> \stopsectionblockenvironment
>
>
> 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
>
> ___
>
___
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] Label to delete in the table of contents

2020-08-24 Thread Wolfgang Schuster

Fabrice Couvreur schrieb am 23.08.2020 um 16:02:

Hello,
For the title of the chapters I use the following command.

\unexpanded\def\HeadTitle#1#2%
   {\framed
[frame=off,
       width=fit,
       align=flushleft]
 {\color[darkgray]{\tfxx\cap\bf\labeltext{chapter}}
\blank#1\blank#2}

When I compile my project, I have the label "Chapitre" above the word 
"Sommaire" in the table of contents : how to delete it ?


1. Don't apply the command to \title

\setuphead[title][command=]


2. Make the command local to bodypart of your document, this works only 
when you use section blocks (e.g. \startbodymatter)


\startsectionblockenvironment[bodypart]
    \setuphead[chapter][command=\HeadTitle]
\stopsectionblockenvironment


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] Label to delete in the table of contents

2020-08-23 Thread Fabrice Couvreur
Hello,
For the title of the chapters I use the following command.

\unexpanded\def\HeadTitle#1#2%
   {\framed
  [frame=off,
   width=fit,
   align=flushleft]
   {\color[darkgray]{\tfxx\cap\bf\labeltext{chapter}}
\blank#1\blank#2}

When I compile my project, I have the label "Chapitre" above the word
"Sommaire" in the table of contents : how to delete it ?
Thanks for your help
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] TOC chapter and section numbering

2020-08-18 Thread Adrian
Hello,

I'm attempting to typeset a short book using ConTeXt (current version: 
2020.08.09 22:03).

EXAMPLE:

\setuplist[content][alternative=c]

\setuphead[title][alternative=middle,style=cap]

\setuphead[chapter][number=no]

\setuphead[section][sectionsegments=section]

\setuplist[section][width=1.5em,margin=3em]

\starttext
\title{contents}
\placecontent

\startchapter[title={Introductory}]
\startsection[title={The concept of a function}]
\stopsection
\startsection[title={Extension and intension}]
\stopsection
\startsection[title={Functions of several variables}]
\stopsection
\startsection[title={Abstraction}]
\stopsection
\stopchapter

\startchapter[title={Lambda-Conversion}]

\startsection[title={Primitive symbols, and formulas}]
\stopsection
\startsection[title={Conversion}]
\stopsection
\startsection[title={Fundamental theorems on well-formed formulas and on the 
normal form}]
\stopsection
\stopchapter

\stoptext

I would like all the chapters to be prefixed with "Chapter RN." and the 
sections to keep a single count,
for example:

Chapter I. Introductory .
1. The concept of a function
2. Extension and intension
3. Functions of several variables
4. Abstraction
Chapter II. Lambda Conversion .
5. Primitive symbols and formulas
6. Conversion
7. Fundamental theorems on well-formed formulas and on the normal form

I tried to the following for the chapters:

\defineconversion[church][Chapter \Romannumerals.\quad]

\setuphead[chapter][conversion=church]

Which appeared to generate the prefix correctly but it overlapped the title.

Any help would be greatly appreciated. Thanks

Adrian___
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] Fwd: \emph not working in LMTX (bug?)

2020-08-03 Thread Jairo A. del Rio
Now it works. Thank you very much, Wolfgang!

Cordially,
Jairo

El lun., 3 de ago. de 2020 a la(s) 23:17, Wolfgang Schuster (
wolfgang.schuster.li...@gmail.com) escribió:

> Jairo A. del Rio schrieb am 04.08.2020 um 06:07:
>
> > The following worked some days ago. Now it crashes:
> >
> >
> \setuphead[chapter][alternative=middle,textstyle=\cap,numbercommand=\WORDS]
> >
> \setuphead[section][sectionsegments=section,align=middle,textstyle={\bf},conversion=R,numbercommand={\bf}]
> >
> \setuphead[subsection][numbercommand=,textstyle={\it},sectionsegments=subsection,conversion=n]
> > \starttext
> > \startchapter[title=Dummy chapter]
> > \startsection[title=Dummy section]
> > \startsubsection[title=Dummy subsection]
> > \input knuth
> > \stopsubsection
> > \stopsection
> > \stopchapter
> > \stoptext
>
> This caused by the second related problem mentioned in my answer, you
> get the error message for the \cap and \WORDS command.
>
> In this case there is a easy fix and also better chapter setup:
>
> \setuphead
>[chapter]
>[alternative=middle,
> textstyle=cap,
> numberstyle=WORD]
>
> 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
___


Re: [NTG-context] Fwd: \emph not working in LMTX (bug?)

2020-08-03 Thread Wolfgang Schuster

Jairo A. del Rio schrieb am 04.08.2020 um 06:07:


The following worked some days ago. Now it crashes:

\setuphead[chapter][alternative=middle,textstyle=\cap,numbercommand=\WORDS]
\setuphead[section][sectionsegments=section,align=middle,textstyle={\bf},conversion=R,numbercommand={\bf}]
\setuphead[subsection][numbercommand=,textstyle={\it},sectionsegments=subsection,conversion=n]
\starttext
\startchapter[title=Dummy chapter]
\startsection[title=Dummy section]
\startsubsection[title=Dummy subsection]
\input knuth
\stopsubsection
\stopsection
\stopchapter
\stoptext


This caused by the second related problem mentioned in my answer, you 
get the error message for the \cap and \WORDS command.


In this case there is a easy fix and also better chapter setup:

\setuphead
  [chapter]
  [alternative=middle,
   textstyle=cap,
   numberstyle=WORD]

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] Fwd: \emph not working in LMTX (bug?)

2020-08-03 Thread Jairo A. del Rio
-- Forwarded message -
De: Jairo A. del Rio 
Date: lun., 3 de ago. de 2020 a la(s) 23:05
Subject: Re: [NTG-context] \emph not working in LMTX (bug?)
To: Wolfgang Schuster 


The following worked some days ago. Now it crashes:

\setuphead[chapter][alternative=middle,textstyle=\cap,numbercommand=\WORDS]
\setuphead[section][sectionsegments=section,align=middle,textstyle={\bf},conversion=R,numbercommand={\bf}]
\setuphead[subsection][numbercommand=,textstyle={\it},sectionsegments=subsection,conversion=n]
\starttext
\startchapter[title=Dummy chapter]
\startsection[title=Dummy section]
\startsubsection[title=Dummy subsection]
\input knuth
\stopsubsection
\stopsection
\stopchapter
\stoptext

The log says:

\endgroup

\22>:157>:middle ...headshownumber \strut \headnumbercontent \par \else
\fakeheadnumbercontent \fi \begstrut \headtextcontent

\endstrut }

\strc_rendering_inject_number_and_text ...def \p_command {\headparameter
\c!command }\ifx \p_command \empty \directsetup \currentheadrenderingsetup

\else \p_command \headnumbercontent \headtextcontent \fi

\strc_rendering_place_head_number_and_text ...}\useheadstyleparameter
\c!style \setinlineheadreferenceattributes
\strc_rendering_inject_number_and_text

}\fi \strc_rendering_stop_placement

\strc_sectioning_handle ...onditional \headshownumber \let \getheadnumber
\fullheadnumber \strc_rendering_place_head_number_and_text

\else \strc_rendering_place_head_text \fi \dostoptagged
\strc_sectioning_after_yes \else \ifconditional \c_strc_sectioning_hidden
\strc_se...

\strc_sectioning_start_named_section ...de \currenthead \headparameter
\c!beforesection \the \everybeforehead \strc_sectioning_handle {#1}{#2}{#3}

\headparameter \c!insidesection

...

I guess it's unrelated to Pablo's issue (\emph works again after the patch).

El lun., 3 de ago. de 2020 a la(s) 22:48, Wolfgang Schuster (
wolfgang.schuster.li...@gmail.com) escribió:

> Jairo A. del Rio schrieb am 04.08.2020 um 03:37:
> > The following crashes with LMTX (current version: 2020.08.03 14:25):
> >
> >
> > \starttext
> > \emph{Hola}
> > \stoptext
> >
> > Log:
> >
> >
> > \emphasiscorrection ->\ifhmode \ifnum \currentgrouptype =\aligngroupcode
> >
> > \else \expandafter \expandafter \expandafter \font_emphasis_look \fi \fi
> >
> >  \egroup
> >
> > \egroup
> >
> > l.2 \emph{Hola}
> >
> > Is it a bug? \emph worked for older versions. Thank you in advance.
>
> Yes and it was already reported by Pablo but don't hesitate report
> future bugs.
>
> https://www.mail-archive.com/ntg-context@ntg.nl/msg95268.html
>
> 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
___


Re: [NTG-context] Bug in latest LMTX

2020-07-21 Thread Hans Hagen

On 7/22/2020 5:43 AM, Otared Kavian wrote:

Hi Hans,

It seems that \cap is not anymore defined in the latest LMTX: the following 
gives an error

\starttext
$A \cap B$
\stoptext

with current version: 2020.07.21 18:39.

Also, I would like to place a request about the reporting of errors: can we get 
back the nice reporting of errors we had a few months ago?
Indeed while a few months ago the reporting of errors was extremeley clear and 
helpful, now one gets a cryptic message like this in the html file produced:

Error  ! Missing } inserted
File   chapitre-1.tex
Line   834

Of course there is no missing } error in that file and that line, and one has 
to spend a lot of time to find what the error would be. In this case I could 
guess that the error comes from the fact that \cap is not defined, but it 
wasn't easy (the file used to typeset correctly with version 2020.07.13, and it 
typesets correctly with mkiv).
In eralier versions, ConTeXt would tell the user
undefined control sequence \cap
and one could fix things very quickly.


\cap is defined (just put \meaning in front), it just doesn't have the 
meaning you want in math (a symbol), so it scane for an argument


fixed in next (the running out of text is on the agenda for later, part 
of something larger)


Hans


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


[NTG-context] Bug in latest LMTX

2020-07-21 Thread Otared Kavian
Hi Hans,

It seems that \cap is not anymore defined in the latest LMTX: the following 
gives an error

\starttext
$A \cap B$
\stoptext

with current version: 2020.07.21 18:39.

Also, I would like to place a request about the reporting of errors: can we get 
back the nice reporting of errors we had a few months ago? 
Indeed while a few months ago the reporting of errors was extremeley clear and 
helpful, now one gets a cryptic message like this in the html file produced:

Error  ! Missing } inserted
File   chapitre-1.tex
Line   834

Of course there is no missing } error in that file and that line, and one has 
to spend a lot of time to find what the error would be. In this case I could 
guess that the error comes from the fact that \cap is not defined, but it 
wasn't easy (the file used to typeset correctly with version 2020.07.13, and it 
typesets correctly with mkiv).
In eralier versions, ConTeXt would tell the user 
undefined control sequence \cap
and one could fix things very quickly.

Best regards, and please pardon my early morning request…
Otared
___
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] french translation of ConTeXt interface - progress (v3)

2020-07-19 Thread Garulfo

file name can be confusing, it's not yet complete

TypeNames   TranslationsAchievement 
commands3962954 24%
constants   841 708 84%
elements26  25  DONE
setupstrings135 56  41%
variables   1330680 51%
6294242339%


Following your feedbacks, I will update it and improve its consistency.

As you advised, I will try first to complete constants and variables 
(keys/values) during July and August.


And, if it makes sense for ConTeXt's community to use it as a "new" or 
an "updated" french interface, I may try to produce a 40~50 pages 
documentation for the basics commands (during 2020 S2):


• \starttext
• \startchapter, \startsection, \starttitle, \startsubject,
\setuphead,  \completecontent
• \em, \bf, \cap,
• \startitemize, \startitem,  \starthead,
• \placefigure, \externalfigure,
• \placetable, \starttable,\starttabulate, \setupTABLE, \bTABLE
• \index, \completeindex
• \setuplayout, \setupfootertexts et \setupheadertexts
• \definedescription, \defineenumeration
• \at, \in


Anyway, thanks again for your support.


Le 19/07/2020 à 22:55, Hans Hagen a écrit :

On 7/19/2020 8:27 PM, Garulfo wrote:


file: mult-def.lua.complet

i'll have a look at it

Hans

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


___
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] Quotation dash issues with semantic markup

2020-01-17 Thread Wolfgang Schuster

Hans Hagen schrieb am 30.12.2019 um 10:19:

On 12/30/2019 5:03 AM, Sam May wrote:


\setuplanguage[en]
[leftquotation=\quotedash~,
rightquotation=~\quotedash,
leftsentence=\removeunwantedspaces~\endash\space,
midsentence=\removeunwantedspaces~\endash\space,
%    leftsentence=\endash~,
%    midsentence=~\endash,
rightsentence=~\endash]
\define\quotedash{\emdash\endash}

%\setupbackend[export=yes]

\starttext

\startsection[title=Introduction]
Any of you able to help me get my quotation dashes into line when 
automatically
inserted by the semantic commands?  I'm sure a number of you look at 
this style
and cringe, but \cap{A.} I'm not looking for grammatical input, and 
\cap{B.}
I'm intending this for a non-English language where the quotation dash 
(though

still not most common) isn't as out of place.
\stopsection

\startsection[title=Desired rendering]
\quotedash~Speech should always have a dash at the start, but none at 
the end

of a paragraph.

\quotedash~Dialog asides should not duplicate dashes,~\endash\ he
said.~\quotedash\ Also, this doesn't reflect the spacing mentioned in 
section

\in[extra].  \quotedash~nor, as above, add ones at the end of paragraphs.
\endash~he continued.
\stopsection

\startsection[title=Actual output]
\speech{Speech should always have a dash at the start, but none at the 
end of a

paragraph.}

\speech{Dialog asides should not duplicate dashes, \aside{he said.}} 
Also, note
the spacing isn't removed despite \type{\removeunwantedspaces}, but 
instead

duplicated.  \speech{nor, as above, add ones at the end of paragraphs.
\aside{he continued.}}
\stopsection

\startsection[title=Additional considerations and 
observations,reference=extra]
It would also be nice if a quote ending in a period carried the 
\quote{broad}

spacing to the other side of the (ending) quote dash |=| the dash before
\quote{Also} above would be packed on the left and broad on the right. 
I know

this might be a lot trickier to code, and only consider it a bonus.

The issue with \type{\removeunwantedspaces} only seems to affect the 
command
forms.  When inserted directly |<| as here |>| the spacing acts as 
desired in
the \cap{PDF} (as expected, the \cap{XML} doesn't understand the 
order).  Also,

the right \type{|>|} doesn't require either of the explicit spacing
instructions (beyond being non-breaking) while the others do; try 
switching the

commented lines and re-rendering.

The quotation dash itself only \emph{looks} as I want it; when I 
highlight and
copy the text or export it to the \cap{XML} backend, it's still two 
dashes next
to each other.  Instead, I'd like it to be the Unicode bar U+2015.  
I'm not
sure if \TEX/\LUATEX\ allows that difference between appearance and 
interaction
(I do know \cap{PDF} does), so if there's some way of adding a new 
glyph to the
font |<| one that mimics the other dashes even if the font changes |>| 
I'd love
to actually use the proper codepoint.  As is, that doesn't work in the 
standard

font(s): [\char"2015].
\stopsection

\stoptext

I bet that Wolfgang has the answers to the speech setup so I'll do the 
font part.


It's possible to use leaders to remove multiple dashes and also dashes 
at the end of a paragraph but this will only work for the PDF. A 
limitation is that you can't use the existing \speech and \aside 
commands because they use groups which prevents the removal of unwanted 
dashes.


\unprotect

\def\speech_dash
  {\setbox\scratchbox\hbox{\texthorizontalbar\space}%
   \leaders\copy\scratchbox\hskip\wd\scratchbox}

\def\speech_left
  {\ifhmode
 \removeunwantedspaces
   \else
 \dontleavehmode
   \fi
   \space\speech_dash}

\def\speech_right
  {\removeunwantedspaces
   \space\speech_dash}

%\define[1]\speech
%  {\speech_left#1\speech_right}

\unexpanded\def\speech
  {\speech_left
   \bgroup
   \aftergroup\speech_right
   \let\next=}

\def\aside_dash
  {\setbox\scratchbox\hbox{\endash\space}%
   \leaders\copy\scratchbox\hskip\wd\scratchbox}

\def\aside_left
  {\ifhmode
 \removeunwantedspaces
   \else
 \dontleavehmode
   \fi
   \space\aside_dash}

\def\aside_right
  {\space\aside_dash}

%\define[1]\aside
%  {\aside_left#1\aside_right}

\unexpanded\def\aside
  {\aside_left
   \bgroup
   \aftergroup\aside_right
   \let\next=}

\protect

\setupbodyfont[pagella]

\starttext

\speech{first speech} \speech{second speech}

\speech{first speech} no speech \speech{second speech}

\speech{first speech\aside{aside}} \speech{second speech}

\speech{speech \aside{aside}} no speech

\stoptext

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
___


Re: [NTG-context] Quotation dash issues with semantic markup

2019-12-30 Thread Hans Hagen

On 12/30/2019 5:03 AM, Sam May wrote:


\setuplanguage[en]
[leftquotation=\quotedash~,
rightquotation=~\quotedash,
leftsentence=\removeunwantedspaces~\endash\space,
midsentence=\removeunwantedspaces~\endash\space,
%   leftsentence=\endash~,
%   midsentence=~\endash,
rightsentence=~\endash]
\define\quotedash{\emdash\endash}

%\setupbackend[export=yes]

\starttext

\startsection[title=Introduction]
Any of you able to help me get my quotation dashes into line when 
automatically
inserted by the semantic commands?  I'm sure a number of you look at 
this style
and cringe, but \cap{A.} I'm not looking for grammatical input, and 
\cap{B.}
I'm intending this for a non-English language where the quotation dash 
(though

still not most common) isn't as out of place.
\stopsection

\startsection[title=Desired rendering]
\quotedash~Speech should always have a dash at the start, but none at 
the end

of a paragraph.

\quotedash~Dialog asides should not duplicate dashes,~\endash\ he
said.~\quotedash\ Also, this doesn't reflect the spacing mentioned in 
section

\in[extra].  \quotedash~nor, as above, add ones at the end of paragraphs.
\endash~he continued.
\stopsection

\startsection[title=Actual output]
\speech{Speech should always have a dash at the start, but none at the 
end of a

paragraph.}

\speech{Dialog asides should not duplicate dashes, \aside{he said.}} 
Also, note

the spacing isn't removed despite \type{\removeunwantedspaces}, but instead
duplicated.  \speech{nor, as above, add ones at the end of paragraphs.
\aside{he continued.}}
\stopsection

\startsection[title=Additional considerations and 
observations,reference=extra]
It would also be nice if a quote ending in a period carried the 
\quote{broad}

spacing to the other side of the (ending) quote dash |=| the dash before
\quote{Also} above would be packed on the left and broad on the right. 
I know

this might be a lot trickier to code, and only consider it a bonus.

The issue with \type{\removeunwantedspaces} only seems to affect the 
command
forms.  When inserted directly |<| as here |>| the spacing acts as 
desired in
the \cap{PDF} (as expected, the \cap{XML} doesn't understand the order). 
 Also,

the right \type{|>|} doesn't require either of the explicit spacing
instructions (beyond being non-breaking) while the others do; try 
switching the

commented lines and re-rendering.

The quotation dash itself only \emph{looks} as I want it; when I 
highlight and
copy the text or export it to the \cap{XML} backend, it's still two 
dashes next

to each other.  Instead, I'd like it to be the Unicode bar U+2015.  I'm not
sure if \TEX/\LUATEX\ allows that difference between appearance and 
interaction
(I do know \cap{PDF} does), so if there's some way of adding a new glyph 
to the
font |<| one that mimics the other dashes even if the font changes |>| 
I'd love
to actually use the proper codepoint.  As is, that doesn't work in the 
standard

font(s): [\char"2015].
\stopsection

\stoptext

I bet that Wolfgang has the answers to the speech setup so I'll do the 
font part. Assuming that you use context lmtx (the luametatex branch), 
you can use some of the new metafun magic.


\startMPcalculation{simplefun}

vardef QuotationDash =
draw image (
interim linecap := squared ;
save l ; l := 0.2 ;
draw (l/2,2) -- (15-l/2,2) withpen pencircle scaled l ;
)
enddef ;

lmt_registerglyphs [
name = "symbols",
units= 10,
usecolor = true,
width= 15,
height   = 2.1,
depth= 0,
] ;

lmt_registerglyph [ category = "symbols", unicode = "0x2015", code 
= "QuotationDash ;" ] ;


\stopMPcalculation

\definefontfeature[default][default][metapost=symbols]

% \showglyphs

\starttext

\startlines
xx\endashxx
xx\emdashxx
xx\endash\emdash xx
xx\char"2015 xx
\stoplines

\stoptext

Keep in mind that when you use for instance pagella, that there already 
that glyph.


Hans


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


Re: [NTG-context] Adjust kern for one character

2019-12-26 Thread Rik Kabel


On 12/23/2019 18:45, Rik Kabel wrote:


On 12/22/2019 21:34, Henri Menke wrote:



On 12/23/19 3:33 PM, Henri Menke wrote:

On 12/23/19 2:30 PM, Rik Kabel wrote:


On 12/22/2019 17:40, mf wrote:

Il 22/12/19 22:19, Rik Kabel ha scritto:

List,

Is there a way in ConTeXt to adjust the left-side kern for one
character? The cap J in the font I am using is being set too 
close to

the preceding characters and I would rather not insert a thinspace
before each. (Inserting a thinspace is sufficient, but finer control
is welcome.)


\definecharacterspacing[distantJ]
\setupcharacterspacing[distantJ]["004A][left=.15,alternative=1] % 
004A

is the unicode hex index of letter J
\starttext
    normal: AJB\par
    \setcharacterspacing[distantJ] more space on the left: AJB\par
    \resetcharacterspacing normal again: AJB\par
\stoptext


Thank you for that, Massi.

Unfortunately, that is too blunt an instrument in this case -- in
addition to the body font where the problem exists, it works on the
heading and titling font, which does not share the problem.

As Henri's answer hints, I was a bit unclear in my request. It is a 
kern

between a word space and the cap J that is the issue. Perhaps a font
feature file is the place to do such a thing.


\startluacode
fonts.handlers.otf.addfeature {
  name = "kern",
  type = "kern",
  data = {
  [" "] = {
  ["J"] = 1000 % exaggerated value


Should of course be a Lua comment

    ["J"] = 1000 -- exaggerated value


  }
  }
}
\stopluacode

\setupbodyfont[modern] % have to reload the font

\starttext

No Jokes!

\stoptext


Henri,

This looks very promising. It works, mostly. That is, all fonts that 
use default fontfeatures pick up the change. So, for example, the 
companion sansserif for my body font also gets it even though that is 
not what I want.


I can remove kerning from the default fontfeatures and add it back 
just for the problematic font, but that means no kerning for the sans 
font.


Is there a way to apply this to one font only (serif upright, bold, 
italic, ...) or even a single face (upright), perhaps by giving it a 
unique name? I have tried a few variations but had no success. The 
fonts-mkiv manual has very little on this, and the cld manual nothing.


Okay, I have progressed further but have run into something (else) I 
cannot understand. Consider the following example:


   \definefontfeature   [myserif] [mode=node,kern=yes,xkern=yes]
   \definefontfeature   [mysans]  [mode=node,kern=yes,xkern=no]
   \definefontfeature   [none][mode=node]
   \definefontfamily[mykerns] [serif] [Baskervaldx][features=myserif]
   \definefontfamily[mykerns] [sans]  [Dejavusans] [features=mysans]
   \definefontfamily[default] [serif] [Baskervaldx][features=default]
   \definefontfamily[default] [sans]  [Dejavusans] [features=default]
   \definefontfamily[nokerns] [serif] [Baskervaldx][features=none]
   \definefontfamily[nokerns] [sans]  [Dejavusans] [features=none]
   \definefontfamily[legends] [mono]  [Dejavusansmono] [features=default]

   \startluacode
  fonts.handlers.otf.addfeature {
  name = "kern",
  type = "kern",
  data = {
  ["x"] = { ["x"] = -300 },
  [" "] = { ["A"] = 1000 }
  }
  }
  fonts.handlers.otf.addfeature {
  name = "xkern",
  type = "kern",
  data = {
  ["x"] = { ["x"] = 500 },
  [" "] = { ["J"] = 500 }
  }
  }
   \stopluacode

   \startbuffer[Sample]
  g, Jaxxb AJon
   \stopbuffer

   \define[2]\Test{
  {\switchtobodyfont[#1]#2\getbuffer[Sample]}}

   \setupbodyfont[legends]

   \starttext
   \starttabulate[|l|l|l|]
   \NC test \NC  Serif\NC  Sans \NC \NR
   \NC nokerns  \NC  \Test{nokerns}{\tf}  \NC  \Test{nokerns}{\ss}  \NC \NR
   \NC default  \NC  \Test{default}{\tf}  \NC  \Test{default}{\ss}  \NC \NR
   \NC mykerns  \NC  \Test{mykerns}{\tf}  \NC  \Test{mykerns}{\ss}  \NC \NR
   \stoptabulate
   \stoptext

It shows, as far as I see, that the kern feature type supports " ", but 
only when it is named kern. When it is named xkern, as here, it does not 
support spaces, but does support other characters.


If I can get support for a separate feature name, I can easily apply 
this corrective kern to the single problematic font.


I also tried a goodie file, but it, too, did not support the " ".

--
Rik

___
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] Adjust kern for one character

2019-12-23 Thread Rik Kabel


On 12/22/2019 21:34, Henri Menke wrote:



On 12/23/19 3:33 PM, Henri Menke wrote:

On 12/23/19 2:30 PM, Rik Kabel wrote:


On 12/22/2019 17:40, mf wrote:

Il 22/12/19 22:19, Rik Kabel ha scritto:

List,

Is there a way in ConTeXt to adjust the left-side kern for one
character? The cap J in the font I am using is being set too close to
the preceding characters and I would rather not insert a thinspace
before each. (Inserting a thinspace is sufficient, but finer control
is welcome.)


\definecharacterspacing[distantJ]
\setupcharacterspacing[distantJ]["004A][left=.15,alternative=1] % 004A
is the unicode hex index of letter J
\starttext
    normal: AJB\par
    \setcharacterspacing[distantJ] more space on the left: AJB\par
    \resetcharacterspacing normal again: AJB\par
\stoptext


Thank you for that, Massi.

Unfortunately, that is too blunt an instrument in this case -- in
addition to the body font where the problem exists, it works on the
heading and titling font, which does not share the problem.

As Henri's answer hints, I was a bit unclear in my request. It is a 
kern

between a word space and the cap J that is the issue. Perhaps a font
feature file is the place to do such a thing.


\startluacode
fonts.handlers.otf.addfeature {
  name = "kern",
  type = "kern",
  data = {
  [" "] = {
  ["J"] = 1000 % exaggerated value


Should of course be a Lua comment

    ["J"] = 1000 -- exaggerated value


  }
  }
}
\stopluacode

\setupbodyfont[modern] % have to reload the font

\starttext

No Jokes!

\stoptext


Henri,

This looks very promising. It works, mostly. That is, all fonts that use 
default fontfeatures pick up the change. So, for example, the companion 
sansserif for my body font also gets it even though that is not what I want.


I can remove kerning from the default fontfeatures and add it back just 
for the problematic font, but that means no kerning for the sans font.


Is there a way to apply this to one font only (serif upright, bold, 
italic, ...) or even a single face (upright), perhaps by giving it a 
unique name? I have tried a few variations but had no success. The 
fonts-mkiv manual has very little on this, and the cld manual nothing.


--
Rik

___
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] Adjust kern for one character

2019-12-22 Thread Henri Menke



On 12/23/19 3:33 PM, Henri Menke wrote:

On 12/23/19 2:30 PM, Rik Kabel wrote:


On 12/22/2019 17:40, mf wrote:

Il 22/12/19 22:19, Rik Kabel ha scritto:

List,

Is there a way in ConTeXt to adjust the left-side kern for one
character? The cap J in the font I am using is being set too close to
the preceding characters and I would rather not insert a thinspace
before each. (Inserting a thinspace is sufficient, but finer control
is welcome.)


\definecharacterspacing[distantJ]
\setupcharacterspacing[distantJ]["004A][left=.15,alternative=1] % 004A
is the unicode hex index of letter J
\starttext
    normal: AJB\par
    \setcharacterspacing[distantJ] more space on the left: AJB\par
    \resetcharacterspacing normal again: AJB\par
\stoptext


Thank you for that, Massi.

Unfortunately, that is too blunt an instrument in this case -- in
addition to the body font where the problem exists, it works on the
heading and titling font, which does not share the problem.

As Henri's answer hints, I was a bit unclear in my request. It is a kern
between a word space and the cap J that is the issue. Perhaps a font
feature file is the place to do such a thing.


\startluacode
fonts.handlers.otf.addfeature {
  name = "kern",
  type = "kern",
  data = {
  [" "] = {
  ["J"] = 1000 % exaggerated value


Should of course be a Lua comment

["J"] = 1000 -- exaggerated value


  }
  }
}
\stopluacode

\setupbodyfont[modern] % have to reload the font

\starttext

No Jokes!

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


Re: [NTG-context] Adjust kern for one character

2019-12-22 Thread Henri Menke

On 12/23/19 2:30 PM, Rik Kabel wrote:


On 12/22/2019 17:40, mf wrote:

Il 22/12/19 22:19, Rik Kabel ha scritto:

List,

Is there a way in ConTeXt to adjust the left-side kern for one
character? The cap J in the font I am using is being set too close to
the preceding characters and I would rather not insert a thinspace
before each. (Inserting a thinspace is sufficient, but finer control
is welcome.)


\definecharacterspacing[distantJ]
\setupcharacterspacing[distantJ]["004A][left=.15,alternative=1] % 004A
is the unicode hex index of letter J
\starttext
   normal: AJB\par
   \setcharacterspacing[distantJ] more space on the left: AJB\par
   \resetcharacterspacing normal again: AJB\par
\stoptext


Thank you for that, Massi.

Unfortunately, that is too blunt an instrument in this case -- in
addition to the body font where the problem exists, it works on the
heading and titling font, which does not share the problem.

As Henri's answer hints, I was a bit unclear in my request. It is a kern
between a word space and the cap J that is the issue. Perhaps a font
feature file is the place to do such a thing.


\startluacode
fonts.handlers.otf.addfeature {
name = "kern",
type = "kern",
data = {
[" "] = {
["J"] = 1000 % exaggerated value
}
}
}
\stopluacode

\setupbodyfont[modern] % have to reload the font

\starttext

No Jokes!

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


Re: [NTG-context] Adjust kern for one character

2019-12-22 Thread Rik Kabel


On 12/22/2019 17:40, mf wrote:

Il 22/12/19 22:19, Rik Kabel ha scritto:

List,

Is there a way in ConTeXt to adjust the left-side kern for one 
character? The cap J in the font I am using is being set too close to 
the preceding characters and I would rather not insert a thinspace 
before each. (Inserting a thinspace is sufficient, but finer control 
is welcome.)



\definecharacterspacing[distantJ]
\setupcharacterspacing[distantJ]["004A][left=.15,alternative=1] % 004A 
is the unicode hex index of letter J

\starttext
  normal: AJB\par
  \setcharacterspacing[distantJ] more space on the left: AJB\par
  \resetcharacterspacing normal again: AJB\par
\stoptext


Thank you for that, Massi.

Unfortunately, that is too blunt an instrument in this case -- in 
addition to the body font where the problem exists, it works on the 
heading and titling font, which does not share the problem.


As Henri's answer hints, I was a bit unclear in my request. It is a kern 
between a word space and the cap J that is the issue. Perhaps a font 
feature file is the place to do such a thing.


--
Rik

___
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] Adjust kern for one character

2019-12-22 Thread mf

Il 22/12/19 22:19, Rik Kabel ha scritto:

List,

Is there a way in ConTeXt to adjust the left-side kern for one 
character? The cap J in the font I am using is being set too close to 
the preceding characters and I would rather not insert a thinspace 
before each. (Inserting a thinspace is sufficient, but finer control is 
welcome.)



\definecharacterspacing[distantJ]
\setupcharacterspacing[distantJ]["004A][left=.15,alternative=1] % 004A 
is the unicode hex index of letter J

\starttext
  normal: AJB\par
  \setcharacterspacing[distantJ] more space on the left: AJB\par
  \resetcharacterspacing normal again: AJB\par
\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
___


Re: [NTG-context] Adjust kern for one character

2019-12-22 Thread Henri Menke

On 12/23/19 10:19 AM, Rik Kabel wrote:

List,

Is there a way in ConTeXt to adjust the left-side kern for one 
character?


No, kerns always come in pairs.


The cap J in the font I am using is being set too close to
the preceding characters and I would rather not insert a thinspace 
before each. (Inserting a thinspace is sufficient, but finer control

is welcome.)


___
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] Adjust kern for one character

2019-12-22 Thread Rik Kabel

List,

Is there a way in ConTeXt to adjust the left-side kern for one 
character? The cap J in the font I am using is being set too close to 
the preceding characters and I would rather not insert a thinspace 
before each. (Inserting a thinspace is sufficient, but finer control is 
welcome.)


--
Rik

___
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] Formatting spaces for \placelistof ?

2019-12-12 Thread Jon Wong
Sorry for the noise. \setupsynonyms[term][width=X].

But I can’t get textstyle to work. Tried bold too.

How do I insert a blank line between entries?

> On Dec 13, 2019, at 3:23 PM, Jon Wong  wrote:
> 
> Space between the term (left column) and the definition (right column) is too 
> small.
> 
> \definesynonyms[term][terms][\deffull]
> \setupsynonyms[term][textstyle=cap]
> \placelistofterms

___
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] Formatting spaces for \placelistof ?

2019-12-12 Thread Jon Wong
Space between the term (left column) and the definition (right column) is too 
small.

\definesynonyms[term][terms][\deffull]
\setupsynonyms[term][textstyle=cap]
\placelistofterms
___
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] Command completion in TeXShop

2019-09-21 Thread Henning Hraban Ramm
Hi,
I don’t use TeXshop, but other editors also lack support for ConTeXt or have an 
outdated vocabulary for it (e.g. the Atom "context" plugin). It would make 
sense to use the interface files and write a script to create the lists needed 
for each editor. Probably I’ll try that for Atom, if I don’t switch to vscode 
(it’s supposed to be quite similar to Atom, and Hans wrote a setup for it)…
Hraban

> Am 2019-09-20 um 07:54 schrieb Otared Kavian :
> 
> Hi,
> 
> I did not know the post by Herb Schulz, but I do use TeXShop and ConTeXt on a 
> Mac, although actually I have never used the command completion mechanism. 
> 
> However I use extensively the autocompletion mechanism which is a way to 
> key-in more rapidly some commands: for instance pressing alt-Cap-$ gives me 
> \startformula
> 
> \stopformula
> 
> with the inserting point being between the two. The autompletion mechanism 
> uses a file named autocompletion.plist which can be easily edited and adapted 
> by the user (mine is adapted to the french keyboard layout AZERTY).
> 
> Indeed I can send you that file and also help fill in the command completion 
> file in order to integrate ConTeXt commands.
> 
> Best regards: OK
> 
>> On 19 Sep 2019, at 14:10, Rogers, Michael K  wrote:
>> 
>> I was looking into command completion in TeXShop (MacOS) and came across 
>> this two-year-old call for help by one of the developers (I assume) for 
>> implementing it for ConTeXt:
>> 
>> http://macosx-tex.576846.n2.nabble.com/TeXShop-Command-Completion-ConTeXt-td7586673.html
>> 
>> As far as I found, command completion for ConTeXt has not yet been 
>> implemented. I’m pointing this out in case someone has sufficient knowledge 
>> of ConTeXt and is interested. Alternatively, perhaps it has been done, and 
>> someone can point me in the right direction.
>> 
>> Thanks,
>> 
>> Michael

___
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] Command completion in TeXShop

2019-09-19 Thread Otared Kavian
Hi,

I did not know the post by Herb Schulz, but I do use TeXShop and ConTeXt on a 
Mac, although actually I have never used the command completion mechanism. 

However I use extensively the autocompletion mechanism which is a way to key-in 
more rapidly some commands: for instance pressing alt-Cap-$ gives me 
\startformula

\stopformula

with the inserting point being between the two. The autompletion mechanism uses 
a file named autocompletion.plist which can be easily edited and adapted by the 
user (mine is adapted to the french keyboard layout AZERTY).

Indeed I can send you that file and also help fill in the command completion 
file in order to integrate ConTeXt commands.

Best regards: OK

> On 19 Sep 2019, at 14:10, Rogers, Michael K  wrote:
> 
> I was looking into command completion in TeXShop (MacOS) and came across this 
> two-year-old call for help by one of the developers (I assume) for 
> implementing it for ConTeXt:
> 
> http://macosx-tex.576846.n2.nabble.com/TeXShop-Command-Completion-ConTeXt-td7586673.html
> 
> As far as I found, command completion for ConTeXt has not yet been 
> implemented. I’m pointing this out in case someone has sufficient knowledge 
> of ConTeXt and is interested. Alternatively, perhaps it has been done, and 
> someone can point me in the right direction.
> 
> Thanks,
> 
> Michael
> 
> 
> 
> This e-mail message (including any attachments) is for the sole use of
> the intended recipient(s) and may contain confidential and privileged
> information. If the reader of this message is not the intended
> recipient, you are hereby notified that any dissemination, distribution
> or copying of this message (including any attachments) is strictly
> prohibited.
> 
> If you have received this message in error, please contact
> the sender by reply e-mail message and destroy all copies of the
> original message (including attachments).
> ___
> 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
> ___

___
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] adjusting tikz pictures

2019-04-24 Thread Aditya Mahajan

On Wed, 24 Apr 2019, Gour wrote:


Hello,

I believe that using GeoGebra for drawing, exporting to TikZ is the most
approachable method for me to be able to create mathematic-related
material like exams for the children in the primary school, but need some
info how to adjust GeoGebra's TikZ output (suitable for LaTeX) for
ConTeXt?


You need to change \begin{tikzpicture} ... \end{tikpicture} to 
\starttikzpicture ... \stoptikzpicture and any other \begin{...} ... 
\end{...} pairs that occur in tikz (like \begin{axis}, \begin{scope}, etc) 
to \start... \stop... pairs. There are a few other quirks which have 
simple workarounds. I am not sure if they are documented anywhere.


If you are more comfortable using a visual tool like GeoGebra than writing 
the tikz/metapost code by hand, then I'd say that simply process the 
generate latex code through latex to generate standalone pdfs and include 
them in your context document using \externalfigure[...].


There are benefits of using the tikz/metapost code in the tex document. 
The main advantage is that your images and main text use the same fonts, 
but that can be handled by using the same fonts in latex when generating 
the image. The other advantages such as consistent look and feel across 
multiple images go away when you copy-paste auto-generated code.


So, simply including the generated figures using \externalfigure[...] will 
allow you to get productive right away. If and when you start noticing the 
limitations of this approach, then you can learn metapost/tikz :-)


If you follow this route, then I would add

\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{2mm}
\PreviewEnvironment{tikzpicture}

in the latex preamble. This will create standalone pages that are the same 
size the tikzpicture, so that you don't have to crop manually.




Here is the simple example:

\documentclass[10pt]{article}
\usepackage{pgf,tikz,pgfplots}
\pgfplotsset{compat=1.15}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\definecolor{zzttqq}{rgb}{0.6,0.2,0}
\definecolor{ududff}{rgb}{0.30196078431372547,0.30196078431372547,1}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
\begin{axis}[
x=1cm,y=1cm,
axis lines=middle,
ymajorgrids=true,
xmajorgrids=true,
xmin=-12.678,
xmax=12.678,
ymin=-13.472,
ymax=8.91,
xtick={-12,-11,...,12},
ytick={-13,-12,...,8},]
\clip(-12.68,-13.47) rectangle (12.68,8.91);
\fill[line width=2pt,color=zzttqq,fill=zzttqq,fill opacity=0.1000149011612] 
(-7.7,2.75) -- (0.88,2.57) -- (-3.04,-3.37) -- cycle;
\draw [line width=2pt,color=zzttqq] (-7.7,2.75)-- (0.88,2.57);
\draw [line width=2pt,color=zzttqq] (0.88,2.57)-- (-3.04,-3.37);
\draw [line width=2pt,color=zzttqq] (-3.04,-3.37)-- (-7.7,2.75);
\draw [line width=2pt,domain=-12.68:12.68] plot(\x,{(--25.3932-4.84*\x)/0.04});
\draw [line width=2pt,domain=-12.68:12.68] plot(\x,{(-13.78-3.92*\x)/5.94});
\draw [line width=2pt,domain=-12.68:12.68] plot(\x,{(--29.7366--8.58*\x)/0.18});
\begin{scriptsize}
\draw [fill=ududff] (-7.7,2.75) circle (2.5pt);
\draw[color=ududff] (-7.54,3.18) node {$A$};
\draw [fill=ududff] (0.88,2.57) circle (2.5pt);
\draw[color=ududff] (1.04,3) node {$B$};
\draw [fill=ududff] (-3.04,-3.37) circle (2.5pt);
\draw[color=ududff] (-2.88,-2.94) node {$C$};
\draw[color=zzttqq] (-3.34,2.58) node {$c$};
\draw[color=zzttqq] (-1.28,0.02) node {$a$};
\draw[color=zzttqq] (-5.04,0.12) node {$b$};
\draw [fill=ududff] (5.2,5.63) circle (2.5pt);
\draw[color=ududff] (5.36,6.06) node {$D$};
\draw [fill=ududff] (5.24,0.79) circle (2.5pt);
\draw[color=ududff] (5.4,1.22) node {$E$};
\draw[color=black] (4.92,8.82) node {$f$};
\draw [fill=ududff] (-2,-1) circle (2.5pt);
\draw[color=ududff] (-1.84,-0.56) node {$F$};
\draw[color=black] (-12.5,5.84) node {$g$};
\draw[color=black] (-3.04,8.82) node {$h$};
\end{scriptsize}
\end{axis}
\end{tikzpicture}
\end{document}

How would such example be adjusted to be used with ConTeXt?


Sincerely,
Gour


--
As the embodied soul continuously passes, in this body,
from boyhood to youth to old age, the soul similarly passes
into another body at death. A sober person is not bewildered
by such a change.


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

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

[NTG-context] adjusting tikz pictures

2019-04-24 Thread Gour
Hello,

I believe that using GeoGebra for drawing, exporting to TikZ is the most
approachable method for me to be able to create mathematic-related
material like exams for the children in the primary school, but need some
info how to adjust GeoGebra's TikZ output (suitable for LaTeX) for
ConTeXt?

The link on the wiki's page (https://wiki.contextgarden.net/TikZ) fior the
manual is dead..


Here is the simple example:

\documentclass[10pt]{article}
\usepackage{pgf,tikz,pgfplots}
\pgfplotsset{compat=1.15}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\definecolor{zzttqq}{rgb}{0.6,0.2,0}
\definecolor{ududff}{rgb}{0.30196078431372547,0.30196078431372547,1}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
\begin{axis}[
x=1cm,y=1cm,
axis lines=middle,
ymajorgrids=true,
xmajorgrids=true,
xmin=-12.678,
xmax=12.678,
ymin=-13.472,
ymax=8.91,
xtick={-12,-11,...,12},
ytick={-13,-12,...,8},]
\clip(-12.68,-13.47) rectangle (12.68,8.91);
\fill[line width=2pt,color=zzttqq,fill=zzttqq,fill opacity=0.1000149011612] 
(-7.7,2.75) -- (0.88,2.57) -- (-3.04,-3.37) -- cycle;
\draw [line width=2pt,color=zzttqq] (-7.7,2.75)-- (0.88,2.57);
\draw [line width=2pt,color=zzttqq] (0.88,2.57)-- (-3.04,-3.37);
\draw [line width=2pt,color=zzttqq] (-3.04,-3.37)-- (-7.7,2.75);
\draw [line width=2pt,domain=-12.68:12.68] plot(\x,{(--25.3932-4.84*\x)/0.04});
\draw [line width=2pt,domain=-12.68:12.68] plot(\x,{(-13.78-3.92*\x)/5.94});
\draw [line width=2pt,domain=-12.68:12.68] plot(\x,{(--29.7366--8.58*\x)/0.18});
\begin{scriptsize}
\draw [fill=ududff] (-7.7,2.75) circle (2.5pt);
\draw[color=ududff] (-7.54,3.18) node {$A$};
\draw [fill=ududff] (0.88,2.57) circle (2.5pt);
\draw[color=ududff] (1.04,3) node {$B$};
\draw [fill=ududff] (-3.04,-3.37) circle (2.5pt);
\draw[color=ududff] (-2.88,-2.94) node {$C$};
\draw[color=zzttqq] (-3.34,2.58) node {$c$};
\draw[color=zzttqq] (-1.28,0.02) node {$a$};
\draw[color=zzttqq] (-5.04,0.12) node {$b$};
\draw [fill=ududff] (5.2,5.63) circle (2.5pt);
\draw[color=ududff] (5.36,6.06) node {$D$};
\draw [fill=ududff] (5.24,0.79) circle (2.5pt);
\draw[color=ududff] (5.4,1.22) node {$E$};
\draw[color=black] (4.92,8.82) node {$f$};
\draw [fill=ududff] (-2,-1) circle (2.5pt);
\draw[color=ududff] (-1.84,-0.56) node {$F$};
\draw[color=black] (-12.5,5.84) node {$g$};
\draw[color=black] (-3.04,8.82) node {$h$};
\end{scriptsize}
\end{axis}
\end{tikzpicture}
\end{document}

How would such example be adjusted to be used with ConTeXt?


Sincerely,
Gour


-- 
As the embodied soul continuously passes, in this body,
from boyhood to youth to old age, the soul similarly passes
into another body at death. A sober person is not bewildered
by such a change.


___
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] Setupheadertexts with if-condition

2019-04-10 Thread Huseyin Özoguz

\doifelsemarking

or

\doifelsetext 


Thanks, that worked. My final solution (just for the archive, it seems 
to be more suitable than the solution in the wiki):


\define\CustomHeader{%
   \cap{
    \doifelsetext{\getmarking[chapter]}%
        {Kapitel \getmarking[chapternumber]: \getmarking[chapter]}%
            {\doifelsetext{\getmarking[section]}
                {\getmarking[section]}
                {}
            }%
        }
}

\setupheadertexts[][\CustomHeader{}{~\|~}\pagenumber][\pagenumber][]

Huseyin Özoguz

E-Mail: h.oezo...@mmnetz.de

Am 10.04.2019 um 13:26 schrieb Hans Hagen:

\doifelsemarking

or

\doifelsetext

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


Re: [NTG-context] Firstline problem with smallcaps

2018-01-14 Thread Hans Hagen

On 1/12/2018 10:47 PM, Rik Kabel wrote:
When \setfirstline is used to set the first line of a paragraph in a 
small-cap style, the line is mis-set. This does not occur with every 
font and input, but occurs with most fonts and many inputs. The problem 
does not seem to be awakened by other styles (emboldened, italicized).


\definefirstline[SC][alternative=line,style=\setfontfeature{smallcaps}]%
or =\sc
\definefirstline[BD][alternative=line,style=bold]
\definefirstline[IT][alternative=line,style=italic]
\setupbodyfont[termes,11pt]% requires font with small caps
\starttext
   \setfirstline[SC]
   \startparagraph
     \input montgomery
   \stopparagraph
   \setfirstline[BD]
   \startparagraph
     \input montgomery
   \stopparagraph
   \setfirstline[IT]
   \startparagraph
     \input montgomery
   \stopparagraph
\stoptext


fixed in next beta


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

[NTG-context] Firstline problem with smallcaps

2018-01-12 Thread Rik Kabel
When \setfirstline is used to set the first line of a paragraph in a 
small-cap style, the line is mis-set. This does not occur with every 
font and input, but occurs with most fonts and many inputs. The problem 
does not seem to be awakened by other styles (emboldened, italicized).


   \definefirstline[SC][alternative=line,style=\setfontfeature{smallcaps}]%
   or =\sc
   \definefirstline[BD][alternative=line,style=bold]
   \definefirstline[IT][alternative=line,style=italic]
   \setupbodyfont[termes,11pt]% requires font with small caps
   \starttext
  \setfirstline[SC]
  \startparagraph
    \input montgomery
  \stopparagraph
  \setfirstline[BD]
  \startparagraph
    \input montgomery
  \stopparagraph
  \setfirstline[IT]
  \startparagraph
    \input montgomery
  \stopparagraph
   \stoptext

--
Rik

___
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] \overline problem again.

2017-11-09 Thread Jeong Dal
Hi,

Yesterday, I had a weird output of the following sample code.
\overline changes the baseline when it is used in the column environment.
It works fine if it is used without columns.
I had similar problems long time ago and I thought it was fixed at that time.

Please check the following sample.

Best regards,
Dalyoung
%
\starttext

\startitemize[n]
\item   Here is a line of math formulas: $\overline{A} = A$, $A' \subset A$, $A 
\cap A' = \emptyset$ and $A^c$ is open.

\item list items one by one in a new line
\startitemize[n, packed, broad][stopper=,left=(, right=)]
\item {$A' \subset A$}
    \item {$A \cap A' = \emptyset$}
\item {$A^c$ is open}
\item {$\overline{A} = A$}
\stopitemize
\stopitemize
As you see, there is no problem al all.\par
But if we list the same formulas using columns, then there is a baseline 
problem.

\startitemize[continue]
\item list items in 4 columns
\startitemize[n, packed,columns, four, broad][stopper=,left=(, right=)]
\item {$A' \subset A$}
\item {$\overline{A} = A$}
\item {$A \cap A' = \emptyset$}
\item {$A^c$ is open}
\stopitemize
\item list items in 2 columns
\startitemize[n, packed,columns, two, broad][stopper=,left=(, right=)]
\item {$\overline{\{a\}} = \{a\}$}
\item {$\overline{\{b\}} = \{b,e\}$}
\item {$\overline{\{c\}} = \{b,c,d\}$}
\item {$\overline{\{d\}} = \{b,c,d,e\}$}
\stopitemize
\stopitemize
\stoptext

%%%


test.pdf
Description: Adobe PDF document
___
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] slanting small cap glpyhs

2017-04-01 Thread Pablo Rodriguez
Dear list,

I have the following sample:

\definefontfeature[smcp][smcp=yes]
\definefontfeature[slsmcp][smcp=yes, slant=0.2]
\definefontfamily[yourface][rm][GFS Didot][it={features:slsmcp}]
\definefontfamily[mainface][rm][GFS Didot]
\setupbodyfontenvironment
[default]
[em=italic]
\setupbodyfont[mainface]
\setuphead[chapter][style={\setupbodyfont[yourface]\addfs{smcp}}]
\starttext
\chapter{Small caps & {\em italics}}
\addfs{smcp}Small caps & {\em italics}
\stoptext

The font has no glyphs for italic small caps. I would like to have the
slanted version of the regular small cap glyphs.

My previous sample outputs slanted, but not from the small cap glyphs.

Which is the right way to get them?

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
___

[NTG-context] Bug in \Cap

2017-03-29 Thread Henning Hraban Ramm
I don’t know if anyone needs \Cap at all, but it’s broken:

\Cap{what}

renders

⋒what


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] Communative diagrams with TikZ & ConTeXt

2016-10-11 Thread Alan Braslau
Hello,

I wrote some very simple MetaPost helpers to create commutative diagrams:




natural.pdf
Description: Adobe PDF document



Alan


> On Oct 6, 2016, at 15:45, Hans Åberg  wrote:
> 
> 
>> On 6 Oct 2016, at 15:52, Mojca Miklavec  
>> wrote:
>> 
>> I don't have the file tikzlibrarycommute.code.tex on my machine
>> either. Anywhere. Not in the ConTeXt distribution nor in TeX Live.
>> That file was only posted to the mailing list by Idris and apparently
>> nobody ever looked at it or added it anywhere.
> 
> There is a tikz-cd package at CTAN:
>  https://www.ctan.org/tex-archive/graphics/pgf/contrib/tikz-cd?lang=en
> 
> One makes sure to have the file tikzlibrarycd.code.tex, and follows the 
> translation rules in the manual for ConTeXt. In addition to that, one seems 
> to have to replace the apostrophe with "below".
> 
> The first few examples in the manual, which compiled with latest ConTeXt:
> 
> \usemodule[tikz]
> \usetikzlibrary[cd]
> 
> 
> \starttext
> 
> \starttikzcd
>  A \arrow{rd} \arrow{r}{𝜑} \NC B \NR
> \NC C
> \stoptikzcd
> 
> \starttikzcd
>  A \arrow[r, "\phi"] \arrow[d, red]
>\NC B \arrow[d, "\psi" red] \NR
>  C \arrow[r, red, "\eta" blue]
>  \NC D
> \stoptikzcd
> 
> \starttikzcd
>  A \arrow[r, "\phi" near start, "\psi" below, "\eta" near end] \NC B
> \stoptikzcd
> 
> \starttikzcd
>  T
>  \arrow[drr, bend left, "x"]
>  \arrow[ddr, bend right, "y"]
>  \arrow[dr, dotted, "{(x,y)}" description] \NC \NC \NR
>\NC X \times_Z Y \arrow[r, "p"] \arrow[d, "q"]
>\NC X \arrow[d, "f"] \NR
>  \NC Y \arrow[r, "g"] \NC Z
> \stoptikzcd
> 
> \starttikzcd[column sep=tiny]
>  \NC \pi_1(U_1) \ar[dr] \ar[drr, "j_1", bend left=20]
>\NC
>  \NC[1.5em] \NR
>  \pi_1(U_1\cap U_2) \ar[ur, "i_1"] \ar[dr, "i_2" below]
>\NC
>  \NC \pi_1(U_1) \ast_{ \pi_1(U_1\cap U_2)} \pi_1(U_2) \ar[r, dashed, 
> "\simeq"]
>\NC \pi_1(X) \NR
>  \NC \pi_1(U_2) \ar[ur]\ar[urr, "j_2" below, bend right=20]
>\NC
>  \NC
> \stoptikzcd
> 
> \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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> 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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Communative diagrams with TikZ & ConTeXt

2016-10-06 Thread Hans Åberg

> On 6 Oct 2016, at 15:52, Mojca Miklavec  
> wrote:
> 
> I don't have the file tikzlibrarycommute.code.tex on my machine
> either. Anywhere. Not in the ConTeXt distribution nor in TeX Live.
> That file was only posted to the mailing list by Idris and apparently
> nobody ever looked at it or added it anywhere.

There is a tikz-cd package at CTAN:
  https://www.ctan.org/tex-archive/graphics/pgf/contrib/tikz-cd?lang=en

One makes sure to have the file tikzlibrarycd.code.tex, and follows the 
translation rules in the manual for ConTeXt. In addition to that, one seems to 
have to replace the apostrophe with "below".

The first few examples in the manual, which compiled with latest ConTeXt:

\usemodule[tikz]
\usetikzlibrary[cd]


\starttext

\starttikzcd
  A \arrow{rd} \arrow{r}{𝜑} \NC B \NR
 \NC C
\stoptikzcd

\starttikzcd
  A \arrow[r, "\phi"] \arrow[d, red]
\NC B \arrow[d, "\psi" red] \NR
  C \arrow[r, red, "\eta" blue]
  \NC D
\stoptikzcd

\starttikzcd
  A \arrow[r, "\phi" near start, "\psi" below, "\eta" near end] \NC B
\stoptikzcd

\starttikzcd
  T
  \arrow[drr, bend left, "x"]
  \arrow[ddr, bend right, "y"]
  \arrow[dr, dotted, "{(x,y)}" description] \NC \NC \NR
\NC X \times_Z Y \arrow[r, "p"] \arrow[d, "q"]
\NC X \arrow[d, "f"] \NR
  \NC Y \arrow[r, "g"] \NC Z
\stoptikzcd

\starttikzcd[column sep=tiny]
  \NC \pi_1(U_1) \ar[dr] \ar[drr, "j_1", bend left=20]
\NC
  \NC[1.5em] \NR
  \pi_1(U_1\cap U_2) \ar[ur, "i_1"] \ar[dr, "i_2" below]
\NC
  \NC \pi_1(U_1) \ast_{ \pi_1(U_1\cap U_2)} \pi_1(U_2) \ar[r, dashed, 
"\simeq"]
\NC \pi_1(X) \NR
  \NC \pi_1(U_2) \ar[ur]\ar[urr, "j_2" below, bend right=20]
\NC
  \NC
\stoptikzcd

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] uppercase, small caps, numerals and German capital sharp s

2016-05-06 Thread Thomas Fehige

Wolfgang,
Use separate threads for each problem. The uppercase sharp s 
replacement with \WORD can be changed in the next beta.


%% begin example
are you saying, use this example as long as the new beta isn't out yet, 
or are you saying, this example will work as soon as I'll use the new 
beta? It doesn't seem to do anything right now, not even an error message.


I was looking for a general way how to substitute one glyph with another 
depending on context, thus I can't see how there are different problems 
in my post? But it's good to hear that others have thought at least of a 
partial solution.


Is my guess right that normally the author of a font ought to provide 
otf features that can be switched on and off to get one result instead 
of the other? That area seems to be utter chaos in the Calluna fonts.


Cheers -- Thomas

Am 19.04.2016 um 14:05 schrieb Wolfgang Schuster:

Thomas Fehige <mailto:tho...@fehige.de>
19. April 2016 um 09:10
Hello,

I'm new to ConTeXt and this list. After a long time of using LaTeX 
and xeLaTeX I was finally lured into trying ConTexT by its ability of 
grid typesetting.


Today's problem is a bit complex. In a book project I have several 
points where stuff is capitalized or turned into caps+smallcaps or 
pure smallcaps. My guess is that that should work either with 
\WORD{Stuff}, \Cap{Stuff} and \cap{Stuff} or with \uppercase, \sc, 
and {\sc\lowercase{Stuff}}. (Not quite, it seems)


I'll use a commercial font called Calluna, but have added Linux 
Biolinum O to the example for those who don't want to download 
Calluna (the "Regular" can be "bought" for free, e.g. at 
https://www.fontspring.com/fonts/exljbris/calluna).


Both Calluna and Biolinum contain the glyph "LATIN CAPITAL LETTER 
SHARP S" at "1E9E. Calluna also has a small caps version at "F727", 
while Biolinum has it at "E092. I'd like to use these glyphs in the 
capitalizations mentioned, but that only works erratically (cf. 
example).


Secondly, Calluna comes with oldstyle numerals switched on, which is 
nice for normal text, but should change to proportional lining 
numbers in uppercase and to small-cap proportional lining numbers in 
an all-small-cap text. I'm not sure what I'd want in a caps+smallcaps 
context, but certainly not oldstyle numerals with their descenders.
Use separate threads for each problem. The uppercase sharp s 
replacement with \WORD can be changed in the next beta.


%% begin example
\usemodule[lingual-de]

\setupbodyfont[libertine]

\starttext

Gruß Straße Buße

\WORD{Gruß Straße Buße}

\enabledirectives[fonts.uppercasesharps]

\WORD{Gruß Straße Buße}

\disabledirectives[fonts.uppercasesharps]

\WORD{Gruß Straße Buße}

\stoptext
%% end example

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
___


___
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] uppercase, small caps, numerals and German capital sharp s

2016-05-06 Thread Thomas Fehige

Hello,

I'm new to ConTeXt and this list. After a long time of using LaTeX and 
xeLaTeX I was finally lured into trying ConTexT by its ability of grid 
typesetting.


Today's problem is a bit complex. In a book project I have several 
points where stuff is capitalized or turned into caps+smallcaps or pure 
smallcaps. My guess is that that should work either with \WORD{Stuff}, 
\Cap{Stuff} and \cap{Stuff} or with \uppercase, \sc, and 
{\sc\lowercase{Stuff}}. (Not quite, it seems)


I'll use a commercial font called Calluna, but have added Linux Biolinum 
O to the example for those who don't want to download Calluna (the 
"Regular" can be "bought" for free, e.g. at 
https://www.fontspring.com/fonts/exljbris/calluna).


Both Calluna and Biolinum contain the glyph "LATIN CAPITAL LETTER SHARP 
S" at "1E9E. I'm not sure if they contain a small or medium caps 
version. I'd like to use that glyph in the capitalizations mentioned, 
but it only works erratically (cf. example).


Also, Calluna comes with oldstyle numerals switched on, which is nice 
for normal text, but should change to lining numbers in all-caps and to 
small-cap lining numbers in all-small-cap text. I'm not sure what I'll 
want in a caps+smallcaps context, but certainly not oldstyle numbers 
with their descenders.


Any ideas? Thanks for reading! -- Thomas

PS: I asked the same question on stackexchange, there's also an image of 
the result of my example: 
http://tex.stackexchange.com/questions/302823/context-uppercase-%C3%9F-customizing-glyph-substitution


%%
\mainlanguage[de]
\language[de]

\uccode`ß="1E9E% This gives the capital ß to \uppercase

\definefontfeature[fcalluna][default][]	% I tried all the font features 
built


% into Calluna, to no avail.

\definefontfamily [myfamily] [serif][Calluna][features=fcalluna]
\definefontfamily [myfamily] [sans] [Linux Biolinum O][features=fcalluna]
\definefontfamily [myfamily] [mono] [TeX Gyre Cursor]

\setupbodyfont [myfamily]
\startTEXpage[offset=10pt]
\starttabulate[|l|l|l|]
 \NC \it Command \NC \it Calluna \NC \it Linux Biolinum \NC\NR
\NC\type{\WORD{Gruß134}}: 		\NC\WORD{Gruß134} 			\NC 
{\ss\WORD{Gruß134}} 		\NC\NR
\NC\type{\uppercase{Gruß134}}:	\NC\uppercase{Gruß134} 
\NC{\ss\uppercase{Gruß134}} 	\NC\NR
\NC\type{\sc{Gruß134}}: 			\NC{\sc Gruß134} 			\NC{\ss{\sc 
Gruß134}}			\NC\NR
\NC\type{\Cap{Gruß134}:} 		\NC\Cap{Gruß134} 			\NC{\ss 
\Cap{Gruß134}}		\NC\NR
\NC\type{\cap{Gruß134}:} 		\NC\cap{Gruß134} 			\NC{\ss 
\cap{Gruß134}}		\NC\NR
\NC\type{{\sc\lowercase{Gruß134}}:} 	 
\NC{\sc\lowercase{Gruß134}} 			\NC{\ss\sc\lowercase{Gruß134}}	\NC\NR

\stoptabulate
\stopTEXpage
%%
___
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] uppercase, small caps, numerals and German capital sharp s

2016-04-20 Thread Thomas Fehige

Wolfgang,
Use separate threads for each problem. The uppercase sharp s 
replacement with \WORD can be changed in the next beta.


%% begin example
are you saying, use this example as long as the new beta isn't out yet, 
or are you saying, this example will work as soon as I'll use the new 
beta? It doesn't seem to do anything right now, not even an error message.


I was looking for a general way how to substitute one glyph with another 
depending on context, thus I can't see how there are different problems 
in my post? But it's good to hear that others have thought at least of a 
partial solution.


Is my guess right that normally the author of a font ought to provide 
otf features that can be switched on and off to get one result instead 
of the other? That area seems to be utter chaos in the Calluna fonts.


Cheers -- Thomas

Am 19.04.2016 um 14:05 schrieb Wolfgang Schuster:

Thomas Fehige <mailto:tho...@fehige.de>
19. April 2016 um 09:10
Hello,

I'm new to ConTeXt and this list. After a long time of using LaTeX 
and xeLaTeX I was finally lured into trying ConTexT by its ability of 
grid typesetting.


Today's problem is a bit complex. In a book project I have several 
points where stuff is capitalized or turned into caps+smallcaps or 
pure smallcaps. My guess is that that should work either with 
\WORD{Stuff}, \Cap{Stuff} and \cap{Stuff} or with \uppercase, \sc, 
and {\sc\lowercase{Stuff}}. (Not quite, it seems)


I'll use a commercial font called Calluna, but have added Linux 
Biolinum O to the example for those who don't want to download 
Calluna (the "Regular" can be "bought" for free, e.g. at 
https://www.fontspring.com/fonts/exljbris/calluna).


Both Calluna and Biolinum contain the glyph "LATIN CAPITAL LETTER 
SHARP S" at "1E9E. Calluna also has a small caps version at "F727", 
while Biolinum has it at "E092. I'd like to use these glyphs in the 
capitalizations mentioned, but that only works erratically (cf. 
example).


Secondly, Calluna comes with oldstyle numerals switched on, which is 
nice for normal text, but should change to proportional lining 
numbers in uppercase and to small-cap proportional lining numbers in 
an all-small-cap text. I'm not sure what I'd want in a caps+smallcaps 
context, but certainly not oldstyle numerals with their descenders.
Use separate threads for each problem. The uppercase sharp s 
replacement with \WORD can be changed in the next beta.


%% begin example
\usemodule[lingual-de]

\setupbodyfont[libertine]

\starttext

Gruß Straße Buße

\WORD{Gruß Straße Buße}

\enabledirectives[fonts.uppercasesharps]

\WORD{Gruß Straße Buße}

\disabledirectives[fonts.uppercasesharps]

\WORD{Gruß Straße Buße}

\stoptext
%% end example

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
___


___
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] uppercase, small caps, numerals and German capital sharp s

2016-04-19 Thread Wolfgang Schuster

Thomas Fehige <mailto:tho...@fehige.de>
19. April 2016 um 09:10
Hello,

I'm new to ConTeXt and this list. After a long time of using LaTeX and 
xeLaTeX I was finally lured into trying ConTexT by its ability of grid 
typesetting.


Today's problem is a bit complex. In a book project I have several 
points where stuff is capitalized or turned into caps+smallcaps or 
pure smallcaps. My guess is that that should work either with 
\WORD{Stuff}, \Cap{Stuff} and \cap{Stuff} or with \uppercase, \sc, and 
{\sc\lowercase{Stuff}}. (Not quite, it seems)


I'll use a commercial font called Calluna, but have added Linux 
Biolinum O to the example for those who don't want to download Calluna 
(the "Regular" can be "bought" for free, e.g. at 
https://www.fontspring.com/fonts/exljbris/calluna).


Both Calluna and Biolinum contain the glyph "LATIN CAPITAL LETTER 
SHARP S" at "1E9E. Calluna also has a small caps version at "F727", 
while Biolinum has it at "E092. I'd like to use these glyphs in the 
capitalizations mentioned, but that only works erratically (cf. example).


Secondly, Calluna comes with oldstyle numerals switched on, which is 
nice for normal text, but should change to proportional lining numbers 
in uppercase and to small-cap proportional lining numbers in an 
all-small-cap text. I'm not sure what I'd want in a caps+smallcaps 
context, but certainly not oldstyle numerals with their descenders.
Use separate threads for each problem. The uppercase sharp s replacement 
with \WORD can be changed in the next beta.


%% begin example
\usemodule[lingual-de]

\setupbodyfont[libertine]

\starttext

Gruß Straße Buße

\WORD{Gruß Straße Buße}

\enabledirectives[fonts.uppercasesharps]

\WORD{Gruß Straße Buße}

\disabledirectives[fonts.uppercasesharps]

\WORD{Gruß Straße Buße}

\stoptext
%% end example

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
___

[NTG-context] uppercase, small caps, numerals and German capital sharp s

2016-04-19 Thread Thomas Fehige

Hello,

I'm new to ConTeXt and this list. After a long time of using LaTeX and 
xeLaTeX I was finally lured into trying ConTexT by its ability of grid 
typesetting.


Today's problem is a bit complex. In a book project I have several 
points where stuff is capitalized or turned into caps+smallcaps or pure 
smallcaps. My guess is that that should work either with \WORD{Stuff}, 
\Cap{Stuff} and \cap{Stuff} or with \uppercase, \sc, and 
{\sc\lowercase{Stuff}}. (Not quite, it seems)


I'll use a commercial font called Calluna, but have added Linux Biolinum 
O to the example for those who don't want to download Calluna (the 
"Regular" can be "bought" for free, e.g. at 
https://www.fontspring.com/fonts/exljbris/calluna).


Both Calluna and Biolinum contain the glyph "LATIN CAPITAL LETTER SHARP 
S" at "1E9E. Calluna also has a small caps version at "F727", while 
Biolinum has it at "E092. I'd like to use these glyphs in the 
capitalizations mentioned, but that only works erratically (cf. example).


Secondly, Calluna comes with oldstyle numerals switched on, which is 
nice for normal text, but should change to proportional lining numbers 
in uppercase and to small-cap proportional lining numbers in an 
all-small-cap text. I'm not sure what I'd want in a caps+smallcaps 
context, but certainly not oldstyle numerals with their descenders.


Any hints and ideas? Thanks for reading! -- Thomas

PS: I asked the same question on stackexchange, there's also an image of 
the result of my example: 
http://tex.stackexchange.com/questions/302823/context-uppercase-%C3%9F-customizing-glyph-substitution


%%
\mainlanguage[de]
\language[de]

\uccode`ß="1E9E% This gives the capital ß to \uppercase

\definefontfeature[fcalluna][default][]	% I tried all the font features 
built into Calluna, to no avail.


\definefontfamily [myfamily] [serif][Calluna][features=fcalluna]
\definefontfamily [myfamily] [sans] [Linux Biolinum O][features=fcalluna]
\definefontfamily [myfamily] [mono] [TeX Gyre Cursor]

\setupbodyfont [myfamily]
\startTEXpage[offset=10pt]
\starttabulate[|l|l|l|]
 \NC \it Command \NC \it Calluna \NC \it Linux Biolinum \NC\NR
\NC\type{\WORD{Gruß134}}: 		\NC\WORD{Gruß134} 			\NC 
{\ss\WORD{Gruß134}} 		\NC\NR
\NC\type{\uppercase{Gruß134}}:	\NC\uppercase{Gruß134} 
\NC{\ss\uppercase{Gruß134}} 	\NC\NR
\NC\type{\sc{Gruß134}}: 			\NC{\sc Gruß134} 			\NC{\ss{\sc 
Gruß134}}			\NC\NR
\NC\type{\Cap{Gruß134}:} 		\NC\Cap{Gruß134} 			\NC{\ss 
\Cap{Gruß134}}		\NC\NR
\NC\type{\cap{Gruß134}:} 		\NC\cap{Gruß134} 			\NC{\ss 
\cap{Gruß134}}		\NC\NR
\NC\type{{\sc\lowercase{Gruß134}}:} 	 
\NC{\sc\lowercase{Gruß134}} 			\NC{\ss\sc\lowercase{Gruß134}}	\NC\NR

\stoptabulate
\stopTEXpage
%%
___
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] Deprecated $…$ for inline math?

2016-02-18 Thread Hans Hagen

On 2/18/2016 12:40 AM, Pablo Rodriguez wrote:

On 02/17/2016 11:18 PM, Alan BRASLAU wrote:

On Wed, 17 Feb 2016 20:08:31 +0100 Hans Hagen wrote:


you're an american citizen who likes $x^2$ but to call if
beautiful ... €x^2€ nor £x^2£ (in 8 bit encodings / local keyboards
times) all look bad ...


Hans, you forgot: ¥x^2¥, ₽x^2₽, ₱x^2₱, ₹x^2₹, ...
Besides, U+0024 comes from ASCII and all programmers know that it is a
perfectly valid and useful character.


Of course, and even ₧x²₧ or even ₯x²₯...


we need a proper begin/end symbol ..


Too bad Knuth did not choose ¡x^2!


Excuse me, Alan, this is exclamation in Spanish (and only in Spanish).

Just out of curiosity, why do you think he should have chosen that?


because # & % were taken and ^ _ were needed for scripts and [] () | = + 
- are also quite mathematical .. .that doesn't leave much


@x^2@ could have worked

also, DEK used a keyboard with some special characters (probably dating 
from those assembler like computer languages) which is why the plain tex 
format has:


\mathcode`\^^@="2201 % \cdot
\mathcode`\^^A="3223 % \downarrow
\mathcode`\^^B="010B % \alpha
\mathcode`\^^C="010C % \beta
\mathcode`\^^D="225E % \land
\mathcode`\^^E="023A % \lnot
\mathcode`\^^F="3232 % \in
\mathcode`\^^G="0119 % \pi
\mathcode`\^^H="0115 % \lambda
\mathcode`\^^I="010D % \gamma
\mathcode`\^^J="010E % \delta
\mathcode`\^^K="3222 % \uparrow
\mathcode`\^^L="2206 % \pm
\mathcode`\^^M="2208 % \oplus
\mathcode`\^^N="0231 % \infty
\mathcode`\^^O="0140 % \partial
\mathcode`\^^P="321A % \subset
\mathcode`\^^Q="321B % \supset
\mathcode`\^^R="225C % \cap
\mathcode`\^^S="225B % \cup
\mathcode`\^^T="0238 % \forall
\mathcode`\^^U="0239 % \exists
\mathcode`\^^V="220A % \otimes
\mathcode`\^^W="3224 % \leftrightarrow
\mathcode`\^^X="3220 % \leftarrow
\mathcode`\^^Y="3221 % \rightarrow
\mathcode`\^^Z="8000 % \ne
\mathcode`\^^[="2205 % \diamond
\mathcode`\^^\="3214 % \le
\mathcode`\^^]="3215 % \ge
\mathcode`\^^^="3211 % \equiv
\mathcode`\^^_="225F % \lor

i wonder if anyone ever used that

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | 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] tip

2016-02-16 Thread Hans Hagen

On 2/16/2016 3:52 AM, Rik Kabel wrote:

On 2016-02-15 04:56, Hans Hagen wrote:

Hi,

There are quite some probably unknown features in context, here are two:

\enabletrackers[visualizers.justification] % overfull/underfull
\enabletrackers[typesetters.suspects] % suspicious spacing

\setuplayout[width=3mm] \showframe

\starttext

\hsize 3mm

xxx

x

$x$x

x:$x$

\stoptext


Interesting stuff. Can you point to or provide documentation on the
meaning of the hbar colors? (I did try to follow the code, but could not
make sense of it.)

With visualizers.justification, I see:

  * green
  o after loose text?
  * blue
  o in margin after tight text?


these are the bad ones

can also become red when no stretch/shrink permitted


  * yellow
  o around centering text
  * cyan
  o before flush-right text?
  * magenta
  o after flush-left text?


these are suboptimal ones (often harmless) .. the color reflects the 
flush mode



It is not clear what these all mean (except the yellow). What is the
difference between magenta and green (I see both in tables and some
column-set paragraphs)? What is the difference between green and blue?
Does green show how close to needing intraword space compression while
blue indicates the degree of compression that was done?


green is used with normal justification


With typesetters.suspects, I see

  * orange with
  o required space (*~*)
  o occasionally between words where no markup appeared (could this
flag a small word space?)


they normally reflect those invisible spacing characters being used (non 
break space and so)



  * maroon with
  o *’* preceded by whitespace as with the contraction /’tis/
  o *»* preceded by whitespace as an opening quotation mark for German
  * blue with
  o most punctuation, but not *]* or *)*, when at paragraph end or
not followed by whitespace
  o some punctuation (*@ # & % *** / …***·* *and others) at any
position
  o *.* preceding a character other than *]*
  o *.* preceding *\,*
  o some asterisms ⁂ (the second and third when three spaced are
used as a break)
  * green with
  o ς directly preceding another letter (perhaps other terminal
characters, my sample only has this)
  o digit preceding *,* in index
  o italic letter preceding or following an upright character
  o small-cap letter preceding or following a non-whitespace character

There are some obvious patterns here (font style transitions, for
example) but the logic some seems less clear. Can we get a guide?


some day ... but your observations are quite ok ... the colors are 
chosen to make sure they don't collapse too much


it's something we use in automated workflows involving thousands of xml 
files coming from repositories so that a quick visual check of what can 
be wrong is needed (much involves spacing as that is what often gets 
messed up in the xml editors / converters / tools that are used at the 
publishers / editors end)


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | 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] tip

2016-02-15 Thread Rik Kabel

On 2016-02-15 04:56, Hans Hagen wrote:

Hi,

There are quite some probably unknown features in context, here are two:

\enabletrackers[visualizers.justification] % overfull/underfull
\enabletrackers[typesetters.suspects] % suspicious spacing

\setuplayout[width=3mm] \showframe

\starttext

\hsize 3mm

xxx

x

$x$x

x:$x$

\stoptext

Interesting stuff. Can you point to or provide documentation on the 
meaning of the hbar colors? (I did try to follow the code, but could not 
make sense of it.)


With visualizers.justification, I see:

 * green
 o after loose text?
 * blue
 o in margin after tight text?
 * yellow
 o around centering text
 * cyan
 o before flush-right text?
 * magenta
 o after flush-left text?

It is not clear what these all mean (except the yellow). What is the 
difference between magenta and green (I see both in tables and some 
column-set paragraphs)? What is the difference between green and blue? 
Does green show how close to needing intraword space compression while 
blue indicates the degree of compression that was done?


With typesetters.suspects, I see

 * orange with
 o required space (*~*)
 o occasionally between words where no markup appeared (could this
   flag a small word space?)
 * maroon with
 o *’* preceded by whitespace as with the contraction /’tis/
 o *»* preceded by whitespace as an opening quotation mark for German
 * blue with
 o most punctuation, but not *]* or *)*, when at paragraph end or
   not followed by whitespace
 o some punctuation (*@ # & % *** / …***·* *and others) at any
   position
 o *.* preceding a character other than *]*
 o *.* preceding *\,*
 o some asterisms ⁂ (the second and third when three spaced are
   used as a break)
 * green with
 o ς directly preceding another letter (perhaps other terminal
   characters, my sample only has this)
 o digit preceding *,* in index
 o italic letter preceding or following an upright character
 o small-cap letter preceding or following a non-whitespace character

There are some obvious patterns here (font style transitions, for 
example) but the logic some seems less clear. Can we get a guide?

--
rik
___
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] What is a better way to do this macro?

2015-07-17 Thread Idris Samawi Hamid ادريس سماوي حامد
On Fri, 17 Jul 2015 12:07:29 -0600, Wolfgang Schuster  
 wrote:



Idris Samawi Hamid ادريس سماوي حامد <mailto:idris.ha...@colostate.edu>
17. Juli 2015 19:56
On Thu, 16 Jul 2015 22:35:45 -0600, Wolfgang Schuster
 wrote:


Works like a charm. Question: Should the wiki page be edited:

http://wiki.contextgarden.net/Command/setupframed

It has the equivalent of

foregroundstyle = 

Shouldn't that be changed to

foregroundstyle = 

Originally I looked for keys mapped to  so I tried bottom and
top because and those are the only keys that are mapped to 
in the description. Or am I missing something here?


The foregroundstyle should list the same arguments as the style key from
other commands/environments.

For a example look at the arguments for \setupdescriptions:
http://wiki.contextgarden.net/Command/setupdescriptions


Ah! Perhaps disambiguating would help unsuspecting users. So in  
\setupdescriptions we have things like


style = normal bold slanted boldslanted type cap small... command
[i.e. style = |]
color = 
before = 

So in the explanation of the foregroundstyle key we could have, e.g.

foregroundstyle = 

making it clear that this key takes both a name and a command argument.  
Anyway, thanks kindly and


Best wishes
Idris
--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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] Math alignment

2015-07-07 Thread Hans Aberg

> On 7 Jul 2015, at 21:49, Wolfgang Schuster  
> wrote:

> You should google for mathalign.pdf which explains and shows examples for the 
> matrix, cases etc. environments.
> 
> To get the same result as your LaTeX example you can use the m key for 
> \startalign.
> 
> \starttext
> 
> \startformula
> \startalign[m=3,distance=3em]
> \NC K \NC \approx G * H\NC  i   \NC = j+k 
> \NC B \NC \subset C  \NR
> \NC H \NC \approx A_{0}*B_{0}      \NC  i'  \NC = j'+k'   
> \NC C \NC = D\cap E  \NR
> \NC G \NC \approx \coprod_{\alpha\in A} L_{\alpha} \NC  i'' \NC  =j''+k'' 
> \NC A \NC = D \cup E \NR
> \stopalign
> \stopformula
> 
> \stoptext

That is where I started - it does not work with \left\{ … \right. :-)


___
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] Math alignment

2015-07-07 Thread Wolfgang Schuster



Hans Aberg <mailto:haber...@telia.com>
7. Juli 2015 21:11

On 7 Jul 2015, at 20:17, Wolfgang Schuster  wrote:



You can set the alignment for each column in a matrix with the align key.


FYI, the document amshelp.pdf says that AMS-LaTeX environments align, align*, 
and aligned, can have multiple alignments, and gives this example:
\begin{align*}
   K&\approx G * H&i&= j+k&   B&\subset C\\
   H&\approx A_{0}*B_{0}&   i’&= j’+k’&   C&= D\cap E\\
   G&\approx \coprod_{\alpha\in A} L_{\alpha}&   i’’&=j’’+k’’&  A&= D \cup E
\end{align*}
which is typeset so that 'K&\approx G * H’ is one equation aligned on the ‘&’ with 
the others below, followed by 'i&= j+k’ in the next column.

So the ampersands have multiple functions here, it seems: alignment and 
separating columns.

Translating into ConTeXt, one might have (pseudocode):
\startformula
   \startalign
 \NC K \NA \approx G * H \NC  i\NA= j+k \NC B \NA \subset C \NR
 \NC H \NA \approx A_{0}*B_{0} \NC   i’\NA= j’+k’ \NC   C \NA = D\cap E\NR
 \NC G \NA \approx \coprod_{\alpha\in A} L_{\alpha}
   \NC   i’’\NA =j’’+k’’ \NC  A \NA = D \cup E \NR
   \stopalign
\stopformula
where I have introduce a symbol \NA for alignment.

You should google for mathalign.pdf which explains and shows examples 
for the matrix, cases etc. environments.


To get the same result as your LaTeX example you can use the m key for 
\startalign.


\starttext

\startformula
\startalign[m=3,distance=3em]
\NC K \NC \approx G * H\NC  i   \NC = 
j+k \NC B \NC \subset C  \NR
\NC H \NC \approx A_{0}*B_{0}  \NC  i'  \NC = 
j'+k'   \NC C \NC = D\cap E  \NR
\NC G \NC \approx \coprod_{\alpha\in A} L_{\alpha} \NC  i'' \NC  
=j''+k'' \NC A \NC = D \cup E \NR

\stopalign
\stopformula

\stoptext

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] Math alignment

2015-07-07 Thread Hans Aberg

> On 7 Jul 2015, at 20:17, Wolfgang Schuster  
> wrote:

> You can set the alignment for each column in a matrix with the align key.

FYI, the document amshelp.pdf says that AMS-LaTeX environments align, align*, 
and aligned, can have multiple alignments, and gives this example:
\begin{align*}
  K &\approx G * H&   i&= j+k&  B &\subset C\\
  H &\approx A_{0}*B_{0}&  i’&= j’+k’&  C &= D\cap E\\
  G &\approx \coprod_{\alpha\in A} L_{\alpha}&  i’’&=j’’+k’’& A &= D \cup E
\end{align*}
which is typeset so that 'K &\approx G * H’ is one equation aligned on the ‘&’ 
with the others below, followed by 'i&= j+k’ in the next column.

So the ampersands have multiple functions here, it seems: alignment and 
separating columns.

Translating into ConTeXt, one might have (pseudocode):
\startformula
  \startalign
\NC K \NA \approx G * H \NC  i\NA= j+k \NC B \NA \subset C \NR
\NC H \NA \approx A_{0}*B_{0} \NC   i’\NA= j’+k’ \NC   C \NA = D\cap E\NR
\NC G \NA \approx \coprod_{\alpha\in A} L_{\alpha}
  \NC   i’’\NA =j’’+k’’ \NC  A \NA = D \cup E \NR
  \stopalign
\stopformula
where I have introduce a symbol \NA for alignment.


___
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] Synonyms - feature request?

2015-04-15 Thread Hans Hagen

On 3/25/2015 11:24 AM, robin.kirk...@csiro.au wrote:

Folks,

I use the synonym feature heavily as technical documents can have hundreds of 
them. It’s great I can produce a list of synonyms I actually use in a document. 
Proper style however requires that each synonym be “explained” (shown in full) 
the first time it is used — usually in a document, but sometimes in a smaller 
scope, like a part or chapter. This is something I frequently get wrong, and is 
something document reviewers are quick to complain about.

So it would be great if Context could do this automatically. The attached MWE 
shows what I mean — with such a feature, the two paragraphs should come out the 
same.

I’ve placed some (commented) guesses as to how this might be configured in 
\setupsynonyms. Maybe better key names can be imagined.

Typically I would want synonym \XX\ to be expanded to XX (Xxx Xxx) the first 
time it is used (alternative a), but the reverse (alternative b), Xxx Xxx (XX) 
might be preferred. However a command could be used for a custom “explanation”.

Internally to Context, I guess this means each group of synonyms actually used 
has to be complemented with a list of the synonyms that have been “explained” 
(i.e., \infull{}) would add them to this second list). The second list would be 
cleared each new scope (chapter, section). The \XX\ macro would explain the 
synonym if it wasn’t on the second list (using \infull{}, which would then add 
it).

None of this would change the behaviour of \placelistof… where you would 
continue to select the criterium for the list you want output, independently of

The only further tweak might be a scheme so that certain common synonyms (a 
third list) are never explained automatically (perhaps by example, UK in a 
document written in and for a UK audience). This list would silently added to 
the second list immediately after it was cleared, I guess. Synonyms for this 
this list would be added by a slightly different version of the
synonym definition macro (perhaps \commonabbreviation instead of \abbreviation, 
in the MWE).

Anyone think this would be a useful feature addition?

Robin


\definesynonyms[abbreviation][abbreviations][\infull]
\setupsynonyms[abbreviation][
 state=start,
%explain=first,% first,always,never
%explainscope=text,% text,part,chapter,section...
%explainalternative=a, % a: XX (Xxx Xxx), b: Xxx Xxx (XX), command
%explaincommand=COMMAND#1#2,   % to format it yourself
 textstyle=normal,
 synonymstyle=\cap]

\abbreviation [UN]  {UN}  {United Nations}
\abbreviation [UK]  {UK}  {United Kingdom}
\abbreviation [USA] {USA} {United States of America}
\abbreviation [UAE] {UAE} {United Arab Emirates}

%\commonabbreviation [OK] {OK} {okay}
\abbreviation [OK] {OK} {okay}

\setupwhitespace[medium]

\starttext
The \UK\ and the \USA\ are both founding members of the \UN.
And I'm told the \UK\ and \USA\ are both English speaking countries.
But that’s \OK.

The \UK\ (\infull{UK}) and the \USA\ (\infull{USA}) are both founding
members of the \UN\ (\infull{UN}).
And I'm told the \UK\ and \USA\ are both English speaking countries.
But that’s \OK.

\placelistofabbreviations
\stoptext


The next beta has enough to get you going (lightweight extensions):

\definesynonyms
  [myabbreviation]

\setupsynonyms
  [myabbreviation]
  [headstyle=bold,
   headcolor=darkred,
   synonymstyle=boldslanted,
   synonymcolor=darkblue,
   textstyle=slanted,
   textcolor=darkgreen,
   style=normal,
   color=darkyellow]

\definesorting
  [mylogo]

\setupsorting
  [mylogo]
  [style=bold,
   color=darkmagenta]

\myabbreviation [FIRST]  {TheFirst}  {The First Words}
\myabbreviation [SECOND] {TheSecond} {The Second Words}
\myabbreviation [THIRD]  {TheThird}  {The Third Words}

\mylogo [FOURTH] {TheFourth}

\starttext

\setupsynonyms[myabbreviation][alternative=first]

We have \FIRST, \SECOND\ and also \THIRD\ but no \FOURTH.

We have \FIRST, \SECOND\ and also \THIRD\ but no \FOURTH.

\resetshownsynonyms[myabbreviation]

\setupsynonyms[myabbreviation][alternative=last]

We have \FIRST\ and \THIRD\ or \FOURTH.

We have \FIRST\ and \THIRD\ or \FOURTH.

\placelistofsynonyms[myabbreviation]

\placelistofsorts[mylogo]




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

[NTG-context] Synonyms - feature request?

2015-03-25 Thread Robin.Kirkham
Folks,

I use the synonym feature heavily as technical documents can have hundreds of 
them. It’s great I can produce a list of synonyms I actually use in a document. 
Proper style however requires that each synonym be “explained” (shown in full) 
the first time it is used — usually in a document, but sometimes in a smaller 
scope, like a part or chapter. This is something I frequently get wrong, and is 
something document reviewers are quick to complain about.

So it would be great if Context could do this automatically. The attached MWE 
shows what I mean — with such a feature, the two paragraphs should come out the 
same.

I’ve placed some (commented) guesses as to how this might be configured in 
\setupsynonyms. Maybe better key names can be imagined.

Typically I would want synonym \XX\ to be expanded to XX (Xxx Xxx) the first 
time it is used (alternative a), but the reverse (alternative b), Xxx Xxx (XX) 
might be preferred. However a command could be used for a custom “explanation”.

Internally to Context, I guess this means each group of synonyms actually used 
has to be complemented with a list of the synonyms that have been “explained” 
(i.e., \infull{}) would add them to this second list). The second list would be 
cleared each new scope (chapter, section). The \XX\ macro would explain the 
synonym if it wasn’t on the second list (using \infull{}, which would then add 
it).

None of this would change the behaviour of \placelistof… where you would 
continue to select the criterium for the list you want output, independently of 

The only further tweak might be a scheme so that certain common synonyms (a 
third list) are never explained automatically (perhaps by example, UK in a 
document written in and for a UK audience). This list would silently added to 
the second list immediately after it was cleared, I guess. Synonyms for this 
this list would be added by a slightly different version of the
synonym definition macro (perhaps \commonabbreviation instead of \abbreviation, 
in the MWE).

Anyone think this would be a useful feature addition?

Robin


\definesynonyms[abbreviation][abbreviations][\infull]
\setupsynonyms[abbreviation][
state=start,
%explain=first,% first,always,never
%explainscope=text,% text,part,chapter,section...
%explainalternative=a, % a: XX (Xxx Xxx), b: Xxx Xxx (XX), command
%explaincommand=COMMAND#1#2,   % to format it yourself
textstyle=normal,
synonymstyle=\cap]

\abbreviation [UN]  {UN}  {United Nations}
\abbreviation [UK]  {UK}  {United Kingdom}
\abbreviation [USA] {USA} {United States of America}
\abbreviation [UAE] {UAE} {United Arab Emirates}

%\commonabbreviation [OK] {OK} {okay}
\abbreviation [OK] {OK} {okay}

\setupwhitespace[medium]

\starttext
The \UK\ and the \USA\ are both founding members of the \UN.
And I'm told the \UK\ and \USA\ are both English speaking countries.
But that’s \OK.

The \UK\ (\infull{UK}) and the \USA\ (\infull{USA}) are both founding
members of the \UN\ (\infull{UN}).
And I'm told the \UK\ and \USA\ are both English speaking countries.
But that’s \OK.

\placelistofabbreviations
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Problem with embedding code TikZ code

2014-08-29 Thread Fabrice Couvreur
In the code below, I do not understand why the label "Arbre 2" does not
have the color you want, that is to say the same as the label "Arbre 1".
Thank you.

\usemodule[tikz]
\usetikzlibrary[calc]

\definecolor[A2][c=0.60, m=0.00, y=0.00, k=0.10]
\definecolor[H1prime][c=0.50, m=0.00, y=1.00, k=0.00]

\starttext
\starttikzpicture[line width=0.3mm, >=stealth, x=1cm, y=1cm,line cap=round,
line join=round]
\tikzstyle{epais}=[line width=0.5mm, line cap=butt]
\tikzstyle{tres epais}=[line width=0.8mm, line cap=butt]
\draw [tres epais] (6.02,3.63)-- (8.88,3.64);
\draw (6.02,3.63)-- (6.03,0.77);
\draw [tres epais] (6.03,0.77)-- (6.02,3.63);
\draw [tres epais] (8.88,3.64)-- (8.89,0.78);
\draw [dashed] (-3.38,3.6)-- (8.89,-0.09);
\draw [dashed] (8.89,-0.09)-- (8.89,0.78);
\draw [dashed] (-3.38,3.6)-- (6.02,3.63);
\draw [A2,epais,domain=-1:2] plot(\x,{(-8.9-4.4*\x)/-3});
\draw [A2,epais,domain=1.5:4.5] plot(\x,{(--1.58-5.12*\x)/-4.72});
\draw (8.84,4.4) node {\color[H1prime]{\bf Arbre 1}};
\draw (-2.96,4.4) node {\color[H1prime]{\bf Arbre 2}};
\node at (8.14,0.8)  {\small piquet 4};
\draw [A1](8.84,-0.3) node {\bf Georges};
\node[rotate=45] at (0.28,1.88)  {\color[A2]{\bf Ravin}};
\node[rotate=90] at (9.4,1.74)  {\color[B1prime]{\bf longueur mesurée}};
\draw (2.46,4) node {\color[B1prime]{\bf longueur inconnue à estimer}};
\draw[B1prime,<->] (9.05,3.62)-- (9.05,-0.09);
\draw[B1prime,<->] (-3.38,3.8)-- (8.9,3.8);
\node at (8.84,4.0)  {\small piquet 1};
\node[rotate=30] at (6.22,4)  {\small piquet 2};
\node[rotate=30] at (6.22,0.5)  {\small piquet 3};
\stoptikzpicture
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Bold small caps

2014-05-23 Thread Hans Hagen

On 5/23/2014 6:46 PM, Mojca Miklavec wrote:

On Fri, May 23, 2014 at 6:11 PM, Wolfgang Schuster wrote:

Am 23.05.2014 um 17:55 schrieb Mojca Miklavec:


Would it make sense to fix this for the default LM setup as well?


This need to be done by the font designers because Latin Modern
uses a separate font for the small capitals and the \setff (better use
\feature) has no effect in this case.


For some reason I thought that they did both (supported all the small
cap glyphs as well as released a separate font).

But now I remembered that LM doesn't have bold small caps at all.

But apart from fixing the font: would creating some kind of a "virtual
font" with small cap glyphs taken from the other small cap font(s)
(where they exist) be feasible/doable? From what I see there are four
small caps fonts: regular and italic for both the roman and typewriter
style. No bold and no sans.


I wonder what the gyre folks would answer if we ask for proper embedding 
of smallcaps ...


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] Bold small caps

2014-05-23 Thread Mojca Miklavec
On Fri, May 23, 2014 at 6:11 PM, Wolfgang Schuster wrote:
> Am 23.05.2014 um 17:55 schrieb Mojca Miklavec:
>
>> Would it make sense to fix this for the default LM setup as well?
>
> This need to be done by the font designers because Latin Modern
> uses a separate font for the small capitals and the \setff (better use
> \feature) has no effect in this case.

For some reason I thought that they did both (supported all the small
cap glyphs as well as released a separate font).

But now I remembered that LM doesn't have bold small caps at all.

But apart from fixing the font: would creating some kind of a "virtual
font" with small cap glyphs taken from the other small cap font(s)
(where they exist) be feasible/doable? From what I see there are four
small caps fonts: regular and italic for both the roman and typewriter
style. No bold and no sans.

Mojca
___
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] Text and figure side by side

2014-04-24 Thread Fabrice Couvreur
Hi,
Is it possible to put side by side text and a figure created in a TikZ
environment
?
Thank you,
Fabrice

\usemodule[tikz]
\usetikzlibrary[calc]
\starttext
\def\smiley{%
\starttikzpicture[baseline=-0.75ex,black]
\filldraw[fill=orange] circle (2mm);
\node[fill,circle,inner sep=0.5pt] (left eye) at (135:0.8mm) {};
\node[fill,circle,inner sep=0.5pt] (right eye) at (45:0.8mm) {};
\draw (-145:0.9mm) arc (-120:-60:1.5mm);
\stoptikzpicture}
\placefigure[right,none]{}{
\starttikzpicture
\coordinate (c1) at (0,0);
\draw[thick,fill=darkgreen] ($(c1) + (0:30mm)$) arc (0:360:30mm)
($(c1) + (360:35mm)$) arc (360:0:35mm);
\draw[thick,fill=gray] ($(c1) + (0:3mm)$) arc (0:360:3mm);
\foreach \x in {0,36,...,180}
\draw[fill=red, draw=black](c1)--(\x:30mm) arc (\x:\x+36:30mm)--(c1);
\foreach \x in {216,252,...,324}
\draw[fill=blue, draw=black](c1)--(\x:30mm) arc (\x:\x+36:30mm)--(c1);
\foreach \x in {3,12,...,360}
\draw[fill=lightgray] (\x:28mm) circle (2pt);
\draw[thick,fill=white!30] ($(c1) + (0:3mm)$) arc (0:360:3mm)
($(c1) + (360:4mm)$) arc (360:0:4mm);
\draw[thick,fill=darkgray] ($(c1) + (0:3mm)$) arc (0:360:3mm);
\foreach \x in {18,54,...,198}
\node [white,rotate=\x] at (\x:17.5mm){\small \bf PERDU};
\foreach \x in {234,270,306,342}
\node [] at (\x:17.5mm) {\smiley};
\draw[darkgray,-latex,line width=4pt, line cap=round] (90:37mm) --
(90:26mm);
\stoptikzpicture}
\input knuth
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] \triangledown placed too low in Palatino

2014-04-11 Thread Otared Kavian
Hi,

The \triangle operator is used for instance in the « symmetric difference » of 
two subsets: if $E$ is a set and $A \subset E$, and $B \susbet E$, then one 
defines
\startformula
A \triangle B := (A \cup B) \setminus (A \cap B).
\stopformula
Then the mapping $(A,B) \mapsto A \triangle B$ is a commutative, associative 
binary operator on the subsets of $E$.

Some people use instead $A \Delta B$, but this is not the traditional, nor the 
correct way, to write this « symmetric difference » of two sets. This is why, I 
guess, in TeX \triangle is an operator.
I have seen also \triangledown as an operator, but I don’t recall the context 
in which it was used…

Regarding the notation \nabla to denote the gradient, and \Delta, to denote the 
Laplace operator (which by the way can be defined as $\Delta u := \nabla \cdot 
(\nabla u)$), Mikael Sundqvist gave the correct observations.

Best regards: OK

On 11 avr. 2014, at 05:48, Aditya Mahajan  wrote:

> On Thu, 10 Apr 2014, Sanjoy Mahajan wrote:
> 
>> Jannik,
>> 
>> You are right.  \nabla looks much nicer and is placed correctly.  (I
>> still think the \triangledown placement is slightly off.)
>> 
>> My environment files from MkII days have \def\nabla{\triangledown}, so I
>> never tried the true \nabla until your suggestion.
> 
> In MkIV: \triangledown is mapped to 0x25BD while nabla is mapped to 0x2207. 
> These are different glyphs.
> 
> IIUC, the difference in placement is because \triangledown is defined as a 
> mathop (and hence centered on the math-axis) while \nabla is defined as a 
> mathord. Compare:
> 
> \startformula
>  \nabla T
>  \quad
>  \triangledown T
>  \quad
>  \mathop{\nabla} T
> \stopformula
> 
> From what I remember, I was the one who added the mappings for triangledown 
> as a mathop based on, I believe, unicode-math package in LaTeX. I don't 
> understand what all the "triangle operators" are supposed to do. As such, I 
> cannot say whether the wrong placement is due to the wrong font metrics or 
> the wrong mapping (mathop vs mathord) by ConTeXt.
> 
> 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
> ___

___
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] Table next to a text in an environment of type list

2014-03-29 Thread Fabrice Couvreur
Hi,
How to improve this code to make the table to the right of the text in the
environment list ?

\midaligned{\tfb Cadres en entreprise}
\blank
On compte 67 femmes dans une entreprise de 160 personnes.

Parmi les personnes de cette entreprise, il y a 32 cadres dont 15 femmes.
\startitemize[n][stopper=),style=bold]
\item Recopier le tableau ci-contre.

\startitemize[n][stopper=),style=bold]
\setuphanging[location=right]
\starthanging{%
\bTABLE[align={middle,lohi}]
\bTR\bTD {} \eTD \bTD {\bf Femmes} \eTD \bTD {\bf Hommes} \eTD \bTD {\bf
Total} \eTD \eTR
\bTR \bTD {\bf Cadres} \eTD  \bTD {15} \eTD \bTD {} \eTD \bTD {32} \eTD
\bTR  \bTD {\bf Autres employés} \eTD \bTD {} \eTD \bTD {} \eTD \bTD {}
\eTD  \eTR
\bTR  \bTD {\bf Total} \eTD \bTD {67} \eTD \bTD {} \eTD \bTD 160{} \eTD
\eTR
\eTABLE}
\stophanging
\item Parmi les 160 personnes de cette entreprise, on en choisit une au
hasard.

On considère les événements suivants :
\startitemize[2]
\item F : \quotation{la personne choisie est une femme} ;
\item C : \quotation{la personne choisie est un cadre}.
\stopitemize
\startitemize[a][stopper=),style=bold]
\item Définir par une phrase les événements \math{\overline{C}}, \math{F
\cap C} et \math{F\cap\overline{C}}.
\item Calculer les probabilités \math{P(F)}, \math{P(C)},
\math{P(\overline{C})}, \math{P(F \cap C)} et \math{P(F \cap
\overline{C})}.
\stopitemize
\item \startitemize[a][stopper=),style=bold]
\item La personne choisie est un cadre de l'entreprise. Quelle est la
probabilité que ce soit une femme ?

{\it On note \math{P_{C}(F)} cette probabilité.}
\item Calculer \math{\dfrac{P(F \cap C)}{P(C)}}. Que constate-t-on ?
\stopitemize
\item \startitemize[a][stopper=),style=bold]
\item On choisit une femme parmi les personnes de l'entreprise. Quelle est
la probabilité qu'elle soit cadre ?

{\it On note \math{P_{F}(C)} cette probabilité.}
\item Exmpliquer pourquoi on obtient le résultat de la question précédente
en calculant  \math{\dfrac{P(C \cap F)}{P(F)}}.
\stopitemize
\item Que représentent en termes de probabilités les quotients
\math{\dfrac{52}{67}} et \math{\dfrac{52}{128}} ?
\stopitemize

\stoptext

Regards,
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] wrong \sc i with Palatino Linotype

2014-02-17 Thread Pablo Rodriguez
On 02/17/2014 08:46 PM, Jan Tosovsky wrote:
> On 2014-02-17 Pablo Rodriguez wrote:
>>
>> I have noticed that ConTeXt (beta from 2014.02.14 17:07) has a problem
>> with Palatino Linotype.
>> [...]
>>
>> All vowels are fine, but the i is a dotted small cap i. The regular
>> small cap i is defined as i.sc (and the dotted small cap i is defined
>> as i.sc too). But FontForge applies both c2sc and smcp substitutions
>> fine.
> 
> It seems to be a regression as this example now produces a dot as well:
> http://wiki.contextgarden.net/Palatino_Linotype_under_MKIV
> 
> (in ConTeXt 2013.12.20 it was Ok)

Many thanks for your reply, Jan.

In ConTeXt - 2013.05.28 00:36 (which comes with TeX Live 2013), I’m
afraid that bug is there.


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] wrong \sc i with Palatino Linotype

2014-02-17 Thread Jan Tosovsky
On 2014-02-17 Pablo Rodriguez wrote:
> 
> I have noticed that ConTeXt (beta from 2014.02.14 17:07) has a problem
> with Palatino Linotype.
> 
> Here the sample:
> 
> \definefontfeature[capstosc][c2sc=yes]
> \definefontfamily[mainface][serif][Palatino Linotype]
> \setupbodyfont[mainface]
> \starttext
> {\addfeature[capstosc] AEIOU}
> 
> \sc aeiou
> \stoptext
> 
> All vowels are fine, but the i is a dotted small cap i. The regular
> small cap i is defined as i.sc (and the dotted small cap i is defined
> as i.sc too). But FontForge applies both c2sc and smcp substitutions
> fine.
> 

It seems to be a regression as this example now produces a dot as well:
http://wiki.contextgarden.net/Palatino_Linotype_under_MKIV

(in ConTeXt 2013.12.20 it was Ok)

Jan

___
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] wrong \sc i with Palatino Linotype

2014-02-17 Thread Pablo Rodriguez
Dear list,

I have noticed that ConTeXt (beta from 2014.02.14 17:07) has a problem
with Palatino Linotype.

Here the sample:

\definefontfeature[capstosc][c2sc=yes]
\definefontfamily[mainface][serif][Palatino Linotype]
\setupbodyfont[mainface]
\starttext
{\addfeature[capstosc] AEIOU}

\sc aeiou
\stoptext

All vowels are fine, but the i is a dotted small cap i. The regular
small cap i is defined as i.sc (and the dotted small cap i is defined
as i.sc too). But FontForge applies both c2sc and smcp substitutions
fine.

Is there any way to solve this?

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] special case to disable italic correction

2014-01-28 Thread Pablo Rodriguez
On 01/28/2014 03:14 PM, Hans Hagen wrote:
> On 1/26/2014 8:24 PM, Pablo Rodriguez wrote:
>> [...]
>> If I get it right, the italic correction should be avoided before points
>> and commas (these are all the exceptions I can imagine for this case).
>> The explanation is simple: the space is already at the base line, since
>> at the glyph base, the inclination of the italic or slanted glyph makes
>> the right side-bearing larger at the baseline. The issue with italic
>> correction is mainly with ascenders or at the cap height, but I think it
>> isn’t at the base line (or the descenders). Because of that I think it
>> is important to disable italic correction before points and commas.
>> [...]
> Hard coded char checking is talking all punctuation is tricky, so i now 
> use a threshold instead (enabled by default).
> [,,,]
> Will be in next beta.

Many thanks for your implementation, Hans.

It works fine now.

Many thanks again for your work,


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] special case to disable italic correction

2014-01-28 Thread Hans Hagen

On 1/26/2014 8:24 PM, Pablo Rodriguez wrote:

Hi Hans,

after reading the relevant part for italic correction in fonts-mkiv.pdf
and enabling it in my documents, I have found a case in which the italic
correction could be improved.

My settings are:

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

If I get it right, the italic correction should be avoided before points
and commas (these are all the exceptions I can imagine for this case).
The explanation is simple: the space is already at the base line, since
at the glyph base, the inclination of the italic or slanted glyph makes
the right side-bearing larger at the baseline. The issue with italic
correction is mainly with ascenders or at the cap height, but I think it
isn’t at the base line (or the descenders). Because of that I think it
is important to disable italic correction before points and commas.

The sample shows the issue:

\setuppagenumbering[location=]
\definefontfeature[default][default][itlc=yes]
\setupitaliccorrection[global,always]
\starttext
\startTEXpage[offset=1ex]
Abf. {\em Abf}.\\
Abf, {\em Abf},\\
Abf. {\it Abf}.\\
Abf, {\it Abf},
\stopTEXpage
\stoptext

I think it might be worth considering.

Many thanks for your help and your excellent work,


Hard coded char checking is talking all punctuation is tricky, so i now 
use a threshold instead (enabled by default).


\disabledirectives[typesetters.threshold]

% % % % test:

\definefontfeature
  [default]
  [default]
  [itlc=yes]

\setupitaliccorrection
  [global,always]

% \enabletrackers[typesetters.italics]

\starttext
\startTEXpage[offset=1ex]
f. {\em f}.\par f, {\em f},\par f. {\it f}.\par f, {\it f},\par 
f: {\it f}:\par f; {\it f};\par
x. {\em x}.\par x, {\em x},\par x. {\it x}.\par x, {\it x},\par 
x: {\it x}:\par x; {\it x};\par

\stopTEXpage
\stoptext


Will be in next beta.

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
___


[NTG-context] special case to disable italic correction

2014-01-26 Thread Pablo Rodriguez
Hi Hans,

after reading the relevant part for italic correction in fonts-mkiv.pdf
and enabling it in my documents, I have found a case in which the italic
correction could be improved.

My settings are:

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

If I get it right, the italic correction should be avoided before points
and commas (these are all the exceptions I can imagine for this case).
The explanation is simple: the space is already at the base line, since
at the glyph base, the inclination of the italic or slanted glyph makes
the right side-bearing larger at the baseline. The issue with italic
correction is mainly with ascenders or at the cap height, but I think it
isn’t at the base line (or the descenders). Because of that I think it
is important to disable italic correction before points and commas.

The sample shows the issue:

\setuppagenumbering[location=]
\definefontfeature[default][default][itlc=yes]
\setupitaliccorrection[global,always]
\starttext
\startTEXpage[offset=1ex]
Abf. {\em Abf}.\\
Abf, {\em Abf},\\
Abf. {\it Abf}.\\
Abf, {\it Abf},
\stopTEXpage
\stoptext

I think it might be worth considering.

Many thanks for your help and your excellent work,

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
___


  1   2   3   4   >