[NTG-context] Re: How can I use a variable for a MetaPost coordinate ?

2023-10-04 Thread Thomas A. Schmitz
Have a look at chapter 6.4 of the metafun manual. You need StartPage ... 
StopPage in your MPcode, then you can knock yourself out by using 
variables such as PaperHeight or TextHeight and do all sorts of 
calculations.


All best

Thomas

On 10/5/23 05:54, peter.hopcroft--- via ntg-context wrote:
Hello list, I want to draw lines on a page. I want to pass my line 
coordinates as a percent of \width or \textheight, rather than as 
millimetres. So that if I change the page size I don't need to change 
the coordinates. The MWE below compiles but the pdf does not have any 
lines drawn on it. Is there a way of doing calculations on the 
coordinates for the draw using ConTexT variables like \textheight? Thank 
you, Peter Hopcroft



___
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] How can I use a variable for a MetaPost coordinate ?

2023-10-04 Thread peter.hopcroft--- via ntg-context
Hello list,

I want to draw lines on a page. I want to pass my line coordinates as a percent 
of \width or \textheight, rather than as millimetres. So that if I change the 
page size I don't need to change the coordinates. 

The MWE below compiles but the pdf does not have any lines drawn on it. 

Is there a way of doing calculations on the coordinates for the draw using 
ConTexT variables like \textheight?

Thank you,
Peter Hopcroft

--

\starttext
Some text

\startMPcode
pickup pensquare scaled 1pt;
draw (0mm,0mm)--(0mm,\textheight) withcolor red 
\stopMPcode

More text

\startMPcode
pickup pensquare scaled 1pt;
draw (0mm,0mm)--(0mm,50mm) scaled \numexpr\textheight/50mm\relax
\stopMPcode

\stoptext


--

___
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] Re: Attempting to Generate PDF/A in LMTX

2023-10-04 Thread jinho . king
Thank you for your response. I did not rename any profiles; I simply followed 
the instructions on https://wiki.contextgarden.net/PDF/A 

Would you be able to share a MWE that correctly generates a PDF/A without 
errors?
___
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] 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] Re: Attempting to Generate PDF/A in LMTX

2023-10-04 Thread Henning Hraban Ramm

Am 04.10.23 um 07:45 schrieb Jin-Ho King:
Following the instructions on https://wiki.contextgarden.net/PDF/A 
, I am receiving errors that the 
*.icc files cannot be located. I have saved the *.icc files in 
~/context-osx-arm64/tex/texmf-context/colors/icc/profiles per the 
instructions. Here's an excerpt from the log:


backend > profiles > profile specification 'default_cmyk.icc' 
loaded from 
'/Users/jinho/context-osx-arm64/tex/texmf-context/colors/icc/context/colorprofiles.xml'
backend > profiles > error, couldn't locate profile 
'default_cmyk.icc'
backend > profiles > no default profile 'default_cmyk.icc' for 
colorspace 'cmyk'
backend > profiles > profile specification 'default_rgb.icc' 
loaded from 
'/Users/jinho/context-osx-arm64/tex/texmf-context/colors/icc/context/colorprofiles.xml'
backend > profiles > error, couldn't locate profile 
'default_rgb.icc'
backend > profiles > no default profile 'default_rgb.icc' for 
colorspace 'rgb'
backend > profiles > profile specification 'default_gray.icc' 
loaded from 
'/Users/jinho/context-osx-arm64/tex/texmf-context/colors/icc/context/colorprofiles.xml'
backend > profiles > error, couldn't locate profile 
'default_gray.icc'
backend > profiles > no default profile 'default_gray.icc' for 
colorspace 'gray'
backend > profiles > profile specification 'ISO coated v2 300% 
(ECI)' loaded from 
'/Users/jinho/context-osx-arm64/tex/texmf-context/colors/icc/context/colorprofiles.xml'
backend > profiles > error, couldn't locate profile 
'ISOcoated_v2_300_eci.icc'
backend > profiles > invalid output intent 'ISO Coated v2 300% 
(ECI)'


Here is a MWE that generates these errors:

setupinteraction
   [title=TITLE,
    subtitle=SUBTITLE,
    author=AUTHOR,
    keyword={{KEYWORD1, KEYWORD2}, KEYWORD3}]

%% For PDF/A
\setupbackend[
format={pdf/a-1b:2005}, % or pdf/a-1a:2005
profile={default_cmyk.icc,default_rgb.icc,default_gray.icc},
intent=ISO coated v2 300\letterpercent\space (ECI)]


Usually, there are no profiles with names like default_*.icc; use the 
names of your actual profiles. Or did you rename them?


Hraban
___
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: bibliography questions

2023-10-04 Thread Henning Hraban Ramm

Am 03.10.23 um 23:08 schrieb Aditya Mahajan:

On Tue, 3 Oct 2023, Henning Hraban Ramm wrote:


For my ConTeXt book, I thought it would make sense, and I would jump through
some hoops just to use the system, but
– most sources that I want to list are never quoted (method=dataset)
– I would need to define my own rendering, e.g. don’t like the handling of
names
– I need additional fields (custom rendering again)
– if I refer to sources, I want a URL or file path in a footnote (custom cite 
wrapper macro)


When I have to write your own rendering, I find it more convenient to use 
XML/JSON (or even a lua table) as a starting format.


I don’t understand how a custom rendering relates to the input database?

My bib database is already complete, and I find the format much more 
comfortable to write than XML.


Hraban
___
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
___