[NTG-context] C with macron

2022-08-23 Thread Thangalin via ntg-context
Hi again,

Re: https://tex.stackexchange.com/q/364024/2148

How do you typeset a C with a macron below?

\starttext
M\withmacron{c}Anulty
\stoptext

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

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


[NTG-context] Curling straight quotation marks

2022-08-23 Thread Thangalin via ntg-context
Hey folks,

I re-wrote the algorithm KeenWrite uses for curling straight quotes. The
new algorithm is fairly robust with respect to North American and British
English. Could use help finding edge cases:

https://whitemagicsoftware.com/keenquotes/

I use it for preprocessing documents prior to passing them to ConTeXt.

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

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


[NTG-context] Line up itemize list with answer block

2022-08-23 Thread Jan Willem Flamma via ntg-context


Dear list members,

How can I ensure that the itemize list in the answers line up with the 
counter?

Or, put simply: I want '1.1' and 'a) Answer 1' to line up.

Regards,
Jan Willem Flamma

PDF result:
https://live.contextgarden.net/cgi-bin/result.cgi?id=VtEh2Y


MWE:

\defineblock[question]
\defineblock[answer]

\hideblocks[question]
\hideblocks[answer]

\defineenumeration
    [question]
    [text=Question,
 after={\blank[2*big]},
 inbetween={\blank[nowhite]},
 way=bychapter,
 prefixsegments=chapter,
 prefix=yes]

\defineenumeration
    [answer]
    [counter=answer,
 text=,
 width=,
 before={\blank[nowhite]},
 after={\blank[nowhite]},
 indenting=no,
 titledistance=1cm,
 location=inmargin,
 alternative=left,
 headstyle=,
 way=bychapter,
 prefixsegments=chapter,
 prefix=yes]

\starttext

\startchapter[title={Chapter}]

\beginquestion
\startquestion
\startitemize[a,packed][stopper=,right=)]
\item Question 1
\item Question 2
\stopitemize
\stopquestion
\endquestion
\beginanswer
\startanswer
\startitemize[a,packed][stopper=,right=)]
\item Answer 1
\item Answer 2
\stopitemize

\stopanswer
\endanswer


\startsection[title={Questions}]
\useblocks[question]
\stopsection

\blank[big]

\startsection[title={Answers}]
\useblocks[answer]
\stopsection

\stopchapter

\stoptext


___
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 can I make a Gentoo Linux package for ConTeXt LMTX?

2022-08-23 Thread Aditya Mahajan via ntg-context
On Mon, 22 Aug 2022, amano.kenji via ntg-context wrote:

> Wuh. That's a bit complex.

If you are packaging any flavor of TeX, you need to understand TDS (TeX 
Directory Structure): 

https://tug.org/tds/

ConTeXt distributions are TDS compatible, but simplify certain aspects. 
Essentially, context LMTX is distributed as a collection of TDS trees (texmf, 
texmf-context, texmf-linux, etc.) which separate the files according to their 
role. The purpose of texmfcnf.lua is to tell the binary about the location of 
the different trees. 

Aditya
___
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] Clipping multiple PDFs

2022-08-23 Thread Pablo Rodriguez via ntg-context
On 8/23/22 19:12, Jethro Djan via ntg-context wrote:
> Hello,
>
> [...] I have also been searching for stuff about “low-level” stuff in
> ConTexT like the \doloopoverlist command.
https://wiki.contextgarden.net/System_Macros/Loops_and_Recursion should
contain \doloopoverlist.

I have just added
https://wiki.contextgarden.net/System_Macros/Loops_and_Recursion#\doloopoverlist.

Jethro, would you be so kind to edit it, so it may help other newcomers?

Many thanks for your help,

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

maillist : ntg-context@ntg.nl / https://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] Clipping multiple PDFs

2022-08-23 Thread Aditya Mahajan via ntg-context
On Tue, 23 Aug 2022, Pablo Rodriguez via ntg-context wrote:

