* [NTG-context] Asking help for better way to make tickets.
@ 2024-01-12 14:05 Jeong Dal via ntg-context
2024-01-12 16:25 ` [NTG-context] " Marco Patzer
2024-01-12 22:38 ` Bruce Horrocks
0 siblings, 2 replies; 4+ messages in thread
From: Jeong Dal via ntg-context @ 2024-01-12 14:05 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Jeong Dal
[-- Attachment #1.1: Type: text/plain, Size: 1874 bytes --]
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
[-- Attachment #1.2.1: Type: text/html, Size: 12614 bytes --]
[-- Attachment #1.2.2: test.pdf --]
[-- Type: application/pdf, Size: 12314 bytes --]
[-- Attachment #1.2.3: Type: text/html, Size: 259 bytes --]
[-- Attachment #2: Type: text/plain, Size: 511 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* [NTG-context] Re: Asking help for better way to make tickets.
2024-01-12 14:05 [NTG-context] Asking help for better way to make tickets Jeong Dal via ntg-context
@ 2024-01-12 16:25 ` Marco Patzer
2024-01-12 22:38 ` Bruce Horrocks
1 sibling, 0 replies; 4+ messages in thread
From: Marco Patzer @ 2024-01-12 16:25 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Fri, 12 Jan 2024 23:05:14 +0900
Jeong Dal via ntg-context <ntg-context@ntg.nl> 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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* [NTG-context] Re: Asking help for better way to make tickets.
2024-01-12 14:05 [NTG-context] Asking help for better way to make tickets Jeong Dal via ntg-context
2024-01-12 16:25 ` [NTG-context] " Marco Patzer
@ 2024-01-12 22:38 ` Bruce Horrocks
2024-01-13 10:25 ` Jeong Dal via ntg-context
1 sibling, 1 reply; 4+ messages in thread
From: Bruce Horrocks @ 2024-01-12 22:38 UTC (permalink / raw)
To: ntg-context mailing list
> On 12 Jan 2024, at 14:05, Jeong Dal via ntg-context <ntg-context@ntg.nl> 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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* [NTG-context] Re: Asking help for better way to make tickets.
2024-01-12 22:38 ` Bruce Horrocks
@ 2024-01-13 10:25 ` Jeong Dal via ntg-context
0 siblings, 0 replies; 4+ messages in thread
From: Jeong Dal via ntg-context @ 2024-01-13 10:25 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Jeong Dal
[-- Attachment #1.1: Type: text/plain, Size: 2010 bytes --]
Dear Bruce and Marco,
Thank you for your suggestions.
I think that it would be good enough to replace my code.
I learned new method which doesn’t use metaFun.
I’ll modify what you suggested for my purpose.
Thank you again.
Best regards,
Dalyoung
> 2024. 1. 13. 오전 7:38, Bruce Horrocks <ntg@scorecrow.com> 작성:
>
>
>
>> On 12 Jan 2024, at 14:05, Jeong Dal via ntg-context <ntg-context@ntg.nl> 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/ <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 <mailto:ntg-context@ntg.nl> / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl <https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl>
> webpage : https://www.pragma-ade.nl <https://www.pragma-ade.nl/> / https://context.aanhet.net <https://context.aanhet.net/>(mirror)
> archive : https://github.com/contextgarden/context <https://github.com/contextgarden/context>
> wiki : https://wiki.contextgarden.net <https://wiki.contextgarden.net/>
> ___________________________________________________________________________________
[-- Attachment #1.2: Type: text/html, Size: 18028 bytes --]
[-- Attachment #2: Type: text/plain, Size: 511 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-01-13 10:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-12 14:05 [NTG-context] Asking help for better way to make tickets Jeong Dal via ntg-context
2024-01-12 16:25 ` [NTG-context] " Marco Patzer
2024-01-12 22:38 ` Bruce Horrocks
2024-01-13 10:25 ` Jeong Dal via ntg-context
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).