[NTG-context] Re: How to tell a single *.tex file to produce separate PDFs?

2024-09-20 Thread Wolfgang Schuster

Denis Maier via ntg-context schrieb am 20.09.2024 um 15:05:

-Ursprüngliche Nachricht-
Von: Wolfgang Schuster 
Gesendet: Freitag, 20. September 2024 12:26
An: mailing list for ConTeXt users ; Joel via ntg-context 

Betreff: [NTG-context] Re: How to tell a single *.tex file to produce separate
PDFs?

You can use the pdf script file but it's slower than mutool or pdftk.

mtxrun --script pdf --split file.pdf


Where will this split the pdf? At certain headers?


This splits the pdf into single pages and there are no options.

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: How to tell a single *.tex file to produce separate PDFs?

2024-09-20 Thread Wolfgang Schuster

Joel via ntg-context schrieb am 20.09.2024 um 04:57:
I have a document that's quite long. It uses a recurse function, a bit 
like this:


\starttext

     \dostepwiserecurse{1}{180}{1}{%

    \input chapter\recurselevel

}

\stoptext

That produces 180  chapters of content.

Anyway, my boss is upset she has to use a table of contents to navigate 
to the page she wants, and so wants me to split the file into 180  
separate files, which somehow is going to be easier to look at. 
Honestly, she probably still won't ever actually look at it, but that's 
her requirement.


The problem is, I've been splitting the file by using Print --> PDF and 
choosing a custom print range, and then saving it. If I ned to repeat 
that 180 times, it not only will have errors, but probably take 5-10 hours.


Is there something I can put, like \breakpdf or something that will tell 
it to start a new PDF file? They can be named something like file1.pdf, 
file2.pdf, etc.


\starttext

     \dostepwiserecurse{1}{136}{1}{%

    \input chapter\recurselevel

\breakpdf

}

\stoptext

The perhaps "obvious" answer is just make 180  *.tex files, but since 
the minimal example above is like 0.01% of the complexity of the real 
file, that isn't so easy...


You can use the pdf script file but it's slower than mutool or pdftk.

mtxrun --script pdf --split file.pdf

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: Table and rotation: push together 45 degree rotated cells

2024-09-18 Thread Wolfgang Schuster

Gerion Entrup schrieb am 18.09.2024 um 14:44:

Am Dienstag, 17. September 2024, 20:36:23 MESZ schrieb Gerion Entrup:

Hi,

I want to typeset a table where some of the column headings are really long, 
while in the columns itself consists only of numbers.
Therefore, my idea was to rotate the column headings but not 90 degrees (I 
found some solutions for that) but 45 degree.

It then would be beneficial to push together the rotated cells, so the text of 
one cell actually starts above the previous cell.
Do you know, how to achieve that?

Here is a minimal example:
```
\startsetups[table:rotated]
\setupTABLE[frame=off]
\setupTABLE[row][first][bottomframe=on, style=bf, align={center, low}]
\setupTABLE[row][2][align=flushright]
\stopsetups

\starttext
\define\tablerotate{\dontleavehmode\rotate[rotation=-45, location=high]}
\bTABLE[setups=table:rotated]
\bTR \bTD \eTD \bTD \tablerotate{Water buffalo} \eTD \bTD 
\tablerotate{Mexican redknee tarantula} \eTD \bTD \tablerotate{European turtle 
dove} \eTD \eTR
\bTR \bTD Amount of legs \eTD \bTD \digits{4} \eTD \bTD \digits{8} \eTD 
\bTD \digits{2} \eTD \eTR
\eTABLE
\stoptext
```
I would like to achieve that the text "Mexican redknee tarantula" is typeset right and 
above of "Water buffalo" so that the single columns have a width that is similar to the 
width of the single digit coming in the second row.


To visualize this, I patched the PDF of the above example to the desired 
result. See the attachment.


You can use Metapost.

\startuseMPgraphic{tableheader}{text,rotation}

  label.lft("\strut\bf\MPvar{text}",origin)
rotated \MPvar{rotation}
shifted (\the\strutht,0);

  setbounds currentpicture to unitsquare

xyscaled(\the\struttotal,sin(\MPvar{rotation})*\the\widthofstring{\MPvar{text}});

\stopuseMPgraphic

\starttext

\bTABLE[frame=off]
  \bTR[align={middle,low}]
\bTH \eTH
\bTH[width=3em] 
\dontleavehmode\useMPgraphic{tableheader}{text=Water 
buffalo,rotation=315} \eTH
\bTH[width=3em] 
\dontleavehmode\useMPgraphic{tableheader}{text=Mexican redknee 
tarantula,rotation=315} \eTH
\bTH[width=3em] 
\dontleavehmode\useMPgraphic{tableheader}{text=European turtle 
dove,rotation=315} \eTH

  \eTR
  \bTR[topframe=on,align=middle]
\bTD Amount of legs \eTD
\bTD 4 \eTD
\bTD 8 \eTD
\bTD 2 \eTD
  \eTR
\eTABLE

\stoptext

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: (ConTeXt LMTX 2.11.05) how do I make it so that sections, descriptions, and itemizations have just a space between some of the text that they produce

2024-09-16 Thread Wolfgang Schuster

Felix schrieb am 16.09.2024 um 16:24:

[...]

This code shows how I am getting the default spacing between the words from 
itemize, description, and the spacing between the roman numeral and the section 
title. I tried figuring out how to get the spacing for all of these to be set 
to a single space worth but it seems to not be possible with `distance`, 
because it asks for a dimension. How can I get a `\space`'s worth of spacing to 
be the default in descriptions, itemizations, and sections? for itemizations 
and descriptions the spacing seems to vary and I really don't like that. I 
would be thankful to know if there's a way to change the spacing.


Please remove everything from your examples which isn't necessary to 
show the problem, in your example you can get rid of


- the page layout,
- the font settings,
- the title page and
- all settings from \setupdescription and \setuphead unrelated to the 
space between number/title and the text.



The value you're looking for is \spaceamount which can be used with the 
distance-key to set the width of a space as separator.



For descriptions you have to set the value of the width to fit and use 
the distance key to set a fixed
value for the space between the title and following text, to ensure the 
space doesn't increase set

also the shrink and stretch values to 0.

 begin example
\definedescription
  [description]
  [alternative=serried,
   width=fit,
   distance=\spaceamount,
   stretch=0,
   shrink=0]

\starttext

