[NTG-context] Re: Special charakter

2024-05-18 Thread Bruce Horrocks


> On 18 May 2024, at 11:54, Thomas Meyer  wrote:
> 
> I know I can copy and paste it, like here (copied from Wikipedia), but if I 
> don't have a template in a hurry ...


On the Mac, if you are using an 'English' keyboard, you can hold down any 
letter for half a second or so and see a popup selection of alternate accented 
versions of that letter. Not all text editors / word processors support it but 
TeXShop does. No need for cut & paste templates.

—
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-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: How to use fonts without typescripts?

2024-05-15 Thread Bruce Horrocks

> On 15 May 2024, at 15:33, Shiv Shankar Dayal  
> wrote:
> 
> Hi,
> 
> Defining typescripts to use a font is very painful. How can I use a font 
> without using a typescript?

If you just want a very small amount of text in a different font you can use:

\definefont [useWarningFont] [name:arialbold*default at 22pt]
\starttext
This is the regular body text font but {\useWarningFont BE AWARE} that others 
can be used.
\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: transparent color

2024-05-06 Thread Bruce Horrocks


> On 6 May 2024, at 09:41, Hans van der Meer via ntg-context 
>  wrote:
> 
> I would like to use a transparent version of an existing color. Thus
> \definecolor[transparentcolor][color,t=0.2,a=1]
> instead of
> \definecolor[transparentcolor][r=..,g=..,b=..,t=0.2,a=1]
> because I do not know the rgb values of the color that must be made 
> transparent, only its name.
> 
> How to accomplish? 

The Wiki page <https://wiki.contextgarden.net/Color> gives the source files for 
various sets of colours (built in, crayola etc) and the source has the RGB 
values in a fairly obvious format.

—
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: Define a new command that inherits from multiple other command options

2024-04-26 Thread Bruce Horrocks


> On 25 Apr 2024, at 09:24, ai2472206...@yeah.net wrote:
> 
> But what I don't know is how to get it to inherit the options of other 
> commands and perform these features correctly.

Your example didn't work for me - none of the Chinese|Japanese[1] characters 
showed.

AFAIK there is no way to "inherit" functionality.

You still need to write \setupsidenote to call \setupcounter, \setupframed at 
the right points to achieve the right effects.

What you can do is have \setupsidenote accept all options in one big long list 
and then pass the ones that apply to setupcounter to each use of \setupcounter, 
pass on the ones that apply to setupframed to each use of \setupframed and so 
on.

Thsi is releatively easy in Lua where you could define a list of all possible 
commands and which macro they apply to then loop through it looking to see if 
that option had been supplied and building a set of parameters for 
\setupframed, \setupcounter etc.

Hope this makes sense.

But I feel there's probably a better way - it's a lot of effort to go to in 
order to have a single "does it all macro" instead of calling two or three 
macros each time.

Regards,

[1] Apologies for my ignorance.
—
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: documentation: parameters of \setuplist

2024-04-24 Thread Bruce Horrocks


> On 23 Apr 2024, at 20:43, Henning Hraban Ramm  wrote:
> 
> Am 22.04.24 um 18:09 schrieb Henning Hraban Ramm:
>> 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?
>> * symbol (one two three none default): where is this used?
> 
> One solved, still 4 to go… Please, anyone who used these?

In the source there is a comment relating to location:


%D Regular list entries are bound to a specific location in order to get the 
right
%D pagenumber etc.\ associated. When pushing something inbetween (in mkiv) it 
ends
%D up directtly in the list. This is the default because otherwise users will 
wonder
%D why spacing might get messed up (due to an unseen but present node). It is
%D possible to force a location by explicitly setting \type {location} to \type
%D {here}.
%D
%D Another way to force a certain order is to set the \type {order} variable 
when
%D placing a list. The \type {command} option only pushes commands into the 
right
%D order, and \type {all} orders all entries (which might be too much). In this 
case
%D no specific location is needed with the inbetween method. Maybe additional
%D mechanisms show up some day. See \type {inbetween-001.tex} for an example.

I don't really understand what capability the comment is referring to let alone 
be able to create an example demonstrating the difference.

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

2024-04-20 Thread Bruce Horrocks


> On 18 Apr 2024, at 01:09, Joel via ntg-context  wrote:
...
> Or maybe to use > to send the errors to another file for careful study? 
> (using Linux if that matters)

You can run the job from the command line and redirect to a file:

  $ context file.tex > output.log 2>&1

but that is essentially the same as the .log file that is produced by default 
when you run from the command line.

As your book is large you could try adding \writestatus commands at suitable 
points so that when your messages appear in the log you know that processing 
reached that far in the book.

Also you could use \writestatus to output messages before and after known 
problem areas so you can look to see if there is any telltale output in the log 
and then search for that elsewhere.

HTH
—
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-04-18 Thread Bruce Horrocks


> On 17 Apr 2024, at 13:17, Henning Hraban Ramm  wrote:
> 
> Am 17.04.24 um 13:57 schrieb Bruce Horrocks:
>> - There are at least two books, and a third being written but not yet 
>> released: these fit into the Tutorials and Explanation quadrants.
> 
> Which published books do you mean?

Not published in the sense of having an ISBN assigned but the ones I had in 
mind were:

- "ConTeXt Mark IV An Excursion" by Ton Otten (ma-cd-en.pdf in the distribution)
- "A not so short introduction to ConTeXt Mark IV" by Joaquín Ataz-López

and your in-progress one.

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: Wiki - test/proposal to further clarify documentation

2024-04-17 Thread Bruce Horrocks


> On 14 Apr 2024, at 12:21, garu...@azules.eu wrote:
> 
> Hi all,
> 
> I just discover the Diátaxis documentation framework :

I'd be more confident if you had started by saying "I've been using the 
Diátaxis for the last ten years and have used it on multiple projects". ;-)

> - https://www.diataxis.fr/
> - 30min video : "What nobody tells you about documentation", 
> https://www.youtube.com/watch?v=t4vKPhjcMZg  , from Daniele Procida at PyCon 
> 2017
> 
> As I understand it, it can help both readers and writers of the documentation 
> by clarifying the purpose of each element.
> 
> So I started a potential new "welcome page" :  
> https://wiki.contextgarden.net/Main_Page2
> 
> The main lines would be :
> - Tutorials: installation pages, step by step examples
> - How-to guides: most of the existing wiki pages which are not 
> https://wiki.contextgarden.net/Commands/ ...
> - Discussions and manuals: most of the existing manuals
> - Reference : the pages dedicated to commands which already include link to 
> mailing list, stack exchange, ConTeXt's source
>  - https://wiki.contextgarden.net/Category:Commands
>  - https://wiki.contextgarden.net/Special:PrefixIndex?prefix=Command%2F
> 
> To match the logic of Diátaxis, maybe some material from command pages should 
> be moved from "Reference" to "How-to guides",
> for example, when the examples go beyond "pure description" and begin to deal 
> with "how-to" cases, e.g. :
> - Reference for setuphead: https://wiki.contextgarden.net/Command/setuphead
> - How-to guides for headings: https://wiki.contextgarden.net/Titles
> 
> If it make sense, and according to your feedbacks, I can continue to 
> reallocate existing contents.
> 
> Thanks for your feedback and thoughts.

I'm going to be devil's advocate and say that the Context documentation is 
*already* in the Diátaxis framework - just not in one place on the Wiki.

- There are at least two books, and a third being written but not yet released: 
these fit into the Tutorials and Explanation quadrants.

- There are "My Way" guides linked from the Wiki and the PragmaADE website that 
fit into the "How-To Guides" quadrant.

- And the wiki itself is the "Reference" quadrant.

Clearly these can always be better but they are there already. My 
recommendation would be to use the wiki as the reference quadrant and, apart 
from the first few "main pages" for people who land there from a web search, it 
should focus on being the reference manual. Beginners should be directed to the 
books.

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: last page number for a list

2024-04-03 Thread Bruce Horrocks


> On 30 Mar 2024, at 19:59, Alan Bowen  wrote:
> 
> How can I get the last page number of a chapter for a list (ToC)?
> 
> Outside of a list, I use \lastpagenumber. 
> But that does not work in a list such as the ToC.
> 
> Any tips or pointers will be gladly received.


I'm not quite sure what you want to do with these numbers: something like 
printing out a contents page but instead of the start page of a chapter it 
shows the last page of the chapter?

If so then try creating a custom list and use \writetolist immediately before 
each \stopchapter command?

\definelist[LastPages][criterium=all]
\starttext
\completecontent
\page
\completelist[LastPages]
\page
\dorecurse{10}{
  \startchapter[title={This is my chapter}]
  This is a chapter\par \dorecurse{6}{\input knuth } \input math-kontinuitet-sv

  \writetolist[LastPages]{3.}{\namedstructurevariable{chapter}{title}}
  \stopchapter
}
\stoptext

