[NTG-context] Re: Do we have a geometry library for Metafun?

2024-01-12 Thread Shiv Shankar Dayal
> No library that I know of, but drawing tangents (and therefore,
> perpendiculars) is straight-forward:
>
>https://tex.stackexchange.com/a/108060/323
>
> Circumcircle, orthocenter, etc... are you thinking of triangles or general
> polynomails?
>

Triangles. I understand that most of it is very easy, but still a library
will help new users.
Tikz has Tikz-Euclide and Asymptote has a Geometry package. A similar
library for Metafun
will be very useful.

-- 
Respect,
Shiv Shankar Dayal
___
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: Do we have a geometry library for Metafun?

2024-01-12 Thread Aditya Mahajan
On Fri, 12 Jan 2024, Shiv Shankar Dayal wrote:

> Do we have a geometry library for common operations like finding tangents,
> perpendiculars, circumcircle, orthocenters and such?

No library that I know of, but drawing tangents (and therefore, perpendiculars) 
is straight-forward:

   https://tex.stackexchange.com/a/108060/323

Circumcircle, orthocenter, etc... are you thinking of triangles or general 
polynomails?

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


—
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 Marco Patzer
On Fri, 12 Jan 2024 23:05:14 +0900
Jeong Dal via ntg-context  wrote:

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

Here's a suggestion:

\definepapersize
  [jeong]
  [width=67mm,
   height=73mm]

\setuppapersize
  [jeong]
  [A4]

\setuppaper
  [nx=3, ny=4,
   dx=4.4mm, dy=1.5mm]

\setuparranging
  [XY]

\setuplayout
  [page]

\setuppagenumbering
  [state=stop]

\setupmakeup
  [standard]
  [align=middle]

\setupblank
  [2*line]

\showframe
\starttext
  \dorecurse{12}{%%
\startstandardmakeup
Text \blank
{\tfd\recurselevel} \blank
Text
\stopstandardmakeup
\page}
\stoptext

That's how I'd approach it. Not sure if it meets all your
requirements, though.

Marco
___
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: Do we have a geometry library for Metafun?

2024-01-12 Thread Shiv Shankar Dayal
Dear Gavin,

I have managed to create an implementation for these operations which I
think I can convert into functions and put in startMPinclusions and then
use them from. there.

On Fri, Jan 12, 2024 at 9:42 PM Gavin via ntg-context 
wrote:

> Hi Shiv,
>
> > Do we have a geometry library for common operations like finding
> tangents, perpendiculars, circumcircle, orthocenters and such?
>
> I don’t think we have anything like that specifically in the MetaFun
> world, but if there is a MetaPost package you like, you can use it with
> MetaFun. For example, the TeX Live installation includes both ConTeXt and
> 3dgeom.mp, so you should be able to use the 3dgeom package in MetaFun
> simply with "input 3dgeom" in your MetaPost code. (I did a quick check,
> successfully drawing a drawing a cube with 3dgeom. I have not tested it
> beyond than that.)
>
> If there isn’t a MetaPost package for what you want, Lua may be useful for
> doing the calculations.
>
> Gavin
>
> ___
> 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
>
> ___
>


-- 
Respect,
Shiv Shankar Dayal
___
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: Do we have a geometry library for Metafun?

2024-01-12 Thread Gavin via ntg-context
Hi Shiv,

> Do we have a geometry library for common operations like finding tangents, 
> perpendiculars, circumcircle, orthocenters and such?

I don’t think we have anything like that specifically in the MetaFun world, but 
if there is a MetaPost package you like, you can use it with MetaFun. For 
example, the TeX Live installation includes both ConTeXt and 3dgeom.mp, so you 
should be able to use the 3dgeom package in MetaFun simply with "input 3dgeom" 
in your MetaPost code. (I did a quick check, successfully drawing a drawing a 
cube with 3dgeom. I have not tested it beyond than that.)

If there isn’t a MetaPost package for what you want, Lua may be useful for 
doing the calculations.

Gavin
___
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] Do we have a geometry library for Metafun?

2024-01-12 Thread Shiv Shankar Dayal
Do we have a geometry library for common operations like finding tangents,
perpendiculars, circumcircle, orthocenters and such?

-- 
Respect,
Shiv Shankar Dayal
___
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] Asking help for better way to make tickets.