\startdescription [title={I'm not a fan of the}]
default spacing
\stopdescription

\stoptext
 end example


For itemize you can use the fit keyword but be aware once you have more 
than 9 entries you get
a bigger space between the number and content because the environment 
set the width of all

entries to width of the widest number.

 begin example
\starttext

\startitemize[n,fit][distance=\spaceamount]
\startitem
I'm not a fan of the default spacing
\stopitem
\stopitemize

\stoptext
 end example


For section titles you just have to change the distance value.

 begin example
\setuphead
  [section]
  [distance=\spaceamount]

\starttext

\startsection[title={I'm not a fan of the}]

default spacing

\stopsection

\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 / 
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: Interline spacing in tabulate paragraphs

2024-09-15 Thread Wolfgang Schuster

Kirill Davidov schrieb am 15.09.2024 um 20:01:

Ah, that helps. Then, one more question. I assume line=2.8ex is
equivalent to single line spacing, yes? Do I therefore naively multiply
that by, say, 1.5 to get 1.5 line spacing? Thanks!


Yes, the default value is 2.8ex and the medium, big and numeric values 
(e.g. \setupinterlinespace[2])
are multiples of it but you should be aware it is depends on the font 
which specifies the value of ex.


An alternative to the default relative setting are absolute values, e.g. 
\setupinterlinespace[line=16pt].


When your try to reproduce the spacing of another system like MS Word 
how it specifies the meaning
one and half or double spacing because there is no standardized method 
to set the value, below are
a few examples (where I tried to reproduce the MS Word settings but I 
can be wrong here).


 begin example
% \definefontfamily [aptos] [rm] [Aptos Serif]
% \definefontfamily [aptos] [ss] [Aptos]
%
% \setupbodyfont[aptos,ss]

\startdocument

\bold{ConTeXt 1x:} \samplefile{dijkstra}

\blank

\setupinterlinespace[2]% relative value

\bold{ConTeXt 2x:} \samplefile{dijkstra}

\blank

\setupinterlinespace[line=\dimexpr\bodyfontsize+8pt\relax]

\bold{Word 1x:} \samplefile{dijkstra}

\blank

\setupinterlinespace[line=\dimexpr1.15\bodyfontsize+8pt\relax]

\bold{Word 1.15x:} \samplefile{dijkstra}

\blank

\setupinterlinespace[line=\dimexpr2\bodyfontsize+8pt\relax]

\bold{Word 2x:} \samplefile{dijkstra}

\stopdocument
 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 / 
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: Interline spacing in tabulate paragraphs

2024-09-15 Thread Wolfgang Schuster

Florent Michel schrieb am 15.09.2024 um 17:44:

Hello,

It's probably not the best solution, but it seems to work on my side 
if I replace `big` by `2em`; see code below.


When the whole document needs a larger interlinespace

    \setupinterlinespace[big]

is the wrong method and

    \setupinterlinespace[line=4x]

or (which is an alternative form for the one above)

    \setupinterlinespace[4ex]

are the recommended solutions.



The reason why Kirill had the problem with is that tabulate resets the 
interlinespace value
to the global settings while "big" is just a relative value which 
depends on the global value.


This reset is necessary because tabulate uses the global interlinespace 
value to split

the table into slices which allows it to break cells across pages.


When you need a different interlinespace for a part of the document you 
should use


    \start \setupinterlinespace[line=4ex]

    content which a different interlinespace setting

    \stop

which does also work for tabulate.


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: Margins using 2UP imposition schema

2024-09-15 Thread Wolfgang Schuster

Angel M Alganza schrieb am 14.09.2024 um 19:08:

Hello:

I'm composing an A5 booklet printed on an A4 paper using the 2UP 
imposition schema.  I believe, in such case, margins should be 
controlled using 'backspace' and 'cutspace' options of the 
\setuplayout command, but I'm afraid I don't quite understand how to 
use those properl.  I want to make the 'external' margin (right on odd 
pages and left on even pages) as small as possible, and the 'internal' 
margin larger, so that I can hole punch the booklet.


I believe, in such case, margins should be controlled using 
'backspace' and 'cutspace' options of the \setuplayout command, but 
I'm afraid I don't quite understand how to use those properly.  Here's 
a minimal example:


\setuppapersize[A5][A4]
\setuparranging[2UP,rotated]
\setuplayout
[topspace=13pt,
backspace=30pt,
cutspace=-20pt,
width=fit,
height=fit,
header=0pt,
footer=0pt]
\setuppagenumbering[state=stop]
\setupbodyfont[small]
\starttext
\dorecurse{20}{\input tufte \vskip 1em}
\stoptext

I wonder how I could reduce the left margin and increase the left one 
on the even pages.


Any pointers, please?


Create a normal document without imposition in A5 and use afterwards the 
arrange extra to produce your booklet.


You can get a short information block with an example when you write

    context --extras=arrange

in the terminal.

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: (ConTeXt LMTX 2024, monospace font) Why does monospaced text go out of the margin for me? is this supposed to happen?

2024-09-14 Thread Wolfgang Schuster

Felix schrieb am 14.09.2024 um 06:40:

https://pastebin.com/2ce1xSYf

The code linked above has 3 paragraphs. One in TImes New Roman, the other in 
Aptos and the last in Aptos Mono.

The paragraph with \tt seems to go over my margin of .5 inches for the left and 
right side of my doc., but the serif and sans serif text doesn't. I can't seem 
to figure out why exactly this is.

Did I set up \setuplayout incorrectly? I wanted .5in margins but I kind of 
'hacked' the way I got things. Is there a better way that I could have gotten 
.5 inch margins and a.5in header/footer? I can't seem to understand why the 
output is what it is. I would greatly appreciate any help!

Feel free to switch out the fonts if you'd like


You're trying to justify a text with a fixed width font which fails 
because the often have a fixed width space. When you have a space a 
fixed width TeX can stretch or shrink the space between the word to 
align them with the right margin.


The best solution is to disable justification and use ragged text on the 
right side. An alternative is to allow bigger spaces between words but 
as you can see in the following example the gaps between words can be 
quite large.


 begin example
\showframe

\setupbodyfont[tt]

\starttext

\samplefile{zapf}

\blank

\start \setuptolerance[space]
\samplefile{zapf}
\par \stop

\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 / 
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 LMTX 2024, \setupalign: Is the "Nicer justification and microtypography" list of options listed in ConTeXt Garden now obselete?

2024-09-14 Thread Wolfgang Schuster

Felix schrieb am 14.09.2024 um 06:13:

When I try to use a combination (example =
\setupalign[normal,extremestretch,verytolerant,hangingboth,fullhz,hyphenated,]
)

and just normal

I seem to be getting the same result when I try to load in a big paragraph. 
However, there is an obvious difference between me entering (just) flushleft, 
normal, flushright.

Have those options become obsolete? how am I supposed to know?


Whether there is a difference or not depends on your text, when you have 
a wide

text block and short words TeX can produce good results without the need for
additional parameters but when you have a narrow text blocks (e.g. for 
text in

columns) or long words you need additional settings.

The example below shows how different options can result in different 
line breaks
but not all sample text produce the same effect, sometimes you get the 
same result

with and without verytolerant etc.

Don't forget to enable expansion and protrusion before you use the 
hanging and hz

options because they need these font features.

 begin example
\definefontfeature [default] [default] 
[expansion=quality,protrusion=quality]


\setuppapersize [A5]

\defineframed
  [Example]
  [width=max,
   offset=none,
   framecolor=lightgray]

\starttext

\startprocesscommalist[normal,{normal,verytolerant},{normal,stretch},{normal,hanging},{normal,hz}]
  \starttitle[title=\currentcommalistitem]
    \startframed[Example][align=\currentcommalistitem]
    \samplefile{tufte}
    \stopframed
  \stoptitle
\stopprocesscommalist

\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 / 
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: Indentation in headings

2024-09-14 Thread Wolfgang Schuster

Kirill Davidov schrieb am 14.09.2024 um 08:59:

Greetings,

As per Russian GOST standards, numbered section headings are flush left
and start with the paragraph indent. Is there a proper way to indent a
section heading? The code simulates what I want visually, but it
unfortunately causes the heading to poke out into the margins. That can
be troublesome if the title is long enough.

Example code to tinker with:

[...]



You have to use the narrow environment and apply it with the beforehead 
and afterhead command and in addition enable the aligntitle option.


 begin example
\setupindenting
  [yes, 2.5em, first]

\setuphead
  [section]
  [
 align=flushleft,
 beforehead={\startnarrow[left=\parindent][left]},
 afterhead=\stopnarrow,
 aligntitle=yes,
 indentnext=yes,
   ]

\showframe

\startdocument

\startsection[title=Very long section title that makes you question the 
author's writing capabilities]


\input dijkstra

\stopsection

\stopdocument
 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 / 
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 beginner, What should I enable within font features? And how do I see all the options possible?

2024-09-13 Thread Wolfgang Schuster

Felix schrieb am 13.09.2024 um 08:02:

Hello Wolfgang, so if I follow your code examp,e what if I were to edit my code 
to be like this:

\definefontfeature[generalfeatures][default][
 kern=yes, % enables kerning
 extrakerns=yes, % enables extra kerning
 trep=yes, % Enables single and double quotes to show up correctly in text, 
perhaps does more
 liga=yes, % Enables ligatures.
 itlc=yes, % Activates italic correction.
 mark=yes, % Used for positioning diacritical marks (accents, dots, etc.) 
relative to base characters.
 mkmk=yes, % positions diacritical marks relative to other marks
 locl=yes,
 ccmp=yes, % Composes multiple characters into a single glyph or breaks 
down ligatures.
 mode=node,
 protrusion=yes,
 expansion=yes,
 language=dflt,
]

\definefontfamily [myfonts] [rm][Times New Roman] 
[features=generalfeatures,dlig=yes,cpsp=yes,% dlig enables times new roman 
ligatures, and cpsp is used by tnr, not aptos]
\definefontfamily [myfonts] [ss][Aptos]   
[features=generalfeatures,]
\definetypeface   [myfonts] [mm] [math] [stixtwo] 
[features=generalfeatures,]

\setupbodyfont[myfonts,12pt]

do you think this code is flawed?


Stay with the following basic setups and add only expansion or 
protrusion when you use the features in your document, otherwise there 
is no need for them.


\definefontfeature [times] [default] [trep=yes,dlig=yes]
\definefontfeature [aptos] [default] [trep=yes]

\definefontfamily [myfonts] [rm]    [Times New Roman] [features=times]
\definefontfamily [myfonts] [ss]    [Aptos] [features=aptos]
\definefontfamily [myfonts] [tt]    [Aptos Mono] [features=none]
\definetypeface   [myfonts] [mm] [math] [stixtwo]

\setupbodyfont[myfonts,12pt]

\starttext
\samplefile{lorem}
\stoptext


Also, do you think you could explain how locl and extrakerns works? do I need 
to have kern=yes for it to enable? how can I test if extrakerns Is working? 
when I just have kern=yes enable, and then enable extra, a pdf that has a 
paragraph using both in code looks the same. locl is something I'm completely 
unsure about.


1. Many features above are part of the default set.

2. When you don't know what the effect of an opentype feature is (look 
at https://www.preusstype.com/techdata/features.php for a few examples) 
don't enable it because you can get an unexpected output in your 
document. It is also important to know what your font makes with the 
feature because like I previously mentioned Times New Roman uses dlig to 
produce standard ligatures which isn't what you expect here.


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: collector advice

2024-09-12 Thread Wolfgang Schuster

jbf schrieb am 12.09.2024 um 04:21:
Using the example in the ConTexT wiki for "collectors", I have as 
follows, to credit the person who took the photo:


\setupcaption[number=no]

\definecollector[example]

\setcollector [example] 
{\leftaligned{\externalfigure[bird.jpg][width=5cm,frame=off]}}


Remove \leftaligned.


\setcollector [example] [corner={right,bottom},location={left,top}]

{\rotate[rotation=90]{\framed[frame=off]{\tfx Taken by Kathy Luck, used 
with permission}}}


\placefigure [] [] {} {\composedcollector{example}}


\placefigure {} {\leftaligned{composedcollector{example}}}

or just

\leftaligned{composedcollector{example}}


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: how do I get the correct page numbers and do the calculations with it?

2024-09-11 Thread Wolfgang Schuster

ai2472206...@yeah.net schrieb am 11.09.2024 um 04:22:

Thank you for your careful and patient explanation.
I'll check my code again.
Because it's still very simple,
and some situations haven't been taken into account.
In particular, the condition judgment to split the part of the box.


I run your code and already found a few example where it fails, e.g.

- when you have a very short text it is spread over the while line and 
you get a line break at the end
- when you use it in the narrower environment you don't compensate the 
left/right indentations



Regarding the part about referencing commands,
I inadvertently forgot to delete it.

I have a question about the command "\warichuparameter\c!XXX" :
Why can we use "\warichuparameter\c!XXX" instead of "\warichuparameter{XXX}" in 
most cases,
but in some cases, it says that the command is not defined?
For example, \warichuparameter\c!pointstyle -->   Control sequence expected 
instead of undefined

I've used "\warichuparameter\c!XXX" before, but it causes the error
because there are some keys that are specifically named.
For the sake of stylistic consistency, I used "\warichuparameter{XXX}" for all 
command.

Maybe it's because I didn't define it? Should I define the following in advance?

%%%
\def\c!pointstyle{pointstyle}
%%%


Yes, these constants are predefined to have language dependent keys in 
the setup command, e.g.


    \setupitemize[width=1cm]

is written as

    \stelleaufzaehlungein[breite=1cm]

with the german interface.


To ensure you use the correct name for the key you use \c!width as 
argument for the \xxxparameter command.



While you can use \def\c!...{...}  to create a new constant the proper 
method is to use \setinterfaceconstant.



You can run the following example to get a list with a predefined 
constant. When you uncomment the first three lines you see the new entry 
also appears in the list.


 begin example
% \startinterface all
% \setinterfaceconstant {pointstyle} {pointstyle}
% \stopinterface

\setuplayout[tight]

\starttext

\startluacode
context.startcolumns({n=3})
for constant, _ in table.sortedpairs(interfaces.constants) do
  context.mono(constant)
  context.par()
end
context.stopcolumns()
\stopluacode

\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 / 
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: how do I get the correct page numbers and do the calculations with it?

2024-09-10 Thread Wolfgang Schuster

Bruce Horrocks schrieb am 11.09.2024 um 00:35:



On 10 Sep 2024, at 19:47, Wolfgang Schuster  
wrote:

You can't use page counters in running text without problems because you're 
working against the way how TeX constructs pages.

The only reliable way are multipass solutions like the pagestate or reference 
mechanism.

If commands such as \pagenumber and \userpagenumber don’t work reliably then 
maybe the commands should be removed? Just a thought.


They work without problems when you use them to show the pagenumber in 
the header/footer
because these elements are added when the page is finished and the 
values don't change anymore.


What doesn't works is to use them to print the number of the current 
page within running text
because TeX collects more text than it can fit on a single page which 
can result in the number

of the previous page when the text is moved to the next one.

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: how do I get the correct page numbers and do the calculations with it?

2024-09-10 Thread Wolfgang Schuster
dimexpr\wd\scratchbox/2+1pt\relax}%
 \get@split@box{\dimexpr\wd\scratchbox+1pt\relax}}\allowbreak%
  \exitloop%
   \fi}%
\warichuparameter{right}%
\warichuparameter{distance}\endgroup}


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: how do I get the correct page numbers and do the calculations with it?

2024-09-10 Thread Wolfgang Schuster

Bruce Horrocks schrieb am 09.09.2024 um 23:27:

On 9 Sep 2024, at 08:57, ai2472206...@yeah.net wrote:

As the title suggests, how do I get the correct page numbers?


There does seem to be an anomaly here. Simpler MWE:

\starttext
\dorecurse{15}{
\input knuth
%{\ssd\color[red]{\pagenumber}} % not as expected
{\color[red]{\pagenumber}}   % as expected
}
\stoptext

With the \ssd the first number at the top of the second and subsequent pages is 
one less than it should be. Without the \ssd then the numbers are as expected.

@Muyik: Are you able to use \pagenumber without using \ssd or similar to change 
the size? That might be a work-around for you. There is also \userpagenumber.


You can't use page counters in running text without problems because 
you're working against the way how TeX constructs pages.


The only reliable way are multipass solutions like the pagestate or 
reference mechanism.


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: how do I get the correct page numbers and do the calculations with it?

2024-09-10 Thread Wolfgang Schuster

ai2472206...@yeah.net schrieb am 10.09.2024 um 06:05:

1. The usage of the command  "\definepagestate " is what I searched for in 
previous posts and source files.
I don't know exactly how he used it. (╥﹏╥)

2. I've devised a command that needs to get the current page number to 
determine if it's an odd or even page.
This is then used to get a certain width to determine the width of the command 
on that line.
Below I designed the command. The code related to this issue is mainly


You have to differentiate between odd and even and right hand and left 
hand pages.


When you want to check whether you have an right hand or left hand page 
you can use the following method.
To get the correct result ensure you start a paragraph before you set 
the flag with \signalrightpage.


 begin example
%\setuppagenumbering[alternative=doublesided]
%\setuppagenumbering[alternative={singlesided,doublesided}]

\starttext

\dorecurse{20}
  {\dontleavehmode\signalrightpage\doifelserightpage{\bold{Right 
page}}{\bold{Left page}}

   \samplefile{lorem}}

\stoptext
 end example

To have a check which works for odd and even pages you have to use the 
pagestate mechanism.
Even in this case it is important to start a paragraph before save the 
current state, afterwards

you can check the stored pagenumber.

 begin example
\definepagestate[warichu]

\starttext

\dorecurse{20}
  {\dontleavehmode\autosetpagestate{warichu}%
   \ifodd0\autopagestaterealpage{warichu}%
 \bold{Odd page}
   \else
 \bold{Even page}
   \fi
   \samplefile{lorem}}

\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 / 
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: What could possibly be wrong with 'P'?

2024-09-09 Thread Wolfgang Schuster

jbf schrieb am 10.09.2024 um 02:36:


Here is a really odd one that I have a simple workaround for, but for 
the life of me I cannot work out why this is happening. Is 'p' (or 
'P') some sort of restricted letter in certain circumstances?


Here is the issue:

\startdocument

[metadata:author={Author name},

metadata:title={Psalms}]



1. This is *not* a complete minimal working example.

2. The following example works (with and without \setupinteraction) here 
with the latest version.


\setupinteraction[state=start]

\startdocument
  [metadata:author={Author name},
   metadata:title={Psalms}]

Psalms.

\stopdocument

And I get an error. Document will not compile. Any other initial 
letter than 'p' (in Psalms) does not produce the error.


So if I do something like:

\startdocument

[metadata:author={Janet Dawson},

metadata:title={~Psalms}]

Then I no longer get the problem. Which just seems to confirm the fact 
that it is the initial letter 'p' that is the problem. I can also 
change the spelling of 'psalms' (anything really, asalms, xsalms) and 
there is no problem, but of course that would be silly.


I have never had this issue before, so while it looks like 'p' is the 
problem (it can hardly be the Psalms!), it is possibly something else, 
but what, I would not know. If it helps, I am calling in that 
metadata:title in the header in the usual way, e.g.:


\setupheadertexts

[ ] [{\getmarking[chapter]\hskip1em \pagenumber}]

[] [ {\pagenumber \hskip1em \documentvariable{metadata:title}}]

But that should not be a problem.



The \hskip is a problem because the commands is looking for additional 
parameters and when it encounters the "p" at the beginning of 
metadata:title it assumes you set the plus parameter.


To prevent the error either add a \relax after the dimension (i.e. 
\hskip1em\relax) or use \quad which inserts a horizontal space of 1em.


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: how do I get the correct page numbers and do the calculations with it?

2024-09-09 Thread Wolfgang Schuster

ai2472206...@yeah.net schrieb am 09.09.2024 um 09:57:

Thank to all who answered my questions before.
As the title suggests, how do I get the correct page numbers?
For example, in the example below,
the first line on the 2nd page, but the page number showed is 1,
In the meantime, I tried using \definepagestate,
but it didn't seem to work either.
What I can think of is to use citations to get the correct page number.
But it seems that what is obtained is not a pure number,
and it cannot do the calculations.

so ,how do I get the correct page numbers and do the calculations with it?


1. You save only 1 pagestate with index 0 but you try to access the data 
of the pagestates with index 1 to 10.


2. What do you try to achieve here?

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: Is \not still supported?

2024-09-08 Thread Wolfgang Schuster




Hans Hagen schrieb am 08.09.2024 um 20:21:

On 9/8/2024 5:19 PM, Wolfgang Schuster wrote:

Hi,

is the \not command still supported in math mode or should users 
replace it with the combined form, e.g. \notin instead of \not\in.


 begin example
\starttext

\im{x \in M}

\im{x \notin M}

\im{x \not\in M}

\stoptext
 end example

indeed, because old school \not was a symbols that got overlayed.

we could of course make some clever not but i hav eto discuss that 
with MS .. if there are \not cases at all


My main reason for the question was to get clarification about the 
status of the command.


Using the proper commands (e.g. \notin) was always the better choice 
because they produce better output than \not does.


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] Is \not still supported?

2024-09-08 Thread Wolfgang Schuster

Hi,

is the \not command still supported in math mode or should users replace 
it with the combined form, e.g. \notin instead of \not\in.


 begin example
\starttext

\im{x \in M}

\im{x \notin M}

\im{x \not\in M}

\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 / 
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: Steps to become a ConTeXt developer

2024-09-08 Thread Wolfgang Schuster

Hans Hagen via ntg-context schrieb am 28.08.2024 um 20:18:

On 8/28/2024 5:06 PM, Henning Hraban Ramm wrote:

There’s also the scite module that uses SciTE’s lexers for syntax 
highlighting. The builtin highlighters are limited to TeX/ConTeXt, 
MetaPost, Lua and XML.
They are actually just lpeg lexers that we made for use in scite so no 
scite installation is needed.


Which highlighter should extended when support for additional languages 
is needed, the built-in one or the scite version?


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: ConTeXt beginner, What should I enable within font features? And how do I see all the options possible?

2024-09-07 Thread Wolfgang Schuster

Felix  schrieb am 05.09.2024 um 22:58:

https://pastebin.com/245uwYj4

I have this setup for my fonts, called myfonts.

I assume that `\definefontfeature [default] [default] 
[trep=yes,dlig=yes,itlc=yes]` will affect every single font that goes into my 
preamble (Forgive me if I seem incompetent, I am a beginner at ConTeXt)


It is applied to all fonts which use the "default" feature set and which 
enabled after you made the changes.


In the following example only pagella uses the "trep" feature because 
modern was loaded before the settings was added to the default feature set.


 begin example
\starttext

\setupbodyfont[modern]

a'b

\definefontfeature [default] [default] [trep=yes]

\setupbodyfont[pagella]

a'b

\stoptext
 end example

To be on the save side create custom feature set where you add 
additional settings and apply these to your fonts.


 begin example
\definefontfeature [MyFeatures] [default] [trep=yes]

\definefontfamily [OldTimes] [rm] [Times New Roman]
\definefontfamily [NewTimes] [rm] [Times New Roman] [features=MyFeatures]

\starttext

\setupbodyfont[OldTimes]

a'b

\setupbodyfont[NewTimes]

a'b

\stoptext
 end example


I have dlig and trep on so that works with single quotations like don't have a 
directional quote, and so that I get the Times New Roman ligatures via dlig and 
not just liga. itlc is enabled since I read some documentation and they 
sometimes mention enabling it


It shouldn't be necessary to add "itlc" anymore to get italic correction 
for \em etc.



is there some stuff like the extrafeatures option or anything that you would 
recommend i enable? might there be options for extrakerns that would be seen as 
something that one should enable?

also, how can I see all the options available? dlig is something I discovered 
by accident that was not in the options list in the documentation.


Unless you know the effect of a feature you shouldn't add or enable it.

You even have to know what is supported by the fonts in your document 
which can differ between certain versions of a font, take Times New 
Roman which is included with Windows as an example.


1. For a long time ligatures weren't supported by the font at all and 
the first mention of the support it is from 2022.


2. The font uses the "dlig" feature to enable the f ligatures even 
though the normal tag for it is "liga". My guess why they made this 
decision is backwards compatibility with existing document to avoid them 
from using these ligatures.


3. You shouldn't enable "dlig" by default for all fonts because the 
results of the feature can vastly for the fonts which provide it, take 
the following two fonts as example.


 begin example
\definefontfeature [discretionary-ligatures] [dlig=yes]

\starttext

