[NTG-context] How to change the way one input file's data is displayed, depending on where it is in the document.

2024-09-23 Thread Joel via ntg-context
I have some code like this--it is a very reduced minimum-working example, from 
10,000+ lines of code:
fileA.tex--

\datatypeA{fish}{an animal that lives in the sea}
\datatypeA{bear}{a big animal with claws and fur}
\datatypeA{squid}{a sea creature with many legs}

fileB.tex--

\datatypeB{fish}{an animal that lives in the sea}
\datatypeB{bear}{a big animal with claws and fur}
\datatypeB{squid}{a sea creature with many legs}

main.tex--

\datatypeA[2]{\startitemize \item #1 #2 \stopitemize}
\datatypeA[B]{#1 -- #2}

\define[8]\activity{
    \subject{#1}
    #2
    \startitemize
    \item #3
    \item #4
    \item #5
    \item #6
    \item #7
    \stopitemize
    #8
}

\define[2]\balloongame{
    \activity{Balloon Toss Game}{Instructions}{scissors}{plates}{construction 
paper}{#1}{#2}{\input fileA}
}
\define[2]\fishinggame{
    \activity{Fun Fishing Game}{Instructions}{scissors}{plates}{construction 
paper}{#1}{#2}{\input fileB}
}

\starttext

    \balloongame{balloons}{tape}
    \fishinggame{crayons}{glue}

\stoptext
Basically, I have different classroom activities, defined as macros. 
\balloongame gives all details to the teacher about a "Balloon Toss Game" and 
\fishinggame defines a "Fun Fishing Game". (code has been reduced and 
simplified significantly).
The main issue I have is I have data being stored in filesA.tex, fileB.tex, 
etc. (there are often a dozen such files). Note that strangly the datasets are 
all identical, but a different file is called, and the only difference in the 
dataset is they call different macros. So "Balloon Game" pulls the list, but 
displays them in datatypeA format, the other game takes the same data, but its 
in a different file, and since the macros are different, it displays the 
information differently.
Basically, I have tons of data files sharing basically the same information, 
but each one defined inside the file as using a different macro, according to 
how the information is to be displayed (maybe sometimes as a list, sometimes in 
a table, etc.)
This method seems horribly inefficient. I should be able to store that data in 
one file, but display the data in different ways. The problem is if I use one 
format, like this...

 \datatype{fish}{an animal that lives in the sea}
\datatype{bear}{a big animal with claws and fur}
\datatype{squid}{a sea creature with many legs}
...how do I get that dataset to be included, but displayed in a different 
format each time?
My thinking is perhaps constantly redefine the macro \datatype, but that seems 
still inefficient and prone to lead to errors in the code. Is that the best 
solution?

Any suggestion for the most proper way to go about displaying the information 
from this file, but in different ways in the document?
NOTE: My event code already uses 8 of the #1 #2 variables, so there's not 
really room to include that information there.

--Joel

___
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] suitable macros for Pandoc custom styles for paragraphs, spans and tables

2024-09-23 Thread mf

Hello list,

I started a topic in Pandoc discussions (see 
https://github.com/jgm/pandoc/discussions/10208) about custom styles in 
pandoc tables.



This is the framework:

- in Pandoc, some textual elements have a "custom-style" attribute, 
whose value becomes the name of a paragraph or character style in DOCX, 
ICML or ODT when exported to those formats


- e.g. when you have a Span with custom-style="myStyle" around some 
inline text, you'll get a character style "myStyle" in those formats


- for paragraphs, it's a bit different: since they have no attributes in 
Pandoc, you set the "custom-style" attribute of a surrounding Div 
element, then all the paragraphs inside it will get that custom 
paragraph style in DOCX, ICML or ODT


- for DOCX output you may set a "custom-style" attribute also in tables


Why not using that information about custom styles for ConTeXt output too?

I started from the last ones (tables), suggesting that a Table element 
with a "custom-style" attribute set to "myStyle" could be output in 
ConTeXt as:


\startxtable[myStyle]

(Currently, tables converted to ConTeXt by Pandoc start only with a 
"\startxtable" line)


That's doable, because ConTeXt does not terminate with an error, when it 
encounters a \startxtable[myStyle] not preceded by a \definextable[myStyle].



Then JGM, Pandoc's main author, replied that it would be weird having 
custom styles for tables and not for spans or paragraphs in ConTeXt output.


Good point.


In ConTeXt, there are many ways to specify what in Word and LibreOffice 
are "character" and "paragraph" styles.


For example, \definehighlight is suitable for character styles.

Badumont, in the pandoc discussion, suggested \definestartstop; good, 
though you should be careful not to specify a custom style with the same 
name of an existing environment (e.g. "narrower"); maybe a prefix like 
"CS" could be a workaround, so that "myStyle" becomes "CSmyStyle", and 
also "narrower" becomes a less dangerous "CSnarrower".


Also, in this case, Pandoc should prepend a \definestartstop[CSmyStyle] 
before \startCSmyStyle, otherwise ConTeXt would terminate with an error 
(I think this is doable in Pandoc code, anyways).


(BTW, the wiki says \definestartstop is "used to define block level 
commands": does it mean it can't be suitable for spans of inline text in 
a paragraph?)



Any ideas to specify paragraph and character styles?


Massi

___
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-23 Thread Otared Kavian
Hi Bruce,

I had an analogous problem a while ago, but with 7 chapter files, which I 
treated manually…
Your solution is a very nice one, thank you for sharing ! 

For the archives, if one wishes to have the correct chapter number in each 
separate PDF file, one could change the content of « test.tex » file as follows:

\starttext
\setupheadnumber[chapter][\cldcontext{\env{ChapNo}-1}]
\input chapter-\env{ChapNo}.tex
\stoptext

Best regards: Otared


> On 20 Sep 2024, at 19:04, Bruce Horrocks  wrote:
> 
> 
> 
>> On 20 Sep 2024, at 03:57, Joel via ntg-context  wrote:
>> 
>> 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.
> 
> Since you’ve already got the chapter content split into separate \input files 
> ...
> 
> At the Unix level, use the following script to run Context 180 times 
> specifying a different output file each time:
> 
> #! /bin/bash
> for i in {1..180}
> do
>  context \
>--arguments="ChapNo=$i" test.tex \
>--result="chapter_$i.pdf”
> done
> 
> And at the Context level, test.tex is simply:
> 
> \starttext
>  \input chapter\env{ChapNo}
> \stoptext
> 
> 
> Regards,
> —
> Bruce Horrocks
> Hampshire, UK
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___

Otared Kavian
e-mail: ota...@gmail.com
Phone: +33 6 88 26 70 95




___
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 Joel via ntg-context
 I am using Linux, so those tools are available, but Bruce's solution is 
working great! Just had to make tiny changes to the file.
I had no idea I could send an environment variable to ConTeXt...will be using 
that a lot from now! Thanks very much everyone for the help!

On Friday, September 20, 2024 at 11:04:47 AM MDT, Bruce Horrocks 
 wrote:  
 
 

> On 20 Sep 2024, at 03:57, Joel via ntg-context  wrote:
> 
> 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.

Since you’ve already got the chapter content split into separate \input files 
...

At the Unix level, use the following script to run Context 180 times specifying 
a different output file each time:

#! /bin/bash
for i in {1..180}
do
  context \
    --arguments="ChapNo=$i" test.tex \
    --result="chapter_$i.pdf”
done

And at the Context level, test.tex is simply:

\starttext
  \input chapter\env{ChapNo}
\stoptext


Regards,
—
Bruce Horrocks
Hampshire, UK

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

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


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

2024-09-20 Thread Bruce Horrocks


> On 20 Sep 2024, at 03:57, Joel via ntg-context  wrote:
> 
> 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.

Since you’ve already got the chapter content split into separate \input files 
...

At the Unix level, use the following script to run Context 180 times specifying 
a different output file each time:

#! /bin/bash
for i in {1..180}
do
  context \
--arguments="ChapNo=$i" test.tex \
--result="chapter_$i.pdf”
done

And at the Context level, test.tex is simply:

\starttext
  \input chapter\env{ChapNo}
\stoptext


Regards,
—
Bruce Horrocks
Hampshire, UK

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

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


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

2024-09-20 Thread Jim
On Fri, Sep 20, 2024 at 02:57 (+), Joel via ntg-context wrote:

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

Joel,

others have suggested mutool and pdftk, which could be half the solution
for you.  (I use pdftk for things like this, but I assume mutool is just as
good.  Either are far less tedious than printing to file.)

If the information of the chapter boundaries is available in the log file,
a judicious use of grep and a few lines of shell script code might do the
trick.  Alternatively, you might be able to use a tool like pdfgrep to find
the page numbers from the PDF file, and then use a few lines of shell code.

If you are a Linux or Mac user, this should be "easy enough".  I don't do
windows, but now that there is (as I understand it) a bash shell available,
you might also be able to use grep and/or pdfgrep there as well.

If the log file isn't currently sufficiently helpful, could you add
something to your "start a new chapter" command to write a comment into the
log file giving you exactly the information you need?

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

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


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

2024-09-20 Thread Denis Maier via ntg-context
I was going to suggest pdftk which is similar to mutools. You can get
boundaries from a the log file and then split the file using these tools.
(Search the mailing list: I think that's also something ConTeXt might be
able to do natively, but I'm not sure.)

Then, you might also consider using a product-component based solution.
You'll then be able to process each file indivdually while still having a
main file around. The page numbers in the individual file will be incorrect,
i.e. always start at 1, but for having a quick look that still might be
nice. (Hans or Wolfgang probably know if there is a way to get correct page
numbers when using components...)

Best,
Denis

> -Ursprüngliche Nachricht-
> Von: vm via ntg-context 
> Gesendet: Freitag, 20. September 2024 10:23
> An: ntg-context@ntg.nl
> Cc: vm 
> Betreff: [NTG-context] Re: How to tell a single *.tex file to produce
separate
> PDFs?
> 
> 
> 
> On 20/09/2024 04:57, Joel via ntg-context wrote:
> >
> > 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.
> 
> 
> what is the difference between scrolling through your single page files
folder
> and scrolling through a single pdf?
> 
> How about  too search in the pdf?
> 
> 
> with mutools you can take a pdf aprt into individual pages.
> 
> 
> $ mutool --help
> usage: mutool  [options]
>   clean   -- rewrite pdf file
>   convert -- convert document
>   create  -- create pdf document
>   draw-- convert document
>   trace   -- trace device calls
>   extract -- extract font and image resources
>   info-- show information about pdf resources
>   merge   -- merge pages from multiple pdf sources into a new pdf
>   pages   -- show information about pdf pages
>   poster  -- split large page into many tiles
>   sign-- manipulate PDF digital signatures
>   run -- run javascript
>   show-- show internal pdf objects
> 
> 
> __
> _
> 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
> __
> _

___
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 vm via ntg-context




On 20/09/2024 04:57, Joel via ntg-context wrote:


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.



what is the difference between scrolling through your single page files 
folder and scrolling through a single pdf?


How about  too search in the pdf?


with mutools you can take a pdf aprt into individual pages.


$ mutool --help
usage: mutool  [options]
clean   -- rewrite pdf file
convert -- convert document
create  -- create pdf document
draw-- convert document
trace   -- trace device calls
extract -- extract font and image resources
info-- show information about pdf resources
merge   -- merge pages from multiple pdf sources into a new pdf
pages   -- show information about pdf pages
poster  -- split large page into many tiles
sign-- manipulate PDF digital signatures
run -- run javascript
show-- show internal pdf objects


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

2024-09-19 Thread Joel via ntg-context
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...

--Joel
___
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-19 Thread Gerion Entrup
Am Donnerstag, 19. September 2024, 16:44:31 MESZ schrieb Hans Hagen:
> On 9/19/2024 1:03 PM, Gerion Entrup wrote:
> 
> > What is the meaning of \hss here? It seems to work just fine without it.
> 
> a left over from trial and error

Thank you all! I have documented both solutions in the Wiki 
(https://wiki.contextgarden.net/TABLE#Rotated_headline).

Gerion



signature.asc
Description: This is a digitally signed message part.
___
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-19 Thread Hans Hagen

On 9/19/2024 1:03 PM, Gerion Entrup wrote:


What is the meaning of \hss here? It seems to work just fine without it.


a left over from trial and error

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: Table and rotation: push together 45 degree rotated cells

2024-09-19 Thread Gerion Entrup
Am Donnerstag, 19. September 2024, 09:35:49 MESZ schrieb Hans Hagen via 
ntg-context:
> On 9/19/2024 7:54 AM, Mikael Sundqvist wrote:
> > Hi,
> > 
> > On Thu, Sep 19, 2024 at 12:23 AM Gerion Entrup  
> > wrote:
> >>
> >> Am Mittwoch, 18. September 2024, 22:53:55 MESZ schrieb 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.
> >>
> >> Thanks for this solution. It, however, seems to fail with any other angle 
> >> than 315° (I tested 305, 325 and 314).
> > 
> > Try
> > 
> >
> > xyscaled(\the\struttotal,abs(sind(\MPvar{rotation}))*\the\widthofstring{\MPvar{text}});
> > 
> > with sind instead of sin. And maybe with abs around it, but one can
> > think of improvements for smaller angles. It all depends on what one
> > wants.
> 
> here is an alternative
> 
> \bTABLE[frame=off]
>\bTR[align={middle,low}]
>  \bTH \eTH
>  \bTH 
> \dontleavehmode\kern1.5em\llap{\rotate[rotation=315,frame=on]{\strut 
> Water buffalo}\hss} \eTH
>  \bTH 
> \dontleavehmode\kern1.5em\llap{\rotate[rotation=315,frame=on]{\strut 
> Mexican redknee tarantula}\hss} \eTH
>  \bTH 
> \dontleavehmode\kern1.5em\llap{\rotate[rotation=315,frame=on]{\strut 
> European turtle dove}\hss} \eTH
>\eTR
>\bTR[frame=on,align=middle]
>  \bTD Amount of legs \eTD
>  \bTD[width=3em] 4 \eTD
>  \bTD[width=3em] 8 \eTD
>  \bTD[width=3em] 2 \eTD
>\eTR
> \eTABLE

What is the meaning of \hss here? It seems to work just fine without it.

Gerion



signature.asc
Description: This is a digitally signed message part.
___
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-19 Thread Hans Hagen via ntg-context

On 9/19/2024 7:54 AM, Mikael Sundqvist wrote:

Hi,

On Thu, Sep 19, 2024 at 12:23 AM Gerion Entrup  wrote:


Am Mittwoch, 18. September 2024, 22:53:55 MESZ schrieb 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.


Thanks for this solution. It, however, seems to fail with any other angle than 
315° (I tested 305, 325 and 314).


Try

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

with sind instead of sin. And maybe with abs around it, but one can
think of improvements for smaller angles. It all depends on what one
wants.


here is an alternative

\bTABLE[frame=off]
  \bTR[align={middle,low}]
\bTH \eTH
\bTH 
\dontleavehmode\kern1.5em\llap{\rotate[rotation=315,frame=on]{\strut 
Water buffalo}\hss} \eTH
\bTH 
\dontleavehmode\kern1.5em\llap{\rotate[rotation=315,frame=on]{\strut 
Mexican redknee tarantula}\hss} \eTH
\bTH 
\dontleavehmode\kern1.5em\llap{\rotate[rotation=315,frame=on]{\strut 
European turtle dove}\hss} \eTH

  \eTR
  \bTR[frame=on,align=middle]
\bTD Amount of legs \eTD
\bTD[width=3em] 4 \eTD
\bTD[width=3em] 8 \eTD
\bTD[width=3em] 2 \eTD
  \eTR
\eTABLE

and yes, i needed to trial and error a bit,

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: Table and rotation: push together 45 degree rotated cells

2024-09-18 Thread Mikael Sundqvist
Hi,

On Thu, Sep 19, 2024 at 12:23 AM Gerion Entrup  wrote:
>
> Am Mittwoch, 18. September 2024, 22:53:55 MESZ schrieb 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.
>
> Thanks for this solution. It, however, seems to fail with any other angle 
> than 315° (I tested 305, 325 and 314).

Try

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

with sind instead of sin. And maybe with abs around it, but one can
think of improvements for smaller angles. It all depends on what one
wants.

/Mikael
___
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 Gerion Entrup
Am Mittwoch, 18. September 2024, 22:53:55 MESZ schrieb 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.

Thanks for this solution. It, however, seems to fail with any other angle than 
315° (I tested 305, 325 and 314).


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

I guess, this one actually draws the text...


>setbounds currentpicture to unitsquare
>  
> xyscaled(\the\struttotal,sin(\MPvar{rotation})*\the\widthofstring{\MPvar{text}});

and this one calculates the faked width. Doesn't the sinus here calculate the 
height of the rotated text?

Beside from using Metapost (since I currently do not understand it and would 
only be able to copy paste your code), is there some kind of box construct 
which artificially reduces the width of the inner content?
I would have expected something like \fakewidth[width=1cm, 
align=flushright]{\rotate[rotation=-45, location=high]{A really long text, much 
longer than 1cm}}.
If I see it right, such a construct would also solve the problem, while less 
cleaner due to the fixed width.


Gerion




signature.asc
Description: This is a digitally signed message part.
___
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 Hans Hagen

On 9/18/2024 10:53 PM, Wolfgang Schuster wrote:

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


Neat. Added to the test suite.

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: 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: Table and rotation: push together 45 degree rotated cells

2024-09-18 Thread Gerion Entrup
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.


> Another question in this context: Is is possible to specify a \setupTABLE 
> command that works for column 2-4 starting from row 2?
> Something like \setupTABLE[row][2-][column][2,3,4][background=color, 
> backgroundcolor=red].
> In this example this would cover all numbers but nothing else.
> 
> Best
> Gerion



mwe.fixed.pdf
Description: Adobe PDF document


signature.asc
Description: This is a digitally signed message part.
___
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] Table and rotation: push together 45 degree rotated cells

2024-09-17 Thread 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.

Another question in this context: Is is possible to specify a \setupTABLE 
command that works for column 2-4 starting from row 2?
Something like \setupTABLE[row][2-][column][2,3,4][background=color, 
backgroundcolor=red].
In this example this would cover all numbers but nothing else.

Best
Gerion

signature.asc
Description: This is a digitally signed message part.
___
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 Florent Michel
Thank you Wofgang for the clarification and information!
(And indeed using 4ex makes more sense than my 2em! I must be too used to
systems which don't define ex...)

Best regards,
Florent

Le dim. 15 sept. 2024 à 18:14, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> a écrit :

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

2024-09-01 Thread Felix
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. 

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

2024-08-31 Thread Joel via ntg-context
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?
--Joel
___
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 Gerion Entrup
Hi,

thank you, that answers all my questions!

Gerion

Am Mittwoch, 28. August 2024, 00:03:34 MESZ schrieb 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
> 
> identifierfamilyname fontname 
> filename   subfont   instances
> 
> xcharterbold  xcharter   xcharterbold XCharter-Bold.otf
> xcharterbolditalicxcharter   xcharterbolditalic 
> XCharter-BoldItalic.otf
> xcharterboldslanted   xcharter   xcharterboldslanted 
> XCh

[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: Is there a short-cut to adding sub-categories for index entries?

2024-08-25 Thread Henning Hraban Ramm

Am 25.08.24 um 15:38 schrieb Joel via ntg-context:

I have a document with thousands of index entries. Here’s a sample code:
Some people lived in 
\index{cliff-dwelling}\index{dwellings+cliff-dwelling}cliff-dwellings, 
while others lived in \index{lean-to}\index{dwellings+lean-to}lean-tos.




I’m wondering if there is a short-cut means to set this up, such that if 
I can tell the document that any time it sees “cliff-dwellings” in an 
index, it will also add its page numbers to under 
“dwellings+cliff-dwelling”? In other words, is there an easier way to 
add these categories, then to go through the entire document and mark 
them? I already have a list of all the words.


For instance, in my above code, I must find every \index{cliff-dwelling} 
entry and add a \index{dwellings+cliff-dwelling} next to it...which 
would take hundreds of hours if I did that for every word. Is there a 
quicker way to tell it always also add it under "dwellings" too?


If it’s just a few instances, define a macro:

\define[1]\DwIndex{\index{#1}\index{dwellings+#1}#1}

For a list of words, a lookup table and a Lua function make sense.

With a comparable problem, normalizing location names, I used this:

-- lookups.lua
userdata = userdata or { }

userdata.Mapping = {
  ["Albano"] = "Albano (Provinz Rom)",
  ["Altona"] = "Altona (Hamburg)",
  ["Aurich"] = "Aurich (Ostfriesland)",
-- …
}

function userdata.Lookup(name)
  context(userdata.Mapping[name] or name)
end


%%% environment

\loadluafile[lookups.lua]
\defineregister[Location][]
\define[1]\LocIndex{\expanded{\Location{%
  \ctxlua{userdata.Lookup("#1")


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

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


[NTG-context] Re: upload

2024-08-01 Thread Hans Hagen

On 8/1/2024 9:21 AM, Henning Hraban Ramm wrote:

Am 31.07.24 um 19:55 schrieb Hans Hagen via ntg-context:

Hi,

end of the month update:

- we are still working on the math manual so updates there (we want 
the manual to stable for the upcoming meeting)


- we also work on the export (some changes and additions there but we 
will conver that plus some new tools later when we're done, read: are 
satisfied with what browsers can handle sort of well)


- wolfgang updated the setups (command definitions) so plenty of 
improvements and completion in there (he also did some quality assurance)


- all kind of small thingies (some to be introduced at the upcoming 
meeting were as usual we also discuss development and priorities)


- there are some new \setupalign options, like 'notwins', 'notoddlers' 
and 'noorphans' in case someone wants to be surprised


as usual when we run into unforseen issues we'll fix it,


I dared to update, since Hans’ & Mikael’s article for the journal 
required the latest version. (I wonder what \startimage is about…)


related to the export, we'll demo it at the meeting: formulas, metapost 
etc; here it is used to make an images file so that you don't need to 
update (i assumed that you'd turn the text into whatever the journal 
needs (if you render yourself best also check if the examples come out 
right)



Being careful, I did a parallel install, but all looks good so far.


no fundamental changes

My book went from 490 to 484 pages, must investigate, might just be 
better paragraph/page/table breaking or something like that. Or is 
automatical nonsense-removal now included?


run old and new and then

context --extra=compare old.pdf new.pdf

it might be some improvement in page crossing

My usual TTC problem (all Cambria is Bold Cambria) didn’t show after 
installation of the distribution, but resurfaced after installing all 
modules. ("mtxrun --script font --reload --force" helped as usual.)
there is an issue with cambria and name resolving, i'll send you an 
alternative typescript we've been testing


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

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

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


[NTG-context] Re: upload

2024-08-01 Thread Henning Hraban Ramm

Am 31.07.24 um 19:55 schrieb Hans Hagen via ntg-context:

Hi,

end of the month update:

- we are still working on the math manual so updates there (we want the 
manual to stable for the upcoming meeting)


- we also work on the export (some changes and additions there but we 
will conver that plus some new tools later when we're done, read: are 
satisfied with what browsers can handle sort of well)


- wolfgang updated the setups (command definitions) so plenty of 
improvements and completion in there (he also did some quality assurance)


- all kind of small thingies (some to be introduced at the upcoming 
meeting were as usual we also discuss development and priorities)


- there are some new \setupalign options, like 'notwins', 'notoddlers' 
and 'noorphans' in case someone wants to be surprised


as usual when we run into unforseen issues we'll fix it,


I dared to update, since Hans’ & Mikael’s article for the journal 
required the latest version. (I wonder what \startimage is about…)


Being careful, I did a parallel install, but all looks good so far.

My book went from 490 to 484 pages, must investigate, might just be 
better paragraph/page/table breaking or something like that. Or is 
automatical nonsense-removal now included?


My usual TTC problem (all Cambria is Bold Cambria) didn’t show after 
installation of the distribution, but resurfaced after installing all 
modules. ("mtxrun --script font --reload --force" helped as usual.)


Hraban

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

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


[NTG-context] spreadsheet module

2024-07-20 Thread Henning Hraban Ramm
Hi, I checked the spreadsheet module for the first time (in my own 
invoices I do everything in Lua and don’t need it).


In the attached example, I setup a decimal comma, as usual in German:
\setupspreadsheet[rechnung][
period={,}, comma={\,}, split=yes]

Unfortunately, this also replaces all dots in the text strings.

Is there a workaround (beside using \getspr in a “real” table)?

Apparently, \startrow or \startcell don’t understand the period setting.

Hraban

spreadsheet.tex
Description: TeX 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: mtxrun error with script pattern

2024-07-15 Thread Marcus Vinicius Mesquita
Thank you, Hans

The file mtx-patterns.lua you sent solved the problem

Regards

Marcus Vinicius

On Mon, Jul 15, 2024 at 8:39 PM Hans Hagen  wrote:
>
> On 7/16/2024 1:00 AM, Marcus Vinicius Mesquita wrote:
> > Dear List
> >
> > When using:
> >
> > mtxrun --script pattern --convert --path=./source --destination=./patterns
> >
> > with the file hyph-pt.tex v. 1.4 proposed by Leo Araujo and Aline Benevides,
> > (see: 
> > https://github.com/hyphenation/tex-hyphen/pull/62/commits/79f4327c7c94c435cfcb73ea61c001a525fc818e)
> >
> > I got the following message:
> >
> > …
> > mtx-patterns| converting language pt, file hyph-pt
> > mtx-patterns| using tex file hyph-pt.txt
> > lua error : function call:
> > ...t/tex/texmf-context/scripts/context/lua/mtx-patterns.lua:331: bad
> > argument #1 to 'for iterator' (table expected, got string)
> >
> > I tried also using the old version 1.3 and got the same message.
> >
> > How can this error be corrected?
> > I'm using context version: 2024.06.21 23:45
> i'll send you a fix
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___



-- 
Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o
corpo nem seus membros, por ser descanso da alma, primavera do
coração, distração do aflito, entretenimento do solitário, e viático
do viajante.

Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik)
___
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: mtxrun error with script pattern

2024-07-15 Thread Hans Hagen

On 7/16/2024 1:00 AM, Marcus Vinicius Mesquita wrote:

Dear List

When using:

mtxrun --script pattern --convert --path=./source --destination=./patterns

with the file hyph-pt.tex v. 1.4 proposed by Leo Araujo and Aline Benevides,
(see: 
https://github.com/hyphenation/tex-hyphen/pull/62/commits/79f4327c7c94c435cfcb73ea61c001a525fc818e)

I got the following message:

…
mtx-patterns| converting language pt, file hyph-pt
mtx-patterns| using tex file hyph-pt.txt
lua error : function call:
...t/tex/texmf-context/scripts/context/lua/mtx-patterns.lua:331: bad
argument #1 to 'for iterator' (table expected, got string)

I tried also using the old version 1.3 and got the same message.

How can this error be corrected?
I'm using context version: 2024.06.21 23:45

i'll send you a fix


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

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

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


[NTG-context] mtxrun error with script pattern

2024-07-15 Thread Marcus Vinicius Mesquita
Dear List

When using:

mtxrun --script pattern --convert --path=./source --destination=./patterns

with the file hyph-pt.tex v. 1.4 proposed by Leo Araujo and Aline Benevides,
(see: 
https://github.com/hyphenation/tex-hyphen/pull/62/commits/79f4327c7c94c435cfcb73ea61c001a525fc818e)

I got the following message:

…
mtx-patterns| converting language pt, file hyph-pt
mtx-patterns| using tex file hyph-pt.txt
lua error : function call:
...t/tex/texmf-context/scripts/context/lua/mtx-patterns.lua:331: bad
argument #1 to 'for iterator' (table expected, got string)

I tried also using the old version 1.3 and got the same message.

How can this error be corrected?
I'm using context version: 2024.06.21 23:45

Kind regards

Marcus Vinicius


-- 
Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o
corpo nem seus membros, por ser descanso da alma, primavera do
coração, distração do aflito, entretenimento do solitário, e viático
do viajante.

Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik)
___
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 float split behavior

2024-07-10 Thread Henning Hraban Ramm

Am 17.06.24 um 18:36 schrieb Henning Hraban Ramm:

Table floats split in odd places, independent of top/page/here location.

There’s always a first part, then some not-float text, then the other 
parts.


Even if the table would fit on two pages (with location=page), it always 
gets split into three.


Can I influence this anyhow?


Hans explained in today’s online meeting:

The float location "split" cannot be combined with other locations 
(here, top, bottom, page). "split" alone is like "here"; for "page", use


\startpostponing
\startplacetable[location=split]
\bTABLE
% long table
\eTABLE
\stopplacetable
\stoppostponing

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

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


[NTG-context] Re: regular online meet-up

2024-07-10 Thread Henning Hraban Ramm

Reminder: this is tonight!


I have questions about …
* table floats (is there a solution or workaround for the odd splitting 
behavior?),
* consecutive environments (can we know if this is the first or last of 
its kind in a series?)

* and a few details for documentation.

Would like to show my current solution to typesetting messenger chats 
and discuss how to make it better.


CU Hraban


Am 04.07.24 um 20:25 schrieb Henning Hraban Ramm:

You’re invited to our regular online meet-up, this upcoming
Wednesday, July 10th, 19:00 CEST (UTC+2)

at https://lecture.senfcall.de/hen-rbr-rku-oke
(same, but shorter: https://u.mtxrun.eu/ctxmtg)

ConTeXt users of all levels are welcome!

Do you have a subject that you’d like to talk about?

Looking forward to seeing you,
Hraban


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

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


[NTG-context] Re: table float split behavior

2024-07-08 Thread vm via ntg-context




On 08/07/2024 16:25, Henning Hraban Ramm wrote:

Try #1, it often works where \recurselevel fails.


That gives the intended numbers.
Thank you

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

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


[NTG-context] Re: table float split behavior

2024-07-08 Thread Henning Hraban Ramm

Am 08.07.24 um 15:48 schrieb vm via ntg-context:

There is a reason that the \recurselevel do not work in this context;
all \recurselevel show up as zero


   {\bTABLE
    \dorecurse{100}{
    \bTR \bTD \recurselevel \eTD \bTD one \eTD \eTR
    \bTR \bTD two \eTD \bTD \recurselevel \eTD \eTR
    }
    \eTABLE}


Any hint?


Something about expansion and maybe buffers.

Try #1, it often works where \recurselevel fails.

Hraban

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

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


[NTG-context] Re: table float split behavior

2024-07-08 Thread Henning Hraban Ramm

Am 08.07.24 um 14:39 schrieb Bruce Horrocks:




On 7 Jul 2024, at 19:34, Henning Hraban Ramm  wrote:

Am 07.07.24 um 20:22 schrieb Bruce Horrocks:

On 7 Jul 2024, at 10:51, Henning Hraban Ramm  wrote:

Also, is it possible to have different captions in first and other parts?

This previous thread might help.
<https://www.mail-archive.com/ntg-context@ntg.nl/msg102641.html>


Thank you, but that doesn’t fit my use case: In my ConTeXt book, there are many 
long tables of parameters. The caption says “Parameters of \setupsomething”, 
but I’d also give hints like “You can also use the parameters of \setupframed, 
see p.123.”. I’d like to have these hints only in the first caption, and 
they’re different for each table.

It’s not that important, I can move the text somewhere else, but often enough 
in ConTeXt there are obscure features for advanced stuff.


If I understand you correctly then this does what you want. It's a bit of a 
hack though.

\defineselector [caption] [max=2]

\starttext

\setupfloatsplitting [inbetween={\setupselector[caption][n=2]}]

\setupselector[caption][n=1]
\placetable[split]
   {\select{caption}
 {Parameters of \type{\setupsomething}. You can also use the parameters of 
\type{\setupframes}, see page. 123}
 {Parameters of \type{\setupsomething}.}
   }
   {\bTABLE
\dorecurse{100}{
\bTR \bTD One \eTD \bTD two \eTD \eTR
\bTR \bTD One \eTD \bTD two \eTD \eTR
}
\eTABLE}

\stoptext


Thank you, that’s a good idea. (Another mechanism in ConTeXt that I 
didn’t know and need to document…)


Hraban

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

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


[NTG-context] Re: table float split behavior

2024-07-08 Thread vm via ntg-context




On 08/07/2024 14:39, Bruce Horrocks wrote:

\defineselector [caption] [max=2]

\starttext

\setupfloatsplitting [inbetween={\setupselector[caption][n=2]}]

\setupselector[caption][n=1]
\placetable[split]
   {\select{caption}
 {Parameters of \type{\setupsomething}. You can also use the parameters of 
\type{\setupframes}, see page. 123}
 {Parameters of \type{\setupsomething}.}
   }
   {\bTABLE
\dorecurse{100}{
\bTR \bTD One \eTD \bTD two \eTD \eTR
\bTR \bTD One \eTD \bTD two \eTD \eTR
}
\eTABLE}

\stoptext



There is a reason that the \recurselevel do not work in this context;
all \recurselevel show up as zero


  {\bTABLE
   \dorecurse{100}{
   \bTR \bTD \recurselevel \eTD \bTD one \eTD \eTR
   \bTR \bTD two \eTD \bTD \recurselevel \eTD \eTR
   }
   \eTABLE}


Any hint?

___
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 float split behavior

2024-07-08 Thread Bruce Horrocks


> On 7 Jul 2024, at 19:34, Henning Hraban Ramm  wrote:
> 
> Am 07.07.24 um 20:22 schrieb Bruce Horrocks:
>>> On 7 Jul 2024, at 10:51, Henning Hraban Ramm  wrote:
>>> 
>>> Also, is it possible to have different captions in first and other parts?
>> This previous thread might help.
>> <https://www.mail-archive.com/ntg-context@ntg.nl/msg102641.html>
> 
> Thank you, but that doesn’t fit my use case: In my ConTeXt book, there are 
> many long tables of parameters. The caption says “Parameters of 
> \setupsomething”, but I’d also give hints like “You can also use the 
> parameters of \setupframed, see p.123.”. I’d like to have these hints only in 
> the first caption, and they’re different for each table.
> 
> It’s not that important, I can move the text somewhere else, but often enough 
> in ConTeXt there are obscure features for advanced stuff.

If I understand you correctly then this does what you want. It's a bit of a 
hack though.

\defineselector [caption] [max=2]

\starttext

\setupfloatsplitting [inbetween={\setupselector[caption][n=2]}]

\setupselector[caption][n=1]
\placetable[split]
  {\select{caption}
{Parameters of \type{\setupsomething}. You can also use the parameters of 
\type{\setupframes}, see page. 123}
{Parameters of \type{\setupsomething}.}
  }
  {\bTABLE
   \dorecurse{100}{
   \bTR \bTD One \eTD \bTD two \eTD \eTR
   \bTR \bTD One \eTD \bTD two \eTD \eTR
}
\eTABLE}

\stoptext

—
Bruce Horrocks
Hampshire, UK

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

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


[NTG-context] Re: table float split behavior

2024-07-07 Thread Henning Hraban Ramm

Am 07.07.24 um 20:22 schrieb Bruce Horrocks:




On 7 Jul 2024, at 10:51, Henning Hraban Ramm  wrote:

Also, is it possible to have different captions in first and other parts?



This previous thread might help.
<https://www.mail-archive.com/ntg-context@ntg.nl/msg102641.html>


Thank you, but that doesn’t fit my use case: In my ConTeXt book, there 
are many long tables of parameters. The caption says “Parameters of 
\setupsomething”, but I’d also give hints like “You can also use the 
parameters of \setupframed, see p.123.”. I’d like to have these hints 
only in the first caption, and they’re different for each table.


It’s not that important, I can move the text somewhere else, but often 
enough in ConTeXt there are obscure features for advanced stuff.


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

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


[NTG-context] Re: table float split behavior

2024-07-07 Thread Bruce Horrocks


> On 7 Jul 2024, at 10:51, Henning Hraban Ramm  wrote:
> 
> Also, is it possible to have different captions in first and other parts?


This previous thread might help.


—
Bruce Horrocks
Hampshire, UK

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

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


[NTG-context] Re: table float split behavior

2024-07-07 Thread Henning Hraban Ramm

This is a long-time open issue. Am I the only one affected by this?

Also, \bTABLEfoot doesn’t repeat – I’d like to use it e.g for a line (rule).

Also, is it possible to have different captions in first and other parts?

Hraban

Am 17.06.24 um 18:36 schrieb Henning Hraban Ramm:

Table floats split in odd places, independent of top/page/here location.

There’s always a first part, then some not-float text, then the other 
parts.


Even if the table would fit on two pages (with location=page), it always 
gets split into three.


Can I influence this anyhow?

Hraban


\usemodule[visual]

\starttext

\samplefile{tufte}

\startplacetable[location={top,split},title=table split test]
\bTABLE%[setups=twoparamstable]
\bTABLEhead
\bTR\bTH One \eTH\bTH Two\eTH\bTH Three \eTH\eTR
\eTABLEhead
\bTABLEbody
\dorecurse{60}{%
\bTR\bTD #1\eTD\bTD \fakewords{1}{10}\eTD\bTD \fakewords{1}{10}\eTD\eTR
}
\eTABLEbody
\eTABLE
\stopplacetable

\samplefile{knuth}

\stoptext


___
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 Gerion Entrup
Am Dienstag, 2. Juli 2024, 00:17:36 MESZ schrieb 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

Thank you very much! That are a bunch of nice tricks. The setups environment is 
really powerful.
I will actively search for this keyword in the documentation next time.

Gerion





signature.asc
Description: This is a digitally signed message part.
___
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] How to specify a default formatting for TABLE

2024-07-01 Thread Gerion Entrup
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:
```
\setupTABLE[frame=off, offset=2pt]
\setupTABLE[row][first][topframe=on, bottomframe=on, style=bf]
\setupTABLE[row][last][bottomframe=on]
\setupTABLE[row][even][background=color,backgroundcolor=red]

\setupcolors[state=start]

\starttext

A table:\\
\bTABLE
\bTR \bTD head1 \eTD \bTD head2 \eTD \eTR
\bTR \bTD data1 \eTD \bTD data2 \eTD \eTR
\bTR \bTD data3 \eTD \bTD data4 \eTD \eTR
\eTABLE
\blank[line]

Another table with the same format:\\
\bTABLE
\bTR \bTD head1 \eTD \bTD head2 \eTD \eTR
\bTR \bTD data1 \eTD \bTD data2 \eTD \eTR
\bTR \bTD data3 \eTD \bTD data4 \eTD \eTR
\eTABLE
\blank[line]

This table should be formatted in another way (actually not formatted):\\
\bTABLE
\setupTABLE[row][each][topframe=off, bottomframe=off, style=, 
background=]
\bTR \bTD head1 \eTD \bTD head2 \eTD \eTR
\bTR \bTD data1 \eTD \bTD data2 \eTD \eTR
\bTR \bTD data3 \eTD \bTD data4 \eTD \eTR
\eTABLE
\blank[line]

This does not work either:\\
{
\setupTABLE[row][each][topframe=off, bottomframe=off, style=, background=]
% \setupTABLE[row][1,2,3][topframe=off, bottomframe=off, style=, background=] % 
this deactivates the color at least
\bTABLE
\bTR \bTD head1 \eTD \bTD head2 \eTD \eTR
\bTR \bTD data1 \eTD \bTD data2 \eTD \eTR
\bTR \bTD data3 \eTD \bTD data4 \eTD \eTR
\eTABLE
}

\stoptext
```

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.

Gerion

signature.asc
Description: This is a digitally signed message part.
___
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: Inconsistencies with fonts/c2sc feature

2024-06-25 Thread Pablo Rodriguez via ntg-context
On 6/25/24 19:53, Kirill Davidov wrote:
> Yeah, I too checked it out of curiosity today, and yeah, the c2sc table
> doesn't have the Latin entries. I suppose I will stick to a different
> styling or go after the caps manually/with Lua. The "always" and "auto"
> values help too, so thanks to you both!

Hi Kirill,

this font feature may work too:

\startluacode
fonts.handlers.otf.addfeature {
name = "addedsc",
type = "substitution",
data = {
A = "A.sc",
B = "B.sc",
C = "C.sc",
D = "D.sc",
E = "E.sc",
F = "F.sc",
G = "G.sc",
H = "H.sc",
I = "I.sc",
J = "J.sc",
K = "K.sc",
L = "L.sc",
M = "M.sc",
N = "N.sc",
O = "O.sc",
P = "P.sc",
Q = "Q.sc",
R = "R.sc",
S = "S.sc",
T = "T.sc",
U = "U.sc",
V = "V.sc",
W = "W.sc",
X = "X.sc",
Y = "Y.sc",
Z = "Z.sc",
},
}
\stopluacode

\definefontfeature[allsc][c2sc=yes, smcp=yes,
addedsc=yes]

But in that case, you may have c2sc and addedsc as mutually exclusive.

Just in case it might help,

Pablo

___
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: Inconsistencies with fonts/c2sc feature

2024-06-25 Thread Kirill Davidov
Yeah, I too checked it out of curiosity today, and yeah, the c2sc table
doesn't have the Latin entries. I suppose I will stick to a different
styling or go after the caps manually/with Lua. The "always" and "auto"
values help too, so thanks to you both!

Kirill
___
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-21 Thread Ulrike Fischer
Am Thu, 20 Jun 2024 17:33:56 +0200 schrieb Pablo Rodriguez via
ntg-context:

> \setuptagging[state=start] is the culprit. "link" is the word displayed
> when links are hovered over.

well it would imho be better not to use that at all. Sorry but what
context is doing here is cheating. It claims to add a structure (and
probably manage to pass automated tests) but all StructElem with the
exception of links are role mapped to NonStruct and so are non
functional. Links miss the OBJR reference. Annotations only all have
as /Content a generic text (link) (which creates your hover effect).  

When I let Adobe+NVDA read a PDF tagged with LaTeX it recognize and
announces structures:

headinglevel 2  A section
text
table  with 2 rows and 2 columns  
row 1  column 1  header A
   column 2  header B
row 2  header A  column 1  data A
   header B  column 2  data B
out of table
linkhttps://www.example.com

I can navigate from one heading to the next and inside tables (and
when I hover a link the pop up is correct as we are setting the
right Contents value.)

If you do the same with a document tagged with context you only get
a large blob of text

A section textHeader AHeader B data Adata B
https://contextgarden.net

and no navigation at all. All the tagging in the file is useless, it
even actually harms because it makes user believe they get an
accessible PDF. 

Tagged, accessible PDF has a lot of shortcomings, especially when it
comes to complex documents and math, but for standard documents it
can do much better then what context is making out of it. 

 
-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___
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] table float split behavior

2024-06-17 Thread Henning Hraban Ramm

Table floats split in odd places, independent of top/page/here location.

There’s always a first part, then some not-float text, then the other parts.

Even if the table would fit on two pages (with location=page), it always 
gets split into three.


Can I influence this anyhow?

Hraban


\usemodule[visual]

\starttext

\samplefile{tufte}

\startplacetable[location={top,split},title=table split test]
\bTABLE%[setups=twoparamstable]
\bTABLEhead
\bTR\bTH One \eTH\bTH Two\eTH\bTH Three \eTH\eTR
\eTABLEhead
\bTABLEbody
\dorecurse{60}{%
\bTR\bTD #1\eTD\bTD \fakewords{1}{10}\eTD\bTD \fakewords{1}{10}\eTD\eTR
}
\eTABLEbody
\eTABLE
\stopplacetable

\samplefile{knuth}

\stoptext
___
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: Pocket Diary Photo Calendar: how to specify on which day the week begins?

2024-06-16 Thread Bruce Horrocks


> On 15 Jun 2024, at 22:20, Michael Guravage  wrote:
> 
> Bruce,
> 
> Yes, I remember encountering this problem. The two files you need are: 
> sun-MP.tex and moons-MP.tex. I don't recall where I found them so I've 
> attached them below. Drop them into their respective pocketdiary directories 
> Solar and Moonphase and run mtxrun --generate. 
> 
> Your suggestion of the Day key was the first thing I tried myself. 
> Unfortunately, it has no effect.
> 
> Thanks for thinking along.

The month table layout is hard-coded in line 515 of file t-pocketdiary.lua

The code that decides in which cell to put the '1' of the first day is 
calculated elsewhere and not passed as a parameter.

That rules out a simple fix - you'd need to add a "weekstart" or similar 
parameter and track/act on it in various parts of the code.

—
Bruce Horrocks
Hampshire, UK

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

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


[NTG-context] Re: x mark symbol and general symbol guide

2024-06-15 Thread Gerion Entrup
Am Samstag, 15. Juni 2024, 12:19:37 MESZ schrieb Hans Hagen:
> On 6/15/2024 11:02 AM, Gerion Entrup wrote:
> > Am Freitag, 13. Oktober 2023, 14:33:24 MESZ schrieb Gerion Entrup:
> >> Hi,
> >>
> >> I recently tried to typeset a table with checkmarks and x marks.
> >> \checkmark exists but is there a predefined x mark symbol (\xmark does
> >> not work)?
> >>
> >> In general: For LaTeX there exists the very helpful comprehensive LaTeX 
> >> symbol list [1].
> >> Is there a similar documentation for ConTeXt somewhere?
> >>
> >> Best,
> >> Gerion
> >>
> >> [1] https://www.ctan.org/pkg/comprehensive
> >>
> > 
> > Just as an info. I'm using Noto symbols now:
> > ```
> > \definefont[symbolFont][name:notosanssymbols2regular*default at 11pt]
> > \define{\yes}{{\symbolFont\utfchar{0x1f5f8}}}
> > \define{\no}{{\symbolFont\utfchar{0x1f5f4}}}
> > 
> > \starttext
> > \yes and \no.
> > \stoptext
> fwiw: 1F5F8 looks pretty bad (in otf) (i checked as i though it was a 
> bug in lmtx)

Hmm, you are right, like a little frayed. 02713 and 02714 are similar.
I guess, this should look like they were drawn with a brush.

Gerion



signature.asc
Description: This is a digitally signed message part.
___
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] Pocket Diary Photo Calendar: how to specify on which day the week begins?

2024-06-15 Thread Michael Guravage
Hi,

I am trying to use the Pocket Diary
<https://ctan.org/pkg/context-pocketdiary> module to create a photo
calendar as described in the Calendar Examples
<https://ctan.org/pkg/context-calendar-examples>. The examples work fine.
By default weeks begin on Monday. Does anyone know how to specify that
weeks begin on Sunday? I have searched through all the setvariable
assignments, but nothing seems applicable.

I have attached an example file so you needn't retrieve all the examples.
Any help would be appreciated.

-- 
With kind regards,

Michael


<http://literatesolutions.com>
\usemodule[pocketdiary]

%D Choose and setup the font to be used
\setupbodyfont[ibmplex,ss,12pt]

% Supported languages: EN,DE,NL,FR,IT,ES
\mainlanguage[nl]

% Switch off the page numbering
\setuppagenumbering[location=]

% Setup the paper size
\setuppapersize[A4,portrait][A4,portrait]

% Adjust the layout of the page
\setuplayout
  [topspace=20mm,
  backspace=8.6mm,
  header=0pt,
  footer=0pt,
  height=middle,
  width=middle]

% Setup the path where to find the calendar pictures
\setupexternalfigures [directory={., ./graphics, ../graphics, ./MyPhotoDirectory}]
\setupexternalfigures [location={local,global,default}]

\def\testimage {cow} % dolly.png
% Give pictures symbolic names for using in a loop
\useexternalfigure [1] [\testimage]
\useexternalfigure [2] [\testimage]
\useexternalfigure [3] [\testimage]
\useexternalfigure [4] [\testimage]
\useexternalfigure [5] [\testimage]
\useexternalfigure [6] [\testimage]
\useexternalfigure [7] [\testimage]
\useexternalfigure [8] [\testimage]
\useexternalfigure [9] [\testimage]
\useexternalfigure [10] [\testimage]
\useexternalfigure [11] [\testimage]
\useexternalfigure [12] [\testimage]
\useexternalfigure [13] [\testimage]

% Setup the variables for the Pocket diary, only year is used for the calculations.
\setvariables
  [PocketDiary]
  [Year=2025]

% Let the header and the footer be empty:
\setupheadertexts[][]
\setupfootertexts[][]

% Add some label texts for the international interfaces:
\setuplabeltext[en][fotocal={Photo Calendar}]
\setuplabeltext[nl][fotocal=Fotokalender]
\setuplabeltext[de][fotocal=Fotokalender]
\setuplabeltext[fr][fotocal={Calendrier photo}]
\setuplabeltext[it][fotocal={Calendario fotografico}]
\setuplabeltext[es][fotocal={Calendario fotográfico}]

%D Let lua is perform the magic:
\startluacode
  local report = logs.reporter("Photo calendar")

  function thirddata.calendar.Photo_calendar_page(y)

report("Working in function: calendar.Foto_calendar_page")

local year = y
--local path = file.dirname("./Fotokalender-fotos/")
for i = 1,12 do

  local monthname = string.lower(os.date("%B",
os.time{year=year,month=i,day=1}))

  context.startplacefigure({number="",title=""})
 context.externalfigure({i}, {width = "0.8\\textwidth"})
  context.stopplacefigure()
  context.strut()
  context("\\vfill")
  context.startalign({"middle"})
context("\\bfa")
context.labeltext(monthname)
context("~")
context(year)
  context.stopalign()
  context.blank()

  thirddata.diary.monthtableH(i,year)

  context.page()
end
  end
\stopluacode


% Setup of the month table
\startsetups table:month
   \setupTABLE[c]
  [each]
  [width=\dimexpr\textwidth/7,
   frame=on,
   style=\tfa]
   \setupTABLE[r][each][height=1.8\lineheight,align={center,lohi}]
   \setupTABLE[c][7][foregroundcolor=red]
\stopsetups

% Define the macro for calling lua
\define[1]\Photocalendarpages
  {\ctxlua{thirddata.calendar.Photo_calendar_page(#1)}}

% Setup the \TEX\ side of the document
\starttext

  % Add a title page
  \startstandardmakeup[page=yes,doublesided=yes]
\startplacefigure
  [location=middle,
   title=,
   number=]
  {\externalfigure[13][width=\paperwidth]}
\stopplacefigure
\midaligned{\bfc \labeltext{fotocal}~\getvariable{PocketDiary}{Year}}
  \stopstandardmakeup

  % Call the defined macro
  \Photocalendarpages{\getvariable{PocketDiary}{Year}}

\stoptext
___
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: x mark symbol and general symbol guide

2024-06-15 Thread Hans Hagen

On 6/15/2024 11:02 AM, Gerion Entrup wrote:

Am Freitag, 13. Oktober 2023, 14:33:24 MESZ schrieb Gerion Entrup:

Hi,

I recently tried to typeset a table with checkmarks and x marks.
\checkmark exists but is there a predefined x mark symbol (\xmark does
not work)?

In general: For LaTeX there exists the very helpful comprehensive LaTeX symbol 
list [1].
Is there a similar documentation for ConTeXt somewhere?

Best,
Gerion

[1] https://www.ctan.org/pkg/comprehensive



Just as an info. I'm using Noto symbols now:
```
\definefont[symbolFont][name:notosanssymbols2regular*default at 11pt]
\define{\yes}{{\symbolFont\utfchar{0x1f5f8}}}
\define{\no}{{\symbolFont\utfchar{0x1f5f4}}}

\starttext
\yes and \no.
\stoptext
fwiw: 1F5F8 looks pretty bad (in otf) (i checked as i though it was a 
bug in lmtx)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

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

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


[NTG-context] Re: x mark symbol and general symbol guide

2024-06-15 Thread Gerion Entrup
Am Freitag, 13. Oktober 2023, 14:33:24 MESZ schrieb Gerion Entrup:
> Hi,
> 
> I recently tried to typeset a table with checkmarks and x marks.
> \checkmark exists but is there a predefined x mark symbol (\xmark does
> not work)?
> 
> In general: For LaTeX there exists the very helpful comprehensive LaTeX 
> symbol list [1].
> Is there a similar documentation for ConTeXt somewhere?
> 
> Best,
> Gerion
> 
> [1] https://www.ctan.org/pkg/comprehensive
> 

Just as an info. I'm using Noto symbols now:
```
\definefont[symbolFont][name:notosanssymbols2regular*default at 11pt]
\define{\yes}{{\symbolFont\utfchar{0x1f5f8}}}
\define{\no}{{\symbolFont\utfchar{0x1f5f4}}}

\starttext
\yes and \no.
\stoptext
```


signature.asc
Description: This is a digitally signed message part.
___
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: Cite-proc Lua - Following up

2024-06-12 Thread Max Chernoff
Hi,

On Tue, 2024-06-11 at 11:38 +, hdanielhix...@gmail.com wrote:
> There is a LaTeX package called citation-style-language, backed by
> some software called citeproc-lua. The github page for the software is
> here: https://github.com/zepinglee/citeproc-lua

> I'm just wondering if there is more news about its potential
> integration with Context.

A *very* quick and hacky implementation. First, clone the repository
plus all its submodules, then apply two small patches for Lua 5.5
compatibility:

diff --git a/citeproc/citeproc-latex-core.lua 
b/citeproc/citeproc-latex-core.lua
index 3057c5d..95c917a 100644
--- a/citeproc/citeproc-latex-core.lua
+++ b/citeproc/citeproc-latex-core.lua
@@ -260,6 +260,7 @@ end
 local function parse_latex_seq(s)
   local t = {}
   for item in string.gmatch(s, "(%b{})") do
+local item = item
 item = string.sub(item, 2, -2)
 table.insert(t, item)
   end

diff --git a/luaxml-mod-xml.lua b/luaxml-mod-xml.lua
index d40b761..bf09830 100644
--- a/luaxml-mod-xml.lua
+++ b/luaxml-mod-xml.lua
@@ -524,6 +524,7 @@ local function getAttributes(k,v)
   level = level or 0
   local spaces = string.rep(' ', level*2)
   for k,v in pairs(tb) do
+local k = k
 if type(v) ~= "table" then
   local ct = k
   if type(k)=="number" then

Then, install all the files somewhere where ConTeXt can find them. The
following layout seems to work:

$ tree -a $TEXMFHOME
/home/max/Projects/citeproc-lua/texmf/
├── scripts
│   ├── citation-style-language -> ../../citeproc/
│   └── lua-uca -> ../../submodules/lua-uca/src/lua-uca/
└── tex
├── generic
│   └── unicode-data -> ../../../submodules/unicode-data/
├── latex
│   └── citation-style-language -> ../../../latex/
└── luatex
├── lua-uni-algos -> ../../../submodules/lua-uni-algos/
└── luaxml -> ../../../submodules/luaxml/

12 directories, 0 files

Finally, make a new file somewhere in the "examples/" folder with the
following contents:

\startluacode
package.loaded.unicode = { utf8 = string }
package.loaded.lualibs = {}
kpse.find_file = function(name)
local path = resolvers.findfile(name)
if path == "" then
path = nil
end
return path
end

local saved_require = require
function require(name)
return saved_require(name:gsub("^[^%.]+%.", ""))
end

require("util-jsn")

local output = require("citeproc-output")
local ConTeXtWriter = output.LatexWriter

ConTeXtWriter.markups = {
["bibstart"] = [[\startitemize]],
["bibend"] = [[\stopitemize]],
["@font-style/normal"] = [[\normal{%s}]],
["@font-style/italic"] = [[\italic{%s}]],
["@font-style/oblique"] = [[\slanted{%s}]],
["@font-variant/normal"] = "[[\normal{%s}]]",
["@font-variant/small-caps"] = [[{\sc %s}]],
["@font-weight/normal"] = "[[\normal{%s}]]",
["@font-weight/bold"] = [[\bold{%s}]],
["@font-weight/light"] = "[[\normal{%s}]]",
["@text-decoration/none"] = false,
["@text-decoration/underline"] = [[\underline{%s}]],
["@vertical-align/sup"] = [[\high{%s}]],
["@vertical-align/sub"] = [[\low{%s}]],
["@vertical-align/baseline"] = false,
["@cite/entry"] = false,
["@bibliography/entry"] = [[\item %s]] .. "\n"
}

function ConTeXtWriter:write_escaped(str, context)
return string.formatters["%!tex!"](str)
end

function ConTeXtWriter:write_link(inline, context)
if inline.href == inline.value then
-- URL
return string.format([[\hyphenatedurl{%s}]], inline.value)
elseif context.engine.opt.wrap_url_and_doi then
return string.format([=[\goto{\hyphenatedurl{%s}}[url(%s)]]=], 
inline.href, self:write_escaped(inline.value, context))
else
return self:write_escaped(inline.value, context)
end
end

local engine
interfaces.implement {
name = "cslinit",
public = true,
arguments = "2 strings",
actions = function(style_name, bib_file)
local citeproc = require("citeproc")
local latex_core = require("citepr

[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: After using a custom command in the title, the table of contents is not generated properly

2024-06-05 Thread ai2472206007
I was careless. thank you
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: After using a custom command in the title, the table of contents is not generated properly

2024-06-05 Thread Henning Hraban Ramm

Am 05.06.24 um 16:03 schrieb ai2472206...@yeah.net:

As described, here is example:

%
\def\cmd#1{{\tt\textslash #1}}
\def\cmdii#1{\tt #1}
\def\cmdiii#1{\rm #1}

\starttext

\placecontent% if i dont place toc command , ConText can render it.

\chapter{anything else}
\section{\cmdi{with command} section}
\section{\cmdii{with command} section}
\section{\cmdiii{with command} section}
\section{{\rm with command} section} % only this one work well

\stoptext


Am I missing something important? If so, please tell me what to do. Thank you 
so much.


What do you mean with “not properly”?

\cmdi is not defined
Only \cmd has the necessary additional braces to contain the style switch.
But I don’t know if that’s your problem.

Hraban

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

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


[NTG-context] After using a custom command in the title, the table of contents is not generated properly

2024-06-05 Thread ai2472206007
As described, here is example:

%
\def\cmd#1{{\tt\textslash #1}}
\def\cmdii#1{\tt #1}
\def\cmdiii#1{\rm #1}

\starttext

\placecontent% if i dont place toc command , ConText can render it.

\chapter{anything else}
\section{\cmdi{with command} section}
\section{\cmdii{with command} section}
\section{\cmdiii{with command} section}
\section{{\rm with command} section} % only this one work well

\stoptext


Am I missing something important? If so, please tell me what to do. Thank you 
so much.

Muyik
___
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: setuphead in connection with the command argument

2024-06-01 Thread Wolfgang Schuster

Gerion Entrup schrieb am 31.05.2024 um 00:37:

Am Donnerstag, 30. Mai 2024, 22:54:47 MESZ schrieb Wolfgang Schuster:

Gerion Entrup schrieb am 30.05.2024 um 16:25:

The chapter format that I want to achieve in the end is nearly the one in the 
attachment (excerpt of Christian Dietrich's PhD thesis).


When you have a complex layout it is easier to use the
\defineheadalternative command to create it.

To change the font for each element disable the default settings with
\setuphead[style=] and use \startfont (or \definedfont) to apply a
different style for the number, title etc.

 begin example
[...]
 end example


Thank you very much! That looks really clean. I will add it to the wiki.

Can you bring some clarification regarding "style=", "command=" and 
"alternative="?


1. Alternatives are the different styles/layouts for the section titles.

The example below demonstrates a few of them and you can create your own 
styles with \defineheadalternative. The command key provides a different 
method to create your own style/layout and in most cases it doesn't 
mattter which method you use, only when you want an inline title like 
"alternative=text" you need \defineheadalternative because it allows you 
to set a few flags which are needed here.


The biggest difference between both is that command uses arguments to 
place the number (#1) and title (#2) while headalternative use the two 
macros \headnumbercontent and \headtextcontent.


 begin example
\starttext

% \setuphead[section][alternative=normal] % default alternative

\section{Lorem ipsum}
\samplefile{lorem}

\page \setuphead[section][alternative=text]

\section{Lorem ipsum}
\samplefile{lorem}

\page \setuphead[section][alternative=middle]

\section{Lorem ipsum}
\samplefile{lorem}

\page \setuphead[section][alternative=margin]

\section{Lorem ipsum}
\samplefile{lorem}

\stoptext
 end example

2. The "style" key is used to set a custom font/style for all elements 
of the section, when you set an empty value the title uses the current 
style of the document.


You can also apply different styles to the number and title with the two 
key "numberstyle" and "titlestyle", the resulting effect is a 
combination of the general "style" value and the special "numberstyle" 
or "titlestyle" value.


Below are few examples where I use a few combinations of the general and 
special settings.


 begin example
\starttext

\section{Lorem ipsum}
\samplefile{lorem}

\page \setuphead[section][style=\bfc]

\section{Lorem ipsum}
\samplefile{lorem}

\page 
\setuphead[section][style=\tfa,textstyle=\bf,numberstyle={\feature[+][oldstyle]}]


\section{Lorem ipsum}
\samplefile{lorem}

\page 
\setuphead[section][style={\switchtobodyfont[heros]\tfa},textstyle=,numberstyle=]


\section{Lorem ipsum}
\samplefile{lorem}

\stoptext
 end example


What, if I define multiple of them? Is the system not made for this?


Multiple of what?


I just tested my initial example regarding font size with `command=\MyChapter, 
style=` and the font size was only affected by the code of \MyChapter.
What is the default style?


The default style is whatever you set with \setupbofyfont at the begin 
of the document. To get the default settings for \chapter etc. you can 
use the \showinstancevalues which creates a table which prints the values.


 begin example
\usemodule[setups]

\starttext
\showinstancevalues[head][chapter]
\showrootvalues[head]
\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: Number in a circle

2024-05-30 Thread Henning Hraban Ramm

Am 28.05.24 um 23:49 schrieb Kip Warner:

On Tue, 2024-05-28 at 08:17 +0200, Henning Hraban Ramm wrote:

Am 27.05.24 um 19:20 schrieb Kip Warner:



You could just define a fallback font, like:

\definefontfallback[SymbolFB]
    [file:symbola.otf]
    [0x00300-0x003FF,0x02100-0x02800,0x1F000-0x2] % look up the
right
Unicode ranges!
    [check=no,force=no]

\definetypeface [myfonts] [rm] [serif] [times] [default]
[fallbacks=SymbolFB]

And then copy the character from a symbol table, no need for a macro.


Hmm, that's a great idea. But I can't seem to get a minimal to work
with https://context-on-web.eu:

\definefontfallback[SymbolFB]
   [file:symbola.otf]
   [0x00300-0x003FF,0x02100-0x02800,0x1F000-0x2] % look up the
right
Unicode ranges!
   [check=no,force=no]

\definetypeface [myfonts] [rm] [serif] [times] [default]

[fallbacks=SymbolFB]

\starttext

\utfchar{0x02460}
\stoptext

The above just prints the vanilla character '1'. That might be because
the online editor doesn't have access to the font. So I tried compiling
the above locally with the Symbola.otf file in the same directory and
same problem.



My example wasn’t complete, and so is yours. You just define that 
typeface but never use it.


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

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


[NTG-context] Re: Number in a circle

2024-05-28 Thread Kip Warner
On Tue, 2024-05-28 at 08:17 +0200, Henning Hraban Ramm wrote:
> Am 27.05.24 um 19:20 schrieb Kip Warner:
> > On Mon, 2024-05-27 at 07:09 +0200, Ryszard Kubiak wrote:
> > > Hi Kip,
> > > 
> > > You may try characters with Unicode slots from U+2460 upto
> > > U+2469.
> > > They mean circled digits and are available in many fonts.
> > 
> > Thanks Ryszard. Those would be perfect, except I can't get them to
> > work
> > in ConTeXt. I tried using the \utfchar{0x2460} but it just displays
> > the
> > number 1.
> > 
> > I am assuming it needs a font that supports it, but I'm not sure
> > how to
> > switch to a supporting font just to typeset that character and then
> > revert back. Is there some way to define a macro?
> 
> You could just define a fallback font, like:
> 
> \definefontfallback[SymbolFB]
>    [file:symbola.otf]
>    [0x00300-0x003FF,0x02100-0x02800,0x1F000-0x2] % look up the
> right 
> Unicode ranges!
>    [check=no,force=no]
> 
> \definetypeface [myfonts] [rm] [serif] [times] [default] 
> [fallbacks=SymbolFB]
> 
> And then copy the character from a symbol table, no need for a macro.

Hmm, that's a great idea. But I can't seem to get a minimal to work
with https://context-on-web.eu:

   \definefontfallback[SymbolFB]
  [file:symbola.otf]
  [0x00300-0x003FF,0x02100-0x02800,0x1F000-0x2] % look up the
   right
   Unicode ranges!
  [check=no,force=no]
   
   \definetypeface [myfonts] [rm] [serif] [times] [default]
   [fallbacks=SymbolFB]
   
   \starttext
   \utfchar{0x02460}
   \stoptext

The above just prints the vanilla character '1'. That might be because
the online editor doesn't have access to the font. So I tried compiling
the above locally with the Symbola.otf file in the same directory and
same problem.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


signature.asc
Description: This is a digitally signed message part
___
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: Number in a circle

2024-05-27 Thread Henning Hraban Ramm

Am 27.05.24 um 19:20 schrieb Kip Warner:

On Mon, 2024-05-27 at 07:09 +0200, Ryszard Kubiak wrote:

Hi Kip,

You may try characters with Unicode slots from U+2460 upto U+2469.
They mean circled digits and are available in many fonts.


Thanks Ryszard. Those would be perfect, except I can't get them to work
in ConTeXt. I tried using the \utfchar{0x2460} but it just displays the
number 1.

I am assuming it needs a font that supports it, but I'm not sure how to
switch to a supporting font just to typeset that character and then
revert back. Is there some way to define a macro?


You could just define a fallback font, like:

\definefontfallback[SymbolFB]
  [file:symbola.otf]
  [0x00300-0x003FF,0x02100-0x02800,0x1F000-0x2] % look up the right 
Unicode ranges!

  [check=no,force=no]

\definetypeface [myfonts] [rm] [serif] [times] [default] 
[fallbacks=SymbolFB]


And then copy the character from a symbol table, no need for a macro.

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

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


[NTG-context] Re: simplify side by side Poems

2024-05-24 Thread seyal . zavira
Thanks so much

i also could define poem structure like this:

Using table method: 
\protected\def\PoemStart#1\PoemStop
   {\bTABLE[setups=tablepoem]#1\eTABLE}
\protected\def\Beyt#1
   {\bTR #1 \eTR}
\protected\def\Misra#1
   {\bTD #1 \eTD}
   
\starttext
\PoemStart
\Beyt{\Misra{the first sentence}   \Misra{the second sentence}}
\Beyt{\Misra{the third sentence}   \Misra{the fourth sentence}}
\PoemStop
\stoptext

also it can be done with itemize(easier but less flexible):
\defineitemgroup[Mypoem]
\setupitemgroup[Mypoem][horizontal,two]

\protected\def\PoemStart#1\PoemStop
   {\startitemgroup[Mypoem]#1\stopitemgroup}
\protected\def\Misra#1
   {\startitem#1\stopitem}

\starttext
\PoemStart
\Misra{the first sentence}  \Misra{the second sentence}
\Misra{the third sentence}  \Misra{the fourth sentence}
\PoemStop
\stoptext

there is also another method by using buffers and lua code (part of the answer 
to my question on the stack site).
___
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: simplify side by side Poems

2024-05-23 Thread Wolfgang Schuster

seyal.zav...@gmail.com schrieb am 23.05.2024 um 18:59:

Thanks so much

but what should a person do if he wants to define an equivalent of \eTD?
for example it can be useful for RTL language
such as:
\def\پسل{\eTD}
and as you said this code will not work.


You can create your own replacement for the \bTD ... \eTD pair define a 
command which is delimited by another command. To do this you have to 
first create a new command like always as \def\... which takes a single 
argument and at the end after the argument you another command is used 
as delimiter for the argument.


The argument of your new delimited command is then passed to the normal 
commands for the table cell.


 begin example
\starttext

\protected\def\StartTableCell#1\StopTableCell
  {\bTD#1\eTD}

% New method to create delimited arguments with #L and #R in Luametatex
%
% \protected\def\StartTableCell#L\StartTableCell#R\StopTableCell#1%
%   {\bTD#1\eTD}

\bTABLE
  \bTR
\StartTableCell row 1 column 1 \StopTableCell
\StartTableCell row 1 column 2 \StopTableCell
  \eTR
  \bTR
\StartTableCell row 2 column 1 \StopTableCell
\StartTableCell row 2 column 2 \StopTableCell
  \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: simplify side by side Poems

2024-05-23 Thread Wolfgang Schuster

seyal.zav...@gmail.com schrieb am 23.05.2024 um 14:13:

Hi all,

i want to use tables for constructing poems structure
this snippet of code works well:

\startsetups tablepoem
\setupTABLE[column][each][width=5cm]
\stopsetups
\starttext
\bTABLE[setups=tablepoem]
\bTR \bTD One one ons ksl   \eTD \bTD  two gfjgfd oski kwo \eTD \eTR
\bTR \bTD One wer s dft tgf \eTD \bTD  two gfkdsjg dfs we  \eTD \eTR
\eTABLE
\stoptext

but when i use this code for simplifying of changing cells I get an error:

\startsetups tablepoem
\setupTABLE[column][each][width=5cm]
\stopsetups

\def\Poemstart{\bTABLE[setups=tablepoem] \bTR \bTD}
\def\Mesra{\eTD \bTD}
\def\nextBeyt{\eTD\eTR\bTR\bTD}
\def\Poemstop{\eTD\eTR\eTABLE}

\starttext
\Poemstart
One one ons ksl\Mesratwo gfjgfd oski kwo  \nextBeyt
One wer s dft tgf   \Mesratwo gfkdsjg dfs we
\Poemstop
\stoptext

what is the problem?


The table environment collects the content of the table cell-wise which 
means when TeX sees a \bTD in the input it reads the following text 
until it finds the corresponding \eTD. When you put the \eTD in the 
definition of another command the scanner will never find the end of a 
cell and you either run out of memory or reach the end of the file etc.


Below are a few alternative solutions to simplify the input, one of them 
is an alternative version of input (\startTABLE) for natural tables 
which uses the same commands to separate columns as tabulate does.


 begin example
\starttext

\startTABLE[width=5cm]
\NC One one ons ksl   \NC two gfjgfd oski kwo \NC\NR
\NC One wer s dft tgf \NC two gfkdsjg dfs we  \NC\NR
\stopTABLE

\starttabulate[|*{2}{k{0}lw(5cm)|}]
\NC One one ons ksl   \NC two gfjgfd oski kwo \NC\NR
\NC One wer s dft tgf \NC two gfkdsjg dfs we  \NC\NR
\stoptabulate

\defineparagraphs[poem][n=2,width=5cm]
\setupparagraphs[poem][each][width=5cm,distance=0pt]

\startpoem
  \startlines
  One one ons ksl
  One wer s dft tgf
  \stoplines
\nextpoem
  \startlines
  two gfjgfd oski kwo
  two gfkdsjg dfs we
  \stoplines
\stoppoem

\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: defining hashtag simulator

2024-05-19 Thread Hans Hagen

On 5/19/2024 5:40 AM, seyal.zav...@gmail.com wrote:

Hi all,

I want to define a command that simulate hashtag behavior in social networks,

In other words, this command should put the hashtag sign at the beginning of 
it, replace spaces with dashes and also it should be a clickable link and 
unbreakable world.
I mean like this, for example:
\myhashtag{hello world}
It should be displayed as #hello_world in the final PDF and when clicked it 
will search for #hello_world throughout the pdf
How is this possible?
One of the disppointments of pdf (some things indeed got worse over 
time) ...


"Table 215 — Named actions" lists several named actions (PDF 1.2) that 
interactive PDF processors

shall support; further names may be added in the future.
Table 215 — Named ac

Only a few were ever formal ok. Acrobat supports some more (at least 
did) but even on the


\goto{test}[action(search)]

one could not set a string. Adding a decent subset of commands is way 
easier than whatever came later to the standard. It's especially ironic 
in the perspective of accessibility.


However, if one could agree on a subset (as the standard is open) and 
open source viewers would support it ... but getting all on board is 
probably not possible).


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

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

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


[NTG-context] Re: Wiki - test/proposal to further clarify documentation

2024-05-18 Thread Bruce Horrocks
On 17 May 2024, at 21:40, garu...@azules.eu wrote:
> 
> I have tested on 2 pages :
> - https://wiki.contextgarden.net/Sciences (only mathematics part)
> - https://wiki.contextgarden.net/Fonts
> 
> After these tests, I think this may help users to find their way around the 
> various sources of documentation :
> In one small table he/she has an overview of the documentation for a given 
> topic,  :
> - the few key tutorials
> - link to one "main wiki page" about the topic
> - the few key manuals
> - the reference for commands

The fonts page is a lot better than before[1], IMHO. I would prefer the table 
were 90% width rather than 50 but that is minor.

So is the plan to go through each of the main headings in the left side-bar and 
make the same type of change?

> 
> I'm not sure I've selected the few documents that are considered by the 
> community as the key tutorials.
> Thanks for your feedback again.

I don't think that is a problem - the Wiki can be updated by others as long as 
the layout/structure of the page is clear so people know where to add links.

> PS : in order to benefit from mediawiki page organization features, I moved 
> some pages, for example
> wiki.contextgarden.net/blablabla
> ==> wiki.contextgarden.net/Topic/blablabla


[1] Previous style for reference: 
<https://web.archive.org/web/20231116125758/https://wiki.contextgarden.net/Fonts>
—
Bruce Horrocks
Hampshire, UK

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

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


[NTG-context] Re: Wiki - test/proposal to further clarify documentation

2024-05-17 Thread garulfo
I have tested on 2 pages :
- https://wiki.contextgarden.net/Sciences (only mathematics part)
- https://wiki.contextgarden.net/Fonts

After these tests, I think this may help users to find their way around the 
various sources of documentation :
In one small table he/she has an overview of the documentation for a given 
topic,  :
- the few key tutorials
- link to one "main wiki page" about the topic
- the few key manuals
- the reference for commands

I'm not sure I've selected the few documents that are considered by the 
community as the key tutorials.
Thanks for your feedback again.

PS : in order to benefit from mediawiki page organization features, I moved 
some pages, for example
wiki.contextgarden.net/blablabla
==> wiki.contextgarden.net/Topic/blablabla
___
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] Errors with 2024-05-11 LMTX

2024-05-12 Thread Rik Kabel
I have come across an error that halts processing with the latest 
release. The following demonstrates this:


   \setuppagenumbering [location=]

   \starttext

 \dorecurse{36}{\dorecurse{19}{abc }}

 \startplacetable[location=split,title={Table}]
    \starttabulate[|p|p|]
    \HL
    \NC Heading \crlf
    heading
    \NC Heading \crlf
    heading
    \NC\AR
    \HL
    \NC abc \crlf
    abc
    \NC abc
    \NC\AR
    \NC abc \crlf
    abc
    \NC abc
    \NC\AR
    \NC abc \crlf
    abc
    \NC abc
    \NC\AR
    \NC abc \crlf
    abc
    \NC abc
    \NC\AR
    \HL
    \stoptabulate
    \stopplacetable

   \stoptext

while this version ends with the error : error (nodes): attempt to 
double-free rule node 55342, ignored


   \setuppagenumbering [location=]
   \starttext

 \dorecurse{37}{\dorecurse{19}{abc }}

 \startplacetable[location=split,title={Table}]

    \starttabulate[|p|p|]
    \HL
    \NC Heading \crlf
    heading
    \NC Heading \crlf
    heading
    \NC\AR
    \HL
    \NC abc \NC abc \NC\AR
    \NC abc \NC abc \NC\AR
    \NC abc \NC abc \NC\AR
    \HL
    \stoptabulate

    \stopplacetable

   \stoptext

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

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


[NTG-context] Re: start/stopregister

2024-04-25 Thread Hans Hagen

On 4/25/2024 4:51 PM, Taco Hoekwater wrote:




On 25 Apr 2024, at 16:45, Thomas A. Schmitz  wrote:

On 4/25/24 16:13, Henning Hraban Ramm wrote:

I’m using it like
\startregister[index][bibliografie]{Bibliografie}
…
\stopregister[index][bibliografie]
i.e. very similar to your example, and can confirm it doesn’t result in a page 
range in the index. Also gives no error.


Since I've become an expert on tuc files since yesterday (ha!): if I compare the tuc from 
a mkiv and a mkxl run, I see that mkiv produces an entry ["lastrealpage"]=9 in 
the references table, mkxl doesn't. This appears to be the relevant bit, and it is 
connected with the replacement of realpageno by c_realpageno in line 638 of strc-reg.lmt

references.lastrealpage = texgetcount(c_realpageno)


Let's seen if we can make Thomas more of an expert as he's zooming in on 
the issue:


extendregister {
metadata   = { name =  name },
references = { abel =  label },
}

Let me know if you't see it.


Possibly related: I noticed last week that mkxl does not update the legacy 
counter \pageno any more for every page.

i'll check it

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

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

maillist : ntg-context@ntg.nl / 
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: start/stopregister

2024-04-25 Thread Taco Hoekwater


> On 25 Apr 2024, at 16:45, Thomas A. Schmitz  
> wrote:
> 
> On 4/25/24 16:13, Henning Hraban Ramm wrote:
>> I’m using it like
>> \startregister[index][bibliografie]{Bibliografie}
>> …
>> \stopregister[index][bibliografie]
>> i.e. very similar to your example, and can confirm it doesn’t result in a 
>> page range in the index. Also gives no error.
> 
> Since I've become an expert on tuc files since yesterday (ha!): if I compare 
> the tuc from a mkiv and a mkxl run, I see that mkiv produces an entry 
> ["lastrealpage"]=9 in the references table, mkxl doesn't. This appears to be 
> the relevant bit, and it is connected with the replacement of realpageno by 
> c_realpageno in line 638 of strc-reg.lmt
> 
> references.lastrealpage = texgetcount(c_realpageno)

Possibly related: I noticed last week that mkxl does not update the legacy 
counter \pageno any more for every page.

Best wishes,
Taco

— 
Taco Hoekwater  E: t...@bittext.nl
genderfluid (all pronouns)


___
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: start/stopregister

2024-04-25 Thread Thomas A. Schmitz

On 4/25/24 16:13, Henning Hraban Ramm wrote:

I’m using it like

\startregister[index][bibliografie]{Bibliografie}
…
\stopregister[index][bibliografie]

i.e. very similar to your example, and can confirm it doesn’t result in 
a page range in the index. Also gives no error.


Since I've become an expert on tuc files since yesterday (ha!): if I 
compare the tuc from a mkiv and a mkxl run, I see that mkiv produces an 
entry ["lastrealpage"]=9 in the references table, mkxl doesn't. This 
appears to be the relevant bit, and it is connected with the replacement 
of realpageno by c_realpageno in line 638 of strc-reg.lmt


references.lastrealpage = texgetcount(c_realpageno)

But that's as far as I could get...

Thomas
___
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: which parameter is for adjust the distance between items in a list?

2024-04-25 Thread hf
You are right. I shall change the parameter `inbetween` in `\setupitemize`.

Regards,
Hong


April 25, 2024 at 4:54 PM, "Henning Hraban Ramm"  wrote:

> Am 25.04.24 um 10:46 schrieb h...@hongfeng.ch:
> 
>> thank you.
>> 
>> just tried, not worked out yet.
>> 
>> Here it is my text:
>> 
>> ```
>> 
>> setuplist[height=0]
>> 
>> \startitemize[n]
>> 
>> \item It's impossible --- don't waste my time.
>> 
>> \item It's possible, but not worth doing.
>> 
>> \item I said it was a good ideal all along.
>> 
>> \stopitemize
>> 
>> ```
>> 
>> Now the distance between the items is equal to the blank space between 
>> paragraphs.
>> 
>> I want to reduce it equal to the distance between the lines of a paragraph.
> 
> You asked for a list, that is e.g. a table of contents (list of numbered 
> items like sections or 
> floats).
> 
> If you want to affect itemizations, use \setupitemize (same as 
> \setupitemgroup[itemize]).
> 
> https://wiki.contextgarden.net/Command/_setupitemgroup
> 
> Besides, height is a different parameter.
> 
> Hraban
> 
> ___
> 
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> 
> webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> 
> archive : https://github.com/contextgarden/context
> 
> wiki : https://wiki.contextgarden.net
> 
> ___
___
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: which parameter is for adjust the distance between items in a list?

2024-04-25 Thread Henning Hraban Ramm

Am 25.04.24 um 10:46 schrieb h...@hongfeng.ch:

thank you.

just tried, not worked out yet.

Here it is my text:

```
setuplist[height=0]
\startitemize[n]
\item It's impossible --- don't waste my time.
\item It's possible, but not worth doing.
\item I said it was a good ideal all along.
\stopitemize
```

Now the distance between the items is equal to the blank space between 
paragraphs.
I want to reduce it equal to the distance between the lines of a paragraph.


You asked for a list, that is e.g. a table of contents (list of numbered 
items like sections or floats).


If you want to affect itemizations, use \setupitemize (same as 
\setupitemgroup[itemize]).

https://wiki.contextgarden.net/Command/_setupitemgroup

Besides, height is a different parameter.

Hraban

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

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


[NTG-context] Re: documentation: parameters of \setuplist

2024-04-22 Thread Henning Hraban Ramm

Am 22.04.24 um 18:30 schrieb Duncan Hothersall:

Hi Hraban,

I can help with one - aligntitle means an unnumbered section will align 
in the table of contents under the number rather than the title. So for 
example if you have a TOC combining \section and \subject entries, they 
would look like this:


1 ... A section
A subject

rather than

1 ... A section
.. A subject


Thank you! I added it in the wiki.

Hraban

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

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


[NTG-context] Re: documentation: parameters of \setuplist

2024-04-22 Thread Duncan Hothersall
Hi Hraban,

I can help with one - aligntitle means an unnumbered section will align in
the table of contents under the number rather than the title. So for
example if you have a TOC combining \section and \subject entries, they
would look like this:

1 ... A section
A subject

rather than

1 ... A section
.. A subject

Duncan

On Mon, 22 Apr 2024 at 17:09, Henning Hraban Ramm  wrote:

> I tried to complete https://wiki.contextgarden.net/Command/setuplist,
> but I don’t understand all parameters.
>
> Can anyone explain these please:
>
> * state (start stop): what does this en-/disable? collecting entries?
> * label (yes no none Name): language dependent labels? as a prefix or what?
> * location (none, here): disable placement? when makes this sense?
> * aligntitle (yes no): align which part to what?
> * symbol (one two three none default): where is this used?
>
>
> Expect more questions…
>
> Hraban
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___
>
___
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: minwidth not working ?

2024-04-22 Thread Denis Maier via ntg-context
> -Ursprüngliche Nachricht-
> Von: Wolfgang Schuster 
> Gesendet: Samstag, 20. April 2024 11:56
> An: Denis Maier 
> Cc: mailing list for ConTeXt users ; denis.ma...@unibe.ch
> Betreff: Re: [NTG-context] Re: minwidth not working ?
> 
> Denis Maier schrieb am 19.04.2024 um 22:55:
> 
> >> Wolfgang Schuster  hat am
> >> 19.04.2024 20:32 CEST geschrieben:
> >> denis.ma...@unibe.ch schrieb am 10.04.2024 um 12:47:
> >>>
> >>> Hi,
> >>>
> >>> Shouldn’t minwidth set a default minimal width for external figures?
> >>> But this here does not work
> >>>
> >>> [...]
> >>>
> >>> Am I missing something here?
> >>
> >> There are no minwidth/minheight values for \externalfigure.
> >>
> >> Wolfgang
> >>
> > So the wiki is wrong here?
> > https://wiki.contextgarden.net/Command/setupexternalfigure
> 
> Yes the comment at the end of page is wrong and the text about the strut
> setting can also be removed, only the orientation value is missing in the
> command table.
> 
> Wolfgang

Thanks you for the clarification, Wolfgang. I've changed the wiki page.
Best,
Denis

___
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: minwidth not working ?

2024-04-20 Thread Wolfgang Schuster

Denis Maier schrieb am 19.04.2024 um 22:55:

Wolfgang Schuster  hat am 
19.04.2024 20:32 CEST geschrieben:

denis.ma...@unibe.ch schrieb am 10.04.2024 um 12:47:


Hi,

Shouldn’t minwidth set a default minimal width for external figures? 
But this here does not work


[...]

Am I missing something here?


There are no minwidth/minheight values for \externalfigure.

Wolfgang

So the wiki is wrong here? 
https://wiki.contextgarden.net/Command/setupexternalfigure


Yes the comment at the end of page is wrong and the text about the strut 
setting can also be removed, only the orientation value is missing in 
the command table.


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 isolate serious errors from warnings?

2024-04-19 Thread Hans Hagen

On 4/18/2024 8:26 AM, Henning Hraban Ramm wrote:

Am 18.04.24 um 02:09 schrieb Joel via ntg-context:
I'm about to have a lengthy (2,000+ page) document published. Normally 
if it compiles and looks okay, I regard that as meaning no errors 
appeared, but I've noticed that sometimes ConTeXt will still compile, 
even if something isn't displayed on screen as it should:


(1) I tried placing a table inside a startitemize environment, as 
instead of it not compiling, it left a message in the document warning 
that wasn't supported.


(2) In another case, I had an image that ConTeXt couldn't find, as I 
mispelled the filenmame, and it fully compiled and made a PDF, without 
me noticing.


(3) Or maybe in some case, a font couldn't be found for a specific 
character, so a single character in the file isn't displaying.


Those are just some examples; I intended for something to be printed 
on the PDF, but it isn't showing there.


Since a document of this size will have a lot of messages, is there a 
way to adjust the settings, from "show everything" to "show some" to 
"show only serious errors"? Or maybe to use > to send the errors to 
another file for careful study? (using Linux if that matters)


You can enable trackers like

\enabletrackers[figures.*]

But that just gives more log messages for debugging.

You get the list of all trackers with:

context --global m-trackers.mkiv


For your use case, directives are more helpful, like

\enabledirectives[logs.errors=*] (i.e. break at every error)

AFAIK that just handles missing characters, references and modules ATM, 
but this information might be outdated.


You get all directives with

context --global m-directives.mkiv


often the log files has some summaries at the end



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

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

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


[NTG-context] Re: How to isolate serious errors from warnings?

2024-04-17 Thread Henning Hraban Ramm

Am 18.04.24 um 02:09 schrieb Joel via ntg-context:
I'm about to have a lengthy (2,000+ page) document published. Normally 
if it compiles and looks okay, I regard that as meaning no errors 
appeared, but I've noticed that sometimes ConTeXt will still compile, 
even if something isn't displayed on screen as it should:


(1) I tried placing a table inside a startitemize environment, as 
instead of it not compiling, it left a message in the document warning 
that wasn't supported.


(2) In another case, I had an image that ConTeXt couldn't find, as I 
mispelled the filenmame, and it fully compiled and made a PDF, without 
me noticing.


(3) Or maybe in some case, a font couldn't be found for a specific 
character, so a single character in the file isn't displaying.


Those are just some examples; I intended for something to be printed on 
the PDF, but it isn't showing there.


Since a document of this size will have a lot of messages, is there a 
way to adjust the settings, from "show everything" to "show some" to 
"show only serious errors"? Or maybe to use > to send the errors to 
another file for careful study? (using Linux if that matters)


You can enable trackers like

\enabletrackers[figures.*]

But that just gives more log messages for debugging.

You get the list of all trackers with:

context --global m-trackers.mkiv


For your use case, directives are more helpful, like

\enabledirectives[logs.errors=*] (i.e. break at every error)

AFAIK that just handles missing characters, references and modules ATM, 
but this information might be outdated.


You get all directives with

context --global m-directives.mkiv


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

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


[NTG-context] How to isolate serious errors from warnings?

2024-04-17 Thread Joel via ntg-context
I'm about to have a lengthy (2,000+ page) document published. Normally if it 
compiles and looks okay, I regard that as meaning no errors appeared, but I've 
noticed that sometimes ConTeXt will still compile, even if something isn't 
displayed on screen as it should:

(1) I tried placing a table inside a startitemize environment, as instead of it 
not compiling, it left a message in the document warning that wasn't supported.
(2) In another case, I had an image that ConTeXt couldn't find, as I mispelled 
the filenmame, and it fully compiled and made a PDF, without me noticing.
(3) Or maybe in some case, a font couldn't be found for a specific character, 
so a single character in the file isn't displaying.
Those are just some examples; I intended for something to be printed on the 
PDF, but it isn't showing there.

Since a document of this size will have a lot of messages, is there a way to 
adjust the settings, from "show everything" to "show some" to "show only 
serious errors"? Or maybe to use > to send the errors to another file for 
careful study? (using Linux if that matters)

--Joel
___
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: [ using horizontal table lines ]

2024-04-15 Thread Wolfgang Schuster

vm via ntg-context schrieb am 15.04.2024 um 13:15:

I'm probably using the \starttable incorrectly:

with this code I only get only *one* horizontal line in the header

[...]

with this code I get two horizontal lines, but the second is too short.

[...]

with this code I get two horizontal lines, with correct length, but 
above the wrong columns


[...]


diff:
\NC\DC\DC\DC\DL[4]\DL[4]\AR
\NC\DC\DC\DC\DL[4]\DL[3]\AR
\NC\DC\DC\DL[4]\DL[4]\AR

There is (probably) a correct way to solve this.


My suggestion is to switch to either natural table or extreme tables but 
it seems to me there is a problem with the division lines which always 
leave an empty column afterwards.


The following example should add horizontal lines above the first and 
third column but this setting results in an error. When I omit the last 
\DC the error disappears but as can be seen in the output the second 
line appears above the fourth column.


\starttext

\starttable[||]
%\DL  \DC  \DL  \DC  \DC \DR
\DL[red] \DC  \DL[red] \DC  \DR
\VL   01 \VL   02 \VL   03 \VL   04 \VL   05 \VL\SR
\stoptable

\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] [ using horizontal table lines ]

2024-04-15 Thread vm via ntg-context

I'm probably using the \starttable incorrectly:

with this code I only get only *one* horizontal line in the header

\starttable[|r|r|r|r|r|r|r|l|r|r|r|r|][bodyfont=9pt]
\NC step\NC frac\NC ival\NC  \NC\Use{4}[cI]{freq 
(Hz)}\NC~\NC\Use{4}[cI]{wavelength (m)}\AR

\NC\DC\DC\DC\DL[4]\DL[4]\AR
\NC 0 \NC 0.00 \NC 0.000 \NC 12.50\NC 13.75\NC 15.00\NC 12.25\NC A\ \NC 
27.20\NC 24.73\NC 22.67\NC 27.76\AR
\NC 1 \NC 0.08 \NC 0.115 \NC 13.94\NC 15.34\NC 16.73\NC 13.66\NC A\#\NC 
24.38\NC 22.17\NC 20.32\NC 24.88\AR
\NC 2 \NC 0.17 \NC 0.222 \NC 15.28\NC 16.81\NC18.34\NC14.97\NC 
B\ \NC 22.25\NC 20.23\NC 18.54\NC 22.71\AR

\stoptable




with this code I get two horizontal lines, but the second is too short.

\starttable[|r|r|r|r|r|r|r|l|r|r|r|r|][bodyfont=9pt]
\NC step\NC frac\NC ival\NC  \NC\Use{4}[cI]{freq 
(Hz)}\NC~\NC\Use{4}[cI]{wavelength (m)}\AR

\NC\DC\DC\DC\DL[4]\DL[3]\AR
\NC 0 \NC 0.00 \NC 0.000 \NC 12.50\NC 13.75\NC 15.00\NC 12.25\NC A\ \NC 
27.20\NC 24.73\NC 22.67\NC 27.76\AR
\NC 1 \NC 0.08 \NC 0.115 \NC 13.94\NC 15.34\NC 16.73\NC 13.66\NC A\#\NC 
24.38\NC 22.17\NC 20.32\NC 24.88\AR
\NC 2 \NC 0.17 \NC 0.222 \NC 15.28\NC 16.81\NC18.34\NC14.97\NC 
B\ \NC 22.25\NC 20.23\NC 18.54\NC 22.71\AR

\stoptable


with this code I get two horizontal lines, with correct length, but 
above the wrong columns


\starttable[|r|r|r|r|r|r|r|l|r|r|r|r|][bodyfont=9pt]
\NC step\NC frac\NC ival\NC  \NC\Use{4}[cI]{freq 
(Hz)}\NC~\NC\Use{4}[cI]{wavelength (m)}\AR

\NC\DC\DC\DL[4]\DL[4]\AR
\NC 0 \NC 0.00 \NC 0.000 \NC 12.50\NC 13.75\NC 15.00\NC 12.25\NC A\ \NC 
27.20\NC 24.73\NC 22.67\NC 27.76\AR
\NC 1 \NC 0.08 \NC 0.115 \NC 13.94\NC 15.34\NC 16.73\NC 13.66\NC A\#\NC 
24.38\NC 22.17\NC 20.32\NC 24.88\AR
\NC 2 \NC 0.17 \NC 0.222 \NC 15.28\NC 16.81\NC18.34\NC14.97\NC 
B\ \NC 22.25\NC 20.23\NC 18.54\NC 22.71\AR

\stoptable


diff:
\NC\DC\DC\DC\DL[4]\DL[4]\AR
\NC\DC\DC\DC\DL[4]\DL[3]\AR
\NC\DC\DC\DL[4]\DL[4]\AR


There is (probably) a correct way to solve this.

.Floris___
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: Figure reference failing

2024-04-10 Thread Henning Hraban Ramm

Am 10.04.24 um 14:21 schrieb Hans Hagen:

It fails for me as well, when "mode=columns" is used.

compare with and without mode columns:

\starttext

     \enablemode[columns]

     As we see \doifelsemode {columns} {in \in {table} [demo-1]} {below} 
we can have

     more than one cell in a row.

     \startplacetable[mode=columns,reference=demo-1]
     \externalfigure[cow][width=\textwidth]
     \stopplacetable

     \samplefile{tufte}

\stoptext

so basically we have an "at the spot" placement or a float


Is "mode" in floats something new? How is it related to “general” modes?

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

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


[NTG-context] Re: Figure reference failing

2024-04-10 Thread Willi Egger
Hm, I see.

This question appeared while using the tug-boat-style. Taking the example at 
the end of the style I adapted my article accordingly. However I missed the 
point to enable the mode “columns”…

Thanks for the explanation!
Willi

> On 10 Apr 2024, at 14:21, Hans Hagen  wrote:
> 
> On 4/10/2024 1:30 PM, Taco Hoekwater wrote:
>>> On 10 Apr 2024, at 13:04, Willi Egger  wrote:
>>> 
>>> Hello,
>>> 
>>> It seems, that the referencing mechanism is failing. I detected this with 
>>> the January version and the current version: 2024.04.01 08:59.
>>> 
>>> Could some one confirm this?
>> It fails for me as well, when "mode=columns" is used.
> compare with and without mode columns:
> 
> \starttext
> 
>\enablemode[columns]
> 
>As we see \doifelsemode {columns} {in \in {table} [demo-1]} {below} we can 
> have
>more than one cell in a row.
> 
>\startplacetable[mode=columns,reference=demo-1]
>\externalfigure[cow][width=\textwidth]
>\stopplacetable
> 
>\samplefile{tufte}
> 
> \stoptext
> 
> so basically we have an "at the spot" placement or a float
> 
> Hans
> 
> -
>  Hans Hagen | PRAGMA ADE
>  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___

___
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: Figure reference failing

2024-04-10 Thread Hans Hagen

On 4/10/2024 1:30 PM, Taco Hoekwater wrote:




On 10 Apr 2024, at 13:04, Willi Egger  wrote:

Hello,

It seems, that the referencing mechanism is failing. I detected this with the 
January version and the current version: 2024.04.01 08:59.

Could some one confirm this?


It fails for me as well, when "mode=columns" is used.

compare with and without mode columns:

\starttext

\enablemode[columns]

As we see \doifelsemode {columns} {in \in {table} [demo-1]} {below} 
we can have

more than one cell in a row.

\startplacetable[mode=columns,reference=demo-1]
\externalfigure[cow][width=\textwidth]
\stopplacetable

\samplefile{tufte}

\stoptext

so basically we have an "at the spot" placement or a float

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

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

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


[NTG-context] Re: Use of marking

2024-03-20 Thread Andres Conrado Montoya
As I understand, Thomas needs a layout in which the header shows something
like

1. Chapter title -- 1.1. Section title (including the numbers! *This is the
important bit!*)

There are a couple things about this:

1. In a section (part, chapter, section, etc.) you can introduce three
versions of the title for that section. title= is the general one and if
nothing else is specified, this will be used in markings (headers or footer
or wherever you want to put therm) and in listings (contents). If you give
those arguments, marking= and listing=, you will get those texts in those
places: marking= on markings (you can call them with \getmarking) and
listing= in the table of contents.

2. As far as I have found, including the chapter/section number in the
marking is *not really a trivial task*. I usually hack something using
\headnumber and \getmarking, like so:

\setuppagenumbering[alternative=doublesided,location=,]

\setupheadertexts[{\headnumber[section].~\getmarking[section]}---{\headnumber[chapter].~\getmarking[chapter]}]
\setupfootertexts[][pagenumber][pagenumber][]
\setuphead[chapter][header=high]

\starttext
\dorecurse{10}{
  \startchapter[title={This is my chapter}]
  This is a chapter\par \dorecurse{6}{\input knuth } \input
math-kontinuitet-sv

  \startsection[title={This is my section}]
   This is a section\par \dorecurse{6}{\input knuth }\input
math-kontinuitet-sv
  \stopsection
  \stopchapter
}
\stoptext

But with a caveat: the `header=high` setting in setuphead for the chapter
needs to be included, or you will get a section number in the first page,
even if there is no section. I have not found a better mechanism yet, but
I'm quite sure there is a correct solution for this... I just haven't found
it yet. Checking for the presence of \getmarking[section] with
\doifsomething does not work, or I could not make it work.

A little bit more info here:
https://wiki.contextgarden.net/Command/getmarking
https://wiki.contextgarden.net/Command/headnumber


El mié, 20 mar 2024 a las 9:23, Hraban Ramm () escribió:

> \setupheadtext[de][section=Aufgabe]
> Rename the section, then you don’t need marking.
>
> Sorry, I'm in a hurry and must look up how to get the number…
>
>
> Am 20.03.24 um 12:18 schrieb Thomas Meyer:
>
> Hi Hraban,
>
> and thanks.
>
> setuphead[chapter,section][numberwidth=2em] or "fit"
> works!
>
> I know \setupheadertexts, but do not know what shall I write here:
> \startsection[titel=Aufgabe, marking=?]
> If I write marking=Aufgabe I get Aufgabe, no number! For chapter the same.
>
> \setupheadertexts
>[] [{\getmarking[chapter]} - {\getmarking[section]}]
> [{\getmarking[chapter]} - {\getmarking[section]}] []
> > Kapitel - Aufgabe
>
>
> Thanks in advance
> Greetings
> Thomas
>
>
> Am 20.03.24 um 09:09 schrieb Hraban Ramm:
>
>
> Am 20.03.24 um 08:18 schrieb Thomas Meyer:
>
> HI folks,
>
> yesterday while reading along I learned how to suppress the chapter
> numbers in sections. That was something I was looking for myself.
>
> But how do you use marking correctly in startsection? I would like to see
> "1. Kapitel - 1. Aufgabe" in the header on the right. How can I automate
> this with marking?
> And how can I reduce the space between the number (1.) and the title
> (Kapitel or Aufgabe)?
>
> Thanks for your help
> Thomas
>
> Hi Thomas,
>
> do you know how to use \setupheadertexts?
>
> https://wiki.contextgarden.net/Command/setupheadertexts
>
> I guess you're using the section level for "Aufgabe"?
>
> Then something like {\getmarking{chapter} – \getmarking{section}} might
> fit your request.
>
> The formatting should be possible with
> \setuphead[chapter,section][numberwidth=2em] or "fit".
>
> Hraban
>
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___
>
>
>
> ___
> 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.c

[NTG-context] Re: Why aren't cross-references working in tabulate?

2024-03-15 Thread Joel via ntg-context
 Thank you! The solution worked!

On Friday, March 15, 2024 at 02:30:40 PM MDT, Wolfgang Schuster 
 wrote:  
 
 Joel via ntg-context schrieb am 15.03.2024 um 20:50:
> When I run this code, \at{page}[xyz] is unable to find the cross reference:
> 
> \starttext
> %\reference[xyz]{}
> \starttabulate[|lp(.3\textwidth)|lp(.\textwidth)|]
> \NC    \reference[xyz]{} \NC \NC\NR

\NC \doifnotmode{*trialtypesetting}{\pagereference[xyz]} \NC \NC\NR

> \stoptabulate
> 
> 
> \pagebreak
> 
> \at{page}[xyz]
> 
> \stoptext
> 
> The code does work when I uncomment line #2, revealing the 
> cross-references work find when outside of a table.
> 
> I also tried using a TABLE environment instead and the result was 
> similar, it wouldn't show the page number.
> 
> What am I doing wrong?

Tabulate and natural tables process the table content multiple times and 
therefore you're setting the reference multiple times, to avoid this 
check for trialtypesetting mode and set the reference only when you're 
out of the mode.

@Hans: Can we add the check trialtypesetting check to \reference etc.?

\protected\def\strc_references_set_named_reference
- {\ifreferencing
+ {\iftrialtypesetting
+    \expandafter\gobblefourarguments
+  \orelse\ifreferencing
      \expandafter\strc_references_set_named_reference_indeed
    \else
      \expandafter\gobblefourarguments
    \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
___
  ___
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: Why aren't cross-references working in tabulate?

2024-03-15 Thread Wolfgang Schuster

Joel via ntg-context schrieb am 15.03.2024 um 20:50:

When I run this code, \at{page}[xyz] is unable to find the cross reference:

\starttext
%\reference[xyz]{}
\starttabulate[|lp(.3\textwidth)|lp(.\textwidth)|]
\NC    \reference[xyz]{} \NC \NC\NR


\NC \doifnotmode{*trialtypesetting}{\pagereference[xyz]} \NC \NC\NR


\stoptabulate


\pagebreak

\at{page}[xyz]

\stoptext

The code does work when I uncomment line #2, revealing the 
cross-references work find when outside of a table.


I also tried using a TABLE environment instead and the result was 
similar, it wouldn't show the page number.


What am I doing wrong?


Tabulate and natural tables process the table content multiple times and 
therefore you're setting the reference multiple times, to avoid this 
check for trialtypesetting mode and set the reference only when you're 
out of the mode.


@Hans: Can we add the check trialtypesetting check to \reference etc.?

\protected\def\strc_references_set_named_reference
- {\ifreferencing
+ {\iftrialtypesetting
+\expandafter\gobblefourarguments
+  \orelse\ifreferencing
 \expandafter\strc_references_set_named_reference_indeed
   \else
 \expandafter\gobblefourarguments
   \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] Why aren't cross-references working in tabulate?

2024-03-15 Thread Joel via ntg-context
When I run this code, \at{page}[xyz] is unable to find the cross reference:
\starttext%\reference[xyz]{}
\starttabulate[|lp(.3\textwidth)|lp(.\textwidth)|]
\NC    \reference[xyz]{} \NC \NC\NR
\stoptabulate


\pagebreak

\at{page}[xyz]

\stoptext

The code does work when I uncomment line #2, revealing the cross-references 
work find when outside of a table.
I also tried using a TABLE environment instead and the result was similar, it 
wouldn't show the page number.
What am I doing wrong?
--Joel
___
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: Japanese

2024-03-11 Thread Wolfgang Schuster

Emanuel Han via ntg-context schrieb am 10.03.2024 um 17:43:

Hi all,

I added 
https://wiki.contextgarden.net/Chinese_Japanese_and_Korean#Meeting_the_JIS_X_4051_Requirements_for_Japanese_Text_Layout

with attached working example code and to-do list.

Thanks for any contributions!

The working example code is still a work in progress. Its text layout 
output meets already some of the requirements (see comments in the 
code). Among the ones to still be implemented are:


 *
solid setting (no extra spacing between characters)
https://www.w3.org/TR/jlreq/#fig1_8 if no requirement for
line-adjustment https://www.w3.org/TR/jlreq/#term.line-adjustment
 *
aligning of the lines to the Kihon-hanmen (optimizing the code
below in this regard)

Can you make text files out of the images [1] with the spacing 
before/after punctuation to have short examples for testing.


[1] https://www.w3.org/TR/jlreq/#positioning_of_punctuation_marks


 *
positioning and realm of headings
https://www.w3.org/TR/jlreq/#fig3_1_9
https://www.w3.org/TR/jlreq/#fig3_1_15 et al, and
https://www.w3.org/TR/jlreq/#fig3_1_4
 *
positioning of yokugo-ruby https://www.w3.org/TR/jlreq/#fig2_3_24
 *
inline cutting note (warichu) https://www.w3.org/TR/jlreq/#fig2_4_1
 *
emphasis with sesame dot or bullet
 *
itemization https://www.w3.org/TR/jlreq/#fig2_5_6

Circled numbered are easy and achieved by adding additional number 
conversions.


 *
indenting of quotation paragraphs
https://www.w3.org/TR/jlreq/#fig2_5_7


Use the narrower or blockquote environment for this.


 *
tab setting https://www.w3.org/TR/jlreq/#fig2_6_1


Just use a table.


 *
furiwake https://www.w3.org/TR/jlreq/#fig2_7_2
 *
jidori https://www.w3.org/TR/jlreq/#fig2_7_4
 *
math https://www.w3.org/TR/jlreq/#fig2_7_6 and
https://www.w3.org/TR/jlreq/#fig2_7_62
 *
tategaki (writing vertically)


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: .jpx and .jxl

2024-03-05 Thread Jim

On Tue, Mar  5, 2024 at 15:18 (+0100), Taco Hoekwater wrote:


>> On 4 Mar 2024, at 15:30, Jim  wrote:

>> Recently I've been trying to make some PDFs smaller by using better
>> compression of JPEG pictures.

>> I was happy to see that \externalfigure cheerfully accepts .jp2 (JPEG 2000)
>> files.  However, my understanding (and I could well be wrong, but I've seen
>> it multiple places) is that JPEG 2000 *Part 2* files should have extension
>> .jpx, not .jp2.

>> By default, ConTeXt does not recognize .jpx.  But if I rename a .jpx file
>> to have a .jp2 extension, then ConTeXt properly processes the file and I
>> see the picture in the PDF.

>> Q: are there any plans to make ConTeXt recognize the .jpx extension?
>> If not, can anyone suggest some ConTeXt code which allows me to tell
>> ConTeXt to process a .jpx file as a .jp2 file?


> The recognised extensions are specified in a table in grph-inc.lmt, I don’t 
> think you can alter that table runtime. 

> But it is possible to do

>   \externalfigure[method=jp2,file=….jpx]

> Untested, but should work.

Taco,

I could not get that to work, but I did get
\externalfigure[somefile.jpx][method=jp2]
to work.  Thanks very much for leading me to that solution.

Jim

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

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


[NTG-context] Re: .jpx and .jxl

2024-03-05 Thread Taco Hoekwater


> On 4 Mar 2024, at 15:30, Jim  wrote:
> 
> Recently I've been trying to make some PDFs smaller by using better
> compression of JPEG pictures.
> 
> I was happy to see that \externalfigure cheerfully accepts .jp2 (JPEG 2000)
> files.  However, my understanding (and I could well be wrong, but I've seen
> it multiple places) is that JPEG 2000 *Part 2* files should have extension
> .jpx, not .jp2.
> 
> By default, ConTeXt does not recognize .jpx.  But if I rename a .jpx file
> to have a .jp2 extension, then ConTeXt properly processes the file and I
> see the picture in the PDF.
> 
> Q: are there any plans to make ConTeXt recognize the .jpx extension?
>   If not, can anyone suggest some ConTeXt code which allows me to tell
>   ConTeXt to process a .jpx file as a .jp2 file?


The recognised extensions are specified in a table in grph-inc.lmt, I don’t 
think you can alter that table runtime. 

But it is possible to do

  \externalfigure[method=jp2,file=….jpx]

Untested, but should work.

Best wishes,
Taco

> 
> 
> I have also been investigating the use to JPEG-XL files (.jxl).  One of the
> interesting aspects of JXL files is that .jpg files can be **losslessly**
> compressed into .jxl files.  (That is, you can recover the exact .jpg from
> the .jxl file if you want, so there is no further degradation of the image
> by doing this lossless compression.)  I have been seeing 20% to 30%
> reduction in file sizes by converting JPGs into JXLs, which I would be
> happy to make use of in my PDFs, if possible.
> 
> Bonus question: is there any plan to support JXL files in ConTeXt?
> 
> Thanks.
>Jim
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___

— 
Taco Hoekwater  E: t...@bittext.nl
genderfluid (all pronouns)


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

2024-03-01 Thread Emanuel Han via ntg-context
Dear Wolfgang,

thank you for your valuable remarks. I integrated them, see corrected attached 
example.
Yes, correct layout examples exist. They're all showing vertical writing, but 
the rules and principles are exactly the same for horizontal writing.
position of the headers and footers: https://www.w3.org/TR/jlreq/#fig1_30
aligning lines to the text box: https://www.w3.org/TR/jlreq/#fig1_3
protrusion of ruby: https://www.w3.org/TR/jlreq/#fig_ad1_6
In my previous mail, I wrote wrong amounts of lines. They should be 46 lines on 
one page, while the actual example doesn't show the 46th line.
It would be important to identify the reason why only 24 characters are used to 
create a line when 25 could be used. Then we can develop a method to turn that 
mechanism off or circumvent it.
Quotation from https://www.w3.org/TR/jlreq:
In principle, when composing a line with ideographic (cl-19) 
(https://www.w3.org/TR/jlreq/#cl-19), hiragana (cl-15) 
(https://www.w3.org/TR/jlreq/#cl-15) and katakana (cl-16) 
(https://www.w3.org/TR/jlreq/#cl-16) characters, no extra spacing appears 
between their character frame 
(https://www.w3.org/TR/jlreq/#term.character-frame). This is called solid 
setting (see Figure 5 (https://www.w3.org/TR/jlreq/#fig1_8)).

I made manual corrections to scrp-cjk.lua, but with no effect to the ConTeXt 
output of my example. Do I have to recompile ConTeXt first?
Emanuel
On März 1 2024, at 2:59 pm, Wolfgang Schuster 
 wrote:
> Emanuel Han via ntg-context schrieb am 01.03.2024 um 13:08:
> > Dear all, thanks for your contributions.
> >
> > Sure I'll update the
> > https://wiki.contextgarden.net/Chinese_Japanese_and_Korean hopefully
> > with the help of Jeong Dal and others as soon as things are sorted out.
> >
> > In attached example, the opening Brackets (I marked them with
> > \color[red]{【} and \color[red]{{}) are taking the previous character
> > with them to the next line. Please remove these to see that the
> > previous character would stay on the previous line. Thanks Wolfgang
> > for checking wether this is a bug.
>
> Can you stick to fonts which are available for all systems (e.g. Noto
> CJK) because system fonts are a pain when you're on a different system.
>
> The missing line break before 【 is caused by a wrong table entry in
> scrp-cjk.lua and I guess the following change is necessary
>
> local japanese_2 = {
> jamo_initial = korean_break,
> korean = stretch_break,
> chinese = stretch_break,
> hiragana = stretch_break,
> katakana = stretch_break,
> half_width_open = nobreak_stretch_break_autoshrink,
> half_width_close = nobreak_stretch,
> - full_width_open = nobreak_stretch_break_shrink,
> + full_width_open = stretch_break,
> full_width_close = nobreak_stretch,
> full_width_punct = japanese_before_full_width_punct, --
> nobreak_stretch,
> hyphen = nobreak_stretch,
> non_starter = nobreak_stretch,
> other = stretch_break,
> }
>
> but there can be more wrong entries.
> > I was not successful in figuring out how the protrusion mechanism can
> > be set in order to keep full stops and commas on the previous line
> > (protruding the column box). Could you please give me a hint,
> > Wolfgang? Thanks. There's a \color[red]{。} in my example which should
> > not jump to the next line.
>
> Adding the first and last line to your example document worked for me.
> \definefontfeature [default] [default] [protrusion=pure]
> \definefontfamily [...] [...] [...]
> \setupbodyfont [...]
> \setupalign [hanging]
> > My example follows the Kihon-hanmen dimensioning as described in
> > https://www.w3.org/TR/jlreq . What could be the reason that lines
> > which could hold 25 characters are having only 24 characters, for
> > example lines 2, 3 or 13 in column 1? I would expect them to have 25
> > characters, the same as for example lines 7, 9 or 16 in column 1.
>
> I guess the par builder is responsible for this when it arranges the
> paragraph but this is just a guess.
>
> > How can I change alignment of the lines so that the highest character
> > boxes align with the top border of the layout boxes for text and
> > header and with the bottom border of the layout box for footer? I hope
> > that when this is achieved for the layout box for text, then this box
> > would hold the expected 45 lines, and not 44 lines as it is doing now.
> > Ruby characters in the first line should protrude the box, what they
> > already do.
> > I tried to implement the 1em hskip of the header and footer away from
> > the page border. While it works for left aligned headers and footers,
> > it doesn't for the right aligned headers and footers (negative hskip
> > has no effect). How to solve this problem?
&g

  1   2   3   4   5   6   7   8   9   10   >