2024-01-12 Thread Jeong Dal via ntg-context
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.Thank you for reading.Best regards,Dalyoung\setuppapersize[A4]%[A4]\setuplayout[  width=210mm,  height=297mm,  topspace=0pt,  backspace=0pt,  header=0mm,  footer=0mm,  margin=0mm,  bottomspace=0mm   ]\startuseMPgraphic{ticket}{i,j}path p,q;pair A,B;p := unitsquare xyscaled (67mm,73mm);A := point 0.5 of p;B := point 2.5 of p;draw p;label(textext("Text"), .25A+.75B );label(textext("\tfd " & decimal (3*\MPvar{i}-\MPvar{j})), center p);label(textext("Text"), .75A + .25B);\stopuseMPgraphic\starttext\dorecurse{4}{\startcombination[3*1]%distance=0mm]{\useMPgraphic{ticket}{i=\recurselevel,j=2}}{}{\useMPgraphic{ticket}{i=\recurselevel,j=1}}{}{\useMPgraphic{ticket}{i=\recurselevel,j=0}}{}\stopcombination\startcombination[3*1]%distance=0mm]{\useMPgraphic{ticket}{i=\recurselevel,j=2}}{}{\useMPgraphic{ticket}{i=\recurselevel,j=1}}{}{\useMPgraphic{ticket}{i=\recurselevel,j=0}}{}\stopcombination}\page\dostepwiserecurse{5}{8}{1}{\startcombination[3*1]%distance=0mm]{\useMPgraphic{ticket}{i=\recurselevel,j=2}}{}{\useMPgraphic{ticket}{i=\recurselevel,j=1}}{}{\useMPgraphic{ticket}{i=\recurselevel,j=0}}{}\stopcombination\startcombination[3*1]%distance=0mm]{\useMPgraphic{ticket}{i=\recurselevel,j=2}}{}{\useMPgraphic{ticket}{i=\recurselevel,j=1}}{}{\useMPgraphic{ticket}{i=\recurselevel,j=0}}{}\stopcombination}\stoptext

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

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


[NTG-context] Re: conversion from realpage to pagenumber

2024-01-12 Thread mf

Il 12/01/24 10:39, Henning Hraban Ramm ha scritto:

Am 12.01.24 um 10:18 schrieb mf:

Hello list,

how do I convert the realpage number to a page number?

Suppose you have a document with a frontmatter of 20 pages in roman 
numerals, followed by the main text starting from page 1 in arabic 
numerals.


So the twelfth page is 'XII', while the twenty-second is '2'.

How do I get 'XII' from 12 and '2' from 22?


try \realpagenumber



The right one would be \userpagenumber, but it works only with the 
current page.


The code for registers does that translation -- from an arbitrary 
realpage of your document to the corresponding user page number, with 
the right formatting -- but I could not find the code that does that in 
strc-reg.* source files.


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

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


[NTG-context] Re: conversion from realpage to pagenumber

2024-01-12 Thread Wolfgang Schuster

mf schrieb am 12.01.2024 um 10:18:

Hello list,

how do I convert the realpage number to a page number?

Suppose you have a document with a frontmatter of 20 pages in roman 
numerals, followed by the main text starting from page 1 in arabic 
numerals.


So the twelfth page is 'XII', while the twenty-second is '2'.

How do I get 'XII' from 12 and '2' from 22?


\defineconversionset
  [frontpart:pagenumber] [] [romannumerals]

\setuppagenumber
  [way=byblock]

% Alternative method for "way=byblock" when you have an appendix where
% the pagenumber of the bodypart continues rather than being reset
%
% \startsectionblockenvironment[bodypart]
%   \resetuserpagenumber
% \stopsectionblockenvironment

\starttext

\startfrontmatter
\dorecurse{20}{\samplefile{lorem}\page}
\stopfrontmatter

\startbodymatter
\dorecurse{20}{\samplefile{lorem}\page}
\stopbodymatter

\stoptext

Wolfgang

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

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


[NTG-context] conversion from realpage to pagenumber

2024-01-12 Thread mf

Hello list,

how do I convert the realpage number to a page number?

Suppose you have a document with a frontmatter of 20 pages in roman 
numerals, followed by the main text starting from page 1 in arabic numerals.


So the twelfth page is 'XII', while the twenty-second is '2'.

How do I get 'XII' from 12 and '2' from 22?

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

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