\startbuffer[pagella]
\starttabulate[|||]
\NC \type{} \EQ  \NC\NR
\NC \type{--}   \EQ --   \NC\NR
\NC \type{!`}   \EQ !`   \NC\NR
\NC \type{!‘}   \EQ !‘   \NC\NR
\NC \type{?`}   \EQ ?`   \NC\NR
\NC \type{?‘}   \EQ ?‘   \NC\NR
\NC \type{,,}   \EQ ,,   \NC\NR
\NC \type{‘‘}   \EQ ‘‘   \NC\NR
\NC \type{’’}   \EQ ’’   \NC\NR
\NC \type{---}  \EQ ---  \NC\NR
\stoptabulate
\stopbuffer

\setupbodyfont[pagella]

\start \nohyphencollapsing
\getbuffer[pagella]
\stop

\start \nohyphencollapsing \feature[+][discretionary-ligatures]
\getbuffer[pagella]
\stop

\startbuffer[dejavuserif]
\starttabulate[|||]
\NC \type{ſt} \EQ ſt \NC\NR
\NC \type{st} \EQ st \NC\NR
\stoptabulate
\stopbuffer

\setupbodyfont[dejavu]

\start
\getbuffer[dejavuserif]
\stop

\start \feature[+][discretionary-ligatures]
\getbuffer[dejavuserif]
\stop

\stoptext
 end example

The only additional features which can be added without problems are 
"expansion" and "protrusion" because until you enable them with 
\setupalign nothing changes in your document.


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: \ldot and \ldotp not working

2024-09-04 Thread Wolfgang Schuster

Aditya Mahajan schrieb am 04.09.2024 um 05:58:

Hi,

With context 2024.08.16 the following gives an error:

\starttext
$A \ldot B$
\stoptext

tex error   > tex error on line 2 in file ./test.tex: Control sequence 
expected instead of undefined


 $A \ldot
  B$

Same error with `\ldotp`.

However

\starttext
\show\ldot
\show\ldotp
\stoptext

gives


\ldot=permanent \Umathchar"02"00"2E
\ldotp=permanent \Umathchar"06"00"2E


which appears correct.

So, not sure what is going on. Any ideas?



I have no idea what's the cause for the error but I can narrow it down.

When you replace \ldot with it's mathchar version you can reproduce the 
error when there is *no* space at the end, \ldots on the other hand has 
no problem without the space.


\starttext

No space at the end of \tex{Umathchar}:
$\Umathchar"19"00"002026\Umathchar"19"00"002026 $ % \ldots

Space at the end of \tex{Umathchar}:
$\Umathchar"19"00"002026 \Umathchar"19"00"002026 $ % \ldots

No space at the end of \tex{Umathchar}:
% $\Umathchar"02"00"2E\Umathchar"02"00"00002E $ % \ldot

Space at the end of \tex{Umathchar}:
$\Umathchar"02"00"2E \Umathchar"02"00"2E $ % \ldot

\stoptext

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: Is there an alternative to \reference[]{} that won't interfere with the document design?

2024-09-03 Thread Wolfgang Schuster

Jürgen Hanneder via ntg-context schrieb am 31.08.2024 um 17:27:


I recently learned not to leave a space before and after \reference , 
but have not seen
further complex problems as you describe so far. Can you give more 
specific examples for these,

I have to check, because I am also finalising a book at the moment.


References need an anchor to know on which page they end up because a 
page is finished you don't know the answer.


The following example sets three references, one and three marks the 
start of each paragraph but where should two end up?


 begin example
\usemodule[visual]

\setuppapersize[A6,landscape]

\setupwhitespace[line]

\starttext

\showmakeup[hbox]

\pagereference[one]\fakelines{10}{10}

\pagereference[two]

\pagereference[three]\fakelines{10}{10}

\page

\showmakeup[reset]

\starttabulate
\NC one   \NC \at[one]   \NC\NR
\NC two   \NC \at[two]   \NC\NR
\NC three \NC \at[three] \NC\NR
\stoptabulate

\stoptext
 end example

When you process the example you get page 1 as output, but why is this 
the case. Take a look the the tracing information and you can see a "H" 
at the left bottom on page 1 which is missing on page 2, this is where 
ConTeXt places reference two. You get this "H" mark because 
\pagereference starts a new paragraph to ensure the is a anchorpoint but 
as a side effect you can end up with unwanted empty lines in your 
document, to test this change the argument of the first \fakelines from 
10 to 12 and now the stray "H" appears at the top left on the second 
page but in addition you get 2 empty lines at the top (1 for the 
reference and another 1 for the parskip).


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: Combining styles (especially bold and italic)

2024-09-03 Thread Wolfgang Schuster

Gerion Entrup schrieb am 03.09.2024 um 18:28:

Hi,

I have the situation that I want to typeset a special formatted name within a 
section heading.
The name contains an italic part while the heading is bold, but both styles are 
defined at another place.
Is there a way to tell ConTeXt to combine them, so that it is bold _and_ italic?

Here is a minimal example:
```
\define\somename{HX\style[italic]{print}\autoinsertnextspace}


You want \italicface (or \style[italicface]) which selects either \it or 
\bi.


\define\somename{HX{\italicface print}\autoinsertnextspace}

or

\define\somename{HX\style[italicface]{print}\autoinsertnextspace}

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: (ConTeXt LMTX) How do I fix the centering and setting up width in xtables?

2024-09-02 Thread Wolfgang Schuster

Felix schrieb am 01.09.2024 um 20:54:

https://pastebin.com/TQdzmxeP

I am trying to make a resume in ConTeXt (to see how well my skills have gotten, 
I am still quite a beginner) and Iw as able to produce what is in Pastebin.

Though, I am having trouble with the table that goes over the big sized text 
that would be my name. It has  an email, a phone number, and an address but 
they are all aligned very weirdly. I want them to be centered. Though, the 
phone number has some sort of problem with alignment, and I don;t know fi the 
other ones are causing it or are also aligned wrong.

I also wanted to make this code:

\startxcell[topframe=on,bottomframe=on,align=flushright]
 Ability to communicate strongly and effectively, being a reliable team 
member, supporting a team whenever needed, and the desire to help everyone
\stopxcell

has it so that it doesn't take up so much horizontal space (Ideally it is 
taking up 1/3 of the width I am allowing for since there are three rows in 
total) , but when I add width={some value} into the square brackets, it will 
add a blank line after all the text, and this is not what I want.


You have to add "option=fixed" to the cell with the width setting.

 begin example
\starttext

\startxtable[option=stretch]
  \startxrow
    \startxcell
  text text
    \stopxcell
    \startxcell[width=8cm]
  \samplefile{ward}
    \stopxcell
  \stopxrow
\stopxtable

\startxtable[option=stretch]
  \startxrow
    \startxcell
  text text
    \stopxcell
    \startxcell[option=fixed,width=8cm]
  \samplefile{ward}
    \stopxcell
  \stopxrow
\stopxtable

\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 / 
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 LMTX) How do I fix the centering and setting up width in xtables?

2024-09-01 Thread Wolfgang Schuster

Felix schrieb am 01.09.2024 um 20:54:

https://pastebin.com/TQdzmxeP

I am trying to make a resume in ConTeXt (to see how well my skills have gotten, 
I am still quite a beginner) and Iw as able to produce what is in Pastebin.
Your next lesson is to learn how to create a minimal example which 
contains only the necessary information needed to show the problem.

Though, I am having trouble with the table that goes over the big sized text 
that would be my name. It has  an email, a phone number, and an address but 
they are all aligned very weirdly. I want them to be centered. Though, the 
phone number has some sort of problem with alignment, and I don;t know fi the 
other ones are causing it or are also aligned wrong.

I also wanted to make this code:

\startxcell[topframe=on,bottomframe=on,align=flushright]
 Ability to communicate strongly and effectively, being a reliable team 
member, supporting a team whenever needed, and the desire to help everyone
\stopxcell

has it so that it doesn't take up so much horizontal space (Ideally it is 
taking up 1/3 of the width I am allowing for since there are three rows in 
total) , but when I add width={some value} into the square brackets, it will 
add a blank line after all the text, and this is not what I want.

is there a way to fix what I am experiencing? I would also not mind if I could 
be told how to improve my code, whether it be by adding startxrowgroup, 
startxcellgroup, or head and footer sections., or other options. Thank you for 
reading.


Your problem the usage of "option=stretch" to add filler space in the 
table cells.


To calculate the space which is added in each cell context takes the 
widest text in each column
to calculate the current width of the table and when table is narrower 
then the page it distributes
the reaming spaces equally to all rows. This results in a different 
width for each row but another
problem in your case is that context takes the long text in the first 
row (even though it spans

three column) as value to compute the reaming space in the table.

The fix for your case is to set a fixed width for all three column which 
ensures the text
in the second column is centered. You can also simplify your setup by 
moving all settings
at the start of the table and the only local change is needed for the 
merged cells.


 begin example
\starttext

% width=.33tw

\startxtable[frame=off,topframe=on,bottomframe=on,width=.33tw,align=middle]
  \startxrow
    \startxcell[nx=3]
  contact information
    \stopxcell
  \stopxrow
  \startxrow
    \startxcell
  email
    \stopxcell
    \startxcell
  phone
    \stopxcell
    \startxcell
  address
    \stopxcell
  \stopxrow
\stopxtable

% option=stretch

\startxtable[frame=off,topframe=on,bottomframe=on,option=stretch,align=middle]
  \startxrow
    \startxcell[nx=3]
  contact information
    \stopxcell
  \stopxrow
  \startxrow
    \startxcell
  email
    \stopxcell
    \startxcell
  phone
    \stopxcell
    \startxcell
  address
    \stopxcell
  \stopxrow
\stopxtable

\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 / 
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: Is there an alternative to \reference[]{} that won't interfere with the document design?

2024-08-31 Thread Wolfgang Schuster

Joel via ntg-context schrieb am 31.08.2024 um 16:37:
I had to place \reference[]{} in various places in my document as I need 
to refer to page numbers of a lot of various items in the document. 
There are hundreds of these. When placing them, I hadn't realized it 
would impact the document design--I assumed such a command would be 
invisible.


Though I've tried placing as many inside the section titles, where they 
become invisible, I've found just placing \reference[]{} anywhere on a 
page will create extra blank spaces, leading my document to expand from 
440 lines to 448. It added up quite quickly to 8 whole pages. No matter 
how much I use % or try to hide it within the page, it still produces 
weird results. It isn't invisible, its doing things to the document, 
moving text around, leaving gaps. In addition, it makes the document 
look haphazard, creating random formatting "glitches".


I'm assuming because \reference has a curly bracket {} that its causing 
something to be rendered, even it its not really something visible 
always, it often makes a carriage return on the page if placed say after 
a table, or before a section title. Sadly, the way the document was 
designed I don't have a way to integrate them inside the section titles 
everywhere, there are too many and some need to mark a specific page 
within a section.


I haven't placed anything inside the {} and only use the square brackets 
to mark the reference name. Is there an alternative command that won't 
occupy space like this?


Did you learn anything from the answers of your last question [1] with 
similar content?


Hint: Minimal example!

[1] https://www.mail-archive.com/ntg-context@ntg.nl/msg108092.html

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: BUG REPORT: Italic Correction in ConTeXt LMTX

2024-08-29 Thread Wolfgang Schuster

Jim schrieb am 29.08.2024 um 21:19:

Hans (et al),
I'm a couple of days late to this party, but none of the above suggestions
give me any italic correction.  I updated my ConTeXt today, but the fact
that the first one doesn't work didn't surprise me, given your last
sentence.

However, since the second two don't work, can anyone speculate as to what I
might be doing wrong?  Or, did I somehow misinterpret what "There are three
ways:" means?


Italic correction is fixed (for \/ and \italiccorrection) but there 
hasn't been a new context release since then.


The \em variant didn't work because it inserts \/ (which was broken) at 
the end of the text.


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: Defining mathsymbols from unicode char

2024-08-29 Thread Wolfgang Schuster

Jethro Djan schrieb am 29.08.2024 um 21:27:

Dear all,

1. I am trying to define the "pitchfork" unicode 
character(https://unicodeplus.com/U+22D4) to use in ConTeXt as stated on 
page 387 of new math manual authored by Hans and Mikael:

\definemathsymbol[pitchfork][relation]["22D4]

It works with some unicode characters and not others (like this 
character). What can I do to make it work?


1. You forgot to provide a minimal example to reproduce the problem.

2. You need a math which contains the symbol because you can't expect to 
get each symbol with all of them.


You can run the following sample to see which font contains \pitchfork.

 begin example
\starttext

\doloopoverlist
  {antykwa,
   antykwa-light,
   antykwa-cond,
   bonum,
   cambria,
   concrete,
   dejavu,
   ebgaramond,
   erewhon,
   iwona,
   iwona-light,
   koeieletters,
   kpfonts,
   kurier,
   kurier-light,
   libertinus,
   lucida,
   modern,
   pagella,
   schola,
   stixtwo,
   termes,
   xcharter}
  {\mono{\recursestring:} \begingroup
 \switchtobodyfont[\recursestring]
 \im{\pitchfork}
   \endgroup \par}

\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 / 
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: Help with Metapopst code

2024-08-28 Thread Wolfgang Schuster

Shiv Shankar Dayal schrieb am 28.08.2024 um 12:23:

I don't know where you found the code, but the answer to "What is (0,
r) rotated (a *i) doing?" is that it takes the point (0,r) and rotates
it a*i degrees.


I do not understand the concept of rotating a point. It is rotated with respect
to what reference?


You rotate around a point with the x and y coordinates 0.

The blue dot shows the point with the coordinates 0. The green dot is 
rotated around this point.


\starttext

\startMPcode
drawdot (0,0) withpen pencircle scaled 5mm withcolor blue;
draw fullsquare scaled (4cm) withcolor red;
\stopMPcode

\startMPcode
drawdot (0,0) withpen pencircle scaled 5mm withcolor blue;
drawdot (1.5cm,0) withpen pencircle scaled 5mm withcolor green;
draw fullsquare scaled (4cm) withcolor red;
\stopMPcode

\startMPcode
drawdot (0,0) withpen pencircle scaled 5mm withcolor blue;
drawdot (1.5cm,0) rotated (30) withpen pencircle scaled 5mm withcolor green;
draw fullsquare scaled (4cm) withcolor red;
\stopMPcode

\startMPcode
drawdot (0,0) withpen pencircle scaled 5mm withcolor blue;
drawdot (1.5cm,0) rotated (60) withpen pencircle scaled 5mm withcolor green;
draw fullsquare scaled (4cm) withcolor red;
\stopMPcode

\startMPcode
drawdot (0,0) withpen pencircle scaled 5mm withcolor blue;
drawdot (1.5cm,0) rotated (90) withpen pencircle scaled 5mm withcolor green;
draw fullsquare scaled (4cm) withcolor red;
\stopMPcode

\stoptext

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: Questions regarding fonts: obliques (fake italics), ligatures and kerning

2024-08-27 Thread Wolfgang Schuster

Gerion Entrup schrieb am 27.08.2024 um 23:29:

Am Dienstag, 27. August 2024, 22:30:16 MESZ schrieb Wolfgang Schuster:

Gerion Entrup schrieb am 27.08.2024 um 21:28:

Hi,

I played around with different fonts, especially Bitstream XCharter and 
Overpass (http://overpassfont.org/) and wanted to combine them.
However, I see some issues regarding ligatures, kerning and obliques/italics.

Here is a minimal example:
```
\definefontfeature[default][mode=node, kern=yes, liga=yes]
% more features
% [mode=node, kern=yes, liga=yes, tlig=yes, itlg=yes, ccmp=yes, language=dflt, 
protrusion=quality, expansion=quality]

There is no need to set default features like ligatures and kerning, the
better alternative here is to use

  \definefontfeature [default] [default] [protrusion=quality,...]

which adds additional settings to the default set.


\definefontfamily [myfont][roman][xcharter]
\definefontfamily [myfont][sansserif][overpass][rscale=0.93]
\definefontfamily [myfont][teletype][overpass][rscale=0.93]
\definefontfamily [myfont][mono][overpassmono][rscale=0.93]
\definetypeface   [myfont][mathematics][math] [xcharter]

\setupbodyfont[myfont, 11pt]

\startTEXpage

\showfontkerns

   Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi 
abcdel™}, \slanted{effi abcdel™}\\
\style[sans]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi 
abcdel™}, \slanted{effi abcdel™}}\\
\style[mono]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi 
abcdel™}, \slanted{effi abcdel™}}\\

\showbodyfont[myfont]

