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

2022-10-08 Thread Max Chernoff via ntg-context

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.

Thanks,
-- Max
___
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] Apostrophe entity using \xmltexentity is ignored

2022-10-08 Thread Max Chernoff via ntg-context
Hi,

> Has the handling for the apostrophe character entity changed recently?
> 
> In the following example, the \xmltexentity for apostrophe is ignored,
> resulting in a straight apostrophe instead of a curled one:

> Any ideas on how to fix it?

(see also https://tex.stackexchange.com/a/661002/270600)

There are two different problems here.

1. Typing "'" now gives a straight apostrophe instead of a curly one by 
   default.

   The solution to this is to add 
   
  \definefontfeature[default][default][trep=yes]
  
   somewhere near the start of your document. See this thread
   
  https://mailman.ntg.nl/pipermail/ntg-context/2021/104286.html
  
   from last year.
   
2. ConTeXt ignores the redefinition of predefined entities. 

   If you run this code:
   
  \enabletrackers[xml.entities]
  
  \xmltexentity{apos}{XXX}
  \xmltexentity{lsquo}{YYY}
  \xmltexentity{rsquo}{ZZZ}
  \xmltexentity{laquo}{«}
  \xmltexentity{raquo}{»}
  
   then you get this output:
   
  xml > tex > registering tex entity 'apos' as 'XXX'
  xml > tex > registering tex entity 'lsquo' as 'YYY'
  xml > tex > registering tex entity 'rsquo' as 'ZZZ'
  xml > tex > registering tex entity 'laquo' as '«'
  xml > tex > registering tex entity 'raquo' as '»'
  xml > core > resolving entity  to internal ''
  xml > core > resolving entity  to internal ''
  xml > core > resolving entity  to predefined '''
  xml > core > resolving entity  to internal ''
  xml > core > resolving entity  to internal ''
  xml > core > resolving entity  to internal ''
  xml > core > resolving entity  to internal ''
  xml > core > resolving entity  to internal ''
  xml > core > resolving entity  to internal ''
  xml > tex > passing entity 'lsquo' as 'YYY' using 
'ctxcatcodes'
  xml > tex > passing entity 'U+27' as ''' using 'ctxcatcodes'
  xml > tex > passing entity 'laquo' as '«' using 'ctxcatcodes'
  xml > tex > passing entity 'raquo' as '»' using 'ctxcatcodes'
  xml > tex > passing entity 'rsquo' as 'ZZZ' using 
'ctxcatcodes'

   I know of a bad way to fix this (see the linked SE question), but
   hopefully someone here knows of a proper solution.
   
Thanks,
-- Max
___
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] Apostrophe entity using \xmltexentity is ignored

2022-10-08 Thread Thangalin via ntg-context
Has the handling for the apostrophe character entity changed recently?

In the following example, the \xmltexentity for apostrophe is ignored,
resulting in a straight apostrophe instead of a curled one:

% SOT
\xmltexentity{apos}{’}
\xmltexentity{lsquo}{‘}
\xmltexentity{rsquo}{’}
\xmltexentity{laquo}{«}
\xmltexentity{raquo}{»}

\startbuffer[document]

  Sylvias spilled wine.

\stopbuffer

\startxmlsetups xml:xhtml
  \xmlsetsetup{\xmldocument}{body}{xml:*}
\stopxmlsetups

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

\xmlregistersetup{xml:xhtml}

\starttext
  \xmlprocessbuffer{xhtml}{document}{}
\stoptext
% EOT

Any ideas on how to fix it?

Thank you.

mtx-context | current version: 2022.09.11 20:44
___
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] Spacing in \unit

2022-10-08 Thread Gavin via ntg-context
Hi list,

I made a small example with all of the issues I am trying to fix for the \units 
command. The first formula below uses the \unit command, but produces strange 
spacing. The second formula produces the desired spacing, without using the 
\unit command.

\showmakeup[mathglue] %\mathspacingmode=1

\starttext
\startformula
 \unit{1.23e5 kg m^2/s^2} + \unit{8.64e5 W s} = \unit{9.87e5 newton m}
\stopformula
\startformula
 1.23\mathord\times10^5\,{\rm kg\mathord\cdot m^2/s^2} + 
8.64\mathord\times10^5\,{\rm W\mathord{\cdot}s} = 9.87\mathord\times10^5\,{\rm 
N\mathord{\cdot}m}
\stopformula
\stoptext

I’m trying to fix four issues:
  - No space between the number and the following units. Should be a thin space.
  - No space between the units and the following symbol (+ and = above). Should 
be appropriate “bin" or “rel" space.
  - Too much space around the \cdot in the units. Should be treated like an 
“ord" when used to separate units.
  - Too much space around the \times in the scientific notation. Should be 
treated like an "ord" when used in scientific notation. (I'm not sure there is 
consensus on this.)

Some of these seemed like things I could fix myself, so I dug into 
phys-dim.mkxl to see what I could do. The good news is that I didn’t break 
anything. The bad news is that nothing I did seemed to have any effect – 
including deleting phys-dim.mkxl entirely! I double checked that I was working 
on the same installation used for typesetting. Is the code used for \unit now 
somewhere else?

These issues only occur in math mode, and \unit handles comma separators 
correctly, unlike \digit.

I’d like to get some sort of temporary patch for at least some of these issues, 
even if I need to write it myself. I use \unit everywhere in physics problems 
sets for students and in keys that I share other teachers.

Any guidance is appreciated!

Gavin

P.S. I’m working on a more comprehensive test file, but its not ready yet.
___
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] Example from Practex Journal

2022-10-08 Thread Wolfgang Schuster via ntg-context

Jeroen via ntg-context schrieb am 08.10.2022 um 13:17:

Hello,

Could anybody help me out with the setup and a MWE to get a document 
exactly as the one from Steve Peter in the Practex Journal in 2005 as 
in https://tug.org/pracjourn/2005-1/peter/peter.pdf


The articles used a now out of date module [1]  which is MkII only and 
no longer part of the ConTeXt distribution. The filename of the module 
is s-ptj-01.mkii when you're looking for the source.


I find this one hard to replicate. What is the font type that was used 
for this document ?


The document uses TeX Gyre Pagella as main font which can be loaded with 
\setupbodyfont[pagella].


What are your problems with the style of the document?

[1] https://tug.org/pracjourn/stylefiles.html

Wolfgang

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

maillist : ntg-context@ntg.nl / https://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] Example from Practex Journal

2022-10-08 Thread Herbert Voss via ntg-context



Am 08.10.22 um 13:17 schrieb Jeroen via ntg-context:



Could anybody help me out with the setup and a MWE to get a document 
exactly as the one from Steve Peter in the Practex Journal in 2005 as 
in https://tug.org/pracjourn/2005-1/peter/peter.pdf


I find this one hard to replicate. What is the font type that was used 
for this document ?




His email is at the end of the article ...

Herbert
___
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] Example from Practex Journal

2022-10-08 Thread Jeroen via ntg-context
Hello,

Could anybody help me out with the setup and a MWE to get a document
exactly as the one from Steve Peter in the Practex Journal in 2005 as in
https://tug.org/pracjourn/2005-1/peter/peter.pdf

I find this one hard to replicate. What is the font type that was used for
this document ?

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