But I can't get the number option of \writetolist to work - the "3." above is 
ignored. :-(

—
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 get an image to fill the maximum available space?

2024-03-30 Thread Bruce Horrocks


> On 30 Mar 2024, at 09:38, Henning Hraban Ramm  wrote:
> 
> Am 30.03.24 um 03:15 schrieb Joel via ntg-context:
>> I have code like this:
>> \placefigure[here, force]{my caption}{%
>> \externalfigure[#1][frame=on, maxheight=1.2\textwidth, 
>> maxwidth=\textwidth]%
>> }%
>> I need some images to appear in a book. I need them to keep their proper 
>> ratios, but scale up to the maximize the available space.
>> The image can't be more than \textwidth wide, and can't ever be more than 
>> 1.2\textwidth high.
>> The problem I am getting with this code, and it does seem to be limiting the 
>> images to be not bigger than those two dimensions above, is some of the 
>> images, for reasons I can't understand, are appearing really tiny and aren't 
>> scaling up to fill as much space as is possible. I can't explain why this is 
>> happening--the images themselves are very very high resolution.
>> Is there any way to modify the code to make sure the image stretches up to 
>> be the biggest it can, without exceeding the sizes I've listed?
> 
> Hi Joel,
> 
> AFAIK, if you don’t set at least either height or width, ConTeXt uses the 
> image’s resolution setting to calculate its size, and that is often useless.
> 
> (Maybe there’s also something wrong with ConTeXt’s max width/height, I don’t 
> know; I’m still planning to carefully check all options of image processing…)
> 
> You could try if "factor=fit" or "factor=max" yields the results you want.

As Hraban says, you only need to set one of height or width and Context works 
out the other.

For your case I think you just need width=\textwidth, so

  \externalfigure[#1][frame=on,width=\textwidth,maxheight=1.2\textwidth]%

where maxheight imposes the height size limit you mention.

If you still have problems with tiny images then I suspect that is a different 
issue - something to do with the image file and the metadata about the image 
size maybe? If you can share an affected image then perhaps start another 
question with an MWE and upload the image somewhere.

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: Use of marking

2024-03-21 Thread Bruce Horrocks


> On 20 Mar 2024, at 18:45, Andres Conrado Montoya  
> wrote:
> 
> 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: 

You can do the following:

\startsetups[doc:header]
  \getmarking[chapternumber] \space - \space \getmarking[chapter]
  \space :: \space
  \getmarking[sectionnumber] \space - \space \getmarking[section]
\stopsetups
\setupheadertexts[\setup{doc:header}]

\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

Caveat: it needs an if...then test around the section number for when a section 
hasn't started.
—
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: imposition: getting to the last page of a booklet

2024-02-28 Thread Bruce Horrocks


> On 27 Feb 2024, at 10:13, Pablo Rodriguez via ntg-context 
>  wrote:
> 
> I’m afraid I cannot make your sample work:


The sample works for me if you set plain A4 and doublesided, thus:

 \setuppagenumbering[alternative={doublesided}]
 \starttext
 \samplefile{lorem}
 \page[quadruple]
 page before the quadruple (must be 3, not 4)
 \page[yes, quadruple]
 page before the quadruple (must be 7, not 8)
 \stoptext

This puts the "page before quadruple" text on page 4 which is the last side of 
the first four sides, if that makes sense.

Switching to singlesided seems to confuse it - issuing only two sides in total 
so maybe that was part of the problem since both are specified in your original 
example?

—
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: output filename with SHA256

2024-02-23 Thread Bruce Horrocks


> On 23 Feb 2024, at 13:32, Pablo Rodriguez via ntg-context 
>  wrote:
> 
> Dear list,
> 
> I have the following sample file:
> 
> \starttext
> whatever
> 
> \startluacode
> luatex.wrapup(
>  function()
>local t = {}
>local pdf_file_name = tex.jobname..".pdf"
>local sha_pdf = utilities.sha2.hash256(io.loaddata(pdf_file_name))
>local c_r = environment.currentrun
>t[c_r] =  sha_pdf
>local exists_pdf = ("%s_%s-%s.pdf"):format(c_r-1, tex.jobname, t[c_r-1])
>if io.exists(exists_pdf) then os.remove(exists_pdf) end
>os.rename(pdf_file_name, ("%s_%s-%s.pdf"):format(c_r, tex.jobname,
> sha_pdf))
>  end
> )
> \stopluacode
> \stoptext
> 
> In short, it adds its SHA256 to the final filename.
> 
> Since renames the PDF document in each run, I would like to remove the
> output from the previous run.
> 
> The table seems not to store the value from a previous run.
> 
> I see now that I am creating it again with each run.
> 
> Is there any way to check if compilation needs any other run?
> 
> Many thanks for your help,

Rather than use the wrapup() hook can why not rename the file using a second 
job on the command line?

So your compile command might look like:

  $ context jobname.tex add_sha.tex

Jobname.tex is your main file and generates jobname.pdf as its output, while 
add_sha.tex contains the rename logic:

\starttext
\startluacode
   local pdf_file_name = "jobname.pdf"
   local sha_pdf = utilities.sha2.hash256(io.loaddata(pdf_file_name))
   os.rename(pdf_file_name, ("%s-%s.pdf"):format(pdf_file_name, sha_pdf))
\stopluacode
Done
\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: using an end of line as parameter

2024-02-21 Thread Bruce Horrocks


> On 21 Feb 2024, at 08:17, madiazm.eo...@gmail.com wrote:
> 
> Thanks a lot Bruce, that did the trick! definitely I will have to learn a bit 
> lua in summer.
> I just got an error on \qquad and found searching in internet that it was 
> because escape character conflicts between tex and lua. For the time i 
> removed it and since I will create itemizes I hope I dont get that error if I 
> use \item instead of \qquad.
> Thanks again, I spent hours of trial and error, error, error... on this 
> matter.

Yes, the \'s need to be escaped in Lua. And it's made me realise that the 
process of identifying the four lines of the question is separate from the 
typesetting of the question later. The amended version below uses your 
\tareaABC macro to format the question so you can more easily change the layout 
without having to understand ConTeXT Lua Documents in detail.

\startluacode
  userdata = userdata or {}
  
  function userdata.formatTestQuestions()
local the_buffer = buffers.getlines("TestQuestions")
local tracker = 0
local the_question = {}

-- Go through the buffer of questions one line at a time
for i = 1,#the_buffer do

  -- Skip blank lines but 'collect' non-blank lines until we have four
  -- (which is assumed to be a whole question)
  if  string.strip(the_buffer[i]) == "" then
tracker = 0
the_question = {}
  else
tracker = tracker + 1
the_question[tracker] = the_buffer[i]
  end
  
  -- If tracker has got to 4 then we've read four lines
  if tracker == 4 then
context.tareaAbc(
  the_question[1],
  the_question[2], 
  the_question[3],
  the_question[4])
  
-- Reset for the next question (in case no blank line)
tracker = 0
the_question = {}
  end
  
end
  end
\stopluacode

\def\startTestQuestions
  {\dostartbuffer[TestQuestions][startTestQuestions][stopTestQuestions]}
\def\stopTestQuestions
  {\ctxlua{userdata.formatTestQuestions()}}

\define[4]\tareaAbc{\item #1
   \startitemgroup[itemize][a]
   \item #2
   \item #3
   \item #4
   \stopitemgroup}
   
\starttext
Here are some questions:

\startTestQuestions
In den Büchereien gibt es auch … 
… Kuchen.
… Theater.
… Workshops.

In den Büchereien gibt es auch … 
… Kuchen.
… Theater.
… Workshops.
In den Büchereien gibt es auch … 
… Kuchen.
… Theater.
… Workshops.
\stopTestQuestions

\stoptext

—
Bruce Horrocks
Hampshire, UK


tt2.tex
Description: Binary data
___
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 an end of line as parameter

2024-02-20 Thread Bruce Horrocks


> On 20 Feb 2024, at 12:59, madiazm.eo...@gmail.com wrote:
> 
> no, I just want to split at the end of each sentence to get the four 
> arguments: now I pass this four lines to my macro \tareaAbc (with the dirty 
> trick of ñ)
> 
> In den Büchereien gibt es auch …ñ 
> … Kuchen.ñ   
> … Theater.ñ   
> … Workshops.ñ 
> 
> and I wish your context.foo(lines[i]) iteration would become a single 
> context.tareaAbc(the four arguments somehow separated so that I can manage 
> each line with the corresponding context formatting)
> 
> As you see my definition is: \def\tareaAbc #1ñ#2ñ#3ñ#4ñ{...context formating 
> for each #)}; Its the clue to pass each sentence as an independent argument 
> that I don't get to work.
> thanks again
> 

A variation on Hans original suggestion is to use a buffer instead of a 
separate text file, combined with Lua.

\startluacode
  userdata = userdata or {}
  
  function userdata.formatTestQuestions()
local the_buffer = buffers.getlines("TestQuestions")
local tracker = 0
local the_question = {}
local letters = {"-", "a", "b", "c"}

-- Go through the buffer of questions one line at a time
for i = 1,#the_buffer do

  -- Skip blank lines but 'collect' non-blank lines until we have four
  -- (which is assumed to be a whole question)
  if  string.strip(the_buffer[i]) == "" then
tracker = 0
the_question = {}
  else
tracker = tracker + 1
the_question[tracker] = the_buffer[i]
  end
  
  -- If tracker has got to 4 then we've read four lines
  if tracker == 4 then
context.startlines()
context("{\\bf Beispiel:} %s", the_question[1])
context(true)
for answer = 2,4 do
  context("\\qquad %s) %s", letters[answer], the_question[answer])
  context(true)
end
context.stoplines()
  
-- Reset for the next question (in case no blank line)
tracker = 0
the_question = {}
  end
  
end
  end
\stopluacode

\def\startTestQuestions
  {\dostartbuffer[TestQuestions][startTestQuestions][stopTestQuestions]}
\def\stopTestQuestions
  {\ctxlua{userdata.formatTestQuestions()}}

\starttext
Here are some questions:

\startTestQuestions
In den Büchereien gibt es auch … 
… Kuchen.
… Theater.
… Workshops.

In den Büchereien gibt es auch … 
… Kuchen.
… Theater.
… Workshops.
In den Büchereien gibt es auch … 
… Kuchen.
… Theater.
… Workshops.
\stopTestQuestions

How do you think you did on that test? Here's another one.

\startTestQuestions
In den Büchereien gibt es auch … 
… Kuchen.
… Theater.
… Workshops.
\stopTestQuestions

\stoptext

—
Bruce Horrocks
Hampshire, UK


tt.tex
Description: Binary data

___
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: XML processing, unwanted indentation/alignment

2024-02-15 Thread Bruce Horrocks
The extra space is because you have a space between {first_name} and 
{\xmlatt... on line 9 of xml.tex.

> On 15 Feb 2024, at 20:28, Michael Guravage  
> wrote:
> 
> Greetings,
> 
> I'm typesetting an address book whose addresses are in XML. A typical entry 
> has this structure:
> 
>   
> 
> 
>mobile="" /> 
>
>   
> 
>   
> 
> initials and birthday are required, first_name can be left blank and email, 
> mobile and maiden_name are optional.
> 
> I've written a macro (name) to compose the name, i.e. initials, first_name 
> (maiden_name), and another macro (nameemaillink) to make the name a link 
> associated with an email address. 
> 
> % Derive an individual's name
> \def\name#1%
>   {\ifxmlattempty{#1}{first_name} {\xmlatt{#1}{initials}} \else 
> {\xmlatt{#1}{initials}, \xmlatt{#1}{first_name}} \fi
 Remove the space after {first_name} here
>\ifxmlattempty{#1}{maiden_name} {} \else { 
> \tfxx(\xmlatt{#1}{maiden_name})} \fi}
> 
> % Create a mailto:link that associates a individual's name with their email 
> address.
> \def\nameemaillink#1%
>   {\ifxmlattempty{#1}{email} {\name{#1}} \else {\goto{\name{#1}} 
> [url(mailto:\xmlatt{#1}{email})]} \fi}
> 
> I thought I was done when I noticed that a composed name with an empty first 
> name, with or without an email address, is slightly indented. In the mwe Moe 
> and Curly, without first names, are indented; while Shemp and Michael aren't.
> 
> That the undesired indentation/alignment is dependent on the presence of a 
> first name is baffling.  After this long description, if someone would look 
> at the code and tell me where I've gone wrong I would be very grateful. The 
> interesting bits begin on lines 8 and 12 in xml.tex. 

—
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 print the book title and section title where \reference is located?

2024-02-09 Thread Bruce Horrocks


> On 7 Feb 2024, at 03:47, Joel via ntg-context  wrote:
> 
> I have an extensive multi-book project. Each book has a nickname, like TB for 
> "Textbook", "WB 1" for the "Workbook, Vol. 1":
> 
> TB -- 01_textbook.tex
> WB 1 -- 03_workbook.tex
> WB 2 -- 04_workbook.tex
> WB 3 -- 05_workbook.tex
> WB 4 -- 06_workbook.tex
> TG -- 08_teachersguide.tex
> 
> I have to prove to a government agency that the content meets several 
> requirements, so I'm giving them a simple file that says something like 
> "Requirement A is met in TB, "Cats", p. 11" basically letting the reader know 
> its in the textbook, section called "Cats", on p. 11. To mark the pages, I'm 
> simply dropping in macros called "\requirementA" "\requirementB" on whichever 
> page of whichever book demonstrates it meets the requirement, then the file 
> will aquatically list the book, section, and page number by searching for 
> that macro.

[snip]

> Here is a sample message what the output should give:
> 
> "Requirement A is met in WB 3, "Bears", p. 33."

Taking you literally in that you want a *file* listing the occurences and not a 
typeset page listing the occurrences then you could try using the following in 
your document at the places where you currently put \requirementA etc:

\writestatus{RequirementMet}{Requirement A is met in section 
\fetchmark[section][current], p. \pagenumber}

This will write the current section title and page number to the console 
listing, prefixed by the word "RequirementMet". To produce the file for your 
customer all you have to do is filter these lines out of the .log file that is 
produced when you compile your book. In Unix-like systems that is a simple: 
grep RequirementMet file.log

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: chronological TOC

2024-01-29 Thread Bruce Horrocks
On 29 Jan 2024, at 19:15, Wolfgang Schuster  
wrote:
> 
> Henning Hraban Ramm schrieb am 27.01.2024 um 10:05:
>> Am 26.01.24 um 23:46 schrieb jbf:
>>> I wonder if someone can point me in the right direction for a separate TOC 
>>> which needs to be in chronological order at the back of the book (i.e. not 
>>> in page number order, although I need the page numbers to show up in the 
>>> TOC. There is the normal TOC at the front of the book, according to chapter 
>>> titles.
>>> 
>>> I have succeeded in defining a separate TOC to place at the back, but have 
>>> not succeeded in the chronological order! Here is what I have done:
>>> 
>>> \definelist[chron][criterium=all,alternative=c]
>>> 
>>> At the back of the book:
>>> 
>>> \placelist[chron][criterium=all]
>>> 
>>> Then at an appropriate point after each \startchapter I have placed (as an 
>>> example):
>>> 
>>> \writetolist[chron]{}{{\bf 29 April 2017,} Speech, Panama City}
>>> 
>>> This gives me my list, but in page number order. How do I get the date 
>>> (e.g. 29 April 2017) to be the ordering factor in the list. I assume it 
>>> will be something to do with criterium, but am clueless at the moment on 
>>> how to indicate this.
>> I don’t know if it works this way (the wizards will know a way), but for 
>> special needs I’m (ab)using indexes:
>> just add something like \index[2017-04-29]{Speech, Panama City} to your 
>> chapter command and setup the index at will.
> 
> Lists have a sort option but this is no use here because you can't use the 
> title to have a chronological sorted list.
> 
> \starttext
> 
> \placelist[section][order=title]
> 
> \section{Hans}
> 
> \section{Peter}
> 
> \section{Anton}
> 
> \stoptext
> 
> Using the register mechanism as you suggest seems to be the best option in 
> this case.

The order= mechanism doesn't seem to work for \definelist lists as opposed to 
the built-in ones, viz:

\definelist[chron]
\starttext

\placelist[section][order=title]

\section{Hans}
\writetolist[chron]{}{Hans}

\section{Peter}
\writetolist[chron]{}{Peter}

\section{Anton}
\writetolist[chron]{}{Anton}

\placelist[chron][criterium=all,order=title]
\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: How to stop

2024-01-28 Thread Bruce Horrocks


> On 27 Jan 2024, at 21:29, Joel via ntg-context  wrote:
> 
> I have a document that uses ~40 different TABLE configurations, each with 
> their own special requirements, such as these below, and in total, perhaps 
> 2000 tables appear in a file, using one of the configurations.
> 
> \setupTABLE[r][1][align=raggedleft]
> \setupTABLE[c][1][width=.1\textwidth]
> \setupTABLE[c][2][width=.33\textwidth]
> \setupTABLE[c][3][width=.37\textwidth]
> \setupTABLE[c][4][width=.1\textwidth]
> \setupTABLE[c][5][width=.1\textwidth]
> \setupTABLE[c][1,2,3,4,5][align=raggedleft, 
> frame=off]
> 
> %\setupTABLE[r][2,3,4,5,6,8,9,11,12,14][bottomframe=off]
> \setupTABLE[r][1][bottomframe=on]
> \bTABLE[split=yes]
> \bTR\bTD {\it Lesson}\eTD\bTD {\it 
> Time} \\eTD\bTD {\it Date} \eTD\bTD {\it Page} \eTD\eTR
> \eTABLE
> 
> What I've been finding is that previous settings on TABLES appearing earlier 
> in the document is impacting later tables. For instance, if one has a frame 
> to the right of column 1, then the next table seems to acquire this setting 
> as well, even if it isn't expected to have any frames at all.
> 
> Note that each unique table is defined inside a macro.
> 
> How can I make these table settings only apply to the a specific table?

Use setups, one for each of your 40 variations:
e.g:

\startsetup formatA
  \setupTABLE[r][1][align=raggedleft]
  \setupTABLE[c][1][width=.1\textwidth]
\stopsetup
\startsetup formatB
  \setupTABLE[c][1,2,3,4,5][align=raggedleft, frame=off]
\stopsetup

\bTABLE[setups=formatA]
...
\eTABLE

\bTABLE[setups=formatB]
...
\eTABLE

—
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: upload

2024-01-23 Thread Bruce Horrocks
On 23 Jan 2024, at 16:29, Otared Kavian  wrote:
> 
> I wonder whether other MacOS users have had such a problem.

Both Intel and ARM macs updated perfectly for me, just now.

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: Why LuaMetaTex is so slow?

2024-01-19 Thread Bruce Horrocks


> On 19 Jan 2024, at 09:31, Hans Hagen  wrote:
> 
> On 1/18/2024 11:15 PM, Bruce Horrocks wrote:
>> On 18 Jan 2024, at 18:56, Shiv Shankar Dayal  
>> wrote:
>>> 
>>> I understand that why it is slow, but the problem is that the difference is 
>>> too high.
>>> My book has lots of math, so perhaps that is the reason.
>> Option 1: Buy or borrow a faster computer. You'll get your desired speed-up 
>> far faster than waiting for Hans to make changes, even assuming there is 
>> something that can be changed. I'd recommend a Mac M3 :-)
> 
> As tex is a single core process (ok, the os might delegate some file handling 
> to other cores) it benefits from  jump in core speed. I use a 2017 laptop 
> with a reasonable fast intel xeon.  I have a few docks spread round with 
> different resolution monitors (1920x1200, 2560×1440, 4096×2160) and 
> performance also depends on the connected monitor.
> 
> I'd be curious to know how much these new processors impact performance over 
> time because the ages of dohbling performance every year are past.

I mentioned the Mac M3 because it's not the cores that make the difference but 
the speed of the SSD. So reading the source and writing out the result, plus 
writing/reading any intermediate files is astonishingly fast on the Mac. Also 
the RAM is on the same die as the chip so RAM access speeds are high. Even if 
the app is single-threaded, the speed increases are significant - in fact 
especially when the app is single is threaded. :-)

—
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: Why LuaMetaTex is so slow?

2024-01-18 Thread Bruce Horrocks
On 18 Jan 2024, at 18:56, Shiv Shankar Dayal  
wrote:
> 
> I understand that why it is slow, but the problem is that the difference is 
> too high.
> My book has lots of math, so perhaps that is the reason.


Option 1: Buy or borrow a faster computer. You'll get your desired speed-up far 
faster than waiting for Hans to make changes, even assuming there is something 
that can be changed. I'd recommend a Mac M3 :-)

Option 2: Split your book into a project with each chapter, or even part of a 
chapter as a separate component and compile only the chapter you are working 
on. Set up a nighttime (or lunchtime) run to regenerate the entire book while 
you're away from the computer and speed doesn't matter.

—
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: Looking for itemize help

2024-01-15 Thread Bruce Horrocks
On 15 Jan 2024, at 16:15, Jim  wrote:
> 
> I would like
> something which automagically "does the right thing".

Not pretty, but... :-)

\setupwhitespace [big]
\setuppapersize [letter]

\define[1]\mystopitemize{\stopitemize\doifsamestringelse{#1}{\par}{\blank}{#1}}

\starttext
This is a short paragraph.

This is a line before an itemization.
\startitemize[nowhite]
\item First item.
\item Second item.
\mystopitemize
This is a short paragraph immediately following.

This is a line before a {\bf nowhite, after} itemization.
\startitemize[nowhite]
\item First item.
\item Second item.
\mystopitemize

This is the next short paragraph, not part of the above.

\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: font error in float placement?

2024-01-14 Thread Bruce Horrocks
On 13 Jan 2024, at 20:29, Henning Hraban Ramm  wrote:
> 
> Am 13.01.24 um 21:09 schrieb Henning Hraban Ramm:
>>> Here’s the image:
>>> https://yemaya.fiee.net/s/8TqwfcP7mLMmy9p
>>> (In a simple document it works.)
>> I found a workaround: I opened the file with Inkscape and converted 
>> everything in curves. The PDF is even smaller now, and it proves that the 
>> problem was with the fonts. Saving it in Acrobat Pro didn’t help.
>> BTW the "compact" settings didn’t change anything for my big songbook 
>> (hundreds of note line PDFs with included fonts); I’m not sure about the 
>> code examples in my ConTeXt book.
> 
> I found more graphics (PDFs with included fonts) that triggered the error, 
> one of them a LilyPond example that was no problem in the songbook.
> Something in my ConTeXt book setup causes a different handling of these 
> externalfigures – but a small example with the same environments worked.

Whenever I've had odd results like this it's been the result of an accumulation 
of 'small' errors. For example, I once had a missing } in a macro in an 
environment file. For whatever reason, it didn't trigger an immediate end to 
the compilation run and a product with one or two components (using that 
environment) didn't trigger odd behaviour. But once all components were 
included then the odd behaviours started happening.

—
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: Asking help for better way to make tickets.

2024-01-12 Thread Bruce Horrocks


> On 12 Jan 2024, at 14:05, Jeong Dal via ntg-context  
> wrote:
> 
> Dear all,
> 
> I’d like to make a ticket on A4 as follows:
> 
> 1. Use all of A4(no margin, no header, no footer,…)
> 2. Arange 12 tickets in the form of 3 x 4 on one page,
> 3. Two rows are same,
> 4. Numbers in the center of the ticket which is increasing.
> 
> I use the following code to make it.
> 
> but I think that there is a better and simpler way to do it which I don’t 
> know.
> 
> I hope that someone give me a nicer way to do it.

Not sure if it is 'nicer' but I use a table to print addresses onto sticky 
labels. The code should be fairly easy to adapt or just borrow some ideas.
<https://sourceforge.net/projects/context-address-labels/>

—
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: LMTX schema for poster

2024-01-11 Thread Bruce Horrocks


> On 11 Jan 2024, at 19:15, vm via ntg-context  wrote:
> 
> 
> 
> On 11/01/2024 19:52, Henning Hraban Ramm wrote:
>> Here’s a preliminary schema of LMTX. What do you think?
> 
> as is, it is difficult to understand where to look.
> what does is describe?
> 
> e.g. what is the distinction between the 'source' (lua tex) and the 
> 'resources' (fonts icc lib) and the 'frontend' (tex xml png ...mp)
> (no lua?)

Agreed.

In no particular order:

1. "ConTeXt" should be the biggest word - or as an obvious title for the 
poster, away from the actual drawing.

2. Don't add the "MkXL" bit - it's a distracting detail that no one needs to 
know at this stage. Also it looks like "Mk 40" in Roman numerals, or extra 
large.

3. I though Hans had stopped using the TeX style capitalisation now i.e. just 
"Context"?

4. It's not clear whether the intersecting boxes are simply decorative or meant 
to present some sort of logical structure. I'm happy for it to be decorative, 
in which case fewer labels might be better.

5. Similar to the box structure comment is that it's not clear which words I 
should be looking at. Ask yourself: what word(s) do I want the viewer to 
remember when they walk away?

6. Consider swapping the TeX and MetaPost circles so that Lua, MetaPost and TeX 
are read left to right as they appear in the acronym LMTX. Perhaps invert the 
"triangle" so that there are two circles at the top.

7. It doesn't really tell the viewer that Context is a typesetting system - it 
looks like it is a system for producing XMLs and PDFs. (Which is what it is 
but... much more)

8. Don't forget space for a URL and/or a QR code to the Contextgarden website.

Sorry if the above sounds harsh - not meant to be - just brain storming.

I have a suggestion though. Use the Christmas card code / memory game code to 
produce patterns to use as the dots in the QR code? If the QR is large enough 
for people to distinguish the individual dots then it would provide a talking 
point? Or maybe have a copy of the card game to hand and challenge them to find 
a randomly drawn card in the QR code?

—
Bruce Horrocks
Hampshire, UK

—
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: \setupsynonyms textstyle=cap failing

2023-12-23 Thread Bruce Horrocks


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

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

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

\starttext

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

Test 1 : \NTG .

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

\stoptext

—
Bruce Horrocks
Hampshire, UK

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

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


[NTG-context] Re: install-modules script and git URLs

2023-12-19 Thread Bruce Horrocks
Firstly, apologies for any confusion: Apple Mail has decided it knows best and 
has doubled-up the URLs containing { placeholders }. Since the URLs contain 
placeholders then they can't be used directly anyway but you knew that. :-)

Secondly, on re-reading, it comes over as instructions for Hraban when it was 
meant to be a suggestion to Pablo to try the alternate form of the Github 
repository URL first.


> On 19 Dec 2023, at 21:47, Bruce Horrocks  wrote:
> 
>> 
>> On 19 Dec 2023, at 17:48, Henning Hraban Ramm  wrote:
>> 
>> Am 19.12.23 um 18:29 schrieb Pablo Rodriguez via ntg-context:
>>> Hi Hraban and Taco,
>>> the install-modules script doesn’t allow .tar.gz as compression format
>>> to install modules.
>>> .tar.gz seems to be the compression format offered for modules that are
>>> uploaded using a git URL.
>>> Hraban explained in August that the server could be configured to get
>>> .zip compression for modules in git checkout.
>>> Sorry, I know that you are both very busy, but could it be this issue fixed?
>> 
>> I looked at the code and don’t understand enough of it… (it’s old Perl CGI 
>> code).
>> There are more changes that I’d like to do (e.g. add more licenses – needs 
>> db access).
>> 
>>> Using git to upload module versions is way more easy than uploading .zip
>>> files.
>> 
>> I agree.
> 
> The Github API for retrieving a 'zipball' is documented here
> <https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#download-a-repository-archive-zip>
> 
> The explanation of the allowed options is a little terse but, basically, a 
> URL of the form
> 
>  
> https://api.github.com/repos/{OWNER}/{REPO}/zipball<https://api.github.com/repos/%7BOWNER%7D/%7BREPO%7D/zipball>
> 
> should be sufficient to result in a zipped download of the repository named 
> {REPO} owned by {OWNER}.
> 
> You can test manually from a Unix/Linux command line using the command:
> 
>  $ curl -L 
> https://api.github.com/repos/{OWNER}/{REPO}/zipball<https://api.github.com/repos/%7BOWNER%7D/%7BREPO%7D/zipball>
>  > results.zip
> 
> If the existing Perl CGI uses a curl command like this then it may simply be 
> enough for Pablo to specify a suitably formatted Github URL.
> 
> Note that the -L is necessary because the Github API generates a temporary, 
> time-limited URL and redirects to it by returning a 302 response code.
> 
> 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
> ___


—
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: install-modules script and git URLs

2023-12-19 Thread Bruce Horrocks

> On 19 Dec 2023, at 17:48, Henning Hraban Ramm  wrote:
> 
> Am 19.12.23 um 18:29 schrieb Pablo Rodriguez via ntg-context:
>> Hi Hraban and Taco,
>> the install-modules script doesn’t allow .tar.gz as compression format
>> to install modules.
>> .tar.gz seems to be the compression format offered for modules that are
>> uploaded using a git URL.
>> Hraban explained in August that the server could be configured to get
>> .zip compression for modules in git checkout.
>> Sorry, I know that you are both very busy, but could it be this issue fixed?
> 
> I looked at the code and don’t understand enough of it… (it’s old Perl CGI 
> code).
> There are more changes that I’d like to do (e.g. add more licenses – needs db 
> access).
> 
>> Using git to upload module versions is way more easy than uploading .zip
>> files.
> 
> I agree.

The Github API for retrieving a 'zipball' is documented here
<https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#download-a-repository-archive-zip>

The explanation of the allowed options is a little terse but, basically, a URL 
of the form

  https://api.github.com/repos/{OWNER}/{REPO}/zipball 
<https://api.github.com/repos/%7BOWNER%7D/%7BREPO%7D/zipball>

should be sufficient to result in a zipped download of the repository named 
{REPO} owned by {OWNER}.

You can test manually from a Unix/Linux command line using the command:

  $ curl -L https://api.github.com/repos/{OWNER}/{REPO}/zipball 
<https://api.github.com/repos/%7BOWNER%7D/%7BREPO%7D/zipball> > results.zip

If the existing Perl CGI uses a curl command like this then it may simply be 
enough for Pablo to specify a suitably formatted Github URL.

Note that the -L is necessary because the Github API generates a temporary, 
time-limited URL and redirects to it by returning a 302 response code.

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: Problem with the paragraph

2023-12-15 Thread Bruce Horrocks


> On 14 Dec 2023, at 09:44, Ursula Hermann  wrote:
> 
> If I change the name of the textbackground with my example, I sent yesterday, 
> there is no color in the paragraph. 
> 

Try the following version of your example which incoporates Hraban's and 
Wolfgang's suggestions.
Also take care over changing style so use \bold{this is bold} or {\bf this is 
bold} but not \bf{this is bold}.

\definepapersize[MyBook][width=19cm,height=24cm]
\setuppapersize[MyBook][MyBook] % Prints on paper the size of MyBook
%\setuppapersize[MyBook][A4] %Would print MyBook-size pages on A4 paper
\setupbodyfont[Times New Roman, 12.2pt]
\definemargindata  [MyInMargin][inright]
\definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm]
\defineenumeration
  [theorem]
  [
text=Theorem,
title=yes,
width=fit,
distance=0.2em,
alternative=serried,
  ]
\definetextbackground[GrayBackground][
  location=paragraph,
  background=color,
  backgroundcolor=lightgray,
  leftoffset=.5\bodyfontsize,
  rightoffset=.5\bodyfontsize,
  topoffset=.5\bodyfontsize,
  bottomoffset=.5\bodyfontsize,
  frame=off,]
  \margintext{\blackrule[color=black, height=0.10ex, width=1cm]\\}
  \blackrule[color=black, height=0.10ex, width=13.50cm]
\starttext
\margintext {1.1.1}
{\bf Beispiel 3.2.17 (Vertauschung von All- und Existenzquantor).}
\par Sei M die Menge aller Männer und F die Menge aller Frauen. Die
Aussage h(m, f) sei ”m ist verliebt in f“. Unter diesen Voraussetzungen
machen Sie sich die Bedeutung der beiden Aussagen klar.
\par
\startitemize[n]
 \item \m{\forall m ∈ M : ∃f ∈ F : h(m, f)}
 \item ∃f ∈ F : ∀m ∈ M : h(m, f).
\stopitemize
% I changed the above to use \startitemize but have a look at \placeformula as 
well

\startGrayBackground
Mitunter ist es aus der Formulierung nur schwer zu erkennen, dass
ein \m{∃\forall} oder ein \m{\forall\m∃} versteckt ist. Dann ist es besonders 
wichtig, die
Formulierung sehr lange zu prüfen und eventuell auch formalisiert
noch einmal aufzuschreiben.”
\blank
Der Wert von \m{y = f(x)} ist unabhängig von der Wahl\par
von \m{x\doubleprime} ist gleichbedeutend mit \m{∃y : ∀x : f(x) = y} \par
(Beutelspacher [10, S.54]).
\stopGrayBackground
\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: LMTX: Command handling, Interface between TeX and Lua

2023-12-13 Thread Bruce Horrocks

> On 13 Dec 2023, at 17:13, Gerion Entrup  wrote:
> 
> Is there a simple way to define a new command/environment and handle
> the keyword arguments in Lua? For example defining a frontend command
> like this:

I don't have the answer to your other questions but I do have an example for 
this one.
It's not mine - I'm fairly sure it came from this list but I can't find who 
that was any more.

\startluacode
userdata = userdata or { }

function userdata.mycommand(keywords, keyvals, str) 
keyword_options = utilities.parsers.settings_to_array(keywords)
named_values = utilities.parsers.settings_to_hash(keyvals)

context('First option = ' .. keyword_options[1])
context('\\par')
context('Color chosen = ' .. named_values['color'])
context('\\par')
context('Curly braces = ' .. str)
context('\\par')
end
\stopluacode

\def\mycommand[#1][#2]#3{\ctxlua{
userdata.mycommand('#1', '#2', [==[#3]==])}} 

\starttext
\mycommand[top, inmargin, now][color=green, roof=gabled]{Anne of Green Gables?}
\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: margin bigger than backspace pushes it outside the edge

2023-12-10 Thread Bruce Horrocks
On 10 Dec 2023, at 10:30, Jigé via ntg-context  wrote:
> 
> I've been struggling with basic page layout.
> 
> The left margin extends outside the left edge of the page.
> Example (from the wiki):

I don't know why it is like this but changing it now would probably break a lot 
of documents that rely on the defaults.

I suspect that most people, me included, simply adjust margin sizes until they 
have a pleasing result. This would only become a problem if margin text is used 
a lot.

The following corrects for the left margin starting off the page for both 
single and doublesided documents. The remainder of the settings will need 
adjusting to suit your specific circumstances.

\setuppapersize[A4][A3]
\setuplayout[location=middle]
\setuppagenumbering[alternative=doublesided]
\setuplayout[backspace=30.8mm]
\starttext
\showlayout[4,pt,cm]
\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: (again) wrong destination types?

2023-12-04 Thread Bruce Horrocks


> On 3 Dec 2023, at 15:26, Pablo Rodriguez via ntg-context  
> wrote:
> 
> On 11/22/23 00:06, Bruce Horrocks wrote:
>> [...]
>> I changed your example to the following:
>> \setupinteraction[state=start, page=name, focus=standard]
>> \starttext
>> \input knuth \par
>> a\footnote{b} \par
>> \dorecurse{7}{\input knuth \par}
>> \stoptext
> 
> Many thanks for your fast reply, Bruce.
> 
> I wanted to reply much sooner, but it was really impossible for me.
> 
>> From your explanation, the first link (body to footnote, your point b)
> has destination to fit the whole page inside the viewer.
> 
> The second link (footnote to body, your point c) has the destination to
> reach a position inside the page (where the destination lies). This is
> what "focus=standard" should achieve.
> 
> In PDF terms (simplified), fit to page destinations are /Fit
> destinations and placed destinations are /XYZ destinations.
> 
> This sample shows what might be the root issue here:
> 
>  \setupinteraction[state=start, page=name, focus=standard]
>  \starttext
>  \completecontent
>  \chapter{Chapter}
>  a\footnote{b}
>  \stoptext
> 
> ConTeXt handles internally links in categories. For some reason unknown
> to me, "page=name" triggers that special operation links contain /Fit
> instead /XYZ destinations.
> 
> This is similar to the wrong link destinations (fit instead of standard)
> from TOC (but not in footnotes [which are right]) when compiled with MkIV:
> 
>  \setupinteraction[state=start, focus=standard]
>  \starttext
>  \completecontent
>  \chapter{Chapter}
>  a\footnote{b}
>  \stoptext
> 
> I hope it is clearer now. Let me know if it is not.
> 
> My issue is that I cannot avoid having "page=name" for links to external
> documents, but this breaks footnotes and other special operation links.

What are you using for links to external documents? If just a single command 
such as \goto then you might be able to get away with defining a wrapper (e.g. 
\myGoto) that does \setupinteraction[state=start,page=name,focus=standard] then 
the \goto command then \setupinteraction[state=start,page=fit,focus=standard] 
afterwards.

(Assuming calling \setupinteraction that many times does not cause problems in 
itself.)

—
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: It works after a few changes but ..

2023-11-21 Thread Bruce Horrocks


> On 20 Nov 2023, at 08:54, Ursula Hermann  wrote:
> 
> Dear Bruce, 
> 
> Yes, I need also margintext. 

What do you want to appear in the margin: the theorem number or the section 
number of the current section?

In other words, what should replace the "hard coded" 2.1.1 that you have in 
your example?

> 
> 
>> On 17 Nov 2023, at 14:06, Ursula Hermann  wrote:
>> 
>> \margintext{2.1.1}{\starttheorem {The square on the hypotenuse is 
>> equal to the sum of the squares on the other two sides. Ach is das 
>> schön, dass du da bist} \stoptheorem
> 
> The spurious parentheses seem to be a side-effect of having unmatched curly 
> brackets in the bit that I have quoted.
> 
> The following eliminates them:
> 
> \definemargindata  [MyInMargin][inright] 
> \definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1cm]
> \margintext{\blackrule[color=black, height=0.25ex, 
> width=1cm]\\}\blackrule[color=black, height=0.25ex, width=7cm] 
> \setupenumerations  [ before={\blank[big]},
>   after={\blank[big]},
>   location=serried,
>   width=broad,
>   distance=0.5em,
>   headstyle=bold,
>   titlestyle=normal,
>   way=bytext,
>   conversion=numbers]
> \defineenumeration
> [theorem]
> [text=Theorem,
> title=yes,
> style=italic,
>  list=all,
>  listtext={Theorem }]
> \starttext
> \margintext{2.1.1}{\starttheorem The square on the hypotenuse is equal to the 
> sum of the squares on the other two sides. Ach is das schön, dass du da bist 
> \stoptheorem } \stoptext
> 
> I see also in this thread that you have sad "yes" to Aditya's suggestion. But 
> that doesn't have the margintext. Do you still want/need margintext?

—
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: (again) wrong destination types?

2023-11-21 Thread Bruce Horrocks


> On 20 Nov 2023, at 18:01, Pablo Rodriguez via ntg-context 
>  wrote:
> 
> Dear list,
> 
> sorry for insisting, but this is important for my documents.
> 
> I have the following sample:
> 
> \setupinteraction[state=start, page=name, focus=standard]
>  \starttext
>  a\footnote{b}
>  \stoptext
> 
> If page is set to anything different than no in \setupinteractionscreen,
> focus=standard will not work (it will be used as focus=fit).
> 
> Could anyone confirm the issue or explain me what I’m doing wrong?
> 
> Many thanks for your help
> 

I changed your example to the following:

\setupinteraction[state=start, page=name, focus=standard]
\starttext
\input knuth \par
a\footnote{b} \par
\input knuth \par
\input knuth \par
\input knuth \par
\input knuth \par
\input knuth \par
\input knuth \par
\input knuth \par
\stoptext

Using Preview on the Mac I see the following behaviour:
a) The doc opens at page 1, in continuous scroll mode, with the table of 
contents sidebar open. I'm pretty sure it's opening at 100% zoom but it's 
surprisingly hard to verify that in Preview.

b) When I click on the superscript 1 in the main body of the text nothing 
happens. This is because the footnote text is already visible.

c) When I click on the superscipt 1 in the footnote then the view changes and 
the document is scrolled so that the superscript 1 line in the main text is at 
the top of the window.

This is what I would expect for focus=standard as described on the Wiki.

Adobe Acrobat Reader is the same except that the opening view is different - I 
think it is defaulting to my preferences which is to have a double-page view.

—
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: It works after a few changes but ..

2023-11-18 Thread Bruce Horrocks

> On 17 Nov 2023, at 14:06, Ursula Hermann  wrote:
> 
> \margintext{2.1.1}{\starttheorem {The square on the hypotenuse is equal
> to the sum of the squares on the other two sides. Ach is das schön, dass du 
> da bist}
> \stoptheorem

The spurious parentheses seem to be a side-effect of having unmatched curly 
brackets in the bit that I have quoted.

The following eliminates them:

\definemargindata  [MyInMargin][inright]
\definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1cm]
\margintext{\blackrule[color=black, height=0.25ex, 
width=1cm]\\}\blackrule[color=black, height=0.25ex, width=7cm]
\setupenumerations
 [ before={\blank[big]},
   after={\blank[big]},
   location=serried,
   width=broad,
   distance=0.5em,
   headstyle=bold,
   titlestyle=normal,
   way=bytext,
   conversion=numbers]
\defineenumeration
 [theorem]
 [text=Theorem,
 title=yes,
 style=italic,
  list=all,
  listtext={Theorem }]
\starttext
\margintext{2.1.1}{\starttheorem The square on the hypotenuse is equal
to the sum of the squares on the other two sides. Ach is das schön, dass du da 
bist
\stoptheorem }
\stoptext

I see also in this thread that you have sad "yes" to Aditya's suggestion. But 
that doesn't have the margintext. Do you still want/need margintext?

—
Bruce Horrocks
Hampshire, UK



—
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: Text and Remark

2023-11-16 Thread Bruce Horrocks
On 16 Nov 2023, at 12:52, Ursula Hermann  wrote:
> 
> \defineenumeration
> [remark]
> [location=top,text=Remark,inbetween={\blank[nowhite]},after=\blank,headstyle=bold,margin=1in]

Does

[alternative=left,text=Remark,inbetween={\blank[nowhite]},after=\blank,headstyle=bold,margin=1in]

give what you want?

—
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] Problem with dataset not being populated

2023-11-14 Thread Bruce Horrocks
I produce a small magazine where the source files are organised into a product 
and component structure.

For each issue, I have a main file with \startproduct  and then, 
inside that, several \component[filename] statements, one per article. Each 
article starts in a standard way, including adding some information to a 
dataset.

At the end of the issue, the dataset information is retrieved to be printed and 
this is where strange things start to happen.

Sometimes the whole issue will compile without problems and the dataset 
information is retrieved perfectly. I can make edits to both the  product file 
and/or any of the component files and it all recompiles to produce a PDF each 
time.

But at othertimes, something "breaks" and the dataset can't be retrieved or 
isn't created. Everything else compiles fine but there is simply no data being 
retrieved from the dataset so nothing to print.

If I go back to the product file and comment out most of the components then it 
will (99% of the time) 'unbreak' itself and the dataset gets created. Once it 
has started working again I can then uncomment the rest of the components and 
it will recompile with all the dataset data present ... until the next time.

Has anyone seen anything like this?

I'm using Lua to retrieve the dataset info and, when it goes wrong, the dataset 
returned by Lua is a nil value. But the .tua file (not a .tuc) has the full 
dataset structure included.

I can't produce an MWE as I have no idea what to remove and include - it 
doesn't seem to matter which components are left or removed in order to fix the 
problem just as long as several ar removed. In other words, it's not one 
component file causing the problem. And sometimes commenting out just two 
components will fix it, othertimes I have to do most of them.

It could be a caching issue - when it goes wrong, reprocessing the product file 
causes much less to scroll past on the TeXShop log display. And when it is 
fixed, the first successful run has a much longer log, suggesting that more is 
being processed. 

So, unless someone else has seen the above and has the solution, the first 
question is: does LMTX cache the result of previous runs to save reprocessing 
if nothing has changed? If so, how can I force a full reprocess or remove those 
cache files?

I'm using TeXShop to edit and compile, but running "context 
product_filename.tex" from the command line makes no difference. Version is 
2023.09.26 18:19.

—
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: \doifemptyelse issue?

2023-11-14 Thread Bruce Horrocks


> On 14 Nov 2023, at 10:40, Hans Hagen  wrote:
> 
> On 11/13/2023 1:10 PM, Bruce Horrocks wrote:
>> The following MWE gives "false false" instead of "false true". I'm sure this 
>> used to work (18 months or more ago!) as I found it when re-processing an 
>> old document.
> 
> because it's not empty (it's a command that you pass)
> 
>> ---start---
>> \setdataset [DS] [a=]
>> \setdataset [DS] [a=]
>> \starttext
>> :\datasetvariable{DS}{1}{a}: \crlf
>> :\datasetvariable{DS}{2}{a}: \crlf
>> \doifemptyelse{\datasetvariable{DS}{1}{a}}{true}{false}
>> \doifemptyelse{\datasetvariable{DS}{2}{a}}{true}{false}
>>   \stoptext
>> ---end---
>> ConTeXt  ver: 2023.09.26 18:19 LMTX
>> There is a work-around using \doiftext instead as that seems to work okay 
>> with recalled dataset values but I thought I'd raise it.
> for that we have:
> 
> \doifsomethingelse
> 

Thank-you for this. I've realised now that this isn't actually my problem (and 
that why it worked in the past was probably becuase that part of the 'if' was 
never taken!).

I'll start another thread.

—
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] \doifemptyelse issue?

2023-11-13 Thread Bruce Horrocks
The following MWE gives "false false" instead of "false true". I'm sure this 
used to work (18 months or more ago!) as I found it when re-processing an old 
document.

---start---
\setdataset [DS] [a=]
\setdataset [DS] [a=]

\starttext

:\datasetvariable{DS}{1}{a}: \crlf
:\datasetvariable{DS}{2}{a}: \crlf

\doifemptyelse{\datasetvariable{DS}{1}{a}}{true}{false}

\doifemptyelse{\datasetvariable{DS}{2}{a}}{true}{false}
  
\stoptext
---end---

ConTeXt  ver: 2023.09.26 18:19 LMTX

There is a work-around using \doiftext instead as that seems to work okay with 
recalled dataset values but I thought I'd raise it.

—
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 problem - labels missing from the main diagram on the Page Layout page

2023-11-05 Thread Bruce Horrocks


> On 5 Nov 2023, at 20:24, peter.hopcroft--- via ntg-context 
>  wrote:
> 
> I see this problem on my iPad: Safari and Orion browsers. 
> 
> I do not see this problem on my mac: Safari and Orion browsers. 
> 

Thank-you both for checking.

Looking more closely it seems that the web page is actually showing a PNG 
preview of the SVG file

https://wiki.contextgarden.net/images/thumb/5/54/layout.svg/525px-layout.svg.png

(NB: there are alternate size variants so the px value may vary for you.[1])

But the issue is still the same - the text labels won't display when the .png 
is viewed via the main page but do display correctly when opened directly.

I'll keep delving.


[1] Now there's an irony: the Wiki software creates different-sized previews of 
a vector image so that it can show the image at different sizes on different 
clients.

—
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] Wiki problem - labels missing from the main diagram on the Page Layout page

2023-11-05 Thread Bruce Horrocks
When I go to the page layout page on the Contextgarden wiki

  <https://wiki.contextgarden.net/Page_Layout>

the "typesetting areas" diagram is missing its text labels. If I click on the 
diagram the Wiki takes me to the underlying layout.svg file and then I /do/ see 
the labels.

This happens in both Safari and Firefox.

Any suggestions as to what needs to be changed to get the diagram to display 
correctly?

—
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: Combining python and lua

2023-10-25 Thread Bruce Horrocks
On 25 Oct 2023, at 16:45, Alexandre Christe  wrote:
> 
> Dear list,
> 
> I’d like to know the best approach to make this a bit more usable. I’m trying 
> to typeset a table with sin/cos/tan values. I’d like to be able to convert 
> the angles in degrees into radians (with math notation) and to compute the 
> trigonometric function leading to sin(pi/4) = 1/2, or cos(pi/6) = sqrt(3)/2 
> and display it in math mode.

You can use templates to subtitute values into a string and then send that out 
to be typeset.
For example: if you want to turn "sin(pi/4) = 1/2" to 

  \startformula
  \sin{\frac{\pi}{4}} = \frac{1}{2}
  \stopformula

Then use this Lua code:

  local myTrigTemplate = [[
\startformula
\%fname%{\frac{\pi}{%divisor%}} = \frac{%numerator%}{%denominator%}
\stopformula
  ]]

  context.templates[myTrigTemplate] {
fname = "sin",
divisor = 4,
numerator = 1,
denominator = 2
  }

By combining them (using the result of a simple template as the parameter value 
into a larger template) you can create a function similar to Python's latex() 
that handles the trig functions you are using. That is the easy bit.

Converting the angle into radians and then getting the result as a fraction of 
pi requires you to implement a continued fraction algorithm to determine 
numerator and denominator.

Extending that to determine whether to use sqrt(3)/2 instead of some other 
fractional approximation is another significant step up in complexity.

I can send you some code that does that - but it's written in HP-71 BASIC so 
you'll have to adapt it. :-)

The real question is: do you really want to be able to generate an expression 
from *any* initial angle value or just those in your table? If it's just those 
in your table then I think it would be much, much less effort to extend 
'angleList' with accompanying lists holding the values to substitute into the 
template. Or even just typeset the whole table by hand (prepare a list of the 
expressions and use editor macros to ConTeXtify them).

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: regular online meetup

2023-10-11 Thread Bruce Horrocks
I'd quite like to discuss this if people don't mind.
<https://www.mail-archive.com/ntg-context@ntg.nl/msg105880.html>

There's a PDF attached which illustrates the issue.

> On 11 Oct 2023, at 08:15, Henning Hraban Ramm  wrote:
> 
> Reminder: this is tonight at 19:00 CEST (UTC+2), 4h later than up to last 
> time.
> 
> HR
> 

—
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] Problems with line numbered program listings

2023-10-04 Thread Bruce Horrocks
I'm trying to typeset some program listings with annotations alongside. I've 
tried both columns and tabulate but both have (different) issues:

1) Plain \typefile won't allow the line numbers to be in the text - they stay 
in the margin whch I don't want.

2) \typefile using a \definedtyping name does work and works in \columns as 
well. This is great until my listing is too long to fit on a page and then I'd 
rather have the column continue onto the next page but \columns balances of 
course.

3) \tabulate allows a single cell to continue down over the page exactly as I'd 
like, but the line numbers disappear altogether. (And it has to be a single 
cell because the program listings are in source files that I want to include 
using \typefile rather than re-enter to avoid typos.)

You can see each of these effects with the following MWE which first needs a 
file called "three_lines.txt" to be created in the local directory containing 
the lines:
one
two
three

 begin
\setuplinenumbering[location=text,style=\small\tt]
\starttext

Location=text not working in main body
\typefile[numbering=line]{three_lines.txt}

But it does work if a custom typing environment is created.
\definetyping[MyTyping][style=\tt]
\typefile[MyTyping][numbering=line]{three_lines.txt}

Still works if used in a column
\startcolumns
 \typefile[MyTyping][numbering=line]{three_lines.txt}
\column
 :-)
\stopcolumns
\blank

But doesn't work if used in tabulate
\starttabulate[|p|p|]
\NC
 \typefile[MyTyping][numbering=line]{three_lines.txt}
\NC
  No line numbers at all :-(
\NR
\stoptabulate

\stoptext
 end

What I'd most like is for tabulate to allow \typefile with line numbers if at 
all possible.
—
Bruce Horrocks
Hampshire, UK


zz.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Bug? Text following columns at end of page goes into footer not next page

2023-09-30 Thread Bruce Horrocks
Two column text that ends near the foot of a page can push the next line into 
the footer rather than starting a new page.

MWE for ConTeXt  ver: 2023.09.26 18:19 LMTX :-

\setuppapersize [A4]
\showframe

\starttext
Knuth in knolumns
\dorecurse{30}{\crlf}

\startcolumns
  \input knuth
\stopcolumns

This line goes into the footer rather than the next page.
\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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Framed Text with Chapter Numbers as Counter

2023-09-17 Thread Bruce Horrocks


> On 16 Sep 2023, at 21:28, Jeroen  wrote:
> 
> This MWE has a framed text for some verbatim text (code) with as title ref. a 
> counter 1, 2, etc.. Is there a way to change this frame text title as 
> following with the chapter number and a sequential number and the title.

Amemd the \defineenumeration as follows:

\defineenumeration
  [Counter]
  [title=yes,
   alternative=empty,
   before=\startCountFramedText,
   after=\stopCountFramedText,
   left={\somenamedheadnumber{chapter}{current}:}]

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

[NTG-context] Re: Chapters without new page

2023-09-15 Thread Bruce Horrocks


> On 15 Sep 2023, at 13:56, Taco Hoekwater  wrote:
> 
> Like this?
> 
>  \definehead[mychapter][chapter]
>  \setuphead[mychapter][page=no]

Taco beat me to it... a simple example:

\starttext

\chapter{First}
Some text

\chapter{Second}
More text

\chapter{Third}
More text

\setuphead[chapter][page=no]
\chapter{Fourth}
More text

\chapter{Fifth}
More text

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

[NTG-context] Re: streams reversed?

2023-09-14 Thread Bruce Horrocks
On 13 Sep 2023, at 07:47, jbf  wrote:
> 
> When I come to bodymatter and Chapter 1, again it works, except that the 
> positions of the languages are reversed, so I end up with vi on the left and 
> en on the right. By Chapter 2 we are back to the correct position once more 
> (en left and vi right).
> I want to know why this is happening, and if I can prevent it happening.


I've modified the sample code you got from Wolfgang to include chapter headings 
and it all looks fine to me[1] - the red text is all on the right hand side and 
the greeen text is all on the left. If this doesn't help and you still have 
problems then you'll need to post a sample that actually shows the problem. I'm 
using ConTeXt  ver: 2023.09.04 19:15.

\starttext

\startoutputstream[one]
   \startcolor[red]
   \dorecurse{5}{\chapter{Stream One}
 \dorecurse{10}{\input knuth\par}
 }
   \stopcolor
\stopoutputstream

\startoutputstream[two]
   \startcolor[green]
   \dorecurse{5}{\chapter{Stream Two}
 \dorecurse{10}{\input zapf\par}
 }
   \stopcolor
\stopoutputstream

\synchronizestreams[one,two]

\setbox\scratchboxone\outputstreambox[one]
\setbox\scratchboxtwo\outputstreambox[two]

\doloop
 {\ifvoid\scratchboxone
\exitloop
  \else
\setbox\scratchboxfour\vsplit\scratchboxone to \textheight
\vbox to \vsize{\box\scratchboxfour\vss}%
\setbox\scratchboxfive\vsplit\scratchboxtwo to \textheight
\vbox to \vsize{\box\scratchboxfive\vss}%
  \fi}

\stoptext


[1] Apart from unnecessary blank pages at the beginning but that's a different 
problem so I'm not addressing that for now.

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

[NTG-context] Re: zint 2.12.0 barcode generator

2023-08-20 Thread Bruce Horrocks
On 20 Aug 2023, at 17:28, Keith McKay  wrote:
> 
> Hi all,
> 
> I've updated the zint barcode generator on my mac mini to 2.12.0 and now no 
> barcode is produced. I have this vague recollection that it is only the 
> 2.10.0 version of zint which works in ConTeXt. If I am correct, is ConTeXt 
> likely to be updated so that 2.12.0 works?  I originally installed zint with 
> Homebrew. There is a very complicated thread on stackoverflow on how to 
> downgrade to previous versions of a formula in homebrew, but it is far too 
> complicated for my wee brain.

zint 2.12.0 works for me on an x64 Mac mini using ConTeXt ver: 2023.08.10 02:59

Following the instructions here <https://wiki.contextgarden.net/Barcodes>

1) I had to create the path $TEXROOT/tex/texmf-osx-64/bin/lib/luametatex/zint
2) I symbolic linked directly to the homebrew created libzint library

   $ cd $TEXROOT/tex/texmf-osx-64/bin/lib/luametatex/zint
   $ ln -s /usr/local/Cellar/zint/2.12.0/lib/libzint.dylib libzint.so

3) Then
   $ cd ~
   $ mtxrun --generate

4) and the sample file

   \usemodule[zint]
   \starttext
   \barcode[alternative=isbnx, text=9783865419026, width=4cm]
   \stoptext

   produced a barcode.

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

[NTG-context] Re: ideas for ConTeXt stickers?

2023-08-08 Thread Bruce Horrocks


> On 7 Aug 2023, at 18:13, Henning Hraban Ramm  wrote:
> 
> while it’s too late for this year’s conferences, I’d like to have some nice 
> ConTeXt, MetaPost or general TeX stickers for next year’s.
> Do you have ideas?


Here's my suggestion for a sticker that we can't use. ;-)

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

[NTG-context] Re: How to make words searchable without diacritics

2023-08-06 Thread Bruce Horrocks
In Adobe Reader there is an option Preferences › Categories › Search › [ ] 
Ignore Diacritics and Accents which you can tick to search on the underlying 
letter only.

If the search is for your own use only then this might be a solution rather 
than change the generated PDF.

> On 5 Aug 2023, at 20:16, Marcus Vinicius Mesquita 
>  wrote:
> 
> Dear List,
> 
> I have a lot of latin words in a document with the length of the
> vowels indicated by diacritics, for example: fīlĭa.
> 
> Is it possible somehow to make these words searchable without the diacritics?
> That is, if I make a search for filia in the final pdf file, fīlĭa
> would also be found?

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

[NTG-context] Re: combining \definetyping and \definebuffer

2023-07-29 Thread Bruce Horrocks
Your example seems to work: I see the \getbuffer[MyBuffer] command typed (not 
executed) with colour coding on the keyword and line numbered; then the block 
text fakewords from the visual module; then the \fakewords macro shown (again 
not executed) as per the default for typing.

What were you exepcting if not this?

(onTeXt  ver: 2023.07.18 22:07 LMTX)

> On 29 Jul 2023, at 20:09, Henning Hraban Ramm  wrote:
> 
> Hi,
> I’d like to use a custom buffer ("MyBuffer") to use a custom typing style 
> ("MyCode"). How does that work?
> 
> 
> """
> \usemodule[visual]
> 
> \definetyping[MyCode]
> 
> \setuptyping[MyCode][
>  option=tex,
>  numbering=file,
> ]
> 
> \definebuffer[MyBuffer]
> 
> \startMyBuffer
> \fakewords{10}{20}
> \stopMyBuffer
> 
> \starttext
> 
> \startMyCode
> \fakeword
> \stopMyCode
> 
> \getMyBuffer
> 
> \typeMyBuffer
> 
> \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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Text item groups

2023-07-16 Thread Bruce Horrocks
I'm not quite sure what you mean by "run along with text". If you mean "keep in 
the same paragraph" then just remove the blank lines from your example, e.g.
\setupindenting[yes,medium]

\starttext

\startitemize[a,text][textdistance=none]

\startitem \input{jojomayer}\stopitem
\startitem \input{jojomayer}\stopitem

\startitem \input{jojomayer}\stopitem

\stopitemize

\stoptext

> On 15 Jul 2023, at 20:46, Jairo A. del Rio  wrote:
> 
> Hi, list! I want to know how to make numbers in text item groups run along 
> with text (for instance, wrt indentation) regardless of their position in 
> text. In the following example:
> 
> \setupindenting[yes,medium]
> 
> \starttext
> 
> \startitemize[a,text][textdistance=none]
> 
> \startitem \input{jojomayer}\stopitem
> 
> \startitem \input{jojomayer}\stopitem
> 
> \startitem \input{jojomayer}\stopitem
> 
> \stopitemize
> 
> \stoptext
> 
> Indentation is ignored altogether. Thank you in advance
> 
> Regards,
> 
> Jairo
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___


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

[NTG-context] Re: {\rm foo {\it bar}}

2023-07-04 Thread Bruce Horrocks


> On 30 Jun 2023, at 10:47, Gerben Wierda  wrote:
> 
> If I typeset
> 
> {\rm foo{\it bar}}
> 
> bar is not in italic

It is in italic for me in ConTeXt  ver: 2023.06.04 

> if I typeset
> 
> {\it bar}
> 
> it is.
> 
> What am I missing?
> 
> Gerben Wierda (LinkedIn, Mastodon)
> R IT Strategy (main site)
> Book: Chess and the Art of Enterprise Architecture
> Book: Mastering ArchiMate

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

[NTG-context] Re: Why is the fonts database not updated?

2023-07-04 Thread Bruce Horrocks


> On 30 Jun 2023, at 10:45, Gerben Wierda  wrote:
> 
> I moved the fonts form my personal library to the system-wide library but 
> context keeps on keeping the font setup to look for the personal library
> 
> After I have run
> 
> mtxrun --script font --reload --force
> 
> and I compile my test file I see:
> 
> fonts   > defining > source file 
> '/Users/gerben/Library/Fonts/Ophian-Regular.otf' is not found
> fonts   > defining > using source file 
> '/Library/Fonts/Ophian-Regular.otf' due to cache mismatch
> fonts   > defining > source file 
> '/Users/gerben/Library/Fonts/Cabin-Regular.ttf' is not found
> fonts   > defining > using source file 
> '/Library/Fonts/Cabin-Regular.ttf' due to cache mismatch
> 
> Is there a better way to force a real reload of the font cache?

The command

  $ mtxrun --scripts cache --erase

should clear the whole cache.

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

Re: [NTG-context] Tabulate: Change cell orienation for individual cells?

2023-06-27 Thread Bruce Horrocks via ntg-context


> On 27 Jun 2023, at 09:56, Denis Maier via ntg-context  
> wrote:
> 
> Hi,
>  is it possible to override the defined orienatation for a given cell ?

\starttext
\starttabulate[|l|c|r|]
\NC this and that \NC left and right \NC here and there \NC \NR
\NC such and so \NC \rotate[rotation=90]{up and down} \NC on and on \NC \NR
\stoptabulate
\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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Off topic: Does a 'free for commercial use' flared-sans font exist in the world?

2023-06-18 Thread Bruce Horrocks via ntg-context


> On 16 Jun 2023, at 17:35, Gerben Wierda via ntg-context  
> wrote:
> 
> I know this is off topic, but I suspect this community is actually one of the 
> best places to find an answer.
> 
> I really like Optima, and what I really like about it is the 'flared style'.
> 
> But I would like to move to a flared-sans font that gives me more licensing 
> freedom. I haven't been able to find one after extensive searching. The only 
> one who were reasonably priced (not free) were the URW Classico ones in Adobe 
> Creative Cloud, but those can only be used in Adobe programs like InDesign 
> (and not TeX).
> 
> I found some flared-sans fonts, but not one with at least regular, italic, 
> bold, and bold-italic.
> 
> Is there really not a single flared-sans font that is really free (so also 
> for commercial use) to use out there?

Not free but good value: Fontspring have a font called Ophian that looks (to my 
untrained eye!) a reasonable match with Optima.

<https://www.fontspring.com/fonts/fontsite/ophian>

$22 for the first licence added to the shopping cart then reductions show for 
the subsequent licences. I'm guessing you'll need two: desktop in order to 
install on a PC and publish a printed book, and eBook to allow distribution of 
a PDF or eBook, so 33 USD in total. There's no time limit nor number of copies 
limit as far as I can see - just one eBook licence per title.

Maybe there will be VAT etc added when you get to checkout - I didn't go that 
far.

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


Re: [NTG-context] xml nbsp?

2023-06-13 Thread Bruce Horrocks via ntg-context
 is not a pre-defined named character in XML (but it is in HTML which 
lulls you into a false sense of security).

See the link below for some more detail and a fix.
<https://coderanch.com/t/322290/java/html-nbsp-braking-space-character>


> On 13 Jun 2023, at 11:01, Hans van der Meer via ntg-context 
>  wrote:
> 
> What happened to the non breaking space in XML? It has disappeared in a way. 
> See the minimal example attached.
> 
> dr. Hans van der Meer
> 


test-nbsp.pdf
Description: Adobe PDF document
> 

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


Re: [NTG-context] Super slow installation

2023-05-31 Thread Bruce Horrocks via ntg-context
On 31 May 2023, at 01:51, Thangalin  wrote:
> 
> From twelve99.net:
> 
> If you’re interested in our IP city prefixes, we have a lookup table on our 
> website: https://www.arelion.com/our-network/bgp-routing/bgp-communities 
> Scroll down to “Origin + Communities” and expand that section. You can see 
> that sea-b1 (your hop 8) is not in Brussels, but is our router in Seattle.
>  
> My guess would be that the hostname “us-was” for Liberty Global (aorta.net) 
> stands for U.S.A. and Washington D.C, not Warsaw. They’re probably using ICMP 
> tunneling for their MPLS backbone, that’s why the ping times are weird for 
> you.

Good point about the MPLS.

I was using https://www.geolocation.com/ to do the geolocation and it claims 
Warsaw but that - in hindsight - is wrong. So "us-was" is likely to be 
Washington as per the name and is also the device "taking the blame" for the 
entirety of the MPLS latency. Since that will include the transatlantic time 
the extra 75ms isn't quite so bad as it looks.

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


Re: [NTG-context] Super slow installation

2023-05-30 Thread Bruce Horrocks via ntg-context
On 30 May 2023, at 18:59, Thangalin via ntg-context  wrote:

[snip]

> $ traceroute lmtx.pragma-ade.com
>  3  rc1bb-be150-1.vc.shawcable.net (64.59.147.161)  22.062 ms  22.094 ms  
> 22.127 ms
>  4  24.244.60.185 (24.244.60.185)  23.964 ms  24.273 ms  23.612 ms
Vancouver

>  5  24.244.62.57 (24.244.62.57)  24.565 ms  24.926 ms  25.269 ms
Edmonton

>  6  rc1bb-be214.vc.shawcable.net (24.244.58.61)  23.201 ms  16.376 ms  16.637 
> ms
back in Vancouver!

>  7  rc1wt.wa.shawcable.net (66.163.76.66)  20.228 ms  15.492 ms  15.227 ms
Winnipeg

>  8  sea-b1-link.ip.twelve99.net (213.248.67.224)  24.968 ms  28.435 ms  
> 24.726 ms
Brussels (allegedly - I don't believe this gelocation site result because 
Winipeg isn't exactly close to the Atlantic and any undersea cable)

>  9  chi-b23-link.ip.twelve99.net (62.115.132.154)  64.194 ms  64.310 ms  
> 64.081 ms
Chicago (that's more like it)

> 10  nyk-bb2-link.ip.twelve99.net (62.115.137.58)  80.232 ms 
> nyk-bb1-link.ip.twelve99.net (80.91.246.163)  80.730 ms 
> nyk-bb2-link.ip.twelve99.net (62.115.137.58)  80.335 ms
New York

> 11  nyk-b1-link.ip.twelve99.net (62.115.135.133)  84.971 ms  85.189 ms  
> 84.776 ms
still New York - worth a site-seeing tour though!

> 12  upc-ic-355153.ip.twelve99-cust.net (62.115.190.245)  90.268 ms  90.132 ms 
>  90.416 ms
Brussels

> 13  us-was03a-rd1-ae-8-0.aorta.net (84.116.133.98)  165.845 ms  159.578 ms  
> 161.045 ms
Warsaw (plus an extra 75ms latency - that's longer than it took to cross the 
Atlantic)

> 14  nl-ams17b-rc1-lag-105-0.aorta.net (84.116.130.65)  168.328 ms  161.507 ms 
>  162.117 ms
Amsterdam - at last!

> 15  asd-rc0001-cr101-be60-2.core.as33915.net (213.51.64.5)  164.180 ms  
> 168.938 ms  169.739 ms
Amsterdam still

> 16  213.51.7.227 (213.51.7.227)  165.693 ms  161.384 ms  161.558 ms
Hoogeveen

> 17  * * *
This timeout is almost certainly because the last server has been set to ignore 
UDP traffic.

  $ traceroute -I lmtx.pragma-ade.com

uses TCP packets rather than UDP and we get the final response much more 
quickly, which is:

17  d57d1da5.static.ziggozakelijk.nl (213.125.29.165)
which is in Hasselt. :-)

> 
> Something is funky on the network.

Yes. A bit of weirdness in Canada - which could be down to a fault causing 
re-routing. But the Warsaw hop, with its huge increase in latency looks like a 
misconfiguration.

Update: just tried it through a VPN that emerges in Vancouver and I also get 
the trip to Warsaw with a big increase in latency. For some reason Aorta.net 
routing some (or maybe all) traffic through Warsaw - perhaps that's where the 
NSA pay them to spy on on all US->Europe traffic? [1]

[1] Joke. (Besides, they'd never do it for traceroute packets because they'd 
want to hide their snooping.) ;-)  [2]
[2] Also a joke ;-)

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


Re: [NTG-context] new module installer and .tar.gz compression

2023-05-08 Thread Bruce Horrocks via ntg-context


> On 8 May 2023, at 16:20, Pablo Rodriguez via ntg-context  
> wrote:
> 
> Hans,
> 
> many thanks for the new script to install modules in LMTX.
> 
> I forced a new release of handlecsv
> (https://modules.contextgarden.net/cgi-bin/module.cgi/action=view/id=86).
> 
> I provide the contents with a git address, so I cannot choose which kind
> of compression the code will have.
> 
> Since imports from git use .tar.gz, these modules cannot be installed
> with the script (which seems to expect .zip compression exclusively).
> 
> Sorry, but I don’t know how to force git urls to be added as zip
> packages in https://modules.contextgarden.net.
> 

Use <https://github.com/ousia/handlecsv/archive/refs/heads/context-suite.zip> 
as the link to download as a Zip file.

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


Re: [NTG-context] new units

2023-05-07 Thread Bruce Horrocks via ntg-context


> On 7 May 2023, at 10:45, Hans Hagen via ntg-context  
> wrote:
> 
> ps. For those unfamiliar with the tex community, when we talk 'research' and 
> such, keep in mind that most tex related research is kind of bogus, wishful 
> thinking, sounding serious, etc. and that most 'projects' are just 
> 'activities by enthousiatic users' In the end it's all about esthetics which 
> is more about feeling and intuition and pretty much driven by user demsnds. 
> In a similar fashion most 'tex conferences' are more user meetings.


Will there be new units to represent the amount of alcohol that has to be 
imbibed in order to (a) create the joke and (b) understand it?

I'm not sure which of these needs to be the larger. Perhaps that could be the 
subject of the next research?

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


Re: [NTG-context] cannot generate format file with current latest

2023-04-30 Thread Bruce Horrocks via ntg-context

> On 30 Apr 2023, at 14:19, Pablo Rodriguez via ntg-context 
>  wrote:
> 
> Dear list,
> 
> I have just updated to current latest (2023.04.27 17:04).
> 
> I always delete cache with "mtxrun --generate" after an update.
> 
> When I try to create the format file with "context --make --all", I get
> the following error message:
> 
> lua error   > lua error on line 645 in file context.mkxl:
> 
> token call, execute: ...ext/base/mkxl/cldf-pos.lmt:18: attempt to index
> a nil value (global 'posit') stack traceback:
> ...ext/base/mkxl/cldf-pos.lmt:18: in local 'code'
> ...ext/base/mkiv/util-lua.lua:96: in field 'loadedluacode'
> ...ext/base/mkiv/luat-env.lua:108: in field 'luafilechunk'
> ...ext/base/mkxl/luat-cod.lmt:82: in function 'lua.registercode'
> [ctxlua]:1: in main chunk
> 
> A number should have been here; I inserted '0'. (If you can't figure out
> why I needed to see a number, look up 'weird error' in the index to The
> TeXbook.)
> 
> Could anyone confirm the issue?

No. Working fine for me on a Mac using that version, both before and after 
running "make all" and "generate".

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


Re: [NTG-context] Problem with exponent

2023-04-28 Thread Bruce Horrocks via ntg-context


> On 28 Apr 2023, at 19:21, Fabrice Couvreur via ntg-context 
>  wrote:
> 
> Hi,
> I want to write x'² . Only, I get x²'.
> Thanks
> Fabrice
> 
> \starttext
> \m{{x'}²+{y'}²}
> \stoptext

This came up before [1]. The solution is to use \primed{...}

\starttext
\m{{x'}²+{y'}²} 
\quad
\m{\primed{x}^2+\primed{y}^2} 
\stoptext


[1] <https://www.mail-archive.com/ntg-context@ntg.nl/msg103779.html>
—
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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Font error in PDF using ConTeXt and Kepler typeface

2023-04-25 Thread Bruce Horrocks via ntg-context
Another check you can do is to run

  $ mtxrun --script font --list --name '--pattern=*kepler*'

and see if the file for keplerstd-light is the one you are expecting and not a 
second copy somewhere that is upsetting things.


> On 25 Apr 2023, at 21:40, lynx--- via ntg-context  wrote:
> 
> Werner:
> This is the one that I think will help the most (taken from the Fonts out of 
> Context manual, pp 147 - 148
> "If you want to use Lucida, all you have to do when you have bought the 
> fonts, is to put
> the OpenType files in a place where they can be found, for instance:
> 
> tex/texmf-fonts/fonts/data/lucida
> 
> Of course you need to run mtxrun --generate afterwards so that the files can 
> be found.
> 
> 
> 
> On 2023-04-25 12:34, lynx--- via ntg-context wrote:
>> Hello, Werner:
>> Have you tried some diagnostic tests, such as trying to get the PDF output 
>> via DVIPS? I suspect that you are, in fact, more knowledgeable and 
>> experience with ConTeXt than I am, but for what it is worth you may want to 
>> look at:
>> • \setupoutput[dvips,acrobat] (see: Context-The Manual (Hans Hagen; 
>> English, page 24))
>> • \showbodyfont[Options] (see: Not-so-short Intro to ConTeXt (J. 
>> Ataz-Lopez;English, page 114))
>> • $ mtxrun  (mtxrun  is the ConTeXt TDS Runner Tool) command from a 
>> terminal window it has has a large number of options for finding the fonts 
>> installed, and for querying their characteristics (see: Fonts out of ConTeXt 
>> (Hans Hagen, pg 52 and ff))
>> Em
>> 
>> On 2023-04-25 08:50, Werner Schmidt via ntg-context wrote:
>> Hi conTeXt folks,
>> 
>> may I ask again. How could I debug the font typesetting of PDF files with 
>> conTeXt?
>> 
>> Any help is highly appreciated.
>> 
>> Best Werner
>> 
>> On April 21, 2023 1:29:18 PM UTC, Werner Schmidt via ntg-context 
>>  wrote: Hi all,
>> 
>> I'd like to use the commercial Adobe Kepler typeface (Kepler Std - version 
>> 2.020) in conTeXt (v2023-04-15) as text (serif) font. Although the font 
>> files are loaded correctly (see log below), the generated PDF is unreadable 
>> (see attached image).
>> 
>> Notes:
>> - Only serif font (keplerstd-light.otf) is not working. It's not embedded in 
>> the generated PDF.
>> - italics and bold fonts are embedded and are rendered well
>> - Can't provide font files because Kepler is a commercial typeface
>> 
>> Do you have any ideas how to debug this issue?
>> 
>> Thanks Werner
>> 
>> log file:
>> mkiv lua stats > loaded fonts: 10 files: fontawesome6freesolid900.otf, 
>> frutigernextpro-bold.otf, frutigernextpro-regular.otf, 
>> iosevka-term-ss09-light.ttf, keplerstd-light.otf, keplerstd-lightcapt.otf, 
>> keplerstd-lightit.otf, keplerstd-semibold.otf, latinmodern-math.otf, 
>> lmroman10-regular.otf
>> mkiv lua stats > font engine: otf 3.133, afm 1.513, tfm 1.000, 30 instances, 
>> 18 shared in backend, 3 common vectors, 15 common hashes, load time 0.449 
>> seconds
>> Example:
>> 
>> This text can't be read in PDF.par
>> {it However, italics are working.}par
>> {bold Also Bold and bfem BoldItalics!}par
>> input{zapf} 

> 

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


Re: [NTG-context] Spacing problem around decimal point

2023-03-28 Thread Bruce Horrocks via ntg-context


> On 28 Mar 2023, at 21:56, Gavin via ntg-context  wrote:
> 
> Hi Hans, Jim, Bruce, et.al.
> 
> Han’s asked me
> 
>> can you pick up a binary from:
>> 
>> https://dl.contextgarden.net/build/luametatex/work/
>> 
>> and test it?
> 
> Maybe. I picked up the binary, but testing it is not quite as easy as it 
> might be due to the MacOS security settings. I’ll see what I can do, but I 
> know very little about Unix/Darwin.
> 
> Since this appears to be an issue across multiple platforms, I’d welcome 
> anyone else checking the new binary. (Thanks, Günter!)

The x86_64-darwinlegacy from that download link version has fixed the problem 
on the Mac. Thank-you all involved.

\starttext
\startformula
v = \frac{1.32}{1.41} = 0.935
\stopformula
\stoptext

gives the attached.
—
Bruce Horrocks
Hampshire, UK


tt.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] natural table oddities

2023-03-27 Thread Bruce Horrocks via ntg-context
If you're asking for comments with a view to making changes then...

> On 27 Mar 2023, at 15:03, Henning Hraban Ramm via ntg-context 
>  wrote:
> 
> I would be happy about some answers/comments.
> Hraban
> 
> Am 13.03.23 um 23:26 schrieb Henning Hraban Ramm:
>> Working on the documentation for “natural tables” in my book I stumbled upon 
>> a few oddities/problems:
>> ## Addressing cells:
>> * There’s \setupTABLE[header], but not "footer" (or "section"); since we 
>> have TABLEhead and TABLEfoot, IMO "head" and "foot" would make sense.

I'd be happy with that, especially as there is already headstyle and headcolor.

>> * Row 1 is the first row of TABLEbody. I couldn’t find how to address the 
>> first line of TABLEbody.
>> * If I format a column, e.g. \setupTABLE[c][-1][color=red], body and foot 
>> are formatted, but not the same column in header. I couldn’t find how to 
>> format columns in header.

If you disregard the Wiki page instructions to use \bTH...\eTH then you can 
format the header using:

  \bTABLEhead
\bTR \bTH Column 1 \eTH \bTD[color=blue] Column 2 \eTD \eTR
  \eTABLEhead

but I'm not sure what the consequences might be, if any. You lose the default 
bold heading so maybe that's all /bTH.../eTH is adding?

It would be nice to have a way of specifying the header explicitly. My 
suggestion would be to have:
- \setupTABLE[r][head][...] affect just the header
- \setupTABLE[r][next][...] affect the new page header
- \setupTABLE[r][first|last|body][...] affect the first, or last, or only the 
body rows (i.e. not the header or footer)
- \setupTABLE[r][foot][...] affect just the footer 

[r][last] (and [r][-1]) would represent the last body row (but not the footer 
row if one has been requested).

Extending to the formatting of header/footer/next etc columns is not quite so 
neat as an extra parameter is required, e.g. [c][][head][...] to reference 
column n in the header. For consistency the syntax [c][][body][...] could be 
an option.


>> * I don’t understand the addressing options "start" and "one".

Me neither. :)

>> ## Formatting
>> * maxwidth doesn’t seem to have an effect, neither on the whole table nor on 
>> a column.
>> * textwidth works only for the whole table.
>> * width gets stretched if option=stretch; i.e. I can’t fix the width of 
>> single cells or columns.

For me, \setupTABLE [c] [1] [width=3cm] fixes the width of column 1 and forces 
long text to wrap.

I'm not sure what your \textwidth comment relates to because \setupTABLE [c] 
[1] [width=.2\textwidth] works as expected for me.


>> ## Page breaking
>> * What’s the difference between split=repeat and header=repeat ?

\setupTABLE [split=repeat] % works as expected for me
\setupTABLE [header=repeat] % doesn't work for me


>> I’d like to know if there are misunderstandings / if the behavior is 
>> intentional.

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


Re: [NTG-context] Spacing problem around decimal point

2023-03-26 Thread Bruce Horrocks via ntg-context
I also get the incorrect spacing on a Mac.

system  > ConTeXt  ver: 2023.03.20 17:07 LMTX  fmt: 2023.3.22  int: 
english/english


> On 26 Mar 2023, at 22:16, Jim via ntg-context  wrote:
> 
> Hi all,
> 
> Regrettably, I see the same problem and Gavin.
> 
> I am using TeXlive 2023 on Slackware64 15.0, for what that is worth.
> 
> 
>Jim
> 
> On Sun, Mar 26, 2023 at 17:36 (+0200), Günter Kolousek via ntg-context wrote:
> 
> 
>> Hi,
> 
>> I can confirm that the x64_64-linux from
> 
>> https://dl.contextgarden.net/build/luametatex/work/
> 
>> version works correctly. So, no excess spaces around the
>> decimal points at all.
> 
>> HTH
>> Günter
> 
>> Hans Hagen via ntg-context @ 2023-03-26 13:22 +02:
> 
>>> On 3/26/2023 4:20 AM, Gavin via ntg-context wrote:
>>>> Hi List,
>>>> I’m getting strange spaces around some decimal points after a clean
>>>> LMTX
>>>> install. MWE:
>>>> \starttext
>>>> \startformula
>>>> v = \frac{1.32}{1.41} = 0.935
>>>> \stopformula
>>>> \stoptext
>>>> This produces the result attached below. The 1.32 looks fine, but
>>>> the next two
>>>> numbers have excess space around the decimal point. Adding the line
>>>>   \showmakeup[mathglue] %\mathspacingmode=1
>>>> to the preamble reveals that the second and third decimal points are
>>>> being
>>>> treated as binary operators. It’s very strang. Are others getting
>>>> this?
>>> can you pick up a binary from:
> 
>>> https://dl.contextgarden.net/build/luametatex/work/
> 
>>> and test it?
> 
>>> Hans
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___

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


Re: [NTG-context] \setupTABLE: framecolor

2023-03-25 Thread Bruce Horrocks via ntg-context


> On 25 Mar 2023, at 05:45, jbf via ntg-context  wrote:
> 
> Hi, I am struggling with the last row of a table which, according to its 
> author, should have a black bottomframe, but gray (I am using a defined 
> 'lightgray') for the sides. The first row has a black frame. All intermediate 
> rows have gray.
> I have no difficulty achieving the first row, and the black bottomframe for 
> the last row, but I have been unable to get the last row sides to be gray. 
> Here is the current setups that I have:
> \setupTABLE[frame=off]
> \setupTABLE[row] [first] [topframe=on,bottomframe=on,style=bold]
> \setupTABLE[row][2][topframe=on]
> \setupTABLE[row][2][topframe=off,rightframe=on,leftframe=on,framecolor=lightgray]
> \setupTABLE[row][3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21][frame=on, 
> framecolor=lightgray]
> \setupTABLE[row] [last] [bottomframe=on,style=normal]
> 
> My first row is fine and all but the topframe of row 2 is 'lightgray'; all 
> following rows are 'lightgray'. The last row (22) has a black bottomframe, 
> but how could I achieve 'lightgray' for rightframe, leftframe? If I add a new 
> setup e.g. 
> \setupTABLE[row][last][rightframe=on,leftframe=on,framecolor=lightgray] then 
> I lose the bottomframe in black. I have tried all kinds of combinations but 
> unsuccessfully.
> Julian 

One way to achieve what you want is to have a dummy last row.

\setupTABLE[frame=off]
\setupTABLE[row] [first] [topframe=on,bottomframe=on,style=bold]
\setupTABLE[row][2][topframe=on]
\setupTABLE[row][2][topframe=off,rightframe=on,leftframe=on,framecolor=lightgray]
\setupTABLE[row][3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22][frame=on,
 framecolor=lightgray]
\setupTABLE[row] [last] [topframe=on,framecolor=black, height=0pt]

\starttext
\bTABLE
  \dorecurse{22}{
  \bTR\bTD Row #1 column 1 \eTD\bTD Row #1 column 2 \eTD\eTR
  }
  % Dummy last row
  \bTR \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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Problem with \stoptabulate

2023-03-21 Thread Bruce Horrocks via ntg-context
Sorry everyone, ignore me, it doesn't work.

(Got my test files mixed up - aargh!)

> On 21 Mar 2023, at 11:06, Bruce Horrocks via ntg-context  
> wrote:
> 
> 
> Thanks Julian - I tried a startstop environment originally but it didn't work.
> 
> The answer turns out to be trivial - just needed to use \long\def for 
> \stoptabulate so the following appears to work:
> 
> \def\startMyExample{\starttabulate[|r|c|l|p|]}
> \long\def\stopMyExample{\stoptabulate}  %% long def required here
> \def\MyExampleItem#1#2#3{\NC #1 \NC \rightarrow \NC #2 \NC #3 \NC\NR}
> 
> \starttext
> Here are some examples...
> 
> \startMyExample
>  \MyExampleItem{before}{after}{change before into after}
>  \MyExampleItem{straw}{gold}{Rumpelstiltskin}
> \stoptabulate
> 
> \stoptext
> 
> 
>> On 21 Mar 2023, at 05:23, jbf via ntg-context  wrote:
>> 
>> Not sure if this helps, Bruce, but there is \definestartstop
>> 
>> Julian
>> 
>> On 21/3/23 10:34, Bruce Horrocks via ntg-context wrote:
>>> I have a technical manual style document that requires a lot of examples to 
>>> be included.
>>> 
>>> They can easily be typeset with a table so I thought I would save myself 
>>> some typing by defining macros for the various bits of a tabulate table. 
>>> Thus I have:
>>> 
>>> \def\startMyExample{\starttabulate[|r|c|l|p|]}
>>> \def\stopMyExample{\stoptabulate}
>>> \def\MyExampleItem#1#2#3{\NC #1 \NC \rightarrow \NC #2 \NC #3 \NC\NR}
>>> 
>>> \starttext
>>> Here are some examples...
>>> 
>>> \startMyExample
>>>  \MyExampleItem{before}{after}{change before into after}
>>>  \MyExampleItem{straw}{gold}{Rumpelstiltskin}
>>> \stopMyExample
>>> %\stoptabulate
>>> 
>>> \stoptext
>>> 
>>> The problem is that \stopMyExample doesn't work - the \stoptabulate isn't 
>>> recognised and I get an end of file reached error. If use a straight 
>>> \stoptabulate then it works as expected. That's fine but it would be nice, 
>>> from an aesthetic point of view, to have start & stop 'paired' commands in 
>>> the source.
>>> 
>>> Presumably some sort of deep ConTeXt fu is going on - can anyone explain it 
>>> please?
>>> 
>>> Regards,
>>> —
>>> Bruce Horrocks
>>> Hampshire, UK
> 
> —
> 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://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___


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


Re: [NTG-context] Problem with \stoptabulate

2023-03-21 Thread Bruce Horrocks via ntg-context

Thanks Julian - I tried a startstop environment originally but it didn't work.

The answer turns out to be trivial - just needed to use \long\def for 
\stoptabulate so the following appears to work:

\def\startMyExample{\starttabulate[|r|c|l|p|]}
\long\def\stopMyExample{\stoptabulate}  %% long def required here
\def\MyExampleItem#1#2#3{\NC #1 \NC \rightarrow \NC #2 \NC #3 \NC\NR}

\starttext
Here are some examples...

\startMyExample
  \MyExampleItem{before}{after}{change before into after}
  \MyExampleItem{straw}{gold}{Rumpelstiltskin}
\stoptabulate

\stoptext


> On 21 Mar 2023, at 05:23, jbf via ntg-context  wrote:
> 
> Not sure if this helps, Bruce, but there is \definestartstop
> 
> Julian
> 
> On 21/3/23 10:34, Bruce Horrocks via ntg-context wrote:
>> I have a technical manual style document that requires a lot of examples to 
>> be included.
>> 
>> They can easily be typeset with a table so I thought I would save myself 
>> some typing by defining macros for the various bits of a tabulate table. 
>> Thus I have:
>> 
>> \def\startMyExample{\starttabulate[|r|c|l|p|]}
>> \def\stopMyExample{\stoptabulate}
>> \def\MyExampleItem#1#2#3{\NC #1 \NC \rightarrow \NC #2 \NC #3 \NC\NR}
>> 
>> \starttext
>> Here are some examples...
>> 
>> \startMyExample
>>   \MyExampleItem{before}{after}{change before into after}
>>   \MyExampleItem{straw}{gold}{Rumpelstiltskin}
>> \stopMyExample
>> %\stoptabulate
>> 
>> \stoptext
>> 
>> The problem is that \stopMyExample doesn't work - the \stoptabulate isn't 
>> recognised and I get an end of file reached error. If use a straight 
>> \stoptabulate then it works as expected. That's fine but it would be nice, 
>> from an aesthetic point of view, to have start & stop 'paired' commands in 
>> the source.
>> 
>> Presumably some sort of deep ConTeXt fu is going on - can anyone explain it 
>> please?
>> 
>> Regards,
>> —
>> Bruce Horrocks
>> Hampshire, UK

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


[NTG-context] Problem with \stoptabulate

2023-03-20 Thread Bruce Horrocks via ntg-context
I have a technical manual style document that requires a lot of examples to be 
included.

They can easily be typeset with a table so I thought I would save myself some 
typing by defining macros for the various bits of a tabulate table. Thus I have:

\def\startMyExample{\starttabulate[|r|c|l|p|]}
\def\stopMyExample{\stoptabulate}
\def\MyExampleItem#1#2#3{\NC #1 \NC \rightarrow \NC #2 \NC #3 \NC\NR}

\starttext
Here are some examples...

\startMyExample
  \MyExampleItem{before}{after}{change before into after}
  \MyExampleItem{straw}{gold}{Rumpelstiltskin}
\stopMyExample
%\stoptabulate

\stoptext

The problem is that \stopMyExample doesn't work - the \stoptabulate isn't 
recognised and I get an end of file reached error. If use a straight 
\stoptabulate then it works as expected. That's fine but it would be nice, from 
an aesthetic point of view, to have start & stop 'paired' commands in the 
source.

Presumably some sort of deep ConTeXt fu is going on - can anyone explain it 
please?

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


Re: [NTG-context] Automatic numbering of footnotes set with \note (not with \footnote)

2023-03-16 Thread Bruce Horrocks via ntg-context
I don't have the answer to your explicit question, but a work-around might be 
to put the footnotes into buffers instead of \footnotetext and then use 
/footnote[...]{\getbuffer[name]} in the body. That way ConTeXt sees them in 
order of appearance in the body and so the numbering should be as you want.

> On 15 Mar 2023, at 09:19, Joaquín Ataz López via ntg-context 
>  wrote:
> 
> Good Morning to all list members.
> 
> I am writing a document with very long footnotes, and in order not to break 
> (in the source file) the flow of the main text, instead of using the 
> \footnote macro, I introduce the footnotes using \note[label] at the point 
> where the call to the footnote should be placed, and in a separate place in 
> the source file I write the text associated to the footnote using 
> \footnotetext[label].
> 
> This works quite well and allows to create a more readable source file. There 
> is, nevertheless, a small inconvenience, and it is that when processing the 
> document ConTeXt goes numbering automatically the notes, attending to the 
> order in which they are, in the source file, the \footnotetext commands. 
> Would there be a simple way so that the automatic numbering follows the order 
> of the \note commands, and not that of \footnotetext? Maybe something with 
> \startbuffer combined with a counter?
> 
> -- 
> 
> Joaquín Ataz López
> Departamento de Derecho civil
> Universidad de Murcia

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


Re: [NTG-context] rotated headers in natural tables

2023-03-15 Thread Bruce Horrocks via ntg-context
\setupTABLE inherits from \setupframed which has an orientation option.

So \bTR[orientation=90] on the header row should do it, with the content 
specified normally i.e. without using \RtH.

A quick test on one of my tables showed some issues with alignment so you may 
need to fix the 'width' (now the height) of the cells rather than let it be 
calculated by contents.

> On 15 Mar 2023, at 18:15, Henning Hraban Ramm via ntg-context 
>  wrote:
> 
> Hi!
> 
> In my table, I want the header texts to be 90˚ rotated and aligned to the 
> bottom of their cell. I couldn’t find an option to do that.
> Tried \dontleavehmode or \hfill in my \RtH macro to no avail.
> Is it possible?
> 
> 
> \define[1]{\RtH}{\rotate{#1}}
> 
> \starttext
> 
> \setupTABLE[offset=3pt]
> \setupTABLE[header][background=color,backgroundcolor=yellow,align=bottom]
> \bTABLE
> \bTABLEhead
> \bTR \bTH\RtH{animal}\eTH \bTH\RtH{size}\eTH \bTH\RtH{weight}\eTH 
> \bTH\RtH{average speed}\eTH \eTR
> \eTABLEhead
> \bTABLEbody
> \bTR \bTD sparrow \eTD \bTD small \eTD \bTD light \eTD \bTD high \eTD \eTR
> \bTR \bTD dog \eTD \bTD medium \eTD \bTD medium \eTD \bTD medium \eTD \eTR
> \bTR \bTD snail \eTD \bTD small \eTD \bTD light \eTD \bTD slow \eTD \eTR
> \bTR \bTD elephant \eTD \bTD big \eTD \bTD heavy \eTD \bTD medium \eTD \eTR
> \eTABLEbody
> \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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] How to extend an existing macro to take optional parameters?

2023-03-14 Thread Bruce Horrocks via ntg-context


> On 14 Mar 2023, at 02:08, Alan Braslau via ntg-context  
> wrote:
> 
> Designating "optional" parameters within [...] is a LaTeX notion.
> ConTeXt handles parameters differently.
> 
> Alan

Thanks Alan but I've never used LaTeX so I've no idea what the philosophical 
differences are.

I wanted three mandatory and two optional params. One of those optional params 
is not typeset so I assumed it should be [ ] delimited and not { }.

> 
>>> and I'd like to be able to extend it so that any of the following
>>> can be used:
>>> 
>>>   \mycommand{aa}{bb}{cc}
>>>   \mycommand{aa}{bb}{cc}{dd}
>>>   \mycommand{aa}{bb}{cc}{dd}[ee]
>>> 
>>> or
>>> 
>>>   \mycommand[ee]{aa}{bb}{cc}{dd}  % if this is more the ConTeXt way
>>> 
>>> where {dd} is the optional extra parameter and, if it is present,
>>> then [ee] can also be optionally added (because it controls how
>>> {dd} is printed).

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


Re: [NTG-context] How to extend an existing macro to take optional parameters?

2023-03-14 Thread Bruce Horrocks via ntg-context


> On 13 Mar 2023, at 21:39, Hans Hagen via ntg-context  
> wrote:
> 
> On 3/12/2023 2:24 PM, Bruce Horrocks via ntg-context wrote:
>> I have an existing macro that I'd like to extend.
>> The current definition is \define[3]\mycommand{...} which I'd like to extend 
>> to take an optional 4th parameter plus an optional setup parameter.
>> Thus I currently invoke it as:
>>   \mycommand{aa}{bb}{cc}
>> and I'd like to be able to extend it so that any of the following can be 
>> used:
>>   \mycommand{aa}{bb}{cc}
>>   \mycommand{aa}{bb}{cc}{dd}
>>   \mycommand{aa}{bb}{cc}{dd}[ee]
>> or
>>   \mycommand[ee]{aa}{bb}{cc}{dd}  % if this is more the ConTeXt way
>> where {dd} is the optional extra parameter and, if it is present, then [ee] 
>> can also be optionally added (because it controls how {dd} is printed).
>> If it helps, the actual body of the macro can easily be a call to Lua so 
>> it's fine if the function takes 5 params where 4 and 5 can be nil or empty 
>> strings.
>> I've trawled through syst-aux.mkiv but it only covers optional numbers of [ 
>> ] or { } but not combinations of both (which given the vast numbers of 
>> combinations is perhaps not surprising!). Have I missed something obvious 
>> that would help me?
> So, four optional with mandate {} plus a fallback to an optional []
> 
> \starttext
> 
> \tolerant\def\mycommand#=#=#=#=#:[#5]%
>  {\ifparameter#1\or(1:#1)\fi
>   \ifparameter#2\or(2:#2)\fi
>   \ifparameter#3\or(3:#3)\fi
>   \ifparameter#4\or(4:#4)\fi
>   \ifparameter#5\or[5:#5]\fi}
> 
> \startbuffer
> \mycommand{aa}{bb}{cc}
>  \mycommand{aa}{bb}{cc}{dd}
>  \mycommand{aa}{bb}{cc}{dd}[ee]
> \mycommand{aa}{bb}{cc}
>  \mycommand{aa}{bb}{cc}{dd}
>  \mycommand{aa}{bb}{cc}{dd}[ee]
> \stopbuffer
> 
> \typebuffer
> 
> \startlines \getbuffer \stoplines
> 
> \stoptext
> 
> I'm not saying that it's the best solution, you can add \protected in front 
> of the \def if needed.
> 
> Hans

Thanks Hans,

This works well. I'll try and add something to the Wiki but I don't understand 
how #: does what it does.

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


[NTG-context] How to extend an existing macro to take optional parameters?

2023-03-12 Thread Bruce Horrocks via ntg-context
I have an existing macro that I'd like to extend.

The current definition is \define[3]\mycommand{...} which I'd like to extend to 
take an optional 4th parameter plus an optional setup parameter.

Thus I currently invoke it as:

  \mycommand{aa}{bb}{cc}

and I'd like to be able to extend it so that any of the following can be used:

  \mycommand{aa}{bb}{cc}
  \mycommand{aa}{bb}{cc}{dd}
  \mycommand{aa}{bb}{cc}{dd}[ee]

or

  \mycommand[ee]{aa}{bb}{cc}{dd}  % if this is more the ConTeXt way 

where {dd} is the optional extra parameter and, if it is present, then [ee] can 
also be optionally added (because it controls how {dd} is printed).

If it helps, the actual body of the macro can easily be a call to Lua so it's 
fine if the function takes 5 params where 4 and 5 can be nil or empty strings.

I've trawled through syst-aux.mkiv but it only covers optional numbers of [ ] 
or { } but not combinations of both (which given the vast numbers of 
combinations is perhaps not surprising!). Have I missed something obvious that 
would help me?

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


[NTG-context] Aaligned numbers in a matrix?

2023-02-26 Thread Bruce Horrocks via ntg-context
I'm using the following MWE to produce a matrix:

\definemathmatrix[bmatrix]
  [matrix:brackets]
  [simplecommand=bmatrix]
\starttext
$ a \rightarrow
  \bmatrix{1, 2, 3, 4; 
   2, 1, 4, 3;
   3,-4, 1,-2;
   4,-3, 2,-1} $
\stoptext

The columns with negative numbers in are centred and I would rather have them 
right-aligned so that the digits stack up above each other and the negative 
signs stick out to the left, so to speak. Is there an easy way to achieve this?

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


Re: [NTG-context] Chapter cover page

2023-02-23 Thread Bruce Horrocks via ntg-context
Hi Alex,

I couldn't get it to work with \tabulate so I switched to TABLE instead. The 
workaround for the horizontal mode problem is to put the chapter title into row 
two of the table. Hopefully this works with your actual text. Also I'm not sure 
where \layoutcolumnwidth is coming from so I just hard-coded a width for now. 
Lastly there are neater ways (using \setuptable) to define the table but it's 
just an example...

\define[2]\MyChapter{
   \bTABLE[frame=off]
   \bTR
 \bTD[width=4cm] \structureuservariable{author} \eTD
 \bTD \structureuservariable{bio} \eTD
   \eTR
   \bTR
 \bTD[nc=2] #1 #2 \eTD
   \eTR
   \eTABLE
}

\definehead[interview][chapter]
\setuphead[interview][
   page=right,
   command=\MyChapter,
   % insidesection={\page},
   style={\tfa},
]

\starttext
\startinterview[title={My Interview}][
   author={Jane Doe},
   year={2022},
   month={Decembre},
   bio={\input ward}
]

\dorecurse{10}{\input ward \crlf}
\stopinterview
\stoptext


> On 23 Feb 2023, at 10:21, Alex Leray via ntg-context  
> wrote:
> 
> Hello,
> 
> I'm trying to figure out how to design a chapter page for a custom head 
> section with uservariables defined.
> 
> I'd like to have the chapter page start on a right page. I'd like this page 
> to feature the title of the chapter (here: an interview) along with some 
> other info like the interviewee name and bio. All in a "fancy" layout.
> 
> I'm having issue putting it all together. The command parameter allow me to 
> override the content of the title but has some drawbacks (it seems to be 
> stuck in horizontal mode for instance).
> 
> I'm open to any solution but would find it nice to keep the 
> \startstopinterview structure.
> 
> Here is my code at the moment:
> 
> %%%
> 
> \define[2]\MyChapter{
>\starttabulate[|p(\layoutcolumnwidth)|p(\layoutcolumnwidth)|]
>\NC \structureuservariable{author} \NC \structureuservariable{bio} \NR
>\stoptabulate
> }
> 
> \definehead[interview][chapter]
> \setuphead[interview][
>page=right,
>command=\MyChapter,
>% insidesection={\page},
>style={\tfa},
> ]
> 
> 
> \starttext
> \startinterview[title={My Interview}][
>author={Jane Doe},
>year={2022},
>month={Decembre},
>bio={\input ward}
> ]
> 
> \dorecurse{10}{\input ward \crlf}
> \stopinterview
> \stoptext
> 
> %%%
> 
> Many thanks
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___

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


Re: [NTG-context] How to prevent \subject from being the last line

2023-02-19 Thread Bruce Horrocks via ntg-context


> On 19 Feb 2023, at 19:34, Sylvain Hubert via ntg-context  
> wrote:
> 
> Dear list,
> 
> I have a long document (A4 * 170 pages) with some CJK fonts, where some of 
> the \subject{...} are placed at the end of the corresponding pages, which 
> looks awkward. How can one flush those last-line titles to the next pages?
> 
> Currently I don't have a MWE, as trivial filling-up with 1-2 pages of \lipsum 
> doesn't reproduce the problem. I'm optimistically asking without MWE, but if 
> it is necessary anyway, please tell me and I will obfuscate the 170-page 
> document and find a way to upload it.

\testpage[...] might help.

<https://wiki.contextgarden.net/Command/testpage>

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


Re: [NTG-context] Problem using \scale

2023-02-10 Thread Bruce Horrocks via ntg-context

> On 10 Feb 2023, at 09:20, Hans Hagen via ntg-context  
> wrote:

[snip]

Thank-you Hans, these work great - so well in fact that now I've seen the 
output I've come to the conclusion that the scaled text would be too small and 
what I should really do is flag the one or two addresses in our mailing list 
that have long lines and print them on larger labels in a separate run. :-)

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


[NTG-context] Problem using \scale

2023-02-09 Thread Bruce Horrocks via ntg-context
I'm printing address labels. Sometimes an address has a long line that is too 
long to fit on the label with the result that it wraps. Instead of wrapping, I 
thought it would be nice to try and auto-scale the label and shrink it so that 
the long line just fits.

I'm using \crlf to break the address into lines and this doesn't play well with 
the \scale command, see MWE below, where the second frame is just one long line 
as the \crlf's seem to be ignored.

Is there a simple solution that allows \crlf and also scale?

\starttext
\startbuffer[address]
Name \crlf
Address 1 \crlf
A long line that wraps \crlf
Town \crlf
Postcode
\stopbuffer
\framed[width=3cm,align=flushleft]{\getbuffer[address]}
\framed[width=3cm,align=flushleft]{\scale[factor=fit]{\getbuffer[address]}}
\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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Iwona error

2023-02-06 Thread Bruce Horrocks via ntg-context


> On 6 Feb 2023, at 22:16, Hans Hagen via ntg-context  
> wrote:
> 
> On 2/6/2023 9:57 PM, Bruce Horrocks via ntg-context wrote:
>> Just installed today's update (ConTeXt  ver: 2023.02.06 17:58 LMTX) and 
>> tried out the 3 fonts mentioned.
>> \setupbodyfont[iwona]
>> % \setupbodyfont[kurier]
>> % \setupbodyfont[antykwa]
>> \starttext
>> Some text
>> \stoptext
>> I did a ./install.sh update with no obvious errors and afterwards Kurier and 
>> Antykwa worked for me on the above MWE but Iwona failed with the log entry:
>> [snip]
>> luatex warning  > font: lua-loaded font '21' with name 'ex-iwonar' has no 
>> characters
>> fonts   > virtual math > the mapping is incomplete for 'iwonamath' 
>> at 7pt
>> tex error   > tex error on line 1 in file ./tt.tex:
>> lua error:
>> registered function call [1154]: 
>> ...-64/tex/texmf-context/tex/context/base/mkxl/math-vfu.lmt:677: attempt to 
>> index a nil value (local 'fci')
>> stack traceback:
>> ...-64/tex/texmf-context/tex/context/base/mkxl/math-vfu.lmt:677: in upvalue 
>> 'virtualize'
>> ...-64/tex/texmf-context/tex/context/base/mkxl/math-vfu.lmt:1014: in 
>> function <...-64/tex/texmf-context/tex/context/base/mkxl/math-vfu.lmt:725>
>> (...tail calls...)
>> ...-64/tex/texmf-context/tex/context/base/mkxl/font-def.lmt:485: in field 
>> 'read'
>> ...-64/tex/texmf-context/tex/context/base/mkxl/font-ctx.lmt:1377: in 
>> function <...-64/tex/texmf-context/tex/context/base/mkxl/font-ctx.lmt:1234>
>> (...tail calls...) 
>> [snip]
>> Not sure if that's to do with my setup or true for everyone. I've never used 
>> those fonts before if that makes a difference.
> can you try with
> 
> https://github.com/contextgarden/context-distribution-fonts/blob/main/fonts/data/gust/iwona-math/ex-iwona.enc
> 
> wipe the font cache first

Yes, that worked. Thanks.

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


[NTG-context] Iwona error

2023-02-06 Thread Bruce Horrocks via ntg-context
Just installed today's update (ConTeXt  ver: 2023.02.06 17:58 LMTX) and tried 
out the 3 fonts mentioned.

\setupbodyfont[iwona]
% \setupbodyfont[kurier]
% \setupbodyfont[antykwa]
\starttext
Some text
\stoptext

I did a ./install.sh update with no obvious errors and afterwards Kurier and 
Antykwa worked for me on the above MWE but Iwona failed with the log entry:

[snip]
luatex warning  > font: lua-loaded font '21' with name 'ex-iwonar' has no 
characters
fonts   > virtual math > the mapping is incomplete for 'iwonamath' at 
7pt
tex error   > tex error on line 1 in file ./tt.tex: 

lua error:

registered function call [1154]: 
...-64/tex/texmf-context/tex/context/base/mkxl/math-vfu.lmt:677: attempt to 
index a nil value (local 'fci')
stack traceback:
...-64/tex/texmf-context/tex/context/base/mkxl/math-vfu.lmt:677: in 
upvalue 'virtualize'
...-64/tex/texmf-context/tex/context/base/mkxl/math-vfu.lmt:1014: in 
function <...-64/tex/texmf-context/tex/context/base/mkxl/math-vfu.lmt:725>
(...tail calls...)
...-64/tex/texmf-context/tex/context/base/mkxl/font-def.lmt:485: in 
field 'read'
...-64/tex/texmf-context/tex/context/base/mkxl/font-ctx.lmt:1377: in 
function <...-64/tex/texmf-context/tex/context/base/mkxl/font-ctx.lmt:1234>
(...tail calls...)  
[snip]

Not sure if that's to do with my setup or true for everyone. I've never used 
those fonts before if that makes a difference.

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


[NTG-context] A corner case relating to corners!

2023-02-04 Thread Bruce Horrocks via ntg-context
In the Wiki <https://wiki.contextgarden.net/Command/setupframed> the examples 
for corner styles 00 - 09 no longer work and the single digit values 0 - 9 need 
to be used instead. (Styles 10 upwards continue to work as per the page.)

Is this a deliberate change and the Wiki needs to be updated or should the 
change be reverted for backwards compatibility?

MWE:

\starttext
\framed[corner=7]{Some text}
\stoptext

With value 07 the frame doesn't display, with value 7 the frame appears as 
expected. (Readers with a long-haired white cat can try corner=007) ;-)

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


Re: [NTG-context] footnotes by paragraph?

2023-01-28 Thread Bruce Horrocks via ntg-context
On 28 Jan 2023, at 02:14, jbf via ntg-context  wrote:
> 
> Here's a tricky one (for me) that I haven't been able to work out. I am 
> dealing with a set of constitutions that I am organizing with a paragraph 
> definition 
> \defineparagraphs[Two][n=2]
> \setupparagraphs[Two][1][width=.2\textwidth,style=\bfx,after={\blank},align=flushleft]
> \setupparagraphs[Two][2][width=.77\textwidth,style=normal,after={\blank}]
> But I need to get the footnotes (which all apply to [2] in each article of 
> the constitutions) to come beneath my defined 'Two'. I do not want them to 
> come at the bottom of the page.
> I thought I might be able to do it by placing \start...stopTwo within a 
> \start...stopsection and defining \setupnotation[way=bysection] but that is 
> not working.
> Any thought on how I could approach this?
> Julian 

Does this help?

\defineparagraphs[Two][n=2]
\setupparagraphs[Two][1][width=.2\textwidth,style=\bfx,after={\blank},align=flushleft]
\setupparagraphs[Two][2][width=.77\textwidth,style=normal,after={\blank}]

\starttext
\startTwo
The role of the Committee
\Two
The role of the Committee\endnote{See a dictionary if you want to know what a 
committee is!} is very important.
Some more text.
\stopTwo
\startTwo
The Chairman
\Two
The role of the Chairman...
\stopTwo
\startTwo
~
\Two
\placenotes[endnote]

\stopTwo
\input knuth
\stoptext


—
Bruce Horrocks
Hampshire, UK

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


[NTG-context] Printing mailing list labels

2023-01-25 Thread Bruce Horrocks via ntg-context
If you've ever struggled with Word's or (worse) LibreOffice's mail merge 
features to print a mailing list onto sticky labels then this might be of 
interest.

I've created some macros and an example file showing how to print address 
labels on Avery L7160 paper (which is 7 rows of 3 labels on A4) and uploaded 
them here.
<https://context-address-labels.sourceforge.io/>

Features:
- full control over label content (can even differ from one label to the next 
if necessary)
- easily use up a part-used sheet of labels to avoid waste
- read address data from a CSV file
- easily support different address formats for different international 
destinations
- option to preview on plain paper
- even label your labels in the page header so you remember why you printed 
them!


No licence - the files are placed in the public domain. Feedback welcome.
—
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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Minor bug in Lua or ConTeXt

2023-01-18 Thread Bruce Horrocks via ntg-context
Thanks Hans.

Before Pablo spends too much effort on the wiki it's worth pointing out that 
this only happened because I was in-line documenting the Lua function that I 
had written and wanted to name the ConTeXT macro that would invoke it - so it's 
trivial for me to avoid this error.

Perhaps the Wiki only needs to point out that if you get a Lua related error 
and the error log lists the entire contents of \startluacode ... \stopluacode 
then a possible source of the error is a \command somewhere in there?

Regards,


> On 18 Jan 2023, at 09:48, Hans Hagen via ntg-context  
> wrote:
> 
> On 1/18/2023 12:36 AM, Bruce Horrocks via ntg-context wrote:
>> ConTeXt  ver: 2023.01.04
>> The following MWE won't compile because of the \dummycommand line even 
>> though it is a comment. Not sure whether it's a minor bug or an unavoidable 
>> aspect of allowing embedded Lua.
>> \startluacode
>> -- \dummycommand
>> \stopluacode
>> \starttext
>> Hello
>> \stoptext
> 
> a bang-head-against-the-wall case:
> 
> \let\dummycommand\relax
> 
> \startluacode
> -- \dummycommand
> \stopluacode
> \starttext
> Hello
> \stoptext
> 
> or:
> 
> \ifdefined\dummycommand \else \let\dummycommand\relax \fi
> 
> a document-on-the-wiki challenge for Pablo
> 
> Hans
> 
> -
>  Hans Hagen | PRAGMA ADE
>  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___

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


[NTG-context] Minor bug in Lua or ConTeXt

2023-01-17 Thread Bruce Horrocks via ntg-context
ConTeXt  ver: 2023.01.04

The following MWE won't compile because of the \dummycommand line even though 
it is a comment. Not sure whether it's a minor bug or an unavoidable aspect of 
allowing embedded Lua.

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


[NTG-context] OT: Adobe releases the original PostScript interpreter software as open source

2022-12-19 Thread Bruce Horrocks via ntg-context
A bit off topic but some might be interested...

Adobe have released the PostScript interpreter source code as open source.

Press release here
<https://www.globenewswire.com/news-release/2022/12/01/2566212/28639/en/Computer-History-Museum-Makes-Adobe-PostScript-s-Source-Code-Available-to-the-Public-as-a-Part-of-Its-Art-of-Code-Series.html>

and a blog post with the background to PostScript here
<https://computerhistory.org/blog/postscript-a-digital-printing-press/>

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


Re: [NTG-context] Page break with placement of a figure at the bottom of the page

2022-11-11 Thread Bruce Horrocks via ntg-context

> On 10 Nov 2022, at 17:06, Fabrice Couvreur via ntg-context 
>  wrote:
> 
> Hi,
> Sorry to come back to you, but it seems to me that there is enough space here.
> Fabrice

For some reason your PNG images came through in extremely low resolution. 
Without having the ConTeXt source it's hard to say for sure what's happening - 
for example, I would have expected the text on the second page to be at the 
bottom of the first even if there wasn't room for the image - because that was 
what was happening in your first example. 

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


Re: [NTG-context] Page break with placement of a figure at the bottom of the page

2022-11-09 Thread Bruce Horrocks via ntg-context
On 9 Nov 2022, at 18:22, Pablo Rodriguez via ntg-context  
wrote:
> 
> On 11/9/22 17:51, Fabrice Couvreur via ntg-context wrote:
>> Hi,
>> I find that for some time (but maybe the problem comes from me !), the
>> placement of a figure at the bottom of the page causes a page break when
>> it seems to me that there is enough space, which poses some problems in
>> the pagination of my documents.
> 
> Hi Fabrice,
> 
> your figure requires about 7¼ lines (one line before, six for the image
> itself, and some extra space after it).
> 
> Your layout for the first page only allows 43 lines and sample text ends
> on line 37.
> 
> Replace \showframe with \showgrid and you will see that there might be
> not enough space to fit the image in the first page.
> 
> Add "bottomspace=7.25mm" to the layout for the first page and the image
> will fit in the first page.
> 
> Just in case it might help,

Or Pablo's answer shown another way... change the end of the example to:

\starttext
\dorecurse{11}{\input ward}
\placerecipe{}{\externalfigure[dum]}
\dorecurse{5}{\input ward} %% extra
\stoptext

and the extra text shows how much space the image requires. Holding a ruler up 
to the screen you can see that it won't fit.

The problem seems to be that the image is reserving space for a caption even 
though there isn't a caption. A work-around is to change \setupfloat to the 
following:

 \setupfloat
 [recipe]
 [default={right,none,high}]

and then the image fits as you want it to.
—
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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] \setuparranging values for perfect bound A5 on A3?

2022-10-09 Thread Bruce Horrocks via ntg-context


> On 9 Oct 2022, at 02:58, Max Chernoff  wrote:
> 
> 
> Hi Bruce,
> 
>> I have a book to be perfect bound[1] and I'm trying to work out what
>> imposition to use.
>> 
>> The printer would like 4 A5 pages laid out on A3 e.g.
>> 
>> +---+---+
>> |   |   |
>> | a | b |
>> |   |   |
>> +---+---+
>> |   |   |
>> | c | d |
>> |   |   |
>> +---+---+
>> 
>> so that he can cut the paper and simply stack a, b, c, & d on top of
>> each other and then put them in the binding machine[2].
>> 
>> If the book is 40 pages long, say, then stack 'a' has page 1 on the
>> top, page 2 on the reverse, then the next sheet has page 3 and 4, and
>> so on down to the last sheet which has page 9 on the front and page 10
>> on the back. Stack 'b' would have page 11 on the front, 12 on the back
>> and so on, so that each stack has a quarter of the book.
>> 
>> Is this something LMTX can do and if so what combination of
>> \setuplayout and \setuppaper do I need to use? If they can be printed
>> in reverse order then great but I assume the printer can do that
>> fairly easily.
> 
> I don't think that there's any way to do this from within a document
> run, so I think that you'll need to use an external program.
> 
>> If not, is there a recommended external program that can do it?
> 
> But, you can use ConTeXt as the external program here. 
> 
> Save as "imposition.cld":
> 
>   local filename = document.getargument("filename")
>   local pdf = lpdf.epdf.image.open(filename)
>   local pages = pdf.nofpages
>   local max = math.ceil(pages / 4)
> 
>   context.setuppapersize({ "A5" }, { "A3" })
>   context.setuppaper { nx = 2, ny = 2 }
>   context.setuparranging { "XY" }
> 
>   local function insert_page(n)
>   context.startpagemakeup()
>   context.filterpages({ filename }, { n })
>   context.stoppagemakeup()
>   end
> 
>   context.starttext()
>   for i = 1, max do
>   if i % 2 == 1 then
>   insert_page(i + 0 * max)
>   insert_page(i + 1 * max)
>   insert_page(i + 2 * max)
>   insert_page(i + 3 * max)
>   else
>   insert_page(i + 1 * max)
>   insert_page(i + 0 * max)
>   insert_page(i + 3 * max)
>   insert_page(i + 2 * max)
>   end
>   end
>   context.stoptext()
> 
> Then run:
> 
>   context imposition.cld --filename=document.pdf
> 
> where "document.pdf" is replaced by your document name.
> 
> I'm not sure if I got your desired output quite right here, but
> hopefully you can easily modify the script if something isn't quite
> right.

Thank-you Max - that is exactly what I wanted and your code worked first time. 
:)

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


[NTG-context] \setuparranging values for perfect bound A5 on A3?

2022-10-08 Thread Bruce Horrocks via ntg-context
I have a book to be perfect bound[1] and I'm trying to work out what imposition 
to use.

The printer would like 4 A5 pages laid out on A3 e.g.

+---+---+
|   |   |
| a | b |
|   |   |
+---+---+
|   |   |
| c | d |
|   |   |
+---+---+

so that he can cut the paper and simply stack a, b, c, & d on top of each other 
and then put them in the binding machine[2].

If the book is 40 pages long, say, then stack 'a' has page 1 on the top, page 2 
on the reverse, then the next sheet has page 3 and 4, and so on down to the 
last sheet which has page 9 on the front and page 10 on the back. Stack 'b' 
would have page 11 on the front, 12 on the back and so on, so that each stack 
has a quarter of the book.

Is this something LMTX can do and if so what combination of \setuplayout and 
\setuppaper do I need to use? If they can be printed in reverse order then 
great but I assume the printer can do that fairly easily. If not, is there a 
recommended external program that can do it?

I've tried \setuplayout[4*2] and XY with 2x2 but neither output is what I need.

Thanks in advance.

[1] glued spine (if that term isn't used outside the UK)
[2] I'm sure it's actually harder than that. :-)

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


Re: [NTG-context] TOC colors and in-page anchors

2022-09-28 Thread Bruce Horrocks via ntg-context


> On 28 Sep 2022, at 09:18, Sylvain Hubert via ntg-context  
> wrote:
> 
> Dear list,
> 
> \usemodule[ipsum]
> \setupinteraction[state=start]
> 
> \starttext
> \completecontent
> \section{s1}\ipsum
> \section{s2}\ipsum
> \section{s3}\ipsum
> \section{s4}\ipsum
> \section{s5}\ipsum
> \section{s6}\ipsum
> \stoptext
> 
> In the table of contents, s1 and s2 (at page 1) are rendered in red, while 
> others in green.
> 
> Moreover, when I click s4, it jumps to page 2 without locating the section 
> precisely within the page.
> This is not the case when using the latex hyperref package.
> 
> Does anyone know how to make the colors uniform and the links precise?
> 
> Any help is appreciated.

The colour change is because those links are on the same page that you are 
jumping to. When you have more text in your document they will be consistent. 
You can override the colors with \setupinteraction[state=start,color=black] for 
example if you wish.

You need focus=standard to jump direct but only when the viewer is in scrolling 
mode. It's explained on the Wiki.
<https://wiki.contextgarden.net/Command/setupinteraction>

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


Re: [NTG-context] Spacing in \unit

2022-09-25 Thread Bruce Horrocks via ntg-context


> On 25 Sep 2022, at 14:30, Gavin via ntg-context  wrote:
> 
> Hello list,
> 
> I have a few questions about space produced by the unit command. Consider 
> this MWE
> 
> \starttext
> \unit{3.00e8 kg m/s}
> 
> $\unit{3.00e8 kg m/s}$
> \stoptext
> 
> The dot between “kg” and “m” has different spacing depending on whether the 
> \unit command is in text or math mode. I think that the tighter spacing in 
> the first one, in text, is correct.
> 
> I personally would also like less space around the \times. To me, the number 
> 3.00e8 should be typeset more like a single number, rather than like a 
> product of 3.00 and 10^8. I am probably in the minority here. If \unit and 
> \digit had an option for tighter spacing around the \times, I’d use it, but 
> the current output with more space is probably what most people expect and 
> want. Perhaps something like [scispace=tight].

I too would prefer less space around the times e.g. \starttext 3.00×10\high{8} 
\stoptext is fine (except for the 8 which is nicer in \unit).

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


[NTG-context] Is there an "align with item on facing page" option?

2022-09-25 Thread Bruce Horrocks via ntg-context
Is there a way to align text with an item on the facing page?

I'm typesetting author biographies for a book and I'm doing two per page. The 
author's name appears on a line of its own in \tfa size and then the bio text 
follows. Ideally I'd like their names aligned so that all four (on a two page 
spread) appear nicely symmetrical.

Currently I'm using \godown[\dimexpr80mm-\pagetotal] (for A5 pages) between 
each pair which works nicely in that if the first biography is too long it 
overlaps and I know to edit it to be shorter.

However, if the second biography is a little long, it pushes the first back up 
the page a little - maybe only one line - and then it no longer aligns with the 
the one on the facing page. If I could somehow tell ConTeXt to vertically align 
the author names then that might do the job?

I've tried using two frames above each other with fixed min and maxheight but 
then I can't get the author's thumbnail picture to place properly and have the 
text wrap around it.

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


Re: [NTG-context] PDF viewer

2022-09-23 Thread Bruce Horrocks via ntg-context
On 23 Sep 2022, at 08:59, Henning Hraban Ramm via ntg-context 
 wrote:
> 
> Unfortunately, Firefox doesn’t register itself as a PDF viewer (at least on 
> MacOS), that means I can’t use it easily to open a PDF from the command line 
> (e.g. in scripts).

The following works for me in Monterey on an Intel Mac:

$ /Applications/Firefox.app/Contents/MacOS/firefox test.pdf  

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


  1   2   3   >