\stopTEXpage
```
It produces the PDF in the attachment. I'm struggling with several things:
- xcharter seems to have no kerning applied. It is listed as font feature, 
though. Is it correct to have no kerning at all for that font?

The font has kerning information but none for characters in the ASCII range.

Good to know. Especially for the "Va" in "Vase", I expected kerning (it looks 
not equally spaced currently).



- xcharter also have no ligatures (at least it doesn't look like that). That is 
listed as font feature, too, although only for italic and slanted. According to 
https://tug.org/FontCatalogue/xcharter/ there are ligatures in the font.

There are ligatures for ff[il].

They are defined in the font, but they are not used in the PDF output, aren't they? For example in the "ffi" 
in "Effizient" the "f" is not connected with the "i", while the ligature glyph has a 
connection there.


You have to change the value of the script tag because the don't set 
them for the dflt script.


\definefontfeature[default][default][script=latn]

\definefontfamily[myfont][rm][xcharter]

\setupbodyfont[myfont]

\showmakeup[glyph]

\starttext

ff fi fl ffi ffl fb fh fk

\feature[-][ligatures]

ff fi fl ffi ffl fb fh fk

\stoptext


I attached a screenshot for comparison. The ligature was generated with 
"\ShowCompleteFont{name:xcharter*default}{11pt}{1}" (with the fnt-10 module).
It is, however, noticeable that the whole xcharter font is thicker in the 
output of \ShowCompleteFont. Is this part of the reason?


When you load a font by name use one which is listed in the table you 
get with "mtxrun --script fonts --list --all  --pattern=xcharter*". In 
this case the table is


identifier    familyname fontname 
filename   subfont   instances


xcharterbold  xcharter   xcharterbold XCharter-Bold.otf
xcharterbolditalic    xcharter   xcharterbolditalic 
XCharter-BoldItalic.otf
xcharterboldslanted   xcharter   xcharterboldslanted 
XCharter-BoldSlanted.otf

xcharteritalic    xcharter   xcharteritalic XCharter-Italic.otf
xchartermath  xchartermath   xchartermath XCharter-Math.otf
xchartermathbold  xchartermathbold   xchartermathbold 
XCharter-Math-Bold.otf

xchartermathmedium    xchartermath   xchartermath XCharter-Math.otf
xchartermathregular   xchartermath   xchartermath XCharter-Math.otf
xcharternormal    xcharter   xcharteritalic XCharter-Italic.otf
xcharterregular   xcharter   xcharterroman XCharter-Roman.otf
xcharterroman xcharter   xcharterroman XCharter-Roman.otf
xcharterslanted   xcharter   xcharterslanted 
XCharter-Slanted.otf


and as you can see there is no entry "xcharter". In your case context 
loaded the bold version of the font but when you use "xcharterroman" as 
name the document shows the normal upright version.



- Overpass has a glyph for the ae ligature. Is it normal that it is not used as 
a ligature for ae?

This seems to be a stupid decision to replace ae by default with a
ligature, maybe dependent on the language but not for all of them.

Ok, I've seen it here as (somewhat) common ligature: 
https://en.wikipedia.org/wiki/Ligature_(writing)#Computer_typesetting
But there is also mentioned that TeX just has ff, fi

[NTG-context] Re: Questions regarding fonts: obliques (fake italics), ligatures and kerning

2024-08-27 Thread Wolfgang Schuster

Gerion Entrup schrieb am 27.08.2024 um 21:28:

Hi,

I played around with different fonts, especially Bitstream XCharter and 
Overpass (http://overpassfont.org/) and wanted to combine them.
However, I see some issues regarding ligatures, kerning and obliques/italics.

Here is a minimal example:
```
\definefontfeature[default][mode=node, kern=yes, liga=yes]
% more features
% [mode=node, kern=yes, liga=yes, tlig=yes, itlg=yes, ccmp=yes, language=dflt, 
protrusion=quality, expansion=quality]


There is no need to set default features like ligatures and kerning, the 
better alternative here is to use


    \definefontfeature [default] [default] [protrusion=quality,...]

which adds additional settings to the default set.


\definefontfamily [myfont][roman][xcharter]
\definefontfamily [myfont][sansserif][overpass][rscale=0.93]
\definefontfamily [myfont][teletype][overpass][rscale=0.93]
\definefontfamily [myfont][mono][overpassmono][rscale=0.93]
\definetypeface   [myfont][mathematics][math] [xcharter]

\setupbodyfont[myfont, 11pt]

\startTEXpage

\showfontkerns

  Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi 
abcdel™}, \slanted{effi abcdel™}\\
\style[sans]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi 
abcdel™}, \slanted{effi abcdel™}}\\
\style[mono]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi 
abcdel™}, \slanted{effi abcdel™}}\\

\showbodyfont[myfont]