> On 8/23/22 17:27, Aditya Mahajan via ntg-context wrote:
> > [...]
> > For a more low-level interface to finding the number of pages, see:
> >
> > https://adityam.github.io/context-blog/post/include-multi-page-pdf/
> 
> Hi Aditya,
> 
> I wonder whether your final definition should be rewritten as:
> 
>  \unexpanded\def\includePDF[#1]%
> {\getfiguredimensions[#1]
>  \dorecurse{\noffigurepages}
> {\startTEXpage
> \externalfigure[#1][page=\recurselevel]
>  \stopTEXpage}}
> 
> At least, otherwise it will only work with "talk.pdf".
> 
> Or am I missing something?

Thanks. That was a typo and is now fixed.

Aditya
___
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] Clipping multiple PDFs

2022-08-23 Thread Pablo Rodriguez via ntg-context
On 8/23/22 17:27, Aditya Mahajan via ntg-context wrote:
> [...]
> For a more low-level interface to finding the number of pages, see:
>
> https://adityam.github.io/context-blog/post/include-multi-page-pdf/

Hi Aditya,

I wonder whether your final definition should be rewritten as:

 \unexpanded\def\includePDF[#1]%
{\getfiguredimensions[#1]
 \dorecurse{\noffigurepages}
{\startTEXpage
\externalfigure[#1][page=\recurselevel]
 \stopTEXpage}}

At least, otherwise it will only work with "talk.pdf".

Or am I missing something?

Many thanks for your comment,

Pablo
___
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] Clipping multiple PDFs

2022-08-23 Thread Jethro Djan via ntg-context
Hello,

Thanks to Pablo and Aditya for the solutions. Sometimes it is very
difficult to find the right manuals and info for what you want to achieve
for those of us new to ConTeXt. I found the stuff on
context(context.noffigurepages) here (
https://wiki.contextgarden.net/Image_Placement) and I didn’t know the
manual you linked to existed. I have also been searching for stuff about
“low-level” stuff in ConTexT like the \doloopoverlist command.

I hope to contribute to the online wiki as I become a better user of
ConTeXt.

On Tue, Aug 23, 2022 at 3:58 PM Pablo Rodriguez via ntg-context <
ntg-context@ntg.nl> wrote:

> On 8/22/22 17:46, Jethro Djan via ntg-context wrote:
> > Thanks for the solution Pablo. It works well.
>
> Glad to read it worked for you, Jethro.
>
> > I wanted to add more pdfs (which also has many pages) and found it
> > was easier for me to reason in the lua side of things. This is what I
> > have at the moment:
>
> I think this might be what you intend:
>
>   \setuplayout[page]
>   \starttext
>   \doloopoverlist{ass1,ass2,ass3,ass4,ass5,ass6,ass7,ass8}
> {\def\Doc{\recursestring.pdf}
>  \getfiguredimensions[\Doc]
>  \dorecurse{\noffigurepages}
>  {\externalfigure[\Doc]
>[page=\recurselevel, width=20cm, scale=950]}}
>   \stoptext
>
> > I didn’t know how to get an array (or indexed table or whatever you
> > call it) in ConTeXt/Tex.
>
> \doloopoverlist & \recursestring are your friends here.
>
> > My problem is now with context(context.noffigurepages). Am I calling
> > it wrong? All I want to do is call \noffigurepages from the lua side.
> > Is there something I am missing?
>
> The approach is totally different: "getnofpages"
> (
> http://www.pragma-ade.com/general/manuals/luametatex.pdf#search=getnofpages
> ).
>
> BTW, your code crashed my session, CPU goes to 100% and RAM usage too. I
> wonder how your sample could be compiled fine by your system.
>
> I hope it helps,
>
> Pablo
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Clipping multiple PDFs

2022-08-23 Thread Pablo Rodriguez via ntg-context
On 8/22/22 17:46, Jethro Djan via ntg-context wrote:
> Thanks for the solution Pablo. It works well.

Glad to read it worked for you, Jethro.

> I wanted to add more pdfs (which also has many pages) and found it
> was easier for me to reason in the lua side of things. This is what I
> have at the moment:

I think this might be what you intend:

  \setuplayout[page]
  \starttext
  \doloopoverlist{ass1,ass2,ass3,ass4,ass5,ass6,ass7,ass8}
{\def\Doc{\recursestring.pdf}
 \getfiguredimensions[\Doc]
 \dorecurse{\noffigurepages}
 {\externalfigure[\Doc]
   [page=\recurselevel, width=20cm, scale=950]}}
  \stoptext

> I didn’t know how to get an array (or indexed table or whatever you
> call it) in ConTeXt/Tex.

\doloopoverlist & \recursestring are your friends here.

> My problem is now with context(context.noffigurepages). Am I calling
> it wrong? All I want to do is call \noffigurepages from the lua side.
> Is there something I am missing?

The approach is totally different: "getnofpages"
(http://www.pragma-ade.com/general/manuals/luametatex.pdf#search=getnofpages).

BTW, your code crashed my session, CPU goes to 100% and RAM usage too. I
wonder how your sample could be compiled fine by your system.

I hope it helps,

Pablo
___
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] Clipping multiple PDFs

2022-08-23 Thread Aditya Mahajan via ntg-context
On Mon, 22 Aug 2022, Jethro Djan via ntg-context wrote:

> 
> Thanks for the solution Pablo. It works well.
> 
> I wanted to add more pdfs (which also has many pages) and found it was easier 
> for me to reason in the lua side of things. This is what I have at the moment:
> 
> \starttext
> \startluacode
>   local function doc(fil)
> return fil..[[.pdf]]
>   end
> 
>   local function disppdf(fname)
> n = 1 
> repeat 
>   context.externalfigure({fname},{
> page = n,
> width = "200mm",
> scale = "950"
>   })
>   n = n + 1
> until n == context(context.noffigurepages)
>   end
> 
>   local pdffiles = {"ass1", "ass2", "ass3", "ass4", "ass5", "ass6", "ass7", 
> "ass8"}
>   for index=1,#pdffiles do 
> local f = doc(pdffiles[index])
> context.getfiguredimensions({f})
> disppdf(pdffiles[index])
>   end
> \stopluacode
> \stoptext
> 
> I didn’t know how to get an array (or indexed table or whatever you call it) 
> in ConTeXt/Tex. My problem is now with context(context.noffigurepages). It 
> doesn’t produce an integer so n is being compared to nil. Am I calling it 
> wrong? All I want to do is call \noffigurepages from the lua side. Is there 
> something I am missing?

For a more low-level interface to finding the number of pages, see:

https://adityam.github.io/context-blog/post/include-multi-page-pdf/

Aditya___
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 can I make a Gentoo Linux package for ConTeXt LMTX?

2022-08-23 Thread amano.kenji via ntg-context
> https://tug.org/TUGboat/tb34-3/tb108preining-distro.pdf

Somebody needed to update TeX Live on Gentoo Linux. I'm going to read it.

> From a developer perspective, this is essentially just the base ConTeXt 
> files, a modified texmfcnf.lua, and a fairly basic makefile.

I'm going to read https://github.com/vlasakm/context soon. Until then, I would 
feel confused and disoriented.

--- Original Message ---
On Tuesday, August 23rd, 2022 at 1:11 AM, Max Chernoff  wrote:


> Hi Amano,
> 
> > Wuh. That's a bit complex.
> 
> 
> Not really. From a user perspective, all that you need to run is
> 
> make install
> 
> From a developer perspective, this is essentially just the base ConTeXt
> files, a modified texmfcnf.lua, and a fairly basic makefile.
> 
> > For distribution packages that depend on context for generation of PDF
> > documents, having context as a system package is essential.
> 
> 
> I'd say that ConTeXt is available in nearly every package manager, via
> TeX Live. Very very few package managers would have no TeX Live. TeX
> Live only includes MkIV, the "stable" version, but most users won't
> notice many differences from MkXL/LMTX, the "experimental" version.
> 
> By policy, TeX Live only updates its binaries once per year. This would
> be pretty much unworkable with LuaMetaTeX due to its frequent upgrades.
> At some point when LuaMetaTeX is stable, the source will be released and
> almost certainly be incorporated in TeX Live.
> 
> > And, distribution maintainers can make things work if they understand
> > TeX directory structure and texmfcnf.lua.
> 
> 
> Packaging/installing ConTeXt is actually much easier than doing so for
> other TeX systems. With other systems, you need to fiddle around with
> fonts and packages, but with ConTeXt, you can pretty much just unpack a
> few files.
> 
> Here's a short paper that should give you an overview of how hard
> packaging TeX can be:
> 
> https://tug.org/TUGboat/tb34-3/tb108preining-distro.pdf
> 
> > It comes down to care. If they care and they have installation guide,
> > they will make it work.
> 
> 
> I'm not sure who you're talking about here. If you're talking about end-
> users, then yes, it's pretty simple to install ConTeXt. I personally
> find ConTeXt much easier to install than TeX Live.
> 
> If you're talking about packagers, then packaging ConTeXt is no more
> complex than packaging TeX Live (which of course includes ConTeXt MkIV).
> The installer documentation for ConTeXt LMTX certainly isn't as detailed
> as it is for TeX Live, but LMTX is still beta software.
> 
> If you're trying to say that the ConTeXt developers don't care, then you
> may be "right" in a sense, but missing the point entirely. There is no
> one who is paid to work on ConTeXt: all of the developers work on it
> either as volunteers or to support their own business needs. The current
> installer works for them and for many other users. This isn't to say
> that they don't care about the users, but rather that they are unlikely
> to spend much time making a package for a fairly unpopular distro where
> the official installer already works.
> 
> > On Sunday, August 21st, 2022 at 7:13 PM, Michal Vlasák  > gmail.com> wrote:
> 
> 
> Hi Michal,
> 
> > > I prepared a proof of concept, that I am ready to take down immediately
> > > at Hans' request, since I don't handle license information properly, and
> > > texmf-context is stripped down (just so that the downloads are not too
> > > big for proof of concept).
> > > 
> > > https://github.com/vlasakm/context
> 
> 
> That's quite impressive!
> 
> > > There is documentation about how it can be used. I hope its obvious how
> > > I got "texmf" (texmf-context.zip, unzip, delete some files I didn't want
> > > to take up space),
> 
> 
> One suggestion: instead of unpacking and committing "texmf-context.zip",
> I'd recommend adding
> 
> https://github.com/contextgarden/context-mirror/
> 
> as a git submodule. That way, it's easy to keep the files up-to-date, your
> repo will use less space, and there's a clearer separation between your
> package files and ConTeXt itself.
> 
> > > A bit of a disclaimer: I don't really recommend pursuing this further.
> > > Some time ago I was also that foolish to try to package TeX for Linux
> > > distributions. Unfortunately I think that the result will never by
> > > optimal - as demonstrated by the previous discussions, the usual
> > > purposes of packages (to integrate software into the system) don't apply
> > > much to TeX / ConTeXt - there one wants something more or less self
> > > contained (so that updates are under control, no random non-essential
> > > libraries brake things, etc.).
> 
> 
> Well packaging the files into .rpm/.deb isn't really a bad idea; what's
> bad is the weird modifications that distros make, plus the fact that
> nearly every distro delays updates by quite some time. I generally agree
> that installing TeX straight from the source is better, although I can
> see why some 

Re: [NTG-context] How can I make a Gentoo Linux package for ConTeXt LMTX?

2022-08-23 Thread amano.kenji via ntg-context
> they are unlikely to spend much time making a package for a fairly unpopular 
> distro where the official installer already works.

If someone adds something like installation.md to the root directory of ConTeXt 
source archive or git commit, anyone can read it and translate it into one's OS 
package. installation.md would be one generalized set of instructions that 
apply to windows, Mac, linux distributions, BSDs, and all other operating 
systems.

--- Original Message ---
On Tuesday, August 23rd, 2022 at 1:11 AM, Max Chernoff  wrote:


> Hi Amano,
> 
> > Wuh. That's a bit complex.
> 
> 
> Not really. From a user perspective, all that you need to run is
> 
> make install
> 
> From a developer perspective, this is essentially just the base ConTeXt
> files, a modified texmfcnf.lua, and a fairly basic makefile.
> 
> > For distribution packages that depend on context for generation of PDF
> > documents, having context as a system package is essential.
> 
> 
> I'd say that ConTeXt is available in nearly every package manager, via
> TeX Live. Very very few package managers would have no TeX Live. TeX
> Live only includes MkIV, the "stable" version, but most users won't
> notice many differences from MkXL/LMTX, the "experimental" version.
> 
> By policy, TeX Live only updates its binaries once per year. This would
> be pretty much unworkable with LuaMetaTeX due to its frequent upgrades.
> At some point when LuaMetaTeX is stable, the source will be released and
> almost certainly be incorporated in TeX Live.
> 
> > And, distribution maintainers can make things work if they understand
> > TeX directory structure and texmfcnf.lua.
> 
> 
> Packaging/installing ConTeXt is actually much easier than doing so for
> other TeX systems. With other systems, you need to fiddle around with
> fonts and packages, but with ConTeXt, you can pretty much just unpack a
> few files.
> 
> Here's a short paper that should give you an overview of how hard
> packaging TeX can be:
> 
> https://tug.org/TUGboat/tb34-3/tb108preining-distro.pdf
> 
> > It comes down to care. If they care and they have installation guide,
> > they will make it work.
> 
> 
> I'm not sure who you're talking about here. If you're talking about end-
> users, then yes, it's pretty simple to install ConTeXt. I personally
> find ConTeXt much easier to install than TeX Live.
> 
> If you're talking about packagers, then packaging ConTeXt is no more
> complex than packaging TeX Live (which of course includes ConTeXt MkIV).
> The installer documentation for ConTeXt LMTX certainly isn't as detailed
> as it is for TeX Live, but LMTX is still beta software.
> 
> If you're trying to say that the ConTeXt developers don't care, then you
> may be "right" in a sense, but missing the point entirely. There is no
> one who is paid to work on ConTeXt: all of the developers work on it
> either as volunteers or to support their own business needs. The current
> installer works for them and for many other users. This isn't to say
> that they don't care about the users, but rather that they are unlikely
> to spend much time making a package for a fairly unpopular distro where
> the official installer already works.
> 
> > On Sunday, August 21st, 2022 at 7:13 PM, Michal Vlasák  > gmail.com> wrote:
> 
> 
> Hi Michal,
> 
> > > I prepared a proof of concept, that I am ready to take down immediately
> > > at Hans' request, since I don't handle license information properly, and
> > > texmf-context is stripped down (just so that the downloads are not too
> > > big for proof of concept).
> > > 
> > > https://github.com/vlasakm/context
> 
> 
> That's quite impressive!
> 
> > > There is documentation about how it can be used. I hope its obvious how
> > > I got "texmf" (texmf-context.zip, unzip, delete some files I didn't want
> > > to take up space),
> 
> 
> One suggestion: instead of unpacking and committing "texmf-context.zip",
> I'd recommend adding
> 
> https://github.com/contextgarden/context-mirror/
> 
> as a git submodule. That way, it's easy to keep the files up-to-date, your
> repo will use less space, and there's a clearer separation between your
> package files and ConTeXt itself.
> 
> > > A bit of a disclaimer: I don't really recommend pursuing this further.
> > > Some time ago I was also that foolish to try to package TeX for Linux
> > > distributions. Unfortunately I think that the result will never by
> > > optimal - as demonstrated by the previous discussions, the usual
> > > purposes of packages (to integrate software into the system) don't apply
> > > much to TeX / ConTeXt - there one wants something more or less self
> > > contained (so that updates are under control, no random non-essential
> > > libraries brake things, etc.).
> 
> 
> Well packaging the files into .rpm/.deb isn't really a bad idea; what's
> bad is the weird modifications that distros make, plus the fact that
> nearly every distro delays updates by quite some time. I generally agree
> that installing