\stopTEXpage
```
It produces the PDF in the attachment. I'm struggling with several things:
- xcharter seems to have no kerning applied. It is listed as font feature, 
though. Is it correct to have no kerning at all for that font?


The font has kerning information but none for characters in the ASCII range.


- xcharter also have no ligatures (at least it doesn't look like that). That is 
listed as font feature, too, although only for italic and slanted. According to 
https://tug.org/FontCatalogue/xcharter/ there are ligatures in the font.


There are ligatures for ff[il].


- Overpass has a glyph for the ae ligature. Is it normal that it is not used as 
a ligature for ae?


This seems to be a stupid decision to replace ae by default with a 
ligature, maybe dependent on the language but not for all of them.



- Overpass Mono does not contain italic glyphs. I would have expected obliques 
when using \slanted then. However, it just remains normal.


You can use the slanted feature for this but the default setting is to 
fall back to the upright alternative and you as a user has to make the 
choice.


Example: \definefontfamily[myfont][tt][overpassmono][sl={features:slanted}]


- I included the ™ in the example since its italic glyph is not slanted. For 
all fonts \slanted seems to switch to the extra (italic?) glyphs, while I would 
have expected obliques. At least overpass seems to have no dedicated slanted 
style, while xcharter has one.


How a glyph for a certain styles appears depends on the font designer.


When you use \definefontfamily you get always the same style for italic 
and slanted because most fonts provide only italic or oblique (but not 
both). In some case you do something like the following font setting but 
the best solution when you have a large font family have is to write a 
typescript.


    \definefontfamily[myfont][rm][xcharter][sl=style:slanted]

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: About the font used in the document mathincontext-paper.pdf

2024-08-27 Thread Wolfgang Schuster

Fabrice Couvreur schrieb am 27.08.2024 um 15:35:

In this " A small note, with source".


As Mikael already wrote, the example use Antykwa Torunska for the text 
but when you take a look at the end of the source you find the following 
note:


On the next few pages we show the result after compiling this small 
example. We added a \switchtobodyfont[antykwa], to vary the look a little.


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: About the font used in the document mathincontext-paper.pdf

2024-08-27 Thread Wolfgang Schuster

Fabrice Couvreur schrieb am 27.08.2024 um 15:04:

Hello,
I read this very good document and it says that it was written with 
the Pagella font. I use this font with a simple 
\setupbodyfont[pagella,11pt] but I find that the rendering is not the 
same as on the document, it is less  nice especially in the writing of 
the theorems with the text in italic. Imaginary impression or reality ?

Which page/section of the manual you're referring to?

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: chapter counter?

2024-08-26 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 26.08.2024 um 20:14:

Am 26.08.24 um 17:57 schrieb Wolfgang Schuster:

Henning Hraban Ramm schrieb am 26.08.2024 um 17:41:

Hi,
I’d like to check the chapter number like

\ifodd\rawcountervalue[chapter]
What an odd chapter!
\fi

but apparently the counter isn’t called "chapter", or I’m doing it 
wrong otherwise.

Could you enlighten me?


\namedheadnumber{chapter}


Thank you, but it doesn’t work in my setup where I’m trying to change a 
background image depending on the chapter number:


\defineoverlay[BG][\start
\ifodd\namedheadnumber{chapter}\relax
\externalfigure[bgimage][height=\overlayheight]
\else
\mirror{\externalfigure[bgimage][height=\overlayheight]}
\fi
\stop]

This is then used with

\setlayerframed[papier][background=BG]

I guess it’s expanded only once.

But it was a bad idea anyway, I wanted more than two variants and now 
just set them as a uservariable.


Without more information there is no way to provide a solution but for 
the archive there is below a solution to get mirrored images for even 
chapters. The background has also a check an image before the start of 
the first chapter.


\setupexternalfigure[location=default]

\defineoverlay
  [BackGround]
  [\ifzeronum\namedheadnumber{chapter}\relax
 %
   \orelse\ifodd\namedheadnumber{chapter}\relax
 \externalfigure[mill][factor=min]%
   \else
 \mirror{\externalfigure[mill][factor=min]}%
   \fi]

\setupbackgrounds[page][background=BackGround]

\starttext

FooBar

\chapter{Foo}

\chapter{Bar}

\stoptext

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: chapter counter?

2024-08-26 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 26.08.2024 um 17:41:

Hi,
I’d like to check the chapter number like

\ifodd\rawcountervalue[chapter]
What an odd chapter!
\fi

but apparently the counter isn’t called "chapter", or I’m doing it wrong 
otherwise.

Could you enlighten me?


\namedheadnumber{chapter}

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: digits / units setup

2024-08-25 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 24.08.2024 um 20:59:

Am 24.08.24 um 20:38 schrieb Henning Hraban Ramm:

According to docs,

\setupunit[method=3]

should change the rendering of numbers in

\unit{10,123.99 mm} or \digits{10,123.99} to “10\,123,99”,

but it doesn’t.

\setdigitmode{3} works, though.


Seems to be a problem of my environment.

In a minimal example, \setupunit changes \unit, \setdigitmode changes 
\digits.


The \digits mechanism was never extended to provide a basic setup mechanism
which means you have to use the \set... commands to change the output.

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: [ how to remove speae before (and after) \startitemize ?

2024-08-25 Thread Wolfgang Schuster

vm via ntg-context schrieb am 25.08.2024 um 14:36:

Any hint as how to remove the automatic default space before and after
\startitemize and have equal line spacing between all text lines?


\starttext
one two three
\startitemize[packed]


\startitemize[packed,joinedup]

or

\startitemize[packed][before=,after=]

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: understanding units / dimensions

2024-08-25 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 25.08.2024 um 13:45:
At the meeting I noted a few units that I didn’t know about, while I 
already knew many.


* general units: in, m, cm, mm (ft?)
* typographical units: pt, dd, bp, pc, cc, sp
* font related: em, ex, fs, fa, fd, fc, ch
* layout related: pw, ph, tw, th, cw, cd, lw, hs, vh
* frame related: fw, fh, fo
* funits: dk, es, tv, eu

Are there even more?


Yes, there are more of them.

Look into the lowlevel-registers document which describes how they are
created and also how you can define your own identifiers with \newuserunit.


Questions:

How differs "1" from "2"?
* em fs


\startbuffer[dimensions]
\starttabulate
\NC em \EQ \the\dimexpr1em\relax \NC\NR % \emwidth
\NC fs \EQ \the\dimexpr1fs\relax \NC\NR % \globalbodyfontsize
\stoptabulate
\stopbuffer

\starttext

\getbuffer[dimensions]

\setupbodyfont[14.4pt]

\getbuffer[dimensions]

\stoptext



* lw hs


lw stands for \linewidth which is the default value for rulethickness in 
\framed etc.


hs is just \hsize.


* ph vh


ph is \paperheight.

vh doesn't exist.


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: Any way to forbid boldface for a section of text?

2024-08-25 Thread Wolfgang Schuster

Wolfgang Schuster schrieb am 24.08.2024 um 17:49:

Denis Maier via ntg-context schrieb am 24.08.2024 um 08:25:
You could define a specific typescript for that without a definition 
for bold.


Below is an implementation of your suggestion which gets rid of all font 
styles for serif, sans serif and monospace fonts.


\starttypescript [serif,sans,mono] [uprightonly]
     \definefontsynonym [\typescriptprefix\typescriptone Italic] 
[\typescriptprefix\typescriptone]
     \definefontsynonym [\typescriptprefix\typescriptone Slanted] 
[\typescriptprefix\typescriptone]
     \definefontsynonym [\typescriptprefix\typescriptone Bold] 
[\typescriptprefix\typescriptone]
     \definefontsynonym [\typescriptprefix\typescriptone BoldItalic] 
[\typescriptprefix\typescriptone]
     \definefontsynonym [\typescriptprefix\typescriptone BoldSlanted] 
[\typescriptprefix\typescriptone]

\stoptypescript

\starttypescript [uprightonly]
     \definetypeface [\typescriptone] [rm] [serif] [\typescriptone]
     \definetypeface [\typescriptone] [ss] [sans]  [\typescriptone]
     \definetypeface [\typescriptone] [tt] [mono]  [\typescriptone]
\stoptypescript

\setupbodyfont[pagella]

\starttext

xxx {\bf yyy} xxx {\it zzz} xxx

\start \switchtobodyfont[uprightonly]
xxx {\bf yyy} xxx {\it zzz} xxx
\stop

xxx {\bf yyy} xxx {\it zzz} xxx

\stoptext


In the next release you don't have to create the typescript anymore 
because Hans is including it with the other typescripts and in addition 
it will also support math input.


The new complete minimal example is now:

\usetypescriptfile[uprightonly]

\starttext

xxx {\bf yyy} xxx {\it zzz} xxx

\start \switchtobodyfont[uprightonly]
xxx {\bf yyy} xxx {\it zzz} xxx
\stop

xxx {\bf yyy} xxx {\it zzz} xxx

\stoptext

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: Any way to forbid boldface for a section of text?

2024-08-24 Thread Wolfgang Schuster

Denis Maier via ntg-context schrieb am 24.08.2024 um 08:25:
You could define a specific typescript for that without a definition for 
bold.


Below is an implementation of your suggestion which gets rid of all font 
styles for serif, sans serif and monospace fonts.


\starttypescript [serif,sans,mono] [uprightonly]
\definefontsynonym [\typescriptprefix\typescriptone Italic] 
[\typescriptprefix\typescriptone]
\definefontsynonym [\typescriptprefix\typescriptone Slanted] 
[\typescriptprefix\typescriptone]
\definefontsynonym [\typescriptprefix\typescriptone Bold] 
[\typescriptprefix\typescriptone]
\definefontsynonym [\typescriptprefix\typescriptone BoldItalic] 
[\typescriptprefix\typescriptone]
\definefontsynonym [\typescriptprefix\typescriptone BoldSlanted] 
[\typescriptprefix\typescriptone]

\stoptypescript

\starttypescript [uprightonly]
\definetypeface [\typescriptone] [rm] [serif] [\typescriptone]
\definetypeface [\typescriptone] [ss] [sans]  [\typescriptone]
\definetypeface [\typescriptone] [tt] [mono]  [\typescriptone]
\stoptypescript

\setupbodyfont[pagella]

\starttext

xxx {\bf yyy} xxx {\it zzz} xxx

\start \switchtobodyfont[uprightonly]
xxx {\bf yyy} xxx {\it zzz} xxx
\stop

xxx {\bf yyy} xxx {\it zzz} xxx

\stoptext

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: Problem with Cambria

2024-08-16 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 16.08.2024 um 10:52:

I’m not sure if "cambmath" or "cambria.ttf" relates to "cambria.ttc".


When Cambria was released you had two ways to get the fonts:

    1. As part of your windows (or was it office?) installation.

    2. You bought a end user license from Ascender fonts.

The second option is no longer available because Ascender was bought in 
2010 by Monotype and it seems the fonts aren't available for purchase 
anymore.


@Hans and Mikael: Can we remove the ascender version from the typescript 
or change the file check to make the microsoft version the default?


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: Problem with Cambria

2024-08-16 Thread Wolfgang Schuster

Lutz Haseloff schrieb am 16.08.2024 um 09:47:

Hi Hans, hi all,

the latest ConTeXt lmtx seems to have a problem with MS Cambria.

My file is:

\setupbodyfont[cambria]
\definefont[symbola][file:symbola*default at 10pt]
\starttext
\startMPpage[offset=1dk]
draw textext("AC{\symbola ⚡}DC");
\stopMPpage
\stoptext


Which result (YES or NO) do you get with the following example?

\starttext
\doiffileelse{cambria.ttc}{YES}{NO}
\stoptext

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: problem with location={right,high} in latest LMTX

2024-08-14 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 14.08.2024 um 23:11:

There seems to be a regression with sidefloats:

"""
\useMPlibrary[dum]

\starttext

\startplacefigure[title={problem},location={right,high}]
\externalfigure[dummy][width=.3\textwidth]
\stopplacefigure
\samplefile{ward}

\stoptext
"""


Line 1154 in strc-flt.mkxl:

\def\strc_floats_analyze_variables_two
  {...
-    \ifinset\v!high    \floatlocation\global  \plusone  \fi
+    \ifinset\v!high    \floatlocation\global\c_page_sides_skipmode 
\plusone  \fi
 \ifinset\v!low \floatlocation\global\c_page_sides_skipmode 
\plustwo  \fi
 \ifinset\v!fit \floatlocation\global\c_page_sides_skipmode 
\plusthree\fi
 \ifinset\v!tolerant 
\floatlocation\global\c_page_sides_tolerance\plusone  \fi
\ifinset\v!verytolerant\floatlocation\global\c_page_sides_tolerance\plustwo 
\fi

   ...}

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: Missing \endcsname inserted error

2024-08-13 Thread Wolfgang Schuster

Jeong Dal via ntg-context schrieb am 13.08.2024 um 21:21:

Hi,

I draw a figure using MetaFun and insert it \startplacefigure and 
\stopplacefigure.

(Sample file is listed below)
But, I got an error as following:

Missing \endcsname inserted

[...]
\starttext
\startplacefigure[location=none,\title=]


Either remove the backslash before the title key or just remove it from 
the argument because the values of \startplacefigure are empty by default.


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: Complete novice, why does it seem that LuaLaTeX (Compiled via LaTeX Workshop with MikTeX and added packages on Windows) will generate a more compact result than ConTeXt?

2024-08-13 Thread Wolfgang Schuster

Hans Hagen via ntg-context schrieb am 13.08.2024 um 17:40:

On 8/13/2024 4:49 PM, fm117...@students.panola.edu wrote:
Hello, ConTeXt mailing list! I have a question regarding a difference 
in the code that I have which uses the same paper size and margin 
settings, and also the same indentation rules and font size and font. 
It seems that ConTeXt (which I compiled via Windows Terminal, this 
*is* the proper way to compile ConTeXt docs, right?) seems to make 
text that is less... compact, and I am not sure if this is due to me 
not adding features that I **should** have turned on in ConTeXt when 
using Times New Roman that is installed by default on Windows. I also 
was not able to get a "proper (?)" single quote like when Word or 
LaTeX compiles "Don't", that ' is a straight quote in the compiled text.


I also heard that ConTeXT would be much better for typography since 
it does have a more advanced typographical engine as the base (and 
this is a big reason as to why I want to switch to ConTeXt, pretty 
much everything is built in, I just can't understand documentation 
that well), and this may be because my code is very basic and I do 
not know how do properly do ConTeXt. Is it possible that ConTeXt also 
has a more "correct" way of formatting? Anyways, thank you for 
reading and taking the time to read this post.


LuaLaTeX code: https://pastebin.com/p5aWxAyK

ConTeXt code: https://pastebin.com/DsMnxMvY

Can you explain what you mean with less compact?


The default baseline distance of LaTeX is AFAIK 1.2 times the font size, 
adding


    \setupinterlinespace [line=1.2\bodyfontsize]

to the document setup should produce similar results with ConTeXt.

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: Complete novice, why does it seem that LuaLaTeX (Compiled via LaTeX Workshop with MikTeX and added packages on Windows) will generate a more compact result than ConTeXt?

2024-08-13 Thread Wolfgang Schuster



Hans Hagen via ntg-context schrieb am 13.08.2024 um 17:40:

On 8/13/2024 4:49 PM, fm117...@students.panola.edu wrote:
Hello, ConTeXt mailing list! I have a question regarding a difference 
in the code that I have which uses the same paper size and margin 
settings, and also the same indentation rules and font size and font. 
It seems that ConTeXt (which I compiled via Windows Terminal, this 
*is* the proper way to compile ConTeXt docs, right?) seems to make 
text that is less... compact, and I am not sure if this is due to me 
not adding features that I **should** have turned on in ConTeXt when 
using Times New Roman that is installed by default on Windows. I also 
was not able to get a "proper (?)" single quote like when Word or 
LaTeX compiles "Don't", that ' is a straight quote in the compiled text.


I also heard that ConTeXT would be much better for typography since 
it does have a more advanced typographical engine as the base (and 
this is a big reason as to why I want to switch to ConTeXt, pretty 
much everything is built in, I just can't understand documentation 
that well), and this may be because my code is very basic and I do 
not know how do properly do ConTeXt. Is it possible that ConTeXt also 
has a more "correct" way of formatting? Anyways, thank you for 
reading and taking the time to read this post.


LuaLaTeX code: https://pastebin.com/p5aWxAyK

ConTeXt code: https://pastebin.com/DsMnxMvY
Can you explain what you mean with less compact? Can we assume that 
you are running the LMTX version? (luametatex engine)


[...]

\setupbodyfont[termes,12pt]


To get Times New Roman as font replace the \setupbodyfont line from the 
example of Hans
with the following settings. The \definefontfeature line replaces all ' 
in your text with

a apostrophe.

\definefontfeature [default] [default] [trep=yes]

\definefontfamily [TimesNewRoman] [rm]    [Times New Roman]
\definetypeface   [TimesNewRoman] [mm] [math] [termes]

\setupbodyfont [TimesNewRoman,12pt]

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: Nāgarī for Academics

2024-08-10 Thread Wolfgang Schuster



Otared Kavian schrieb am 10.08.2024 um 17:56:

On 10 Aug 2024, at 11:59, Jürgen Hanneder via ntg-context  
wrote:


Does it work if you say

{\language[sa]yoga}

That's it!!

Hi Jürgen,

You may also define a command like (or a shorter name…)

\define[1]\sanskrit{\start\language[sa]#1\stop}


\definestartstop [sanskrit] [style={\language[sa]}]

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: How to allow hyphenation, only for footnotes?

2024-08-10 Thread Wolfgang Schuster

Joel via ntg-context schrieb am 10.08.2024 um 16:54:
My copy editor urged me to remove all hyphens from the main text of my 
document. I'm using:


\definefontfeature[default][default][expansion=quality,protrusion=quality]


\start \setupalign[nothyphenated,tolerant,hz,hanging]

(text)

\stop


Is there a reason why do the alignment change within a local group?

The problem is that is messing with footnotes, causing things like URLS 
to run off the page. How can I permit the hyphenation to appear 
normally, but only on the footnote text?


\setupalign[verytolerant,nothyphenated]

\setupnotation[footnote][align={hyphenated,normal}]

\starttext

\samplefile{lorem}\footnote{\samplefile{lorem}}

\stoptext

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: Nāgarī for Academics

2024-08-10 Thread Wolfgang Schuster

Jürgen Hanneder via ntg-context schrieb am 10.08.2024 um 11:10:

Dear Richard,


Are you after a Context version of something such as
Xetex Devanagari?

https://github.com/wujastyk/xetex-devanagari


Indeed. In my XeTeX publications settling the font was quite 
straightforward:


\usepackage{polyglossia,fontspec,xunicode}
\setmainfont{Adobe Text Pro}
\newfontfamily\sanskritfont[Script=Devanagari,Mapping=RomDev,Scale=1.4]{AdishilaSan} 


\setdefaultlanguage{english} \setotherlanguage{sanskrit}


But coming back to ConTeXt:

I am grateful to Pablo and Wolfgang for their suggestions, but
it does not (yet) work as it should. Perhaps this has to do
with the problem in the language command. Here is my test file that
works up to the point, and then shows the problem.

---
\setuppapersize[A4]
\setuplayout[width=14cm, height=fit]

\definefontfamily [roman] [rm] [minion]


You set a font here for english text but never enable it.


\definefontfamily [nagari] [rm] [Adishila] [features=devanagari-one]
\setupbodyfont [nagari]


This is where you set the font for the whole document.


\usetransliteration[indic]
\definetransliteration
[MyDeva]   [lang=sa,vector={iast to deva}]

\startsetups [sanskrit]
\settransliteration[MyDeva]
\switchtobodyfont[nagari]
\stopsetups

\setuplanguage [sa] [setups=sanskrit]

\starttext

Example:   आनन्द। अपिच   % this comes out as it should, but since 
input is in Nagari there is no transliteration involved.
test  % the word "test" comes 
out in roman, i.e. switching back to roman works.


\language[sa]{yoga}    % the word "yoga" is typeset in 
Nagari as expected,
test  % but the word 
"test" is still typeset in Nagari


\language[en]{test}    % still no switching back to 
roman, it seems stuck with Nagari.


\stoptext
-


\definefallbackfamily [Roman] [rm] [Adishila] 
[range=devanagari,features=devanagari-one]

\definefontfamily [Roman] [rm] [Minion Pro]

\setupbodyfont [Roman]

\definefontfamily [nagari] [rm] [Adishila] [features=devanagari-one]

\usetransliteration[indic]

\definetransliteration [MyDeva] [lang=sa,vector={iast to deva}]

\startsetups [sanskrit]
  \settransliteration[MyDeva]
  \switchtobodyfont[nagari]
\stopsetups

\setuplanguage [sa] [setups=sanskrit]

\starttext

Example: आनन्द। अपिच

Example: \language[sa]{yoga}

\stoptext

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: Nāgarī for Academics

2024-08-08 Thread Wolfgang Schuster

Jürgen Hanneder via ntg-context schrieb am 08.08.2024 um 13:07:

The text below works, thanks for the help!

But there is one more problem.

I could not find an elegant method to set the language of the document 
to English without
disabling Nagari. If one adds \setupbodyfont[minion] the Nagari parts 
disappear.


The normal scenario would be a document in English with Sanskrit as a 
secondary language, to
one switches with a command that changes font, language and activates 
the transliteration

mechanism.


You can put all settings (fonts, transliteration etc.) you need for your 
sanskrit texts
in a setups blocks and apply the block to a language. When you use now 
the \language

command (or environment) all settings are now applied to the content.

Below is a untested example.

\definefontfamily [nagari] [rm] [adishila] [features=devanagari-one]

\usetransliteration[indic]

\definetransliteration
  [MyDeva]
  [lang=sa,
   vector={iast to deva}]

\startsetups [sanskrit]
  \settransliteration[MyDeva]
  \switchtobodyfont[nagari]
\stopsetups

\setuplanguage [sa] [setups=sanskrit]

\starttext

\subject{Some notes on Printing Sanskrit with lmtx}

\language[sa]{योग} -- That is the word Yoga, input and, when you compile 
this document,

printed in (Deva)Nagari script.

\stoptext

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: Error after latest update

2024-08-06 Thread Wolfgang Schuster

Shiv Shankar Dayal schrieb am 06.08.2024 um 21:17:

LuaMetaTeX 2.11.03 20240517 + ConTeXt LMTX 2024.05.17 16:32


I had a copy of this older version and the cell handling was different 
back then.


Still the correct way to add filler symbols in a matrix is the \HF 
command which

has two optional commands where you can a) set the number of columns which
should be filled and b) the filler alternative to be used for the symbol.

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: Error after latest update

2024-08-06 Thread Wolfgang Schuster

Shiv Shankar Dayal schrieb am 06.08.2024 um 19:30:

Hi,

I still do not know why it stopped working after the latest update.


Which version was your last one you used?

Just because it worked without an error message before doesn't mean your 
input is the right  way.
Especially when you have to pass 9 as argument to \multispan even though 
you have only 5 columns

should be alarming.

The reason for the error here is that Context creates a template for 
each matrix cell which enables
and disable math mode at the begin of each cell but when you use 
\multispan the template is ignored
and you have to provide your own settings. The problem no is that no 
math mode is entered at
the begin of your new marge cell but Context always adds a end of math 
mode trigger when it reaches

the \NR command at the end of the row.

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: Error after latest update

2024-08-06 Thread Wolfgang Schuster

Mikael Sundqvist schrieb am 06.08.2024 um 18:27:

Hi,

On Tue, Aug 6, 2024 at 5:57 PM Shiv Shankar Dayal
 wrote:

I have defined a determinant environment like below:

\definemathmatrix[determinant]
   [matrix:bars]
   [simplecommand=thedeterminant]

and I create a determinant like below:

\startformula \startdeterminant\NC a_{11} \NC a_{12} \NC a_{13} \NC
\cdots \NC a_{1n}\NR
  \NC a_{21} \NC a_{22} \NC a_{23} \NC \cdots \NC a_{2n}\NR
  \NC a_{31} \NC a_{32} \NC a_{33} \NC \cdots \NC a_{3n}\NR
  \multispan{9}{\dotfill}\NR
  \NC a_{n1} \NC a_{n2} \NC a_{n3} \NC \cdots \NC a_{nn}
\NR\stopdeterminant

This was working before today but I updated ConTeXt and it has stopped
working. The error it gives me now is:

tex error   > tex error on line 277 in file determinants.tex: You
can't use '\Ustopmath' in restricted horizontal mode

How can I get it working again?

--
Respect,
Shiv Shankar Dayal

I never seen \multispan before. But this seems to work:


\multispan is a plain TeX command to create cells which span multiple 
columns
and makes only sense when you create tables with the \halign primitive 
because

tables in context use hidden cells for padding on the left and right etc.

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: Alignments of margin notes

2024-08-02 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 02.08.2024 um 18:36:

On 8/2/24 16:41, Wolfgang Schuster wrote:

[...]
The example below shows which predefined margin blocks rely only on
margindata where
you can change the alignment with \etupmargindata and also the ones
which require \setupmarginframed.

 begin example
\setuppapersize[A4][A3]

Sorry, Wolfgang, but I must be missing something here.

Unless I add the following, inner doesn’t behave as expected (I think it
is always outer without these lines):

   \setuppagenumbering[alternative=doublesided]
   \setuphead[title][page=yes]

Is that right or am I missing something?


When you have a singlesided document each page is a right side and it 
doesn't matter whether it's an even or odd page.


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: Alignments of margin notes

2024-08-02 Thread Wolfgang Schuster

Gerion Entrup schrieb am 02.08.2024 um 14:10:

Am Freitag, 2. August 2024, 07:42:29 MESZ schrieb Pablo Rodriguez via ntg-
context:

On 8/2/24 01:13, Gerion Entrup wrote:

Ok, I think I understand that in principal. Thanks for the explanation.
Can I somehow know in advance that a margin note makes use of \framed?

Hi Gerion,

there is an \ifinframed conditional, such as in:
...
This may help to achieve what you want.

Just in case it helps,

Thanks for the answer, but we misunderstood. I'll try to formulate it clearer:
If I get it right, to set margin notes, you need to specify \setupmargindata
in any case.
However, on the one hand, there might be notes that follow the style of the
"style" argument within \setupmargindata.
And on the other hand, there might be notes that internally uses \framed and
follow the "style" argument within a separately specified \setupmarginframed.

My question is, whether I have any chance to get in advance (when writing down
the document styling) which style argument my future (not yet written) margin
notes will follow to know if I need to specify a \setupmarginframed at all.

Is it the style argument of \setupmargindata or \setupmarginframed or is it a
good practice to _always_ specify \setupmarginframed with the same style
argument as given to \setupmargindata?


I have no idea what your question is but you should use 
\setupmarginframed only when the setup
requires it, e.g. to change the alignment for blocks which use the 
framed mechanism.


The example below shows which predefined margin blocks rely only on 
margindata where
you can change the alignment with \etupmargindata and also the ones 
which require \setupmarginframed.


 begin example
\setuppapersize[A4][A3]

\setuplayout[location=middle]

\starttext

\doloopoverlist{
    inleftmargin,
    inrightmargin,
    inoutermargin,
    ininnermargin,
    inleftedge,
    inrightedge,
    inouteredge,
    ininneredge,
    atleftmargin,
    atrightmargin,
}
{
    \setupmargindata[\recursestring][align=middle]
    \title{\tex{\recursestring}}
    \samplefile{lorem}
    \margindata[\recursestring]{Text in the margin!}
    \samplefile{lorem}
}

\doloopoverlist{
    inleft,
    inright,
    inouter,
    ininner,
    inmargin,
    inother,
}
{
    %\setupmargindata[\recursestring][align=middle]
    \setupmarginframed[\recursestring][align=middle]
    \title{\tex{\recursestring}}
    \samplefile{lorem}
    \margindata[\recursestring]{Text in the margin!}
    \samplefile{lorem}
}

\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 / 
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: Alignments of margin notes

2024-08-01 Thread Wolfgang Schuster

Gerion Entrup schrieb am 01.08.2024 um 17:19:

Am Donnerstag, 1. August 2024, 16:36:06 MESZ schrieb Wolfgang Schuster:

Gerion Entrup schrieb am 01.08.2024 um 16:20:

Am Donnerstag, 1. August 2024, 16:13:23 MESZ schrieb Wolfgang Schuster:

Gerion Entrup schrieb am 01.08.2024 um 14:28:

Hi,

I want to make a two sided document with margin notes.
The notes should not be hyphenated and always aligned to the inner text body.
However, I did not get this to work.
It hyphenates and the alignment is only correct at even pages.

Do you know the correct way?

Here is a MWE:
```
\setuppagenumbering[location={footer, right}, alternative=doublesided]

\definealign[myalign][inner, nothyphenated]
\setupmargindata[inmargin][
location=outer,
style=italic,
 % nothing of that seems to have any effect
% align=myalign,
% align=inner,
% align=nothyphentated,
align={inner, nothyphentated},
]

Use \setupmarginframed for the alignment.

\setupmarginframed
 [inmargin]
 [align={inner,nothyphenated}]

Does the align parameter of \setupmargindata has any function, then?
Also, using setupmarginframed leads to other problems:
- The margin text is bold now(?)
- All margin nodes are on the left of the page now (this should be only the 
case for even pages)

The location of the margin block and the style are still controlled by
\setupmargindata and only the alignment has to be changed with
\setupmarginframed.

\setupmargindata
[inmargin]
[location=outer,
 style=italic]

\setupmarginframed
[inmargin]
[align={inner,nothyphenated}]

Thanks, that works for the alignment. It does not change the hyphenation.
I would have expected this line breaks in the margin note:

significant
incredible
components

Instead, ConTeXt generates:

significant in­
credible com­
ponents

In general:
Does the "align" argument in setupmargindata has a meaning at all?


The align key works and the output is correct but the problem in this 
case is a user error.


When you compare mine and your example you should notice a difference in 
the spelling of nothyphenated which has an extra "t" in your case.



Why is the action to setup margin notes splitted in setupmargindata and 
setupmarginframed? I find it kind of unintuitive.


There are two different mechanism at work here:

1. The placement of the texts is controlled with the margindata 
mechanism has style and align options.


2. In addition to the placement mechanism some of the margin texts make 
use of \framed for the content. Because not all margin texts should make 
use \framed this is optional and controlled with an extra setup-command. 
The separate setup mechanism avoid also problems with keys which have a 
different meaning for the placement of the margin texts, e.g. location 
is an already existing framed-key but it is also used to set the 
horizontal position of the block.


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: Alignments of margin notes

2024-08-01 Thread Wolfgang Schuster

Gerion Entrup schrieb am 01.08.2024 um 16:20:

Am Donnerstag, 1. August 2024, 16:13:23 MESZ schrieb Wolfgang Schuster:

Gerion Entrup schrieb am 01.08.2024 um 14:28:

Hi,

I want to make a two sided document with margin notes.
The notes should not be hyphenated and always aligned to the inner text body.
However, I did not get this to work.
It hyphenates and the alignment is only correct at even pages.

Do you know the correct way?

Here is a MWE:
```
\setuppagenumbering[location={footer, right}, alternative=doublesided]

\definealign[myalign][inner, nothyphenated]
\setupmargindata[inmargin][
location=outer,
style=italic,
% nothing of that seems to have any effect
% align=myalign,
% align=inner,
% align=nothyphentated,
align={inner, nothyphentated},
]

Use \setupmarginframed for the alignment.

\setupmarginframed
[inmargin]
[align={inner,nothyphenated}]

Does the align parameter of \setupmargindata has any function, then?
Also, using setupmarginframed leads to other problems:
- The margin text is bold now(?)
- All margin nodes are on the left of the page now (this should be only the 
case for even pages)


The location of the margin block and the style are still controlled by 
\setupmargindata and only the alignment has to be changed with 
\setupmarginframed.


\setupmargindata
  [inmargin]
  [location=outer,
   style=italic]

\setupmarginframed
  [inmargin]
  [align={inner,nothyphenated}]

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: Alignments of margin notes

2024-08-01 Thread Wolfgang Schuster

Gerion Entrup schrieb am 01.08.2024 um 14:28:

Hi,

I want to make a two sided document with margin notes.
The notes should not be hyphenated and always aligned to the inner text body.
However, I did not get this to work.
It hyphenates and the alignment is only correct at even pages.

Do you know the correct way?

Here is a MWE:
```
\setuppagenumbering[location={footer, right}, alternative=doublesided]

\definealign[myalign][inner, nothyphenated]
\setupmargindata[inmargin][
location=outer,
style=italic,
   % nothing of that seems to have any effect
% align=myalign,
% align=inner,
% align=nothyphentated,
align={inner, nothyphentated},
]


Use \setupmarginframed for the alignment.

\setupmarginframed
  [inmargin]
  [align={inner,nothyphenated}]

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: combining float counters

2024-07-31 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 31.07.2024 um 20:43:
Hi, I defined new float types for special figure/caption placement, 
but would like to use the general figure counter. I didn’t find a 
setup for that. How can I do this?


pseudocode:

\setupfloat[myfigure][
  counter=figure,
]


\useMPlibrary[dum]

\definefloat[myfigure][figure]

\starttext

\startplacefigure[title=Figure]
  \externalfigure[dummy-a]
\stopplacefigure

\startplacemyfigure[title=Myfigure]
  \externalfigure[dummy-a]
\stopplacemyfigure

\stoptext

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: MetaPost background

2024-07-23 Thread Wolfgang Schuster

alan.caruanam...@gmail.com schrieb am 23.07.2024 um 20:29:

Hello, I need the background (lines and points) to be inside (tangent) of the 
frame, I don't know how to do it

\startuseMPgraphic{fullheightbackground}
 fill unitsquare xyscaled (OverlayWidth, OverlayHeight) withcolor "gray" ;

 w := MakeupWidth;
 h := OverlayHeight;

 draw (0,0)--(MakeupWidth,0) withpen pencircle scaled 2pt withcolor green;
 draw (0,OverlayHeight)--(MakeupWidth,OverlayHeight) withpen pencircle 
scaled 2pt withcolor green;


Add offset value to the horizontal/vertical dimensions.


    draw (0,1pt+OverlayLineWidth)--(MakeupWidth,1pt+OverlayLineWidth) 
withpen pencircle scaled 2pt withcolor green;
    draw 
(0,OverlayHeight-1pt-OverlayLineWidth)--(MakeupWidth,OverlayHeight-1pt-OverlayLineWidth) 
withpen pencircle scaled 2pt withcolor green;




 drawdot (0,0) withpen pencircle scaled 8pt withcolor red;
 drawdot (MakeupWidth,OverlayHeight) withpen pencircle scaled 8pt withcolor 
red;


Set a bounding box size for the image to ensure the image isn't 
stretched to fill the available space.


    setbounds currentpicture to OverlayBox;


\stopuseMPgraphic


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: About a pagination

2024-07-23 Thread Wolfgang Schuster

Fabrice Couvreur schrieb am 23.07.2024 um 08:57:

Hi,
I'm trying to get the same pagination as in the attached photos.


The images are missing.

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: spacing in columns

2024-07-23 Thread Wolfgang Schuster

Hans van der Meer via ntg-context schrieb am 23.07.2024 um 11:36:

The first screenshot has its items neatly stacked and  is made with
\startsimplecolumns[n=2]
\placenotes[endnote]
\stopsimplecolumns




The second screenshot has its items wide apart and  is made with
\startcolumns[n=2,blank=1pt]


\startcolumns[n=2,grid=no,blank=1pt]

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: Install urbanist fonts

2024-07-22 Thread Wolfgang Schuster

Jean-Pierre Delange schrieb am 22.07.2024 um 12:29:
As Taco suggested, the best way to install new fonts on MS Windows 
(and other OSes) is to tell ConTeXt where they are located. On 
Windows, fonts are usually found in /Fonts. But you still need to 
purge the font cache and regenerate it so that the system can interact 
with ConTeXT. A safer method is to create separate directories, as 
indicated by Taco: /tex/texmf-fonts/fonts/data/urbanist. You can also 
distinguish between True Type fonts (ttf) and Open Type fonts (otf) by 
separating folders as follows: /tex/texmf-fonts/fonts/otf/ and 
/tex/texmf-fonts/fonts/ttf/.


When you use context for a single user you can create a folder texmf in 
the users home directory and place all files in the subfolder 
fonts/data, e.g.


    C:\Users\...\texmf\fonts\data>

There is no need to make distinctions between the two file extension ttf 
and otf because they are meaningless because most truetype fonts are 
also opentype font.


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: documenting itemize specials

2024-07-07 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 07.07.2024 um 10:54:

Hi,
* can anyone give me an example where \noitem makes sense?


This is why the command exists:

\starttext

\startitemize[repeat,n][width=0pt]
\noitem
  \startitemize[a,broad]
  \item First item
  \item Second item
  \stopitemize
\noitem
  \startitemize[a,broad]
  \item First item
  \item Second item
  \stopitemize
\stopitemize

\stoptext



* is the + symbol of \sub configurable?


No.

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: processor for index sub-entry?

2024-07-07 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 05.07.2024 um 22:36:

Hi,
is it possible to apply a processor to an index sub-entry?

\index{Modules+\type{filter}}
looks good, but "filter" is sorted under "type".

\defineprocessor[type][style=mono]
\index{Modules+type->filter}
results in a "Modules / type->filter" entry.

\index[Modules+filter]{Modules+\type{filter}}
works and looks good, but the code feels bad…


1. Complete your example to test them without adding stuff.

2. Use \setregisterentry which allows you to set processors for each 
entry level.


\defineprocessor[type][style=mono]

\starttext

xxx\setregisterentry[index][entries:1=Modules,entries:2=filter,processors:2=type]

\placeindex[n=1]

\stoptext

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: How to specify a default formatting for TABLE

2024-07-01 Thread Wolfgang Schuster

Gerion Entrup schrieb am 01.07.2024 um 23:56:

Hi,

I want to format a bunch a tables with the same formatting.
It seems that specifying the \setupTABLE commands as part of the preamble works.

However, I need some tables that are formatted in another way.
Is there a generic way to specify this?

Here is a MWE:
[...]

The last two tables should be formatted as if the four setupTABLE commands in 
the header are not existent.
My solution does not work, however.


1. Put your table settings in a setups-block and load the one you want 
at the start of your table.


2. You don't need \setupcolors[state=start] because colors are enabled 
by default (since a veee...eeery long time).


3. You can replace \bTD ... \eTD with \bTH ... \eTH for table headers to 
get bold text.


 begin example
\startsetups[table:a]
  \setupTABLE [each] [frame=off,width=1cm,height=1cm,align={middle,lohi}]
  \setupTABLE [each] [background=color,backgroundcolor=lightgray]
\stopsetups

\startsetups[table:b]
  \setupTABLE [each] 
[frame=off,width=2cm,height=1.2\lineheight,align=middle]

  \setupTABLE [each] [topframe=on,bottomframe=on]
\stopsetups

\starttext

\bTABLE
  \bTR
\bTD A \eTD
\bTD B \eTD
  \eTR
  \bTR
\bTD C \eTD
\bTD D \eTD
  \eTR
\eTABLE

\blank

\bTABLE[setups=table:a]
  \bTR
\bTD A \eTD
\bTD B \eTD
  \eTR
  \bTR
\bTD C \eTD
\bTD D \eTD
  \eTR
\eTABLE

\blank

\bTABLE[setups=table:b]
  \bTR
\bTD A \eTD
\bTD B \eTD
  \eTR
  \bTR
\bTD C \eTD
\bTD D \eTD
  \eTR
\eTABLE

\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 / 
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: Flowcharts

2024-06-29 Thread Wolfgang Schuster

Otared Kavian schrieb am 29.06.2024 um 14:36:

Thanks Wolfgang !
I added the hint to the wiki: https://wiki.contextgarden.net/Flow_Charts


Out of curiosity, why should one say
\startFLOWcell[background=color,backgroundcolor=red]
...
\stopFlowcell

while
\startFLOWcell[backgroundcolor=red]
…
\stopFLOWcell

seem to work as well ?

Thanks again and best regards: Otared


You're right, there is no need for "background=color" because each cell 
already has a background color by default.


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: No roman numerals in frontmatter header

2024-06-29 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 29.06.2024 um 10:10:

Am 29.06.24 um 06:49 schrieb jbf:
But if I change to \setuppagenumbering[location= ], and choose, for 
example:


\setupheadertexts

    [ ]    [{\getmarking[chapter]\hskip1em \pagenumber}]

    [{\pagenumber \hskip1em 
\documentvariable{metadata:title}}]    [ ]


I get my header texts with page numbers in arabic numerals in 
frontmatter. I have tried various \setupheadertexts options, but I 
still get arabic numerals in frontmatter. The conversion does not work.


What am I missing or doing wrong?


Try \convertnumber{R}{\pagenumber}


Just use \userpagenumber.

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: Flowcharts

2024-06-28 Thread Wolfgang Schuster

Otared Kavian schrieb am 28.06.2024 um 19:23:

A second try…

Hi all,

Is it possible to have different background colors for different cells in flow 
charts ?
For instance in the following example, is it possible to have a particular 
color for each cell ?


\startFLOWcell[background=color,backgroundcolor=red]
  ...
\stopFLOWcell

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: Use headcommand in \definedescription together with \definehighlight (now: \definestartstop)

2024-06-28 Thread Wolfgang Schuster

Gerion Entrup schrieb am 28.06.2024 um 11:40:


Do you know, why the groupedcommand solution does not work?


The command and the environment which are created by \definestartstop 
can't be interchanged when you use the before/after and left/right keys.


 begin example
\usemodule[visual]

\definestartstop
  [Example]
  [before={\par\leftaligned{\tttf [before]}\par},
after={\par\leftaligned{\tttf [after]}\par},
 left={{\tttf [left]}},
right={{\tttf [right]}}]

\starttext

\fakewords{10}{20}
\startExample
\fakewords{10}{20}
\stopExample
\fakewords{10}{20}

\blank

\fakewords{3}{5}
\Example{\fakewords{3}{5}}
\fakewords{3}{5}

\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 / 
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: Use headcommand in \definedescription together with \definehighlight (now: \definestartstop)

2024-06-27 Thread Wolfgang Schuster

Gerion Entrup schrieb am 25.06.2024 um 08:41:

Am Dienstag, 25. Juni 2024, 00:09:09 MESZ schrieb Wolfgang Schuster:

Gerion Entrup schrieb am 24.06.2024 um 23:57:

Am Montag, 24. Juni 2024, 21:20:19 MESZ schrieb Aditya Mahajan:

On Mon, 24 Jun 2024, Gerion Entrup wrote:


Hi,

I was in the process to convert an itemize part to a description and wanted to 
simplify the code in the same move.
I discovered headcommand for that, but struggled to set the text in an 
highlight _and_ make a colon at the end.

Not sure what exactly you want, but how about:

\definehighlight[hl][style={\m{>}\,\switchtobodyfont[tt]}]
% This is the wrong way to define such a command as '>' is not part of the 
style. I have left this definition just for comparison with the soln below.

Is there a better way to define a highlight that sets a style (color, font) 
_and_ a prefix (symbol)?
Another way, I know of, would be just a plain def, something like 
\def{\hl}{\groupedcommand{>\,\switchtobodyfont[tt]}{}}, but actually I want to 
define a highlight (just with an additional prefix).


1. ConTeXt already uses \hl as name for a existing command.

2. Use \definestartstop:

\definestartstop [gerion] [style=mono,left={›\thinspace}]

\starttext

text

\gerion{text}

\stoptext


\definedescription[category][
alternative=top,
headstyle=bold,
width=broad,
]

\definedescription[desc][
width=fit,
distance={\widthofstring{~}},


distance=\spaceamount,

Wolfgang


This seems to be much better but does not lead to the wanted result. The full 
example now is:
```
\definestartstop[myhl][style=mono,left={›\thinspace}]

\definedescription[categorie][
alternative=top,
headstyle=bold,
width=broad,
]

\definedescription[desc][
width=broad,
distance=\spaceamount,
headcommand={\groupedcommand{\startmyhl}{\stopmyhl :}},
headstyle=,
before={\startpacked},
after={\stoppacked},
alternative=hanging
]

\starttext

This is a \myhl{highlight}.

Some listings

\startcategorie{Itemize}
\startitemize[packed]
\item \myhl{first}: one
\item \myhl{second}: two
\stopitemize
\stopcategorie

Now the same as desc:
\startcategorie{Desc}
\startdesc{first} one \stopdesc
\startdesc{second} two \stopdesc
\stopcategorie

\stoptext
```

This adopts the correct style in \startdesc \stopdesc and sets the colon but 
omits the › (the left part).


You can do the following in the next version.

1. Add "arguments=yes" to \definestartstop to enable the optional 
argument for the new command.


2. Use the new commands with the "headcommand" key and apply ":" as 
right delimiter for the content of \Highlight.


\definestartstop
  [Highlight]
  [arguments=yes,
   style=mono,
left={›\thinspace}]

\definedescription
  [description]
  [  width=broad,
  distance=\spaceamount,
   headcommand=\Highlight[right=:],
   alternative=hanging]

\starttext

This is a \Highlight{highlight}.

\startdescription[title={Lorem ipsum}]
\samplefile{lorem}
\stopdescription

\stoptext

Wolfgang


Highlight.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 / 
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: Letter module broken?

2024-06-26 Thread Wolfgang Schuster

Kip Warner schrieb am 26.06.2024 um 21:08:

On Wed, 2024-06-26 at 08:31 +0200, Henning Hraban Ramm wrote:

Hey Henning,


I’ve no problems with the module in LMTX 2024.06.18 or 2024.06.21,
neither with my usual letters nor with the example.

Usually, there should be some log lines that tell you about the
loading of the module:

modules > 'letter' is loaded
open source > level 2, order 3, name
'/Users/hraban/context/tex/texmf-
modules/tex/context/third/letter/base/s-cor-01.mkvi'

Please check if the module is there and re-generate the file
database.

It looks like it is not. I followed these instructions for installation
of ConTeXt on a 64-bit GNU/Linux system:

https://wiki.contextgarden.net/Installation#GNU.2FLinux_2

I notice that the context/tex/texmf-modules directory exists, but there
is nothing in it, after the installation completes. Is there an
argument that needs to be passed to ./install.sh perhaps?


https://wiki.contextgarden.net/Modules#Installation_by_script_.28LMTX.29

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: Use headcommand in \definedescription together with \definehighlight

2024-06-24 Thread Wolfgang Schuster

Gerion Entrup schrieb am 24.06.2024 um 23:57:

Am Montag, 24. Juni 2024, 21:20:19 MESZ schrieb Aditya Mahajan:

On Mon, 24 Jun 2024, Gerion Entrup wrote:


Hi,

I was in the process to convert an itemize part to a description and wanted to 
simplify the code in the same move.
I discovered headcommand for that, but struggled to set the text in an 
highlight _and_ make a colon at the end.

Not sure what exactly you want, but how about:

\definehighlight[hl][style={\m{>}\,\switchtobodyfont[tt]}]
% This is the wrong way to define such a command as '>' is not part of the 
style. I have left this definition just for comparison with the soln below.

Is there a better way to define a highlight that sets a style (color, font) 
_and_ a prefix (symbol)?
Another way, I know of, would be just a plain def, something like 
\def{\hl}{\groupedcommand{>\,\switchtobodyfont[tt]}{}}, but actually I want to 
define a highlight (just with an additional prefix).


1. ConTeXt already uses \hl as name for a existing command.

2. Use \definestartstop:

\definestartstop [gerion] [style=mono,left={›\thinspace}]

\starttext

text

\gerion{text}

\stoptext


\definedescription[category][
alternative=top,
headstyle=bold,
width=broad,
]

\definedescription[desc][
width=fit,
distance={\widthofstring{~}},


distance=\spaceamount,

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: Spacing within combinations

2024-06-22 Thread Wolfgang Schuster

Michael Guravage schrieb am 22.06.2024 um 18:17:

Greetings,

The attached MWE combines 12 images in  a 3 by 4 grid; with horizontal 
and vertical spacing set by setupcombinations.


I have two questions. First, can someone please tell me why the 
vertical spacing is not applied between the first and second and third 
and fourth rows? Second, why, If I try, e.g.c 15 images, does  ConTeXt 
complain of a missing left brace. More generally, my mwe failed with 
an odd number of images, but succeeded with an even number.


In a combination each entry takes two parts

  1. The content of the cell and
  2. the caption for the cell (unless you enable auto numbering)

but you're omitting the caption for all of them. While I say you omit 
the caption this isn't the actual truth because the \startcontent and 
\startcaption commands are just named alternatives for the braces which 
means every second figure in your example is used as caption for the 
previous image.


To fix your example add

  context.startcaption()
  context.stopcaption()

after the content for each combination cell.

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: (off-topic) hovering over links in Acrobat Reader

2024-06-19 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 19.06.2024 um 21:55:

Am 19.06.24 um 19:16 schrieb Pablo Rodriguez via ntg-context:

Would you be so kind to test the attached document (and the one you may
generate from the sample source) hovering over the link frames in
Acrobat (ideally DC updated to latest)?

At least, I would like to be sure what is going on here.

Hovering over links is basic precaution before clicking them.

To explain that to others, I’d rather know how Acrobat (Reader) behaves
in these cases.


Build 24.2.20857.0 on MacOS 10.15.7:
1: no hover
2: https://contextgarden.net
3: https://contextgarden.net


Trying to compile your code, I get:

"""
...
fonts   > otf loading > math data wiped from 'DejaVu Sans'

Fatal error: catcode push/pop mismatch. Fix this! (restore level: 0)

system  > don't use \end to finish a document
system  > invalid \starttext ... \stoptext structure
close source    > level 1, order 3, name './hover1.tex'
(\end occurred when \ifcase on line 6 was incomplete)
...
"""


This should be \protected\def

\protect\def\myhref#1#2%
  {...}

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: Arranging bullets within tabulate and itemize

2024-06-19 Thread Wolfgang Schuster

Lukas via ntg-context schrieb am 19.06.2024 um 17:19:

Hello,

here is a simple code:


[...]

I cannot find out how to arrange the tabulate bullets straight above 
those of itemize, so how to supress the left indeting, to get:


Foo
• Aaa Aa
• Bbb Bb

Foo
• Ttt
Tt
• Uuu
Uu

How do I achieve this?


You have to set the width for the item symbol/counter to 0pt to get rid 
of the space before the table.


 begin example
\showframe[text][text]

\starttext

\startitemize
\starttabulate[|||]
\NI First item  \NC\NR
\NI Second item \NC\NR
\stoptabulate
\stopitemize

\startitemize[width=0pt]
\starttabulate[|||]
\NI First item  \NC\NR
\NI Second item \NC\NR
\stoptabulate
\stopitemize

\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 / 
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: line numbering respecting original lines

2024-06-17 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 17.06.2024 um 19:30:

Am 17.06.24 um 19:07 schrieb Wolfgang Schuster:

Henning Hraban Ramm schrieb am 17.06.2024 um 18:46:

Am 17.06.24 um 18:16 schrieb Wolfgang Schuster:

Henning Hraban Ramm schrieb am 17.06.2024 um 14:03:
When discussing verses or other texts that have distinct line 
breaking, I need line numbering to adhere to that, even if some 
lines are too long and need breaking. Is that possible?


In my example below the 3rd line is too long and gets line numbers 
3 and 4.


Same problem with source code examples, i.e. \starttyping with 
numbering.
I thought numbering=file (or \setuplinenumbering[method=file]) 
would address that, but apparently not.



\start \setupparagraphnumbering[state=start]
\startlines
...
\stoplines
\stop


Thank you – that works for the minimal example, but the options for 
paragraph numbering are very limited, I can’t even use my own command.

And I can’t combine it with \starttyping.


\def\CodeNumber#1{\hfill\tt\bfx\color[orange]{#1}}

% ok
\setuplinenumbering[
   command=\CodeNumber,
   width=3em,]

% invalid
\setupparagraphnumbering[
   command=\CodeNumber,
   width=3em,]


You can use the style and color keys

   \setupparagraphnumbering[state=start,style=\tt\bfx,color=orange]


but the location of the number in the left margin is fixed.


Yes, I’m just documenting line and paragraph numbering, and I wonder 
why the latter is so limited – is it just too old to use the usual 
parameters, or is it so much more complicated internally?


Maybe Hans (or somebody) needed this for a single document and the 
current version was enough at the time.


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: Combine \setupdelimitedtext with an author (define custom variable?)

2024-06-17 Thread Wolfgang Schuster

Gerion Entrup schrieb am 17.06.2024 um 13:04:

Am Donnerstag, 6. Juni 2024, 16:34:03 MESZ schrieb Wolfgang Schuster:

[...]

Wolfgang



I tried to combine this with the code of the mail thread: "setuphead in connection 
with the command argument" but had not luck.
ConTeXt always stops with:
```
close source> level 1, order 2, name './mwe.tex'
tex error   > runaway error: end of file encountered
mtx-context | fatal error: return code: 1
```

Here is the MWE:
```
[...]

\startsetups[my_chapter]
\startlocalheadsetup
\startframed[chapter_frame]
\blank[2cm]
\startfont[Serif sa 8]
\color[darkgray]{\headnumbercontent}
\stopfont
\blank[5mm]
\startfont[SerifBold sa 2]
\color[m-indigo-800]{\headtextcontent}
\stopfont
\blank[1cm]
\startfont[SerifBold sa 1.5]

\color[m-indigo-800]{\structureuservariable{subtitle}}
\stopfont
\blank[3cm]

\startextract[author={\structureuservariable{quoteauthor}}]
\structureuservariable{quote}
\stopextract
\stopframed
\stoplocalheadsetup
\stopsetups


The userdata environment uses the buffer mechanism of Context which has 
a few limitations where you can use it, e.g. putting the environment in 
the arguments of other commands (like the setup-environment above) 
fails. One way to avoid this is to replace the \startextract ... 
\stopextract in this case with the code for the quoted text, another way 
is to put all content in a buffer and just load the buffer in the 
setups-environment.


\startbuffer[my_chapter]
\startlocalheadsetup
\startframed[chapter_frame]
...
\stopframed
\stoplocalheadsetup
\stopbuffer

\startsetups[my_chapter]
  \getbuffer[my_chapter]
\stopsetups

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: line numbering respecting original lines

2024-06-17 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 17.06.2024 um 18:46:

Am 17.06.24 um 18:16 schrieb Wolfgang Schuster:

Henning Hraban Ramm schrieb am 17.06.2024 um 14:03:
When discussing verses or other texts that have distinct line 
breaking, I need line numbering to adhere to that, even if some lines 
are too long and need breaking. Is that possible?


In my example below the 3rd line is too long and gets line numbers 3 
and 4.


Same problem with source code examples, i.e. \starttyping with 
numbering.
I thought numbering=file (or \setuplinenumbering[method=file]) would 
address that, but apparently not.



\start \setupparagraphnumbering[state=start]
\startlines
...
\stoplines
\stop


Thank you – that works for the minimal example, but the options for 
paragraph numbering are very limited, I can’t even use my own command.

And I can’t combine it with \starttyping.


\def\CodeNumber#1{\hfill\tt\bfx\color[orange]{#1}}

% ok
\setuplinenumbering[
   command=\CodeNumber,
   width=3em,]

% invalid
\setupparagraphnumbering[
   command=\CodeNumber,
   width=3em,]


You can use the style and color keys

  \setupparagraphnumbering[state=start,style=\tt\bfx,color=orange]


but the location of the number in the left margin is fixed.

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: line numbering respecting original lines

2024-06-17 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 17.06.2024 um 14:03:
When discussing verses or other texts that have distinct line breaking, 
I need line numbering to adhere to that, even if some lines are too long 
and need breaking. Is that possible?


In my example below the 3rd line is too long and gets line numbers 3 and 4.

Same problem with source code examples, i.e. \starttyping with numbering.
I thought numbering=file (or \setuplinenumbering[method=file]) would 
address that, but apparently not.


Hraban



\mainlanguage[de]
\setuppapersize[A7,landscape]
\setuplayout[topspace=0mm,bottom=0mm,width=90mm,height=70mm]
\setuppagenumbering[location=none,state=stop]
%\setuplinenumbering[method=file]
\starttext

\startlinenumbering
\startlines
Und doch, wie viel wahnsinniger, einen Freund,
weil ers in einer Kleinigkeit versah,
die nur ein Mensch, mit dem gar nicht zu leben ist,
ihm nicht verzeihen konnte, gleich dafür
zu hassen und zu fliehen, wie den Ruso …
\stoplines
\stoplinenumbering
% aus: C. M. Wieland, Horazens Satiren. Weimar 1786 (2. Aufl. 1804)
\stoptext


\start \setupparagraphnumbering[state=start]
\startlines
...
\stoplines
\stop

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: expanded doif's

2024-06-17 Thread Wolfgang Schuster

Hans van der Meer schrieb am 17.06.2024 um 09:01:
I want to show an errormessage when the macro is undefined. It requires 
expansion of \xmlatt{#1}{name}.

\ifdefined\xmlatt{#1}{name} didn't worked nor \expandafter\ifdefined
I thought of the expanding \doif's.

See the attached output of this xmlsetup attached.

\startxmlsetups hvdm:system:macrocall
%
\doifelsedefined{\xmlatt{#1}{name}}
{
%
%macro without argument
%
\ifxmlattempty{#1}{arg}
\begincsname\xmlatt{#1}{name}\endcsname
%
%macro with argument
%
\else
\begincsname\xmlatt{#1}{name}\endcsname{\xmlatt{#1}{arg}}
\fi
}
{
\ERROR{macro \xmlatt{#1}{name} is not defined}
}
\stopxmlsetups


I have no idea what's wrong in your code without a proper minimal 
example. As the example below shows you can use \doifelsedefined in 
combination with \xmlatt.


\startbuffer[ifdefined]

  
  

\stopbuffer

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

\startxmlsetups xml:macro

  \doifelsedefined{\xmlatt{#1}{name}}
{\texdefinition{\xmlatt{#1}{name}}{\xmlatt{#1}{arg}}}
{{\tttf macro \tex{\xmlatt{#1}{name}} not defined}}

% \ifcsname\xmlatt{#1}{name}\endcsname
%   \lastnamedcs{\xmlatt{#1}{arg}}
% \else
%   %
% \fi

\stopxmlsetups

\startxmlsetups xml:hvdm
\xmlsetsetup{\xmldocument}{document|macro}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:hvdm}

\starttext
\xmlprocessbuffer{hvdm}{ifdefined}{}
\stoptext

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: expanded doif's

2024-06-16 Thread Wolfgang Schuster

Hans van der Meer via ntg-context schrieb am 16.06.2024 um 22:29:

I  remember there was an incantation to work with expanded doif's etc.
In this case I need \doifelsedefined{ARG} with ARG expanded.
I lost the exact spelling of the command and dldn't find it in the 
garden.

What was it?


Can you provide a example where you have problems with \doifdefined etc.

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: Math manual

2024-06-16 Thread Wolfgang Schuster

skyhorse--- via ntg-context schrieb am 16.06.2024 um 18:59:

Mikael Sundqvist  wrote:

./tex/texmf-context/doc/context/documents/general/manuals/mathincontext-screen.pdf
./tex/texmf-context/doc/context/documents/general/manuals/mathincontext-paper.pdf



Sorry about my locational ignorance, but where can I view this document?

I only have  - math-mkiv.pdf
 - math-tweaks.pdf
 in my dir:
/opt/context-lmtx/tex/texmf-context/doc/context/documents/general/manuals


Can you please provide me with the URL to the directory?


You need at least version 2024.06.14 to get the manuals, if they are 
missing on your system the installed context version is tool old.


Another way to get the manuals is from the Pragma website:

- https://www.pragma-ade.com/general/manuals/mathincontext-paper.pdf
- https://www.pragma-ade.com/general/manuals/mathincontext-screen.pdf

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: Prefix the text in an enumeration.

2024-06-14 Thread Wolfgang Schuster

Gerion Entrup schrieb am 14.06.2024 um 11:01:

Am Donnerstag, 13. Juni 2024, 16:31:58 MESZ schrieb Wolfgang Schuster:

\startsetups[question:intro]
\setupparagraphintro[first][\bold{Answer:} ]
\blank
\stopsetups

\defineenumeration[question][
 alternative=top,
 text=Question,
 title=yes,
 titleleft=,
 titleright=,
 right={:},
 headstyle=bold,
inbetween=\setup{question:intro},
]

\starttext

Some text:

\startquestion[title={How long does a loop last?}]
For a while.
\stopquestion

\stoptext


Thank you. That works well for this case.

I have a follow up question. I tried to additionally set a titledistance and reproduce 
that for the "Answer:"-part.
ConTeXt then introduces a mysterious newline.

See this example:

\definehspace[dist][1em]
\startsetups[question:intro]
\setupparagraphintro[first][\bold{Answer:}\hspace[1em]]
\blank
\stopsetups


You need 2 changes for \setupparagraphintro:

1. Change the argument of \hspace to "dist" because the commands accepts 
only keywords and everything else (even a valid length) is ignored and 
results in a horizontal skip of 0pt.


2. You have to add curly braces around the content when the content 
includes square brackets because nesting of optional arguments isn't 
supported yet.


The correct version of the one above is:

\startsetups[question:intro]
   \setupparagraphintro[first][{\bold{Answer:}\hspace[dist]}]
   \blank
\stopsetups

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: Prefix the text in an enumeration.

2024-06-13 Thread Wolfgang Schuster

Gerion Entrup schrieb am 13.06.2024 um 13:41:

Hi,

is there a way to automatically prefix the text body in an enumeration?

Consider this example:
```
\defineenumeration[question][
alternative=top,
text=Question,
title=yes,
titleleft=,
titleright=,
right={:},
headstyle=bold,
]

\starttext

Some text:

\startquestion[title={How long does a loop last?}]
\bold{Answer:} For a while.
\stopquestion

\stoptext
```

I'd like to have the `\bold{Answer:}` automatically. So for example something 
like this:
```
\defineenumeration[question][
alternative=top,
text=Question,
title=yes,
titleleft=,
titleright=,
right={:},
headstyle=bold,
prefix={\bold{Answer:}},
]

\starttext

Some text:

\startquestion[title={How long does a loop last?}]
For a while.
\stopquestion

\stoptext
```

I tried to misuse `inbetween` for that but `alternative=top` seems to make a 
(not modifiable space) between the heading and the text body.


Use the \setupparagraphintro command to set the text which should appear 
at the start of the question.


 begin example
\startsetups[question:intro]
  \setupparagraphintro[first][\bold{Answer:} ]
  \blank
\stopsetups

\defineenumeration[question][
alternative=top,
text=Question,
title=yes,
titleleft=,
titleright=,
right={:},
headstyle=bold,
  inbetween=\setup{question:intro},
]

\starttext

Some text:

\startquestion[title={How long does a loop last?}]
For a while.
\stopquestion

\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 / 
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: dimen 100.0pt not 100.0pt?

2024-06-10 Thread Wolfgang Schuster

Hans van der Meer via ntg-context schrieb am 10.06.2024 um 15:46:
The I do not understand. I am testing if a dimension set can be checked 
against the expected value.
It looks like 100.0pt is not really 100.0pt. Why? And how can I do this 
test properly with true as result?


\scratchdimen=100pt\relax
\iftok{\the\scratchdimen}{100.0pt}true\else false\fi
Screenshot 2024-06-10 at 15.37.32.png

printing \the\scratchdimen results in 100.0pt

while \meaning\scratchdimen results in: constant dimension 100.0pt


\starttext

\scratchdimen=100.0pt

\ifdim\scratchdimen=100.0pt
  True
\else
  False
\fi

\stoptext

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: Scale content to height of the font, measure font height

2024-06-10 Thread Wolfgang Schuster

Gerion Entrup schrieb am 10.06.2024 um 13:16:

Hi,

I'd like to scale something (actually a symbol drawn in TikZ) to the exact
high of the char 'M'. I found the scale environment for it but struggle to
measure the correct font height. I found the "definemeasure/measure/measured"
commands but they define a dimension and are not for doing measurements on
rendered text. Is there a simple way to get the height a char as a dimension?

MWE:
```
\starttext
% Is it possible to replace 1cm with a common expression?
This is the letter M. \scale[height=1cm]{a} should have the exact same size as
M.

This should also be true {\tfc with a bigger M. \scale[height=1cm]{a}}.
\stoptext
```


\starttext
M\scale[height=\heightofstring{M}]{a}M
\stoptext

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: Scale notation base on current font

2024-06-08 Thread Wolfgang Schuster

seyal zavira schrieb am 08.06.2024 um 17:09:

Thanks

sorry for incomplete example
the code below shows the problem better:
\setupinteraction[state=start]
\definenote[Mynote][location=text,before={},]
\setupnote[Mynote]
     [location=left,
      textcommand={\tfa \raise 0.2ex\hbox},
     ]

\definefont[highfont][name:ibmplexsansbold*default at 10pt]
\definehighlight[newhigh][color=darkblue,style=highfont]

\starttext
\input{knuth} \Mynote{refrence}

\startitemize
\item \newhigh{\input{knuth}\Mynote{refrenceTwo}}
\stopitemize

\placenotes[Mynote]
\stoptext

as you can see the note number has same style all over the document.
but i want it to have style base on current font
and if the font changes, the style should change, while maintaining the 
ratio of sizes(i.e., at the half of current font).

i attached the resulted pdf


1. You can use the \offset command to raise the footnote number.

2. Disable the value of the textstyle to ensure you get current style 
for the footnote number.


 begin example
\define[1]\MyNoteTextcommand
  {\offset[y=-0.2ex]{#1}}

\definenote
  [Mynote]

\setupnote
  [Mynote]
  [location=text,
   textstyle=,
   textcommand=\MyNoteTextcommand]

\starttext

\input{knuth}\Mynote{First note.}

\startstyle[style=\ss]
\input{knuth}\Mynote{Second note.}
\stopstyle

\startstyle[style=\tt\bf]
\input{knuth}\Mynote{Third note.}
\stopstyle

\placenotes[Mynote]

\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 / 
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 source from XML

2024-06-08 Thread Wolfgang Schuster



Denis Maier via ntg-context schrieb am 08.06.2024 um 09:14:
Pablo Rodriguez via ntg-context <mailto:ntg-context@ntg.nl>> hat am 07.06.2024 21:41 CEST geschrieben:

Again, xml-mkiv.pdf is documenting the way of handling XML in ConTeXt
and it has to be written that way.
It is part of our task (the one reserved to final users) to compose a
proper introduction on how to typeset XML sources with ConTeXt.
Borrowing the title from other work, “XML in Proper ConTeXt” (actually
taken from https://www.berenddeboer.net/tex/LaTeX2ConTeXt.pdf).

Hi,
I've read Thomas Schmitt's My Way as an excellent introduction in XML 
processing with ConteXt, but I can't find it anywhere anymore... Does 
anyone know what happened to it?




https://wiki.contextgarden.net/images/8/8c/xhtml.pdf

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: missing space with French quotation

2024-06-07 Thread Wolfgang Schuster

Alan Braslau schrieb am 07.06.2024 um 16:21:

I have *never* understood how this works and, in fact, have always done
weird stuff like explicitly putting a nbps before double punctuation
(:;) in my document sources. I do this as it makes the sources much
more readable, preventing my text editor from ever breaking lines
before the punctuation (and not having some space in the source looks
awkward when reading French text).

I use:

[...]

This gives proper spacing with \quotation{} and with \startquotation
... \stopquotation. Also, {\en\quotation{}} and {\de\quotation{}} in
the document correctly do not add spaces.


1. \setcharacterspacing[frenchpunctuation] takes care about the space 
before/after quotation marks when you use manual quotes in a document.


It doesn't matter whether you use or don't use space between the 
quotations marks and the quoted text.


 begin example
\starttext

\startlines
«quoted text»
« quoted text »
\stoplines

\setcharacterspacing[frenchpunctuation]

\startlines
«quoted text»
« quoted text »
\stoplines

\stoptext
 end example

2. When you use the quotation command or environment ConTeXt adds a 
space between the quotation marks and the quoted text by itself but in 
the quotation-environment the space before the closing mark disappears 
when you add \setcharacterspacing.


 begin example
\language[fr]

\starttext

\startquotation
quoted text
\stopquotation

\quotation{quoted text}

\setcharacterspacing[frenchpunctuation]

\startquotation
quoted text
\stopquotation

\quotation{quoted text}

\stoptext
 end example


Is \setupquotation[symstyle=\resetcharacterspacing] necessary?


It's a temporary fix for the problem with the quotation environment by 
disabling the characterspacing mechanism when ConTeXt places the 
quotation marks.


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: missing space with French quotation

2024-06-07 Thread Wolfgang Schuster

Peter Münster schrieb am 07.06.2024 um 13:31:

On Thu, May 30 2024, Peter Münster wrote:


\mainlanguage[fr]
\setcharacterspacing[frenchpunctuation]
\starttext
bla \quotation{OK} bla\\
bla «OK» bla
\startquotation
   Not Ok: a space is missing
\stopquotation
\stoptext


It seems, that this workaround solves the problem:
\setupquotation[before={\setcharacterspacing[reset]}]



The quotation environment doesn't rely on the characterspacing mechanism 
to add the spaces before and the after the quotes but uses language 
dependent skips.


The example below shows how it works and where it fails when you use 
characterspacing. Resetting spacing (and probably other settings like 
charcterkerning etc.) when the quotes are added as you noticed fixes the 
problem.


 begin example
\starttext

\dontleavehmode
\hbox{«\hspace[fr][quotation]}%
xxx%
\hbox{\hspace[fr][quotation]»}

\setcharacterspacing[frenchpunctuation]

\dontleavehmode
\hbox{«\hspace[fr][quotation]}%
xxx%
\hbox{\hspace[fr][quotation]»}

\dontleavehmode
\hbox{\expand\everyresettypesetting\relax «\hspace[fr][quotation]}%
xxx%
\hbox{\expand\everyresettypesetting\relax \hspace[fr][quotation]»}

\stoptext
 end example


What do you think about it? Is this the right way to do it?


I would use the symstyle key as hook to disable charcterspacing for the 
quotes in the environment.


 begin example
\mainlanguage[fr]

\setcharacterspacing[frenchpunctuation]

\setupquotation[symstyle=\resetcharacterspacing]

\starttext

«xxx»

\startquotation xxx\stopquotation

\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 / 
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: Combine \setupdelimitedtext with an author (define custom variable?)

2024-06-06 Thread Wolfgang Schuster

Gerion Entrup schrieb am 06.06.2024 um 12:30:

Hi,

I like to achieve something that looks like this:
```
\definedelimitedtext[extract][blockquote]
\setupdelimitedtext
   [extract]
   [leftmargin=1.5pc,
style={\italic},
before={\setupindenting[next]},
after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
\tfx\italic{René Descartes} \stopalignment}]

\starttext
\startextract
 Cogito ergo sum.
\stopextract
\stoptext
```

So it should setup a quotation and mentions the author.
However, here the author is hardcoded within the blockquote. I would like it to 
use like this:
```
\definedelimitedtext[extract][blockquote]
\setupdelimitedtext
   [extract]
   [leftmargin=1.5pc,
style={\italic},
before={\setupindenting[next]},
after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
\tfx\italic{\getcustomvariable{author}} \stopalignment}]

\starttext
\startextract[author=René Descartes]
 Cogito ergo sum.
\stopextract
\stoptext
```

Is there an easy way to achieve that?
I tried with \structureuservariable (like possible in \startchapter) but it 
does not work.


\startsetups [userdata:extract]
\startnarrower
\setupindenting[next]
\getuserdata
\hairline
\dontleavehmode\wordright{\itx\userdataparameter{author}}
\stopnarrower
\stopsetups

\defineuserdataalternative
  [extract]
  [renderingsetup=userdata:extract]

\defineuserdata
  [extract]
  [style=italic,
   alternative=extract]

\starttext

\startextract[author=René Descartes]
Cogito ergo sum.
\stopextract

\stoptext

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: background= key not working in \startbackground and \starttextbackground

2024-06-06 Thread Wolfgang Schuster

Aditya Mahajan schrieb am 06.06.2024 um 14:48:

Hi,

I am testing some of my old styles on latest context and find that the 
background key of \startbackground and \starttextbackground doesn't work 
(\framed is working as expected). Here is a MWE:


1. \starttextbackground isn't based on \framed and has a mp-key to 
assign a metapost graphic.


2. \startbackground needs to be fixed but it's simple, replace 
\defcsname with \edefcsname in pack-bck.mklx:


\appendtoks
\frozen\protected\instance\defcsname\e!start\currentbackground\endcsname{\pack_backgrounds_start 
[\currentbackground]}%
    \frozen\protected\instance\defcsname\e!stop 
\currentbackground\endcsname{\pack_backgrounds_stop }%
    \frozen\protected\instance\defcsname 
\currentbackground\endcsname{\pack_backgrounds_direct[\currentbackground]}%

\to \everydefinebackground

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: After using a custom command in the title, the table of contents is not generated properly

2024-06-05 Thread Wolfgang Schuster

ai2472206...@yeah.net schrieb am 05.06.2024 um 16:03:

As described, here is example:

%
\def\cmd#1{{\tt\textslash #1}}
\def\cmdii#1{\tt #1}
\def\cmdiii#1{\rm #1}


You can use \definehighlight to create a custom command for a style.

The case where you want a slash before the text you have to use 
\definestartstop which allows you to set something before and after


\definestartstop [cmdi]   [style=\tt,left=\textslash]
\definehighlight [cmdii]  [style=\tt]
\definehighlight [cmdiii] [style=\rm]

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: https://wiki.contextgarden.net/Command/blank

2024-06-04 Thread Wolfgang Schuster

Jim schrieb am 04.06.2024 um 21:29:

On Tue, Jun  4, 2024 at 20:31 (+0200), Taco Hoekwater wrote:


On 4 Jun 2024, at 20:16, Wolfgang Schuster  
wrote:



Jim schrieb am 04.06.2024 um 19:48:



I did not realize the wiki software did that.  On reflection I suppose that
is useful in many (most?) cases.  But I'd argue that it is not always a good
thing, such as in this case.  (If nothing else, it might mislead a n00b
into thinking that you should get output for text preceding \starttext.)



Here is the documentation for the  tag extension:



https://wiki.contextgarden.net/Help:Context


Hi Taco,

thanks very much for the link.  But, ummm, what it says there seems to
contradict what Wolfgang told me in the other response to my message.

[[ I see Wolfgang edited the \blank wiki page to move the text in question
to after \starttext, but I'm sure if you don't believe what I say in the
next paragraph, you can grab the previous version. ]]

Specifically, the example in the (previous) \blank wiki page does, indeed,
have a \starttext and \stoptext.  So, according to the page you mention
above, another \starttext and \stoptext should *not* be added.  And yet the
(previous) \blank page example does print the text (as well as the bullets)
before the \starttext.  Is there a discrepancy between what
.../Help:Context says and what actually happens?


When you take a look at the settings which are applied here you can see 
\setupbodyfont[8pt] which is the reason why the text appears, compare


 begin example
Before \tex{starttext}

\starttext
After \tex{starttext}.
\stoptext
 end example

with

 begin example
\setupbodyfont[12pt]

Before \tex{starttext}

\starttext
After \tex{starttext}.
\stoptext
 end example

The second example loads a font before the text appear in the document 
which is the reason why you can see it.


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: https://wiki.contextgarden.net/Command/blank

2024-06-04 Thread Wolfgang Schuster

Jim schrieb am 04.06.2024 um 19:48:


I did not realize the wiki software did that.  On reflection I suppose that
is useful in many (most?) cases.  But I'd argue that it is not always a good
thing, such as in this case.  (If nothing else, it might mislead a n00b
into thinking that you should get output for text preceding \starttext.)


The reason why you get no text isn't that you wrote it before \starttext 
but that no font was loaded yet. By default ConTeXt postpones the 
loading of the default fonts until \starttext because when you use a 
different font on your document this is normally before \starttext and 
with the postponing there is no need to load a unused font.


At the point where you load a font with \setupbodyfont text even if it 
appears before \starttext is shown as expected but this isn't recommended.



If you (or some other knowledgeable person reading this) don't (doesn't)
mind another question,...
Is the bullet symbol not from some font?  If so, why is that font loaded in
time to see the bullet?


When no font has been loaded yet with \setupbodyfont ConTeXt prints text 
which is put in a \hbox in a monospaced font as shown in the example below.


 begin example
This is before \tex{starttext}.

\hbox{This is also before \tex{starttext}}

\starttext
This is after \tex{starttext}.
\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 / 
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: https://wiki.contextgarden.net/Command/blank

2024-06-04 Thread Wolfgang Schuster

Jim schrieb am 04.06.2024 um 18:01:

Hi,

When I run Example 1 given there, I get three bullet symbols, but no
 "column N ..."
text.

Note that the
 \starttext
is *after* the \startitemize ... \stopitemize

Q1: Is my ConTeXt installation broken, or is the wiki page showing output
 that does not correspond to the input?

Q2: If the wiki page is inconsistent, is there an easy fix?

Q3: If my installation is correct, why do I get bullet symbols *before*
 \starttext ?


The wiki adds \starttext at the start and \stoptext at the end of each 
example

and the \starttext/\stoptext pair which is part is just ignored.

When you try to run the example as is there is no text before \starttext 
because

no font has been loaded yet (you can add \setupbodyfont[modern] before
\startitemize to make the text visible).

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
___


  1   2   3   4   5   6   7   8   9   10   >