[NTG-context] Prefix the text in an enumeration.

2024-06-13 Thread Gerion Entrup
Hi,

is there a way to automatically prefix the text body in an enumeration?

Consider this example:
```
\defineenumeration[question][
alternative=top,
text=Question,
title=yes,
titleleft=,
titleright=,
right={:},
headstyle=bold,
]

\starttext

Some text:

\startquestion[title={How long does a loop last?}]
\bold{Answer:} For a while.
\stopquestion

\stoptext
```

I'd like to have the `\bold{Answer:}` automatically. So for example something 
like this:
```
\defineenumeration[question][
alternative=top,
text=Question,
title=yes,
titleleft=,
titleright=,
right={:},
headstyle=bold,
prefix={\bold{Answer:}},
]

\starttext

Some text:

\startquestion[title={How long does a loop last?}]
For a while.
\stopquestion

\stoptext
```

I tried to misuse `inbetween` for that but `alternative=top` seems to make a 
(not modifiable space) between the heading and the text body.

Best
Gerion 

signature.asc
Description: This is a digitally signed message part.
___
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] How to improve appearance of bars in frac, sqrt, etc. on screens?

2024-06-13 Thread Ralph

Hello,


I’m relatively new to ConTeXt (version 2024.05.31, LMTX, standalone) and 
really enjoy learning it so far, but I have one little problem with the 
appearance of horizontal bars in math mode.


It seems the way ConTeXt displayed horizontal extensible bars in math 
mode some time ago (as used in \frac, \sqrt, \overbar, ...) was similar 
to the way LaTeX (PDFLaTeX and LuaLaTeX) and Plain TeX handled this, but 
it has changed since then. Instead of one bar there are now multiple 
characters attached to each other.


This makes it look more consistent with the font, but unfortunately it 
doesn’t display well in any PDF viewer I’ve tried (on Linux, so I’ve not 
tried Adobe Acrobat Reader). The bars look dotted, I guess it’s due to 
anti-aliasing (the dots disappear when anti-aliasing is disabled, but 
then of course everything looks pixelated). Two screenshots are attached 
(different zoom levels in PDF viewer) so that you know what I’m talking 
about.


Source:
\setuppapersize[S3]
\starttext
\startformula \sqrt{a^2 + b^2} = \frac{1000 \cdot c}{1000} \stopformula
\stoptext

Is there a way to switch to the old bars for documents viewed mainly on 
screens, or is there any other way to improve their appearance? I 
couldn’t find any documentation on this, so I would be very thankful if 
somebody here could help out.



Best,
Ralph
___
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: comment on the wiki

2024-06-12 Thread Pablo Rodriguez via ntg-context
On 6/13/24 04:17, Max Chernoff wrote:
> Hi Pablo (and others),
>
> On Wed, 2024-06-12 at 18:42 +0200, Pablo Rodriguez wrote:
>> Is there any way in which regular wiki contributions may help in
>> removing the accounts or at least all the pages generated with these
>> accounts?
>
> I also don't have deletion privileges, but I went through the recent
> pages and deleted the spammy content.

After sending my message, I saw that the Gardener group seems to have
permissions to delete pages (not sure about user pages).

I wonder whether this may constitute a formal request (for me and Max
[always when he agrees]) to be considered as candidates for Gardeners.

I know that this is not a privilege, but I would like to be able to
remove spam from the wiki.

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://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: comment on the wiki

2024-06-12 Thread Max Chernoff
Hi Pablo (and others),

On Wed, 2024-06-12 at 18:42 +0200, Pablo Rodriguez wrote:
> Is there any way in which regular wiki contributions may help in
> removing the accounts or at least all the pages generated with these
> accounts?

I also don't have deletion privileges, but I went through the recent
pages and deleted the spammy content. These edits should all show up in
"Recent Changes", so _hopefully_ this makes it easier for the Wiki
admins to delete. (If removing the spam makes it harder for the admins
to delete it, please let me know and I won't do it again).

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://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] comment on the wiki

2024-06-12 Thread Pablo Rodriguez via ntg-context
Dear wiki maintainers (Taco at others),

I have found in the user creation log:

05:40, 7 June 2024 User account FelicaEnyeart34 was created
22:59, 26 May 2024 User account NonaAlber414387 was created
04:33, 26 May 2024 User account Tony83264596 was created
15:17, 24 May 2024 User account WallyGarth was created

I‘m afraid these four users may be only spamming accounts.

I don’t know whether it is worth discussing this issue, but I have two
questions:

Is there any way in which regular wiki contributions may help in
removing the accounts or at least all the pages generated with these
accounts?

Is there any way to fix the display of user contributions (such as mine,
https://wiki.contextgarden.net/Special:Contributions/Ousia)?

I have just discovered that the problem is to search for contributions
in all namespaces (set by default), which triggers the error message:

  Namespaces with negative values are not supported.

If main namespace is selected, everything works fine.

I wonder whether it would be possible to set the main namespace as
default to search for user contributions.

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://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: regular online meet-up

2024-06-12 Thread Henning Hraban Ramm

Reminder: tonight!

Am 09.06.24 um 17:25 schrieb Henning Hraban Ramm:

I nearly forgot:

You’re invited to our regular online meet-up, this upcoming
Wednesday, June 12th, 19:00 CEST (UTC+2)

at https://lecture.senfcall.de/hen-rbr-rku-oke
(same, but shorter: https://u.mtxrun.eu/ctxmtg)

ConTeXt users of all levels are welcome!

Do you have a subject that you’d like to talk about?

Looking forward to seeing you,
Hraban


___
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: Cite-proc Lua - Following up

2024-06-12 Thread Max Chernoff
Hi,

On Tue, 2024-06-11 at 11:38 +, hdanielhix...@gmail.com wrote:
> There is a LaTeX package called citation-style-language, backed by
> some software called citeproc-lua. The github page for the software is
> here: https://github.com/zepinglee/citeproc-lua

> I'm just wondering if there is more news about its potential
> integration with Context.

A *very* quick and hacky implementation. First, clone the repository
plus all its submodules, then apply two small patches for Lua 5.5
compatibility:

diff --git a/citeproc/citeproc-latex-core.lua 
b/citeproc/citeproc-latex-core.lua
index 3057c5d..95c917a 100644
--- a/citeproc/citeproc-latex-core.lua
+++ b/citeproc/citeproc-latex-core.lua
@@ -260,6 +260,7 @@ end
 local function parse_latex_seq(s)
   local t = {}
   for item in string.gmatch(s, "(%b{})") do
+local item = item
 item = string.sub(item, 2, -2)
 table.insert(t, item)
   end

diff --git a/luaxml-mod-xml.lua b/luaxml-mod-xml.lua
index d40b761..bf09830 100644
--- a/luaxml-mod-xml.lua
+++ b/luaxml-mod-xml.lua
@@ -524,6 +524,7 @@ local function getAttributes(k,v)
   level = level or 0
   local spaces = string.rep(' ', level*2)
   for k,v in pairs(tb) do
+local k = k
 if type(v) ~= "table" then
   local ct = k
   if type(k)=="number" then

Then, install all the files somewhere where ConTeXt can find them. The
following layout seems to work:

$ tree -a $TEXMFHOME
/home/max/Projects/citeproc-lua/texmf/
├── scripts
│   ├── citation-style-language -> ../../citeproc/
│   └── lua-uca -> ../../submodules/lua-uca/src/lua-uca/
└── tex
├── generic
│   └── unicode-data -> ../../../submodules/unicode-data/
├── latex
│   └── citation-style-language -> ../../../latex/
└── luatex
├── lua-uni-algos -> ../../../submodules/lua-uni-algos/
└── luaxml -> ../../../submodules/luaxml/

12 directories, 0 files

Finally, make a new file somewhere in the "examples/" folder with the
following contents:

\startluacode
package.loaded.unicode = { utf8 = string }
package.loaded.lualibs = {}
kpse.find_file = function(name)
local path = resolvers.findfile(name)
if path == "" then
path = nil
end
return path
end

local saved_require = require
function require(name)
return saved_require(name:gsub("^[^%.]+%.", ""))
end

require("util-jsn")

local output = require("citeproc-output")
local ConTeXtWriter = output.LatexWriter

ConTeXtWriter.markups = {
["bibstart"] = [[\startitemize]],
["bibend"] = [[\stopitemize]],
["@font-style/normal"] = [[\normal{%s}]],
["@font-style/italic"] = [[\italic{%s}]],
["@font-style/oblique"] = [[\slanted{%s}]],
["@font-variant/normal"] = "[[\normal{%s}]]",
["@font-variant/small-caps"] = [[{\sc %s}]],
["@font-weight/normal"] = "[[\normal{%s}]]",
["@font-weight/bold"] = [[\bold{%s}]],
["@font-weight/light"] = "[[\normal{%s}]]",
["@text-decoration/none"] = false,
["@text-decoration/underline"] = [[\underline{%s}]],
["@vertical-align/sup"] = [[\high{%s}]],
["@vertical-align/sub"] = [[\low{%s}]],
["@vertical-align/baseline"] = false,
["@cite/entry"] = false,
["@bibliography/entry"] = [[\item %s]] .. "\n"
}

function ConTeXtWriter:write_escaped(str, context)
return string.formatters["%!tex!"](str)
end

function ConTeXtWriter:write_link(inline, context)
if inline.href == inline.value then
-- URL
return string.format([[\hyphenatedurl{%s}]], inline.value)
elseif context.engine.opt.wrap_url_and_doi then
return string.format([=[\goto{\hyphenatedurl{%s}}[url(%s)]]=], 
inline.href, self:write_escaped(inline.value, context))
else
return self:write_escaped(inline.value, context)
end
end

local engine
interfaces.implement {
name = "cslinit",
public = true,
arguments = "2 strings",
actions = function(style_name, bib_file)
local citeproc = require("citeproc")
local latex_core = require("citeproc-latex-core")
local citeproc_sys = latex_core.make_citeproc_sys { bib_file }
local style = latex_core.read_file(style_name .. ".csl")
engine = citeproc.new(citeproc_sys, style)
engine.output_format = ConTeXtWriter
end
}

interfaces.implement {
name = "cslcite",
public = true,

[NTG-context] Re: Scale content to height of the font, measure font height

2024-06-11 Thread Gerion Entrup
Am Montag, 10. Juni 2024, 15:53:19 MESZ schrieb Wolfgang Schuster:
> Gerion Entrup schrieb am 10.06.2024 um 13:16:
> > Hi,
> > 
> > I'd like to scale something (actually a symbol drawn in TikZ) to the exact
> > high of the char 'M'. I found the scale environment for it but struggle to
> > measure the correct font height. I found the 
> > "definemeasure/measure/measured"
> > commands but they define a dimension and are not for doing measurements on
> > rendered text. Is there a simple way to get the height a char as a 
> > dimension?
> > 
> > MWE:
> > ```
> > \starttext
> > % Is it possible to replace 1cm with a common expression?
> > This is the letter M. \scale[height=1cm]{a} should have the exact same size 
> > as
> > M.
> > 
> > This should also be true {\tfc with a bigger M. \scale[height=1cm]{a}}.
> > \stoptext
> > ```
> 
> \starttext
> M\scale[height=\heightofstring{M}]{a}M
> \stoptext
> 
> Wolfgang
> 

Thank you all! Added to the wiki: https://wiki.contextgarden.net/Dimensions

Gerion


signature.asc
Description: This is a digitally signed message part.
___
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] Cite-proc Lua - Following up

2024-06-11 Thread hdanielhixson
Hello all,

I hope you are well. This is my first time posting. So if I do so erroneously, 
I apologize. 

There is a LaTeX package called citation-style-language, backed by some 
software called citeproc-lua. The github page for the software is here: 
https://github.com/zepinglee/citeproc-lua

It is an excellent piece of software.

There was previous discussion about potentially integrating the software into 
Context. The following link should show a discussion that took place about the 
topic.
https://www.mail-archive.com/search?l=ntg-context@ntg.nl=subject:%22Re%5C%3A+%5C%5BNTG%5C-context%5C%5D+Citeproc%5C-lua%22=newest

I'm just wondering if there is more news about its potential integration with 
Context.

Thank you, devs, for your hard work on making the software.
___
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] nearly on topic: BoVeX, AI alignment

2024-06-10 Thread Henning Hraban Ramm
Funny idea of replacing hyphenation with LLM-generated alternative 
wording, also explains a bit how TeX works:

http://tom7.org/bovex/

(a SIGBOVIK submission)

;) hr
___
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] suggestion: two templates for the wiki

2024-06-10 Thread Pablo Rodriguez via ntg-context
Dear Taco and Hraban,

trying to improve the XML page from the wiki, I think it would be
extremely useful to have two templates for inline code:

{{xml|…}}: inline XML highlighted as  for blocks.

{{tex|…}}: inline TeX code highlighted as  for blocks.

As for the second, {{cmd|…}} includes a link (not always required) and
doesn‘t higlight more than the command itself.

Let me know whether I can contribute in any way to this.

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://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: [ remove all metadata in pdf ]

2024-06-10 Thread Pablo Rodriguez via ntg-context
On 6/10/24 17:49, vm via ntg-context wrote:
> Is there a parameter for context lmtx to strip all metadata from the
> generated pdf?
> Or is that a better task for exiftool afterwards?

  \enabledirectives[backend.date=none]

But this doesn’t remove all metadata.

Title, Producer and XMP data still there.

Just in case 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://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] [ remove all metadata in pdf ]

2024-06-10 Thread vm via ntg-context
Is there a parameter for context lmtx to strip all metadata from the 
generated pdf?

Or is that a better task for exiftool afterwards?


.F
___
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: dimen 100.0pt not 100.0pt?

2024-06-10 Thread Hans Hagen via ntg-context

On 6/10/2024 3:46 PM, Hans van der Meer via ntg-context wrote:
The I do not understand. I am testing if a dimension set can be checked 
against the expected value.
It looks like 100.0pt is not really 100.0pt. Why? And how can I do this 
test properly with true as result?


\scratchdimen=100pt\relax
\iftok{\the\scratchdimen}{100.0pt}true\else false\fi
Screenshot 2024-06-10 at 15.37.32.png

printing \the\scratchdimen results in 100.0pt

while \meaning\scratchdimen results in: constant dimension 100.0pt


It has to do with catcodes (of p and t) so you need this:

\iftok{\the\scratchdimen}{\detokenize{100.0pt}}true\else false\fi

But ... you should do it the way Wolfgang pointer out

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

___
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: dimen 100.0pt not 100.0pt?

2024-06-10 Thread Wolfgang Schuster

Hans van der Meer via ntg-context schrieb am 10.06.2024 um 15:46:
The I do not understand. I am testing if a dimension set can be checked 
against the expected value.
It looks like 100.0pt is not really 100.0pt. Why? And how can I do this 
test properly with true as result?


\scratchdimen=100pt\relax
\iftok{\the\scratchdimen}{100.0pt}true\else false\fi
Screenshot 2024-06-10 at 15.37.32.png

printing \the\scratchdimen results in 100.0pt

while \meaning\scratchdimen results in: constant dimension 100.0pt


\starttext

\scratchdimen=100.0pt

\ifdim\scratchdimen=100.0pt
  True
\else
  False
\fi

\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] Re: Scale content to height of the font, measure font height

2024-06-10 Thread Wolfgang Schuster

Gerion Entrup schrieb am 10.06.2024 um 13:16:

Hi,

I'd like to scale something (actually a symbol drawn in TikZ) to the exact
high of the char 'M'. I found the scale environment for it but struggle to
measure the correct font height. I found the "definemeasure/measure/measured"
commands but they define a dimension and are not for doing measurements on
rendered text. Is there a simple way to get the height a char as a dimension?

MWE:
```
\starttext
% Is it possible to replace 1cm with a common expression?
This is the letter M. \scale[height=1cm]{a} should have the exact same size as
M.

This should also be true {\tfc with a bigger M. \scale[height=1cm]{a}}.
\stoptext
```


\starttext
M\scale[height=\heightofstring{M}]{a}M
\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] dimen 100.0pt not 100.0pt?

2024-06-10 Thread Hans van der Meer via ntg-context
The I do not understand. I am testing if a dimension set can be checked against 
the expected value.
It looks like 100.0pt is not really 100.0pt. Why? And how can I do this test 
properly with true as result?

\scratchdimen=100pt\relax
\iftok{\the\scratchdimen}{100.0pt}true\else false\fi


printing \the\scratchdimen results in 100.0pt

while \meaning\scratchdimen results in: constant dimension 100.0pt

yours sincerely
dr. Hans van der Meer



___
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: Scale content to height of the font, measure font height

2024-06-10 Thread seyal zavira
Also you can use this:

assuming that you have a fixed size figure such as a pdf page:

\definesymbol[Bsymbol][{\scale[width=1.6ex]{\externalfigure[myfile.pdf][page=1]}}]
\define\mysym{\kern 0.2em \symbol[Bsymbol] \kern 0.3em}

\starttext
this is a sample\mysym text.
\tfa{this is a sample\mysym text.}
\stoptext

On Mon, Jun 10, 2024 at 7:18 AM Gerion Entrup 
wrote:

> Hi,
>
> I'd like to scale something (actually a symbol drawn in TikZ) to the exact
> high of the char 'M'. I found the scale environment for it but struggle to
> measure the correct font height. I found the
> "definemeasure/measure/measured"
> commands but they define a dimension and are not for doing measurements on
> rendered text. Is there a simple way to get the height a char as a
> dimension?
>
> MWE:
> ```
> \starttext
> % Is it possible to replace 1cm with a common expression?
> This is the letter M. \scale[height=1cm]{a} should have the exact same
> size as
> M.
>
> This should also be true {\tfc with a bigger M. \scale[height=1cm]{a}}.
> \stoptext
> ```
>
> Best
> Gerion
>
>
> ___
> 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
>
> ___
>


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: Scale content to height of the font, measure font height

2024-06-10 Thread Hans Hagen

On 6/10/2024 1:16 PM, Gerion Entrup wrote:

Hi,

I'd like to scale something (actually a symbol drawn in TikZ) to the exact
high of the char 'M'. I found the scale environment for it but struggle to
measure the correct font height. I found the "definemeasure/measure/measured"
commands but they define a dimension and are not for doing measurements on
rendered text. Is there a simple way to get the height a char as a dimension?

MWE:
```
\starttext
% Is it possible to replace 1cm with a common expression?
This is the letter M. \scale[height=1cm]{a} should have the exact same size as
M.

This should also be true {\tfc with a bigger M. \scale[height=1cm]{a}}.
\stoptext

\the\dimexpr\fontcharht\font`M+\fontchardp\font`M\relax

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

___
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] Scale content to height of the font, measure font height

2024-06-10 Thread Gerion Entrup
Hi,

I'd like to scale something (actually a symbol drawn in TikZ) to the exact 
high of the char 'M'. I found the scale environment for it but struggle to 
measure the correct font height. I found the "definemeasure/measure/measured" 
commands but they define a dimension and are not for doing measurements on 
rendered text. Is there a simple way to get the height a char as a dimension?

MWE:
```
\starttext
% Is it possible to replace 1cm with a common expression?
This is the letter M. \scale[height=1cm]{a} should have the exact same size as 
M.

This should also be true {\tfc with a bigger M. \scale[height=1cm]{a}}.
\stoptext
```

Best
Gerion



signature.asc
Description: This is a digitally signed message part.
___
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: get measures as dimension in Lua

2024-06-10 Thread Henning Hraban Ramm

Thank you, Max, for the effort and Hans for a core solution!

Am 10.06.24 um 10:28 schrieb Hans Hagen via ntg-context:

Indeed we can have:

     local namespace = tokens.getters.macro("??measure")

     function tex.getmeasure(name,asdimen)
     local value = tex.getdimensionvalue(namespace..name)
     if asdimen then
     return value .. "sp"
     else
     return value
     end

and when you want to avoid the namespace you can do:

     function tex.getmeasure(name,asdimen)
     local value = 
token.getexpansion("\\tointeger\\measured{"..name.."}")

     if asdimen then
     return value .. "sp"
     else
     return tonumber(value)
     end
     end

which is some 4 times slower. It'sindeed not documented (although there 
are some examples in accessors-001.tex) but it's in one of my todo's 
because I can use it in some places (there ar emopre such todo's) after 
which it will be discussed in one of the lowlelvel manuals


i'll add tex.getmeasure to the core (but a bit different)


Not to be misunderstood, I couldn’t check yet, maybe I wasn’t clear:

I need to process the measure as a dimension, like \measured{Bleed}.

As far as I tried, neither tex.measured nor context.measured worked (but 
I wouldn’t swear on it, maybe I had a different error).


Hraban
___
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: get measures as dimension in Lua

2024-06-10 Thread Hans Hagen via ntg-context

On 6/10/2024 7:08 AM, Max Chernoff wrote:

Hi Hraban,

On Sun, 2024-06-09 at 22:12 +0200, Henning Hraban Ramm wrote:

when I define a measure on the TeX side, I used to get at the value in
Lua with tex.getdim, like:

\definemeasure[Bleed][3mm]

tex.getdimen("Bleed")

But now I get "incorrect dimen name".
I need it as a dimension, since I do calculations with other dimensions
like "topspace".

How should I do this correctly?


There doesn't appear to be any official interfaces to get the value of a
measure from Lua, but the following should work okay:

 \definemeasure[mymeasure][10pt]

 \newdimen\mydimen \mydimen=10pt

 \definemeasure[measureexpr][1in + 27.73pt]

 \startluacode
 -- Returns the unexpanded value of some variable in a namespace.
 local function get_variable(namespace, variable)
 -- -- Doesn't work since "measure" is defined as a "system 
namespace".
 -- namespace = interfaces.getnamespace(namespace)
 namespace = tokens.getters.macro("??" .. namespace)
 return tokens.getters.macro(namespace .. variable)
 end

 -- Gets the value of a measure and converts it to an integer in sp 
units.
 local function get_measure(name)
 return tex.sp(get_variable("measure", name))
 end

 -- Gets the \dimexpr-evaluated value of a measure, in sp units.
 local function get_measure_expr(name)
 local namespace = tokens.getters.macro("??measure")
 -- Undocumented, but seems to work as expected.
 return tex.getdimensionvalue(namespace .. name)
 end

 -- Print the values of the lengths.
 print(("="):rep(80))
 print("mymeasure:"  , get_measure("mymeasure")   )
 print("mydimen:", tex.dimen["mydimen"]   )
 print("measureexpr:", get_measure_expr("measureexpr"))
 print(("="):rep(80))
 \stopluacode

 \startTEXpage
 \measure{mymeasure}
 \the\mydimen
 \measure{measureexpr}
 \stopTEXpage

Thanks,
-- Max


Indeed we can have:

local namespace = tokens.getters.macro("??measure")

function tex.getmeasure(name,asdimen)
local value = tex.getdimensionvalue(namespace..name)
if asdimen then
return value .. "sp"
else
return value
end

and when you want to avoid the namespace you can do:

function tex.getmeasure(name,asdimen)
local value = 
token.getexpansion("\\tointeger\\measured{"..name.."}")

if asdimen then
return value .. "sp"
else
return tonumber(value)
end
end

which is some 4 times slower. It'sindeed not documented (although there 
are some examples in accessors-001.tex) but it's in one of my todo's 
because I can use it in some places (there ar emopre such todo's) after 
which it will be discussed in one of the lowlelvel manuals


i'll add tex.getmeasure to the core (but a bit different)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

___
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: get measures as dimension in Lua

2024-06-09 Thread Max Chernoff
Hi Hraban,

On Sun, 2024-06-09 at 22:12 +0200, Henning Hraban Ramm wrote:
> when I define a measure on the TeX side, I used to get at the value in
> Lua with tex.getdim, like:
>
> \definemeasure[Bleed][3mm]
>
> tex.getdimen("Bleed")
>
> But now I get "incorrect dimen name".
> I need it as a dimension, since I do calculations with other dimensions
> like "topspace".
>
> How should I do this correctly?

There doesn't appear to be any official interfaces to get the value of a
measure from Lua, but the following should work okay:

\definemeasure[mymeasure][10pt]

\newdimen\mydimen \mydimen=10pt

\definemeasure[measureexpr][1in + 27.73pt]

\startluacode
-- Returns the unexpanded value of some variable in a namespace.
local function get_variable(namespace, variable)
-- -- Doesn't work since "measure" is defined as a "system 
namespace".
-- namespace = interfaces.getnamespace(namespace)
namespace = tokens.getters.macro("??" .. namespace)
return tokens.getters.macro(namespace .. variable)
end

-- Gets the value of a measure and converts it to an integer in sp 
units.
local function get_measure(name)
return tex.sp(get_variable("measure", name))
end

-- Gets the \dimexpr-evaluated value of a measure, in sp units.
local function get_measure_expr(name)
local namespace = tokens.getters.macro("??measure")
-- Undocumented, but seems to work as expected.
return tex.getdimensionvalue(namespace .. name)
end

-- Print the values of the lengths.
print(("="):rep(80))
print("mymeasure:"  , get_measure("mymeasure")   )
print("mydimen:", tex.dimen["mydimen"]   )
print("measureexpr:", get_measure_expr("measureexpr"))
print(("="):rep(80))
\stopluacode

\startTEXpage
\measure{mymeasure}
\the\mydimen
\measure{measureexpr}
\stopTEXpage

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://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] get measures as dimension in Lua

2024-06-09 Thread Henning Hraban Ramm

Hi,
when I define a measure on the TeX side, I used to get at the value in 
Lua with tex.getdim, like:


\definemeasure[Bleed][3mm]

tex.getdimen("Bleed")

But now I get "incorrect dimen name".
I need it as a dimension, since I do calculations with other dimensions 
like "topspace".


How should I do this correctly?

(I just assume this used to work – the code is old any maybe stuck in an 
intermediate state where I switched from \newdim to \definemeasure…)


Hraban
___
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] regular online meet-up

2024-06-09 Thread Henning Hraban Ramm

I nearly forgot:

You’re invited to our regular online meet-up, this upcoming
Wednesday, June 12th, 19:00 CEST (UTC+2)

at https://lecture.senfcall.de/hen-rbr-rku-oke
(same, but shorter: https://u.mtxrun.eu/ctxmtg)

ConTeXt users of all levels are welcome!

Do you have a subject that you’d like to talk about?

Looking forward to seeing you,
Hraban


(Same blurb as always:)

[Howto]
* No special software installation required; most modern browsers should 
work (WebRTC required).

* Open the URL above, accept the privacy statement,
* enter your name,
* click "join" (or "start" if you’re the first),
* click "with microphone", allow your browser to access it, check the audio.
* Your microphone is muted if you join. Activate microphone and/or 
camera with the buttons at the bottom.

* Minimize the default presentation with the "screen" button, bottom right.

* If you’d like to share your screen or upload a file, you can make 
yourself the presenter: Click on your user name, change the setting, 
then you’ll see the "screen sharing" button beside the camera button; 
also there’s now "manage presentations" behind the "plus" button.
Beware there is only one presenter at a time, so don’t kill someone 
else’s presentation.


[Technical hints]
* Sound is usually better if you use a headset (less noise for everyone).
* Connection problems are mostly due to low bandwidth or high latency on 
your side, e.g. with mobile connections.

* Sometimes leaving and re-entering helps.
* If audio/video doesn’t work for you, you can still use the text chat.
* Screen sharing needs a lot of bandwidth.
* BigBlueButton documentation applies: 
https://bigbluebutton.org/teachers/tutorials/


[Netiquette]
* Please use a name that we recognize from here. Some feel uncomfortable 
with anonymous lurkers.

* Mute your microphone while you’re not talking.
* It’s nice to show your face at least when you join.
* If there are connection problems, stop camera sharing.
* The room is set to “everyone’s a moderator“, I trust you...
___
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: Bibliography: separating different kinds of literature OR Sectioning bibliography by type

2024-06-09 Thread Ben Moon via ntg-context
Dear Alan,
Thank you very much for your reply. Unfortunately, I don’t get this working. 
Also, I don’t find the documentation for flushbtxrendering.
Here’s a minimal working example I’m trying:

\startbtxrenderingdefinitions[mybib]

\definebtx
  [mybib]
  [default=default,
   specification=mybib]

\definebtxrendering
  [mybib]
  [specification=mybib,
   numbering=yes]

\stopbtxrenderingdefinitions

\startsetups btx:mybib:list:link
   \btxdoifelse {title} {\btxflush{title}:\space} {No Title}
   \btxdoifelse {url}  {\btxflush{url};\space} {}
   \btxdoifelse {date}  {abgerufen \btxflush{date}.} {}
  \removeunwantedspaces
\stopsetups

\startsetups btx:mybib:list:imagelink
   \btxdoifelse {url}  {\btxflush{url};\space} {}
   \btxdoifelse {date}  {abgerufen \btxflush{date}.} {}
  \removeunwantedspaces
\stopsetups


\startbuffer[maindata]
@link{herbariumathome,
title={Herbarium At Home: A Beginner's Guide},
url={https://youtu.be/2kEbCaTe8XM},
date={04.04.2024}},

@imagelink{zooniverse_logo,
url={https://www.sciencelearn.org.nz/images/3873-zooniverse-logo},
date={04.06.2024}}
\stopbuffer
% enable tracing
\enabletrackers[publications, publications.crossref, publications.details, 
publications.cite, publications.strings]

\definebtxdataset[main]
\usebtxdataset[main][maindata.buffer]
%\definebtxdataset[bilder]
%\usebtxdataset[bilder][imagedata.buffer]
\usebtxdefinitions[mybib, aps] % aps for stuff which isn’t a link or image
\setupbtx[dataset=main]
\definebtxrendering[bibrendering][mybib, aps][dataset=main]

\starttext
\cite[herbariumathome]
\cite[zooniverse_logo]

\section{Quellen: Bilder}
%\placelistofpublications[bibrendering]
\flushbtxrendering [bibrendering]
[method=dataset,
 sorttype=index,
 filter=match(category:imagelink)]

\section{Quellen: Webseiten}
\flushbtxrendering [bibrendering]
[method=dataset,
 sorttype=index,
 filter=match(category:link)]
\stoptext

I would very much appreciate more ideas.

Thank you very much and kind regards

Ben

> On 9 Jun 2024, at 14:37, Alan Braslau via ntg-context  
> wrote:
> 
> Try something like:
> 
>  \flushbtxrendering [bibrendering]
>   [method=dataset,
>sorttype=index,
>filter=match(category:article)]
> 
> I have used the filtering mechanism to select fields, such as 
> filter=match(year:2023).
> 
> Alan
> 
> 
> 
> 
> On Tue, 4 Jun 2024 15:20:14 +0200
> Ben Moon via ntg-context  wrote:
> 
>> Hey there,
>> I would like to place a list of bibliography according to types
>> (article, book, in proceedings) in my document. Similar like here:
>> https://tex.stackexchange.com/questions/112874/sectioning-bibliography-by-type-with-multiple-types-per-section
>> Sectioning bibliography by type (with multiple types per section)
>> tex.stackexchange.com
>> 
>> and here:
>> https://www.mail-archive.com/ntg-context@ntg.nl/msg77056.html
>> The example provided by Hans doesn’t seem to properly work any more,
>> and I cannot make the suggestion work of using two different datasets
>> work as suggested in the same thread. So this is where I’m stuck:
>> 
>> \definebtxdataset[main]
>> \usebtxdataset[main][maindata.buffer]
>> \definebtxdataset[images]
>> \usebtxdataset[images][imagedata.buffer]
>> \usebtxdefinitions[mycustom, aps]
>> \setupbtx[dataset=main]
>> \definebtxrendering[bibrendering][mycustom, aps][dataset=main]
>> \definebtxrendering[bibimgrendering][mycustom, aps][dataset=images]
>> 
>> \placelistofpublications[bibrendering]
>> \placelistofpublications[bibimgrendering]
>> 
>> It would be much appreciated if someone could provide a working
>> example?
>> 
>> Thank you very much
>> 
>> Ben
> 
> ___
> 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
> ___

___
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: Bibliography: separating different kinds of literature OR Sectioning bibliography by type

2024-06-09 Thread Alan Braslau via ntg-context
Try something like:

  \flushbtxrendering [bibrendering]
   [method=dataset,
sorttype=index,
filter=match(category:article)]

I have used the filtering mechanism to select fields, such as 
filter=match(year:2023).

Alan




On Tue, 4 Jun 2024 15:20:14 +0200
Ben Moon via ntg-context  wrote:

> Hey there,
> I would like to place a list of bibliography according to types
> (article, book, in proceedings) in my document. Similar like here:
> https://tex.stackexchange.com/questions/112874/sectioning-bibliography-by-type-with-multiple-types-per-section
> Sectioning bibliography by type (with multiple types per section)
> tex.stackexchange.com
> 
> and here:
> https://www.mail-archive.com/ntg-context@ntg.nl/msg77056.html
> The example provided by Hans doesn’t seem to properly work any more,
> and I cannot make the suggestion work of using two different datasets
> work as suggested in the same thread. So this is where I’m stuck:
> 
> \definebtxdataset[main]
> \usebtxdataset[main][maindata.buffer]
> \definebtxdataset[images]
> \usebtxdataset[images][imagedata.buffer]
> \usebtxdefinitions[mycustom, aps]
> \setupbtx[dataset=main]
> \definebtxrendering[bibrendering][mycustom, aps][dataset=main]
> \definebtxrendering[bibimgrendering][mycustom, aps][dataset=images]
> 
> \placelistofpublications[bibrendering]
> \placelistofpublications[bibimgrendering]
> 
> It would be much appreciated if someone could provide a working
> example?
> 
> Thank you very much
> 
> Ben

___
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: Scale notation base on current font

2024-06-08 Thread seyal . zavira
This is also important
Thanks for your helpful hint.
___
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: Scale notation base on current font

2024-06-08 Thread seyal . zavira
Thanks so much
it works great.
___
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: Scale notation base on current font

2024-06-08 Thread Pablo Rodriguez via ntg-context
On 6/8/24 17:09, seyal zavira wrote:
> Thanks
>
> sorry for incomplete example
> the code below shows the problem better:
> \setupinteraction[state=start]

As for the color, it is caused by \setupinteraction.

You can remove it with:

  \setupinteraction[state=start, style=, color=, contrastcolor=,]

This disables default style and color in links (footnote markers are links).

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://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: Scale notation base on current font

2024-06-08 Thread Wolfgang Schuster

seyal zavira schrieb am 08.06.2024 um 17:09:

Thanks

sorry for incomplete example
the code below shows the problem better:
\setupinteraction[state=start]
\definenote[Mynote][location=text,before={},]
\setupnote[Mynote]
     [location=left,
      textcommand={\tfa \raise 0.2ex\hbox},
     ]

\definefont[highfont][name:ibmplexsansbold*default at 10pt]
\definehighlight[newhigh][color=darkblue,style=highfont]

\starttext
\input{knuth} \Mynote{refrence}

\startitemize
\item \newhigh{\input{knuth}\Mynote{refrenceTwo}}
\stopitemize

\placenotes[Mynote]
\stoptext

as you can see the note number has same style all over the document.
but i want it to have style base on current font
and if the font changes, the style should change, while maintaining the 
ratio of sizes(i.e., at the half of current font).

i attached the resulted pdf


1. You can use the \offset command to raise the footnote number.

2. Disable the value of the textstyle to ensure you get current style 
for the footnote number.


 begin example
\define[1]\MyNoteTextcommand
  {\offset[y=-0.2ex]{#1}}

\definenote
  [Mynote]

\setupnote
  [Mynote]
  [location=text,
   textstyle=,
   textcommand=\MyNoteTextcommand]

\starttext

\input{knuth}\Mynote{First note.}

\startstyle[style=\ss]
\input{knuth}\Mynote{Second note.}
\stopstyle

\startstyle[style=\tt\bf]
\input{knuth}\Mynote{Third note.}
\stopstyle

\placenotes[Mynote]

\stoptext
 end example

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] Re: Scale notation base on current font

2024-06-08 Thread seyal zavira
Thanks

sorry for incomplete example
the code below shows the problem better:
\setupinteraction[state=start]
\definenote[Mynote][location=text,before={},]
\setupnote[Mynote]
[location=left,
 textcommand={\tfa \raise 0.2ex\hbox},
]

\definefont[highfont][name:ibmplexsansbold*default at 10pt]
\definehighlight[newhigh][color=darkblue,style=highfont]

\starttext
\input{knuth} \Mynote{refrence}

\startitemize
\item \newhigh{\input{knuth}\Mynote{refrenceTwo}}
\stopitemize

\placenotes[Mynote]
\stoptext

as you can see the note number has same style all over the document.
but i want it to have style base on current font
and if the font changes, the style should change, while maintaining the
ratio of sizes(i.e., at the half of current font).
i attached the resulted pdf

On Sat, Jun 8, 2024 at 10:04 AM vm via ntg-context 
wrote:

>
>
> On 08/06/2024 13:16, seyal.zav...@gmail.com wrote:
> > \definenote[Mynote][location=text,before={},]
> > \setupnote[Mynote]
> >  [location=left,
> >   textcommand= \scale [height=0.7ex] \raise 0.2ex\hbox,
> >  ]
> > \starttext
> > hello \Mynote{refrence}
> > \placenotes[Mynote]
> > \stoptext
>
>
> add {} this works:
>
> \setupnote[Mnote]
> [location=left,
> textcommand={\scale[height=0.7ex] \raise 0.2ex\hbox},
> ]
>
>
> ___
> 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
>
> ___
>


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: Scale notation base on current font

2024-06-08 Thread vm via ntg-context




On 08/06/2024 13:16, seyal.zav...@gmail.com wrote:

\definenote[Mynote][location=text,before={},]
\setupnote[Mynote]
 [location=left,
  textcommand= \scale [height=0.7ex] \raise 0.2ex\hbox,
 ]
\starttext
hello \Mynote{refrence}
\placenotes[Mynote]
\stoptext



add {} this works:

\setupnote[Mnote]
[location=left,
textcommand={\scale[height=0.7ex] \raise 0.2ex\hbox},
]

___
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: Scale notation base on current font

2024-06-08 Thread Pablo Rodriguez via ntg-context
On 6/8/24 13:16, seyal.zav...@gmail.com wrote:
> Hi all,
>
> There's a problem when I want to define the note so that it's
> displayed according to the size and font of the text:

Not sure I’m getting your point.

But this should show a difference in font size:

  \definenote[Mynote]
  \starttext
  \color[green]{\tfd hello \Mynote{refrence} not really required}

  \switchtobodyfont[36pt]
  \color[green]{hello \Mynote{refrence} not really required}
  \stoptext

> but i cannot set it for \tfxx.
> also it's relative to my main body font, and my current font andI
> color doesn't apply to text.
> for example if my current text has color red with another font the
> note doesn't change according to it, and will display identical
> everywhere.

Could you show how the second paragraph above doesn‘t inherit both size
and color from the current font?

Sorry, otherwise I simply don’t get it.

> And when I try to define it like this MWE:
>
> \definenote[Mynote][location=text,before={},]
> \setupnote[Mynote]
> [location=left,
>  textcommand= \scale [height=0.7ex] \raise 0.2ex\hbox,
> ]

I don’t think the text command value is right.

Besides, if you intend the second paragraph from the sample, this
approach looks unnecessarily complex for me.

I hope it might 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://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] Scale notation base on current font

2024-06-08 Thread seyal . zavira
Hi all,

There's a problem when I want to define the note so that it's displayed 
according to the size and font of the text:

this MWE change the notation size:
\definenote[Mynote][location=text,before={},]
\setupnote[Mynote]
[location=left,
 textcommand=\tfb \raise 0.2ex\hbox,
]
\starttext
hello \Mynote{refrence}
\placenotes[Mynote]
\stoptext

but i cannot set it for \tfxx.
also it's relative to my main body font, and my current font and color doesn't 
apply to text.
for example if my current text has color red with another font the note doesn't 
change according to it, and will display identical everywhere.

And when I try to define it like this MWE:

\definenote[Mynote][location=text,before={},]
\setupnote[Mynote]
[location=left,
 textcommand= \scale [height=0.7ex] \raise 0.2ex\hbox,
]
\starttext
hello \Mynote{refrence}
\placenotes[Mynote]
\stoptext

it doesn't work.

how i should define such notes?
___
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: ConTeXt source from XML

2024-06-08 Thread Pablo Rodriguez via ntg-context
On 6/8/24 09:49, Wolfgang Schuster wrote:
> Denis Maier via ntg-context schrieb am 08.06.2024 um 09:14:
>> [...] 
>> Hi,
>> I've read Thomas Schmitt's My Way as an excellent introduction in XML
>> processing with ConteXt, but I can't find it anywhere anymore... Does
>> anyone know what happened to it?
>
> https://wiki.contextgarden.net/images/8/8c/xhtml.pdf

Many thanks for the new reference, Wolfgang.

Many thanks for mentioning it, Denis.

I’m going to fix the wiki links right now
(https://wiki.contextgarden.net/XML).

Many thanks again,

Pablo

___
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: ConTeXt source from XML

2024-06-08 Thread Pablo Rodriguez via ntg-context
On 6/8/24 10:49, vm via ntg-context wrote:
> in the document
> https://wiki.contextgarden.net/images/8/8c/xhtml.pdf
>
> near the end an essential line got truncated:
> [...]
> how should this line continue ?
> {\externalfigure[\xmlatt{#1}{src}][width=\ctxlua{getmeas("\xmla

As this comes from
https://wiki.contextgarden.net/images/8/8c/xhtml.pdf#page=16 and it
seems to be previously defined on This comes from
https://wiki.contextgarden.net/images/8/8c/xhtml.pdf#page=10, I would say:

  \startxmlsetups xml:img
\placefigure
 [here]
 [\xmlatt{#1}{src}]
   {\xmlatt{#1}{alt}}
   {\externalfigure[\xmlatt{#1}{src}]
 [width=\ctxlua{getmeas("\xmlatt{#1}{width}")}]}
  \stopxmlsetups

But this is my uneducated guess (and not having checked whehter this may
make sense).

Just in case it might 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://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: ConTeXt source from XML

2024-06-08 Thread Thomas A. Schmitz

On 6/8/24 10:49, vm via ntg-context wrote:

in the document
https://wiki.contextgarden.net/images/8/8c/xhtml.pdf

near the end an essential line got truncated:

\startxmlsetups xml:img
\placefigure[here]
[\xmlatt{#1}{src}]
{\xmlatt{#1}{alt}}
{\externalfigure[\xmlatt{#1}{src}][width=\ctxlua{getmeas("\xmla
\stopxmlsetups




how should this line continue ?
{\externalfigure[\xmlatt{#1}{src}][width=\ctxlua{getmeas("\xmla




That would be

{\externalfigure[\xmlatt{#1}{src}]
[width=\ctxlua{getmeas("\xmlatt{#1}{width}")}]}

Thomas
___
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: ConTeXt source from XML

2024-06-08 Thread vm via ntg-context

in the document
https://wiki.contextgarden.net/images/8/8c/xhtml.pdf

near the end an essential line got truncated:

\startxmlsetups xml:img
\placefigure[here]
[\xmlatt{#1}{src}]
{\xmlatt{#1}{alt}}
{\externalfigure[\xmlatt{#1}{src}][width=\ctxlua{getmeas("\xmla
\stopxmlsetups




how should this line continue ?
{\externalfigure[\xmlatt{#1}{src}][width=\ctxlua{getmeas("\xmla



.F
___
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: ConTeXt source from XML

2024-06-08 Thread Wolfgang Schuster



Denis Maier via ntg-context schrieb am 08.06.2024 um 09:14:
Pablo Rodriguez via ntg-context > hat am 07.06.2024 21:41 CEST geschrieben:

Again, xml-mkiv.pdf is documenting the way of handling XML in ConTeXt
and it has to be written that way.
It is part of our task (the one reserved to final users) to compose a
proper introduction on how to typeset XML sources with ConTeXt.
Borrowing the title from other work, “XML in Proper ConTeXt” (actually
taken from https://www.berenddeboer.net/tex/LaTeX2ConTeXt.pdf).

Hi,
I've read Thomas Schmitt's My Way as an excellent introduction in XML 
processing with ConteXt, but I can't find it anywhere anymore... Does 
anyone know what happened to it?




https://wiki.contextgarden.net/images/8/8c/xhtml.pdf

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] Re: ConTeXt source from XML

2024-06-08 Thread Denis Maier via ntg-context


 
 
  
    
   
   
   
Pablo Rodriguez via ntg-context  hat am 07.06.2024 21:41 CEST geschrieben:

   
 

   
 

   
Again, xml-mkiv.pdf is documenting the way of handling XML in ConTeXt

   
and it has to be written that way.

   
 

   
It is part of our task (the one reserved to final users) to compose a

   
proper introduction on how to typeset XML sources with ConTeXt.

   
 

   
Borrowing the title from other work, “XML in Proper ConTeXt” (actually

   
taken from https://www.berenddeboer.net/tex/LaTeX2ConTeXt.pdf).

   
 

   
 

   
  
    
   
  
   Hi,
   
  
   I've read Thomas Schmitt's My Way as an excellent introduction in XML processing with ConteXt, but I can't find it anywhere anymore... Does anyone know what happened to it?
   
  
    
   
  
   Best
   
  
   Denis
  
 

___
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: ConTeXt source from XML

2024-06-07 Thread Henning Hraban Ramm

Am 07.06.24 um 21:41 schrieb Pablo Rodriguez via ntg-context:

It is part of our task (the one reserved to final users) to compose a
proper introduction on how to typeset XML sources with ConTeXt.


Have a look at the XMl related articles in 
https://articles.contextgarden.net/journal/2019.html


Thomas’ “Presentations in XML” is a good introduction IMO.
Taco’s articles are more specialized but give further insights.

Hraban
___
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: ConTeXt source from XML

2024-06-07 Thread Pablo Rodriguez via ntg-context
On 6/6/24 22:53, Christoph Edenhauser wrote:
>> [...]
>> XPath seems to have as it primary purpose to address the nodes of XML trees.
>> [...]
>> If you don’t want this to happen, you have to encode them in the TEI XML
>> sources.
>
> In my case, the connection to the original source will be lost.  While
> we will still try to backport corrections, the connection will be lost
> at the very moment when we will annotate the source text.

Dear Christoph,

well, in your case, your source will be a new one, the annotated one.

> At the moment I'm leaning strongly towards TEI, also because I could try
> to remove the annotations via XSLT once the work is complete, diff the
> result with the original source and improve it). And besides,
> XML+ConTeXt looks quite elegant from the distance of my ignorance.

If you are familiar with XSLT (and XPath), you will have no problem
typesetting XML sources with ConTeXt.

> (Although reading xml-mkiv.pdf creates a pleasant frictional heat in my
> cerebral convolutions, but leaves at least as many knots in them as XML
> data have nodes).

Well, xml-mkiv.pdf isn’t exactly a piece of cake. It isn’t an
introduction and it has to be written that way.

After trying to read it for the n-th time and having learnt only very
little from it (exclusively my fault), I think it assumes a good XPath
background.

Again, xml-mkiv.pdf is documenting the way of handling XML in ConTeXt
and it has to be written that way.

It is part of our task (the one reserved to final users) to compose a
proper introduction on how to typeset XML sources with ConTeXt.

Borrowing the title from other work, “XML in Proper ConTeXt” (actually
taken from https://www.berenddeboer.net/tex/LaTeX2ConTeXt.pdf).

All I can say is that I have read xml-mkiv.pdf and I know I will learn
way more from this document than the huge amount of things I have
already discovered reading it.

>> [...]
>> Having the text properly formatted and printed on paper helps a lot to
>> spot errors.
>
> Same here: It's the paper!
> (I for myself prefer for the first proof reading a page lots of white
> space, in monospaced font like Courier, while my proofreader wants to
> see the font that will be used in the end.)

Sorry for insisting. If the text is not fully formated, it is very easy
to overlook formatting errors with commands (or simple errors with
commands directly).

The most basic sample may read (wrong spacing after command):

  \starttext
\ConTeXt is awesome!
  \stoptext

This is one in a bunch of errors that may be unnoticed.

Just in case it might 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://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: missing space with French quotation

2024-06-07 Thread Wolfgang Schuster

Alan Braslau schrieb am 07.06.2024 um 16:21:

I have *never* understood how this works and, in fact, have always done
weird stuff like explicitly putting a nbps before double punctuation
(:;) in my document sources. I do this as it makes the sources much
more readable, preventing my text editor from ever breaking lines
before the punctuation (and not having some space in the source looks
awkward when reading French text).

I use:

[...]

This gives proper spacing with \quotation{} and with \startquotation
... \stopquotation. Also, {\en\quotation{}} and {\de\quotation{}} in
the document correctly do not add spaces.


1. \setcharacterspacing[frenchpunctuation] takes care about the space 
before/after quotation marks when you use manual quotes in a document.


It doesn't matter whether you use or don't use space between the 
quotations marks and the quoted text.


 begin example
\starttext

\startlines
«quoted text»
« quoted text »
\stoplines

\setcharacterspacing[frenchpunctuation]

\startlines
«quoted text»
« quoted text »
\stoplines

\stoptext
 end example

2. When you use the quotation command or environment ConTeXt adds a 
space between the quotation marks and the quoted text by itself but in 
the quotation-environment the space before the closing mark disappears 
when you add \setcharacterspacing.


 begin example
\language[fr]

\starttext

\startquotation
quoted text
\stopquotation

\quotation{quoted text}

\setcharacterspacing[frenchpunctuation]

\startquotation
quoted text
\stopquotation

\quotation{quoted text}

\stoptext
 end example


Is \setupquotation[symstyle=\resetcharacterspacing] necessary?


It's a temporary fix for the problem with the quotation environment by 
disabling the characterspacing mechanism when ConTeXt places the 
quotation marks.


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] Re: missing space with French quotation

2024-06-07 Thread Alan Braslau via ntg-context
I have *never* understood how this works and, in fact, have always done
weird stuff like explicitly putting a nbps before double punctuation
(:;) in my document sources. I do this as it makes the sources much
more readable, preventing my text editor from ever breaking lines
before the punctuation (and not having some space in the source looks
awkward when reading French text).

I use:

\setupcharacterspacing
  [frenchpunctuation]
  [language=fr]
\mainlanguage [fr]
\setcharacterspacing [frenchpunctuation] % why necessary?
\setupitemize [symbol=2] % dash rather than bullet

This gives proper spacing with \quotation{} and with \startquotation
... \stopquotation. Also, {\en\quotation{}} and {\de\quotation{}} in
the document correctly do not add spaces.


Is \setupquotation[symstyle=\resetcharacterspacing]
necessary?

Alan



On Fri, 7 Jun 2024 14:18:19 +0200
Wolfgang Schuster  wrote:

> Peter Münster schrieb am 07.06.2024 um 13:31:
> > On Thu, May 30 2024, Peter Münster wrote:
> >   
> >> \mainlanguage[fr]
> >> \setcharacterspacing[frenchpunctuation]
> >> \starttext
> >> bla \quotation{OK} bla\\
> >> bla «OK» bla
> >> \startquotation
> >>Not Ok: a space is missing
> >> \stopquotation
> >> \stoptext  
> > 
> > It seems, that this workaround solves the problem:
> > \setupquotation[before={\setcharacterspacing[reset]}]  
> 
> 
> The quotation environment doesn't rely on the characterspacing
> mechanism to add the spaces before and the after the quotes but uses
> language dependent skips.
> 
> The example below shows how it works and where it fails when you use 
> characterspacing. Resetting spacing (and probably other settings like 
> charcterkerning etc.) when the quotes are added as you noticed fixes
> the problem.
> 
>  begin example
> \starttext
> 
> \dontleavehmode
> \hbox{«\hspace[fr][quotation]}%
> xxx%
> \hbox{\hspace[fr][quotation]»}
> 
> \setcharacterspacing[frenchpunctuation]
> 
> \dontleavehmode
> \hbox{«\hspace[fr][quotation]}%
> xxx%
> \hbox{\hspace[fr][quotation]»}
> 
> \dontleavehmode
> \hbox{\expand\everyresettypesetting\relax «\hspace[fr][quotation]}%
> xxx%
> \hbox{\expand\everyresettypesetting\relax \hspace[fr][quotation]»}
> 
> \stoptext
>  end example
> 
> > What do you think about it? Is this the right way to do it?  
> 
> I would use the symstyle key as hook to disable charcterspacing for
> the quotes in the environment.
> 
>  begin example
> \mainlanguage[fr]
> 
> \setcharacterspacing[frenchpunctuation]
> 
> 

> 
> \starttext
> 
> «xxx»
> 
> \startquotation xxx\stopquotation
> 
> \stoptext
>  end example
> 
> 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
> ___


___
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: missing space with French quotation

2024-06-07 Thread Wolfgang Schuster

Peter Münster schrieb am 07.06.2024 um 13:31:

On Thu, May 30 2024, Peter Münster wrote:


\mainlanguage[fr]
\setcharacterspacing[frenchpunctuation]
\starttext
bla \quotation{OK} bla\\
bla «OK» bla
\startquotation
   Not Ok: a space is missing
\stopquotation
\stoptext


It seems, that this workaround solves the problem:
\setupquotation[before={\setcharacterspacing[reset]}]



The quotation environment doesn't rely on the characterspacing mechanism 
to add the spaces before and the after the quotes but uses language 
dependent skips.


The example below shows how it works and where it fails when you use 
characterspacing. Resetting spacing (and probably other settings like 
charcterkerning etc.) when the quotes are added as you noticed fixes the 
problem.


 begin example
\starttext

\dontleavehmode
\hbox{«\hspace[fr][quotation]}%
xxx%
\hbox{\hspace[fr][quotation]»}

\setcharacterspacing[frenchpunctuation]

\dontleavehmode
\hbox{«\hspace[fr][quotation]}%
xxx%
\hbox{\hspace[fr][quotation]»}

\dontleavehmode
\hbox{\expand\everyresettypesetting\relax «\hspace[fr][quotation]}%
xxx%
\hbox{\expand\everyresettypesetting\relax \hspace[fr][quotation]»}

\stoptext
 end example


What do you think about it? Is this the right way to do it?


I would use the symstyle key as hook to disable charcterspacing for the 
quotes in the environment.


 begin example
\mainlanguage[fr]

\setcharacterspacing[frenchpunctuation]

\setupquotation[symstyle=\resetcharacterspacing]

\starttext

«xxx»

\startquotation xxx\stopquotation

\stoptext
 end example

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] Re: missing space with French quotation

2024-06-07 Thread Peter Münster
On Thu, May 30 2024, Peter Münster wrote:

> \mainlanguage[fr]
> \setcharacterspacing[frenchpunctuation]
> \starttext
> bla \quotation{OK} bla\\
> bla «OK» bla
> \startquotation
>   Not Ok: a space is missing
> \stopquotation
> \stoptext

It seems, that this workaround solves the problem:
\setupquotation[before={\setcharacterspacing[reset]}]

What do you think about it? Is this the right way to do it?

-- 
   Peter
___
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: Combine \setupdelimitedtext with an author (define custom variable?)

2024-06-06 Thread Gerion Entrup
Am Donnerstag, 6. Juni 2024, 13:51:53 MESZ schrieb Hans Hagen via ntg-context:
> On 6/6/2024 12:30 PM, Gerion Entrup wrote:
> > Hi,
> > 
> > I like to achieve something that looks like this:
> > ```
> > \definedelimitedtext[extract][blockquote]
> > \setupdelimitedtext
> >[extract]
> >[leftmargin=1.5pc,
> > style={\italic},
> > before={\setupindenting[next]},
> > after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
> > \tfx\italic{René Descartes} \stopalignment}]
> > 
> > \starttext
> > \startextract
> >  Cogito ergo sum.
> > \stopextract
> > \stoptext
> > ```
> > 
> > So it should setup a quotation and mentions the author.
> > However, here the author is hardcoded within the blockquote. I would like 
> > it to use like this:
> > ```
> > \definedelimitedtext[extract][blockquote]
> > \setupdelimitedtext
> >[extract]
> >[leftmargin=1.5pc,
> > style={\italic},
> > before={\setupindenting[next]},
> > after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
> > \tfx\italic{\getcustomvariable{author}} \stopalignment}]
> > 
> > \starttext
> > \startextract[author=René Descartes]
> >  Cogito ergo sum.
> > \stopextract
> > \stoptext
> > ```
> > 
> > Is there an easy way to achieve that?
> > I tried with \structureuservariable (like possible in \startchapter) but it 
> > does not work.
> 
> not all constructs hav ethese user variables (yet)
> 
> i'll add an option for arguments tostart/stop so that you can do
> 
> \starttext
> 
> \definedelimitedtext
>[dextract]
>[blockquote]
>[leftmargin=1.5pc,
> style=italic,
> before=\setupindenting[next],
> after=\setups{extract:whatever}]
> 
> \definestartstop
>[extract]
>[arguments=yes,
> before=\setups{extract:start},
> after=\setups{extract:stop}]
> 
> \startsetups extract:start
>  \startdextract
> \stopsetups
> 
> \startsetups extract:stop
>  \startstopparameter{author}
>  \stopdextract
>  \blank[1ex,samepage]
>  \hrule
>  \blank[1ex,samepage]
>  \dontleavehmode
>  \wordright{\itx\startstopparameter{author}}
> \stopsetups
> 
> \starttext
> 
> \startextract[author=René Descartes]
>  Cogito ergo sum.
> \stopextract
> 
> \stoptext
> 
> but first i want Wolfgang to check the patch,

For me, Wolfgang's answer fulfills all my needs.
So, from my point of view, this is not needed anymore.
Thank you for your effort anyway!

Gerion


signature.asc
Description: This is a digitally signed message part.
___
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] ConTeXt source from XML

2024-06-06 Thread Christoph Edenhauser

Dear Pablo,


Dear Christoph,

just in case it might help to your meditation.

First of all, lpaths are XPath implemented with Lua in ConTeXt.

XPath seems to have as it primary purpose to address the nodes of XML trees.

About your sources, the real issue here is to define whether you want
TEI or TeX to be the format containing them.

I mean, if you add explaining footnotes to your TeX file(s), XML won’t
be source anymore.

If you don’t want this to happen, you have to encode them in the TEI XML
sources.


In my case, the connection to the original source will be lost. While we 
will still try to backport corrections, the connection will be lost at 
the very moment when we will annotate the source text.
From this point of view, an independent source is created here anyway, 
so I have the freedom to choose between TEI or TeX.
At the moment I'm leaning strongly towards TEI, also because I could try 
to remove the annotations via XSLT once the work is complete, diff the 
result with the original source and improve it). And besides, 
XML+ConTeXt looks quite elegant from the distance of my ignorance. 
(Although reading xml-mkiv.pdf creates a pleasant frictional heat in my 
cerebral convolutions, but leaves at least as many knots in them as XML 
data have nodes).



One last suggestion about proofreading. This is something I learnt from
personal experience.

The first reading is much better to catch errors in the text than the
subsequent ones.

Having the text properly formatted and printed on paper helps a lot to
spot errors.


Same here: It's the paper!
(I for myself prefer for the first proof reading a page lots of white 
space, in monospaced font like Courier, while my proofreader wants to 
see the font that will be used in the end.)


Thank you very much for your suggestions,

Christoph
___
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: Combine \setupdelimitedtext with an author (define custom variable?)

2024-06-06 Thread Gerion Entrup
Am Donnerstag, 6. Juni 2024, 16:34:03 MESZ schrieb Wolfgang Schuster:
> Gerion Entrup schrieb am 06.06.2024 um 12:30:
> > Hi,
> > 
> > I like to achieve something that looks like this:
> > ```
> > \definedelimitedtext[extract][blockquote]
> > \setupdelimitedtext
> >[extract]
> >[leftmargin=1.5pc,
> > style={\italic},
> > before={\setupindenting[next]},
> > after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
> > \tfx\italic{René Descartes} \stopalignment}]
> > 
> > \starttext
> > \startextract
> >  Cogito ergo sum.
> > \stopextract
> > \stoptext
> > ```
> > 
> > So it should setup a quotation and mentions the author.
> > However, here the author is hardcoded within the blockquote. I would like 
> > it to use like this:
> > ```
> > \definedelimitedtext[extract][blockquote]
> > \setupdelimitedtext
> >[extract]
> >[leftmargin=1.5pc,
> > style={\italic},
> > before={\setupindenting[next]},
> > after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
> > \tfx\italic{\getcustomvariable{author}} \stopalignment}]
> > 
> > \starttext
> > \startextract[author=René Descartes]
> >  Cogito ergo sum.
> > \stopextract
> > \stoptext
> > ```
> > 
> > Is there an easy way to achieve that?
> > I tried with \structureuservariable (like possible in \startchapter) but it 
> > does not work.
> 
> \startsetups [userdata:extract]
>  \startnarrower
>  \setupindenting[next]
>  \getuserdata
>  \hairline
>  \dontleavehmode\wordright{\itx\userdataparameter{author}}
>  \stopnarrower
> \stopsetups
> 
> \defineuserdataalternative
>[extract]
>[renderingsetup=userdata:extract]
> 
> \defineuserdata
>[extract]
>[style=italic,
> alternative=extract]
> 
> \starttext
> 
> \startextract[author=René Descartes]
>  Cogito ergo sum.
> \stopextract
> 
> \stoptext

Really cool! Thank you. If I see it right, this is completely generic,
so with this it is possible to define any start stop
with completely variable arguments.

Gerion

signature.asc
Description: This is a digitally signed message part.
___
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: background= key not working in \startbackground and \starttextbackground

2024-06-06 Thread Aditya Mahajan
On Thu, 6 Jun 2024, Wolfgang Schuster wrote:

> Aditya Mahajan schrieb am 06.06.2024 um 14:48:
> > Hi,
> >
> > I am testing some of my old styles on latest context and find that the
> > background key of \startbackground and \starttextbackground doesn't work
> > (\framed is working as expected). Here is a MWE:
> 
> 1. \starttextbackground isn't based on \framed and has a mp-key to assign a
> metapost graphic.

Thanks. I had forgotten that.

> 2. \startbackground needs to be fixed but it's simple, replace \defcsname
> with \edefcsname in pack-bck.mklx:
> 
> \appendtoks
> \frozen\protected\instance\defcsname\e!start\currentbackground\endcsname{\pack_backgrounds_start
> [\currentbackground]}%
>     \frozen\protected\instance\defcsname\e!stop
> \currentbackground\endcsname{\pack_backgrounds_stop }%
>     \frozen\protected\instance\defcsname
> \currentbackground\endcsname{\pack_backgrounds_direct[\currentbackground]}%
> \to \everydefinebackground

Thanks. I'll patch it locally. 

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: Kerning in Noto Serif

2024-06-06 Thread Lutz Haseloff
Thanks Hans, works now as expected.

Am 6. Juni 2024 16:30:56 MESZ schrieb Hans Hagen :
>On 6/6/2024 12:21 PM, Lutz Haseloff wrote:
>> Thanks Hraban,
>> 
>> my Noto Serif (just downloaded) is 2.013
>> 
>> --script font shows kern too:
>> kern cyrl dflt
>>     dflt dflt
>>     grek dflt
>>     latn dflt
>(^^ but not all steps are shared!)
>
>I updates that font (updating noto is a pain .. there was a zip once, now one 
>has to download per font unless i miss something).
>
>Indeed you don't get kerns out of the box. Try this:
>
>\char42\char38
>
>and you will see a kern. However, that's the 'shared portion' so in order to 
>get the rest you need to do:
>
>\definefontfeature[default][default][script=latn]
>
>as it looks like dflt/dflt is no longer does that ... keep in mind thta fonts 
>are not downward compatible so never update (or let your syetem do it) in the 
>middle of a project
>
>Hans
>
>-
>  Hans Hagen | PRAGMA ADE
>  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
>-
>
>___
>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
>___
___
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: ConTeXt source from XML

2024-06-06 Thread Hans Hagen via ntg-context

On 6/6/2024 5:33 PM, Pablo Rodriguez via ntg-context wrote:

On 6/5/24 20:23, Christoph Edenhauser wrote:

Dear Pablo,

Thank you very much for your very clear, detailed and elaborate
explanations.  - Over the next few days I will meditate on the ConTeXt
way to handle XML and on my workflow and take a look at lpath (never
heard of it). And somehow I have the impression that the next few days
will last a few weeks.


Dear Christoph,

just in case it might help to your meditation.

First of all, lpaths are XPath implemented with Lua in ConTeXt.

XPath seems to have as it primary purpose to address the nodes of XML trees.

About your sources, the real issue here is to define whether you want
TEI or TeX to be the format containing them.

I mean, if you add explaining footnotes to your TeX file(s), XML won’t
be source anymore.

If you don’t want this to happen, you have to encode them in the TEI XML
sources.

One last suggestion about proofreading. This is something I learnt from
personal experience.

The first reading is much better to catch errors in the text than the
subsequent ones.

Having the text properly formatted and printed on paper helps a lot to
spot errors.

Reading source code is cheaper (no doubt), but the results will be
poorer too.

Just in case it might help,
fwiw, context supports 'synctex' to xml files / nodes so that might help 
a bit


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

___
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: ConTeXt source from XML

2024-06-06 Thread Pablo Rodriguez via ntg-context
On 6/5/24 20:23, Christoph Edenhauser wrote:
> Dear Pablo,
>
> Thank you very much for your very clear, detailed and elaborate
> explanations.  - Over the next few days I will meditate on the ConTeXt
> way to handle XML and on my workflow and take a look at lpath (never
> heard of it). And somehow I have the impression that the next few days
> will last a few weeks.

Dear Christoph,

just in case it might help to your meditation.

First of all, lpaths are XPath implemented with Lua in ConTeXt.

XPath seems to have as it primary purpose to address the nodes of XML trees.

About your sources, the real issue here is to define whether you want
TEI or TeX to be the format containing them.

I mean, if you add explaining footnotes to your TeX file(s), XML won’t
be source anymore.

If you don’t want this to happen, you have to encode them in the TEI XML
sources.

One last suggestion about proofreading. This is something I learnt from
personal experience.

The first reading is much better to catch errors in the text than the
subsequent ones.

Having the text properly formatted and printed on paper helps a lot to
spot errors.

Reading source code is cheaper (no doubt), but the results will be
poorer too.

Just in case it might 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://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: Combine \setupdelimitedtext with an author (define custom variable?)

2024-06-06 Thread Hans Hagen via ntg-context

On 6/6/2024 4:34 PM, Wolfgang Schuster wrote:

Gerion Entrup schrieb am 06.06.2024 um 12:30:

Hi,

I like to achieve something that looks like this:
```
\definedelimitedtext[extract][blockquote]
\setupdelimitedtext
   [extract]
   [leftmargin=1.5pc,
    style={\italic},
    before={\setupindenting[next]},
    after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
\tfx\italic{René Descartes} \stopalignment}]


\starttext
\startextract
 Cogito ergo sum.
\stopextract
\stoptext
```

So it should setup a quotation and mentions the author.
However, here the author is hardcoded within the blockquote. I would 
like it to use like this:

```
\definedelimitedtext[extract][blockquote]
\setupdelimitedtext
   [extract]
   [leftmargin=1.5pc,
    style={\italic},
    before={\setupindenting[next]},
    after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
\tfx\italic{\getcustomvariable{author}} \stopalignment}]


\starttext
\startextract[author=René Descartes]
 Cogito ergo sum.
\stopextract
\stoptext
```

Is there an easy way to achieve that?
I tried with \structureuservariable (like possible in \startchapter) 
but it does not work.


\startsetups [userdata:extract]
     \startnarrower
     \setupindenting[next]
     \getuserdata
     \hairline
     \dontleavehmode\wordright{\itx\userdataparameter{author}}
     \stopnarrower
\stopsetups

\defineuserdataalternative
   [extract]
   [renderingsetup=userdata:extract]

\defineuserdata
   [extract]
   [style=italic,
    alternative=extract]

\starttext

\startextract[author=René Descartes]
     Cogito ergo sum.
\stopextract

\stoptext
ah, i start forgetting about these mechanisms ... i added this example 
to th etest suite


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

___
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: Combine \setupdelimitedtext with an author (define custom variable?)

2024-06-06 Thread Wolfgang Schuster

Gerion Entrup schrieb am 06.06.2024 um 12:30:

Hi,

I like to achieve something that looks like this:
```
\definedelimitedtext[extract][blockquote]
\setupdelimitedtext
   [extract]
   [leftmargin=1.5pc,
style={\italic},
before={\setupindenting[next]},
after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
\tfx\italic{René Descartes} \stopalignment}]

\starttext
\startextract
 Cogito ergo sum.
\stopextract
\stoptext
```

So it should setup a quotation and mentions the author.
However, here the author is hardcoded within the blockquote. I would like it to 
use like this:
```
\definedelimitedtext[extract][blockquote]
\setupdelimitedtext
   [extract]
   [leftmargin=1.5pc,
style={\italic},
before={\setupindenting[next]},
after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
\tfx\italic{\getcustomvariable{author}} \stopalignment}]

\starttext
\startextract[author=René Descartes]
 Cogito ergo sum.
\stopextract
\stoptext
```

Is there an easy way to achieve that?
I tried with \structureuservariable (like possible in \startchapter) but it 
does not work.


\startsetups [userdata:extract]
\startnarrower
\setupindenting[next]
\getuserdata
\hairline
\dontleavehmode\wordright{\itx\userdataparameter{author}}
\stopnarrower
\stopsetups

\defineuserdataalternative
  [extract]
  [renderingsetup=userdata:extract]

\defineuserdata
  [extract]
  [style=italic,
   alternative=extract]

\starttext

\startextract[author=René Descartes]
Cogito ergo sum.
\stopextract

\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] Re: Kerning in Noto Serif

2024-06-06 Thread Hans Hagen

On 6/6/2024 12:21 PM, Lutz Haseloff wrote:

Thanks Hraban,

my Noto Serif (just downloaded) is 2.013

--script font shows kern too:
kern cyrl dflt
    dflt dflt
    grek dflt
    latn dflt

(^^ but not all steps are shared!)

I updates that font (updating noto is a pain .. there was a zip once, 
now one has to download per font unless i miss something).


Indeed you don't get kerns out of the box. Try this:

\char42\char38

and you will see a kern. However, that's the 'shared portion' so in 
order to get the rest you need to do:


\definefontfeature[default][default][script=latn]

as it looks like dflt/dflt is no longer does that ... keep in mind thta 
fonts are not downward compatible so never update (or let your syetem do 
it) in the middle of a project


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

___
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: background= key not working in \startbackground and \starttextbackground

2024-06-06 Thread Wolfgang Schuster

Aditya Mahajan schrieb am 06.06.2024 um 14:48:

Hi,

I am testing some of my old styles on latest context and find that the 
background key of \startbackground and \starttextbackground doesn't work 
(\framed is working as expected). Here is a MWE:


1. \starttextbackground isn't based on \framed and has a mp-key to 
assign a metapost graphic.


2. \startbackground needs to be fixed but it's simple, replace 
\defcsname with \edefcsname in pack-bck.mklx:


\appendtoks
\frozen\protected\instance\defcsname\e!start\currentbackground\endcsname{\pack_backgrounds_start 
[\currentbackground]}%
    \frozen\protected\instance\defcsname\e!stop 
\currentbackground\endcsname{\pack_backgrounds_stop }%
    \frozen\protected\instance\defcsname 
\currentbackground\endcsname{\pack_backgrounds_direct[\currentbackground]}%

\to \everydefinebackground

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] background= key not working in \startbackground and \starttextbackground

2024-06-06 Thread Aditya Mahajan
Hi,

I am testing some of my old styles on latest context and find that the 
background key of \startbackground and \starttextbackground doesn't work 
(\framed is working as expected). Here is a MWE:

\startuseMPgraphic{background:test}
fill OverlayBox withcolor 0.75[red,white];
draw OverlayBox withcolor red withpen pencircle scaled 2bp;
\stopuseMPgraphic

\defineoverlay[background:test][\useMPgraphic{background:test}]

\definetextbackground
[testA]
[ 
location=paragraph,
background=background:test,
frame=off,
]

\definebackground
[testB]
[ 
location=paragraph,
background=background:test,
frame=off,
]

\defineframedtext
[testC]
[ 
background=background:test,
frame=off,
width=broad,
]

\starttext
\starttestA
  \input tufte
\stoptestA

\starttestB
  \input tufte
\stoptestB

\starttestC
  \input tufte
\stoptestC
\stoptext

testA gives nothing, testB gives a gray(!) background, and testC works as 
expected.

The output is attached. I am using 2024.05.31.

Aditya

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: \item would fit, but was pushed to next page. Work-around or fix?

2024-06-06 Thread Jim
On Thu, Jun  6, 2024 at 11:04 (+0200), Aditya Mahajan wrote:

> On Wed, 5 Jun 2024, Jim wrote:

>> Hi,

>> I had the following structure which ended up at the bottom of a page:


> This is perhaps not related to what you asked but ...

>> \noindent
>> {\bf Blah blah blah }
>> \startitemize[intro,nowhite]

> Starting a paragraph with a group {...} can lead to unexpected outcome. It is 
> better to use \bold{...} here, or \dontleavehmode {\bf ... }. 

Aditya,

thanks for the information.  So far (in my ConTeXt journey) I haven't seen
anything with doing that, but I appreciate the advice.

I don't understand the full Zen of \dontleavehmode (in my poor
understanding I think it should be called \ensurehmode or something like
that), but given that I explicitly used \noindent, is that not an analogous
thing?

Thanks.

Jim
___
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: Combine \setupdelimitedtext with an author (define custom variable?)

2024-06-06 Thread Hans Hagen via ntg-context

On 6/6/2024 12:30 PM, Gerion Entrup wrote:

Hi,

I like to achieve something that looks like this:
```
\definedelimitedtext[extract][blockquote]
\setupdelimitedtext
   [extract]
   [leftmargin=1.5pc,
style={\italic},
before={\setupindenting[next]},
after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
\tfx\italic{René Descartes} \stopalignment}]

\starttext
\startextract
 Cogito ergo sum.
\stopextract
\stoptext
```

So it should setup a quotation and mentions the author.
However, here the author is hardcoded within the blockquote. I would like it to 
use like this:
```
\definedelimitedtext[extract][blockquote]
\setupdelimitedtext
   [extract]
   [leftmargin=1.5pc,
style={\italic},
before={\setupindenting[next]},
after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
\tfx\italic{\getcustomvariable{author}} \stopalignment}]

\starttext
\startextract[author=René Descartes]
 Cogito ergo sum.
\stopextract
\stoptext
```

Is there an easy way to achieve that?
I tried with \structureuservariable (like possible in \startchapter) but it 
does not work.


not all constructs hav ethese user variables (yet)

i'll add an option for arguments tostart/stop so that you can do

\starttext

\definedelimitedtext
  [dextract]
  [blockquote]
  [leftmargin=1.5pc,
   style=italic,
   before=\setupindenting[next],
   after=\setups{extract:whatever}]

\definestartstop
  [extract]
  [arguments=yes,
   before=\setups{extract:start},
   after=\setups{extract:stop}]

\startsetups extract:start
\startdextract
\stopsetups

\startsetups extract:stop
\startstopparameter{author}
\stopdextract
\blank[1ex,samepage]
\hrule
\blank[1ex,samepage]
\dontleavehmode
\wordright{\itx\startstopparameter{author}}
\stopsetups

\starttext

\startextract[author=René Descartes]
Cogito ergo sum.
\stopextract

\stoptext

but first i want Wolfgang to check the patch,

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

___
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] Combine \setupdelimitedtext with an author (define custom variable?)

2024-06-06 Thread Gerion Entrup
Hi,

I like to achieve something that looks like this:
```
\definedelimitedtext[extract][blockquote]
\setupdelimitedtext
  [extract]
  [leftmargin=1.5pc,
   style={\italic},
   before={\setupindenting[next]},
   after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
\tfx\italic{René Descartes} \stopalignment}]

\starttext
\startextract
Cogito ergo sum.
\stopextract
\stoptext
```

So it should setup a quotation and mentions the author.
However, here the author is hardcoded within the blockquote. I would like it to 
use like this:
```
\definedelimitedtext[extract][blockquote]
\setupdelimitedtext
  [extract]
  [leftmargin=1.5pc,
   style={\italic},
   before={\setupindenting[next]},
   after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
\tfx\italic{\getcustomvariable{author}} \stopalignment}]

\starttext
\startextract[author=René Descartes]
Cogito ergo sum.
\stopextract
\stoptext
```

Is there an easy way to achieve that?
I tried with \structureuservariable (like possible in \startchapter) but it 
does not work.

Best,
Gerion



signature.asc
Description: This is a digitally signed message part.
___
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: Kerning in Noto Serif

2024-06-06 Thread Lutz Haseloff
Thanks Hraban,

my Noto Serif (just downloaded) is 2.013

--script font shows kern too:
kern cyrl dflt
   dflt dflt
   grek dflt
   latn dflt

Greetings Lutz

Am 6. Juni 2024 11:12:18 MESZ schrieb Henning Hraban Ramm :
>Am 06.06.24 um 09:41 schrieb Lutz Haseloff:
>> Hi all,
>> I can't get Kerning working with Noto Serif.
>> My minimal file is:
>> 
>> \definefontfeature[oldstylenumber][onum=yes]
>> \definefont[testnoto][file:NotoSerif-Regular*default at 12pt]
>> \starttext
>> Line 1: {VAVAVAVAVAVA 12345}\par
>> Line 2: {\setff{oldstylenumber}VAVAVAVAVAVA 12345}\par
>> Line 3: {\addff{oldstylenumber}VAVAVAVAVAVA 12345}\par
>> \testnoto
>> Line 4: {VAVAVAVAVAVA 12345}\par
>> Line 5: {\setff{oldstylenumber}VAVAVAVAVAVA 12345}\par
>> Line 6: {\addff{oldstylenumber}VAVAVAVAVAVA 12345}\par
>> \stoptext
>> 
>> Line 4 and 6 should be significantly shorter too.
>> I tried the variable and the static versions.
>> In fontforge I can see a kerning of -80 between A and V.
>> My context is the newest lmtx.
>
>For me, it looks good with ConTeXt v2024.05.31 and Noto Serif v.1.03
>
>Just to check the font (yes, it has kerning):
>
>$ mtxrun --script font --list --pattern=notoserifregular --info
>mtx-fonts   |
>mtx-fonts   | mapping   : notoserifregular
>mtx-fonts   | fontname  : notoserif
>mtx-fonts   | fullname  : notoserif
>mtx-fonts   | filename  : NotoSerif-Regular.ttf
>mtx-fonts   | family: notoserif
>mtx-fonts   | weight: normal
>mtx-fonts   | style : normal
>mtx-fonts   | width : normal
>mtx-fonts   | variant   : normal
>mtx-fonts   |
>mtx-fonts   | gpos features:
>mtx-fonts   |
>mtx-fonts   |   feature  script   languages
>mtx-fonts   |
>mtx-fonts   |   kern cyrl dflt
>mtx-fonts   |grek dflt
>mtx-fonts   |latn dflt
>mtx-fonts   |   mark cyrl dflt
>mtx-fonts   |grek dflt
>mtx-fonts   |latn dflt
>mtx-fonts   |   mkmk cyrl dflt
>mtx-fonts   |grek dflt
>mtx-fonts   |latn dflt
>mtx-fonts   |
>mtx-fonts   | gsub features:
>mtx-fonts   |
>mtx-fonts   |   feature  script   languages
>mtx-fonts   |
>mtx-fonts   |   ccmp cyrl dflt
>mtx-fonts   |grek dflt
>mtx-fonts   |latn dflt
>
>Hraban
>
>___
>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
>___
___
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: setuphead in connection with the command argument

2024-06-06 Thread Gerion Entrup
Am Montag, 3. Juni 2024, 15:13:20 MESZ schrieb Hans Hagen via ntg-context:
> On 6/3/2024 1:36 PM, Gerion Entrup wrote:
> > Thank you. I think that I understand command vs alternative now.
> > With try and error, I experienced, that the font/style of the `style`
> > parameter interleave in a strange way. Therefore I see it as related.
> > What i mean is:
> style: outer level, also sets interline spacing and adapts before after 
> blanks
> 
> numberstyle and textstyle : specific to the element

Thank you! I will try to wrap it up in the Wiki.

Gerion




signature.asc
Description: This is a digitally signed message part.
___
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: Kerning in Noto Serif

2024-06-06 Thread Henning Hraban Ramm

Am 06.06.24 um 09:41 schrieb Lutz Haseloff:

Hi all,
I can't get Kerning working with Noto Serif.
My minimal file is:

\definefontfeature[oldstylenumber][onum=yes]
\definefont[testnoto][file:NotoSerif-Regular*default at 12pt]
\starttext
Line 1: {VAVAVAVAVAVA 12345}\par
Line 2: {\setff{oldstylenumber}VAVAVAVAVAVA 12345}\par
Line 3: {\addff{oldstylenumber}VAVAVAVAVAVA 12345}\par
\testnoto
Line 4: {VAVAVAVAVAVA 12345}\par
Line 5: {\setff{oldstylenumber}VAVAVAVAVAVA 12345}\par
Line 6: {\addff{oldstylenumber}VAVAVAVAVAVA 12345}\par
\stoptext

Line 4 and 6 should be significantly shorter too.
I tried the variable and the static versions.
In fontforge I can see a kerning of -80 between A and V.
My context is the newest lmtx.


For me, it looks good with ConTeXt v2024.05.31 and Noto Serif v.1.03

Just to check the font (yes, it has kerning):

$ mtxrun --script font --list --pattern=notoserifregular --info
mtx-fonts   |
mtx-fonts   | mapping   : notoserifregular
mtx-fonts   | fontname  : notoserif
mtx-fonts   | fullname  : notoserif
mtx-fonts   | filename  : NotoSerif-Regular.ttf
mtx-fonts   | family: notoserif
mtx-fonts   | weight: normal
mtx-fonts   | style : normal
mtx-fonts   | width : normal
mtx-fonts   | variant   : normal
mtx-fonts   |
mtx-fonts   | gpos features:
mtx-fonts   |
mtx-fonts   |   feature  script   languages
mtx-fonts   |
mtx-fonts   |   kern cyrl dflt
mtx-fonts   |grek dflt
mtx-fonts   |latn dflt
mtx-fonts   |   mark cyrl dflt
mtx-fonts   |grek dflt
mtx-fonts   |latn dflt
mtx-fonts   |   mkmk cyrl dflt
mtx-fonts   |grek dflt
mtx-fonts   |latn dflt
mtx-fonts   |
mtx-fonts   | gsub features:
mtx-fonts   |
mtx-fonts   |   feature  script   languages
mtx-fonts   |
mtx-fonts   |   ccmp cyrl dflt
mtx-fonts   |grek dflt
mtx-fonts   |latn dflt

Hraban

___
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: \item would fit, but was pushed to next page. Work-around or fix?

2024-06-06 Thread Aditya Mahajan
On Wed, 5 Jun 2024, Jim wrote:

> Hi,
> 
> I had the following structure which ended up at the bottom of a page:
> 

This is perhaps not related to what you asked but ...

> \noindent
> {\bf Blah blah blah }
> \startitemize[intro,nowhite]

Starting a paragraph with a group {...} can lead to unexpected outcome. It is 
better to use \bold{...} here, or \dontleavehmode {\bf ... }. 

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] Kerning in Noto Serif

2024-06-06 Thread Lutz Haseloff
Hi all,
I can't get Kerning working with Noto Serif.
My minimal file is:

\definefontfeature[oldstylenumber][onum=yes]
\definefont[testnoto][file:NotoSerif-Regular*default at 12pt]
\starttext
Line 1: {VAVAVAVAVAVA 12345}\par
Line 2: {\setff{oldstylenumber}VAVAVAVAVAVA 12345}\par
Line 3: {\addff{oldstylenumber}VAVAVAVAVAVA 12345}\par
\testnoto
Line 4: {VAVAVAVAVAVA 12345}\par
Line 5: {\setff{oldstylenumber}VAVAVAVAVAVA 12345}\par
Line 6: {\addff{oldstylenumber}VAVAVAVAVAVA 12345}\par
\stoptext

Line 4 and 6 should be significantly shorter too.
I tried the variable and the static versions.
In fontforge I can see a kerning of -80 between A and V.
My context is the newest lmtx.

Greetings Lutz___
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: ConTeXt source from XML

2024-06-05 Thread Christoph Edenhauser

Dear Pablo,

Thank you very much for your very clear, detailed and elaborate 
explanations.  - Over the next few days I will meditate on the ConTeXt 
way to handle XML and on my workflow and take a look at lpath (never 
heard of it). And somehow I have the impression that the next few days 
will last a few weeks.


Best regards, Christoph


___
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: ConTeXt source from XML

2024-06-05 Thread Pablo Rodriguez via ntg-context
On 6/4/24 22:09, Hans Hagen wrote:
> [...]
> There is a xml-mkiv-tricks.tex file in the distribution (no pdf is
> seems so I need to add that one.)

Hans,

sorry, I forgot to reply earlier.

I think this is already included in
https://www.pragma-ade.com/general/manuals/xml-mkiv.pdf#page=53 (as
chapter 5 from xml-mkiv.pdf).

The file from the distribution is the same as the one online (same
SHA512, just in case).

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://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: \item would fit, but was pushed to next page. Work-around or fix?

2024-06-05 Thread Jim
On Wed, Jun  5, 2024 at 18:04 (+0200), Henning Hraban Ramm wrote:

> Am 05.06.24 um 17:33 schrieb Jim:
>> Hi,

>> I had the following structure which ended up at the bottom of a page:
> …
>> Q1: Is there a Right Way to force ConTeXt to put an \item on the current 
>> page?

>> Q2: If not, does anyone wish to suggest some way to trick ConTeXt here, or
>> to do an end-run around its calculations?

>> Note: to solve this problem the use of brute force has been authorized.

> Did you try \adaptlayout?
> https://wiki.contextgarden.net/Command/adaptlayout

> It might also help to put the itemize in a box (but that might end up on the
> next page).

Hi Hraban,

That works perfectly.  I didn't know about that command before, and my
google searches to find something like that didn't turn anything up.
Undoubtedly I used the wrong search terms.

I tried putting the \placefigure and the itemize in a box, thinking that if
all else failed I could put a negative \vskip at the bottom to make the box
shorter.  However, when I tried putting all that in a \vbox I got some
error messages which were not immediately illuminating (to me).

Thanks for the pointer.

Jim
___
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: \item would fit, but was pushed to next page. Work-around or fix?

2024-06-05 Thread Henning Hraban Ramm

Am 05.06.24 um 17:33 schrieb Jim:

Hi,

I had the following structure which ended up at the bottom of a page:

…

Q1: Is there a Right Way to force ConTeXt to put an \item on the current page?

Q2: If not, does anyone wish to suggest some way to trick ConTeXt here, or
 to do an end-run around its calculations?

Note: to solve this problem the use of brute force has been authorized.


Did you try \adaptlayout?
https://wiki.contextgarden.net/Command/adaptlayout

It might also help to put the itemize in a box (but that might end up on 
the next page).


Hraban

___
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] \item would fit, but was pushed to next page. Work-around or fix?

2024-06-05 Thread Jim
Hi,

I had the following structure which ended up at the bottom of a page:

---

\setupcaptions[number=no]
\placefigure[right]
{blah blah blah}
{%
\vskip -15pt
\externalfigure[DSC_2782][width=0.32\textwidth]
}
\noindent
{\bf Blah blah blah }
\startitemize[intro,nowhite]
\item blah blah blah blah blah blah!  blah blah blah blah, blah
  blah blah blah blah blah blah blah blah blah.
\item blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
  blah.
\item blah blah blah blah blah blah blah blah blah blah
  blah blah blah blah blah.
\item blah blah blah blah blah blah blah blah blah blah blah blah blah
  blah blah blah blah blah blah blah blah.
\item blah blah blah blah blah blah blah blah blah blah blah blah blah
  blah blah blah blah blah blah blah blah blah blah blah blah
  blah.
\item blah blah blah blah blah blah blah blah blah blah blah blah
  blah blah blah blah blah blah blah blah blah
  blah blah blah blah blah.
\stopitemize



There was, in fact, room to put the last \item on the page (and even a bit
more), but ConTeXt insisted on moving the last \item to the next page.  I
assume that its calculations were a bit conservative for whatever reason,
but I really wanted the last item to be on the same page as its friends.

I tried some "tricks" that would have worked for me in plain TeX, but
ConTeXt was having none of that.

Q1: Is there a Right Way to force ConTeXt to put an \item on the current page?

Q2: If not, does anyone wish to suggest some way to trick ConTeXt here, or
to do an end-run around its calculations?

Note: to solve this problem the use of brute force has been authorized.

Thanks.

Jim
___
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: ConTeXt source from XML

2024-06-05 Thread Hans Hagen

On 6/5/2024 2:16 PM, Henning Hraban Ramm wrote:

Am 05.06.24 um 12:00 schrieb Christoph Edenhauser:
My Question is, is it possible to generate a second context file2.tex 
with the help of this first xml-mapping file1.tex, where all the 
xml-nodes from the xml file are mapped to contex commands


Hi, I don’t find it hard to understand, but I don’t think it’s possible 
within ConTeXt (while Hans keeps surprising me).

well, as one needs to do some work one can as well do this:

% oeps.tex

\startbuffer[test]


test


\stopbuffer

\startxmlsetups xml:mysetups
\xmlsetsetup{\xmldocument}{*}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:mysetups}

\startxmlsetups xml:something
\tex{StartSomething}\par
\xmlflush{#1}\par
\tex{StopSomething}\par
\stopxmlsetups

\startxmlsetups xml:what
\tex{StartWhat}\par
\xmlflush{#1}\par
\tex{StopWhat}\par
\stopxmlsetups

\setuppapersize[A1]
\setupbodyfont[dejavu,ss,1pt]
\setuplayout[tight]
\setupalign[verytolerant,flushleft,nothyphenated]

\starttext
\xmlprocessbuffer{main}{test}{}
\stoptext

and then run

>context oeps
>mutool draw -F txt oeps.pdf

and get

\StartSomething
\StartWhat
test
\StopWhat
\StopSomething

so now you need to wikify it ...

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

___
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: ConTeXt source from XML

2024-06-05 Thread Pablo Rodriguez via ntg-context
On 6/5/24 12:00, Christoph Edenhauser wrote:
> [...]
> I realise that it is somehow difficult for me to describe what I would
> like to achieve, perhaps what I have in mind is not even possible.

Hi Christoph,

as far as I know (and as Hraban has already mentioned), this is not
possible.

Either XSLT or pandoc would be a way to do that.

That being said, I would avoid conversion (a second source) in all cases.

I use ConTeXt to typeset XML sources typing Markdown sources.

pandoc generates XML and then ConTeXt typesets these XML sources.

> My Question is, is it possible to generate a second context file2.tex
> with the help of this first xml-mapping file1.tex, where all the
> xml-nodes from the xml file are mapped to contex commands which then
> looks something like this:

I‘m afraid this is not possible (it works in a different way)

> I would then like to edit the Text in such a more "TeXish" result 
> manually, e.g. insert small spaces as in ‘St.\,Martin’, explain unknown
> words in \footnote{comment}, etc.

Different spaces are Unicode characters. As entities,  or 
(narrow no-breaking space and thin space, respectively).

> I know you could or even should do the text corrections in the xml file,
> but XML would overwhelm my proofreader. (He has learnt to leave LaTeX
> code untouched, that should then work with ConTeXt code as well). So for
> me, the main reason for having a TeX-ish file2.tex is, that the Text
> could be corrected directly from the proofreader in this file2.tex file,
> but won't do that in the xml file.

I don’t mean the proofreader personally, but TeX code may not be
inherenlty more readable that XML code.

Compile the following:

  \starttext
  \startXML
  
  St.Martin
  A comprehensive treatise
  The medieval part of the church
  \stopXML

  \startTEX
  \starttext
  \startchapter[title=St.\, Martin] \stopchapter
  \startsection[title=The medieval part of the church]\stopsection
  \stoptext
  \stopTEX
  \stoptext

I think that a text editor with reasonable highlighting for XML is key
to your issue.

I mean, XML sources tend to be highlighted leaving pure text as
uncolored and unformatted (no bold or italics).

In that case, I think the text to be proofread may be recognized as not
having any format at all (besides not enclosed inside "<" and ">").

> And now a second approach to my question:
> Are all these \startxmlsetups like '\startxmlsetup xml:chapter'
> internally mapped to standard context commands like \startchapter
> ... \stopchapter before they are converted to pdf?

No, these are formatting commands after the mapping.

In short, there are three steps involved in XML typesetting.

First, you select which elements you would like to select from the XML
source in an XML setup (with a mapping to your configuration commands).

Second, you register this XML setup.

Third, your configure the selected elements with ConTeXt commands.

Here is a sample (using a buffer instead of an external file):

  \startbuffer[demo]
  
 line 1
 line 2
 line 3
  
  \stopbuffer

  \starttext

  \startxmlsetups abc:def
\xmlsetsetup{#1}{foo|bar}{xyz:*}
  \stopxmlsetups

  \xmlregistersetup{abc:def}

  \startxmlsetups xyz:foo
\xmlflush{#1}
  \stopxmlsetups

  \startxmlsetups xyz:bar
\startparagraph
  \xmlflush{#1}
\stopparagraph
  \stopxmlsetups

  \xmlprocessbuffer{main}{demo}{}

  \stoptext

First of all, XML has no hardcoded names for any element (from a certain
point of view, XML are only rules on how to use the "<>" tags).

This is why,  and  are perfectly valid element names (although
they have no meaning for people).

Second, the mapping may use any name for destination setups.

\xmlsetsetup does the mappings, the second group of parentheses contains
the lpath (an Lua version of XPath [how XML is selected]) and the third
group of parentheses is setups.

The command \xmlsetsetup{#1}{foo|bar}{xyz:*} above is bound to existing
elements (or paths) in the XML source, but both "xyz:foo" and "xzy:bar"
may read as the user wants.

Third, after that you need specify the setup for each mapping (or it
won’t appear in your final document).

The setup is what you defined as the second part of the mapping, may it
be "xml:title" or "xyz:bar".

Nothing here is hardcoded. XML is not HTML (elements with meaning).

In order to deal with XML, ConTeXt has to provide the tools to select
elements (and more complex constructs) and map them to configurable setups.

How both tools (construct selection and setup configurations) may be
deployed, this is up to each individual.

Hardcoding this would be a real problem in the short run.

> If this is the case, can this intermediate context representation be
> exported, and how would this be done?

Nice try, but I’m afraid this is not how it works.

I hope my explanation may be minimally clear to understand why your
approach is different from what ConTeXt offers.

Feel free to ask, if my explanation wasn’t clear enough.

I hope it helps,

Pablo


[NTG-context] Re: After using a custom command in the title, the table of contents is not generated properly

2024-06-05 Thread Wolfgang Schuster

ai2472206...@yeah.net schrieb am 05.06.2024 um 16:03:

As described, here is example:

%
\def\cmd#1{{\tt\textslash #1}}
\def\cmdii#1{\tt #1}
\def\cmdiii#1{\rm #1}


You can use \definehighlight to create a custom command for a style.

The case where you want a slash before the text you have to use 
\definestartstop which allows you to set something before and after


\definestartstop [cmdi]   [style=\tt,left=\textslash]
\definehighlight [cmdii]  [style=\tt]
\definehighlight [cmdiii] [style=\rm]

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] Re: After using a custom command in the title, the table of contents is not generated properly

2024-06-05 Thread ai2472206007
I was careless. 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://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: ConTeXt source from XML

2024-06-05 Thread Christoph Edenhauser

Dear Hraban, dear List

Thank you for your suggestions.
I suppose, it would have been too nice if I could have left the XSLT path.
Thank you very much for your patience and help,

Christoph

___
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: After using a custom command in the title, the table of contents is not generated properly

2024-06-05 Thread Henning Hraban Ramm

Am 05.06.24 um 16:03 schrieb ai2472206...@yeah.net:

As described, here is example:

%
\def\cmd#1{{\tt\textslash #1}}
\def\cmdii#1{\tt #1}
\def\cmdiii#1{\rm #1}

\starttext

\placecontent% if i dont place toc command , ConText can render it.

\chapter{anything else}
\section{\cmdi{with command} section}
\section{\cmdii{with command} section}
\section{\cmdiii{with command} section}
\section{{\rm with command} section} % only this one work well

\stoptext


Am I missing something important? If so, please tell me what to do. Thank you 
so much.


What do you mean with “not properly”?

\cmdi is not defined
Only \cmd has the necessary additional braces to contain the style switch.
But I don’t know if that’s your problem.

Hraban

___
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] After using a custom command in the title, the table of contents is not generated properly

2024-06-05 Thread ai2472206007
As described, here is example:

%
\def\cmd#1{{\tt\textslash #1}}
\def\cmdii#1{\tt #1}
\def\cmdiii#1{\rm #1}

\starttext

\placecontent% if i dont place toc command , ConText can render it.

\chapter{anything else}
\section{\cmdi{with command} section}
\section{\cmdii{with command} section}
\section{\cmdiii{with command} section}
\section{{\rm with command} section} % only this one work well

\stoptext


Am I missing something important? If so, please tell me what to do. Thank you 
so much.

Muyik
___
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: ConTeXt source from XML

2024-06-05 Thread Henning Hraban Ramm

Am 05.06.24 um 12:00 schrieb Christoph Edenhauser:
My Question is, is it possible to generate a second context file2.tex 
with the help of this first xml-mapping file1.tex, where all the 
xml-nodes from the xml file are mapped to contex commands


Hi, I don’t find it hard to understand, but I don’t think it’s possible 
within ConTeXt (while Hans keeps surprising me).


Maybe try XSLT or pandoc.

The latter can already read DocBook and write ConTeXt; it doesn’t read 
TEI (yet). There are also XSL style sheets for TEI, e.g. 
https://github.com/TEIC/Stylesheets


I don’t know if you would loose too much information going 
TEI-(something else)-ConTeXt. Maybe it makes sense to adapt the LaTeX 
stylesheets.


Hraban
___
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: ConTeXt source from XML

2024-06-05 Thread Christoph Edenhauser

Dear Hand, dear list

Am 04.06.24 um 22:09 schrieb Hans Hagen:

On 6/4/2024 9:21 PM, Christoph Edenhauser wrote:

Dear Pablo, dear list

That's great, thank you very much for your suggestion.
That seems to me to be a very elegant solution to the next two 
problems that were actually still ahead of me.


And now to my initial question, which I didn't specify precisely enough.

I have the following workflow in mind:
1. I have an XML file (TEI-XML),
2. then, following your brilliant suggestion, I will create an 
xml-analyze-template.tex file and customise it.

3. As you suggest, now one would actually use
 context --environment xml-analyze-template.tex file.xml
 to typeset in a pdf file.
But I would like to convert all the XML nodes into the ConTeXt 
typesetting language, and then edit/correct the text and maybe some 
structure in this *.tex file.


And here comes my question: Can I use context to convert my XML-file 
'file.xml' into a ConTeXt-file 'file.tex' instead of typesetting it 
as a 'file.pdf'.


What do you want to tweak. HEre is the lowest level approach:



    test 1
    
    
    test 2
    
    test 3


But quite some can be done when processing and there are mechanisms to 
inject e.g. page breaks using processing instruction. Probablyh not 
all is documented.


There is a xml-mkiv-tricks.tex file in the distribution (no pdf is 
seems so I need to add that one.)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-



I realise that it is somehow difficult for me to describe what I would 
like to achieve, perhaps what I have in mind is not even possible.


Let' say i have an xml File with something like this


St. Martin
A comprehensive treatise
The medieval part of the church

I would now like to create a first file1.tex with all the necessary 
xmlsetups like e.g. something like this


\startxmlsetupsxml:chapter
\startchapter[title={\xmlflush{#1}}]\stopchapter
\stopxmlsetups
\startxmlsetupsxml:section
\startsection[title={\xmlflush{#1}}]\stopsection
\stopxmlsetups

I can now generate a pdf file with context. But:

My Question is, is it possible to generate a second context file2.tex 
with the help of this first xml-mapping file1.tex, where all the 
xml-nodes from the xml file are mapped to contex commands which then 
looks something like this:


\starttext
\startchapter[title=St. Martin]\stopchapter
\startsection[title=The medieval part of the church]\stopsection
\stoptext

I would then like to edit the Text in such a more "TeXish" result  
manually, e.g. insert small spaces as in ‘St.\,Martin’, explain unknown 
words in \footnote{comment}, etc.


I know you could or even should do the text corrections in the xml file, 
but XML would overwhelm my proofreader. (He has learnt to leave LaTeX 
code untouched, that should then work with ConTeXt code as well). So for 
me, the main reason for having a TeX-ish file2.tex is, that the Text 
could be corrected directly from the proofreader in this file2.tex file, 
but won't do that in the xml file.


And now a second approach to my question:
Are all these \startxmlsetups like '\startxmlsetup xml:chapter' 
internally mapped to standard context commands like \startchapter ... 
\stopchapter before they are converted to pdf?
If this is the case, can this intermediate context representation be 
exported, and how would this be done?


Thank you very much for your help,

best regards, Christoph
___
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: https://wiki.contextgarden.net/Command/blank

2024-06-04 Thread Jim
On Tue, Jun  4, 2024 at 21:50 (+0200), Wolfgang Schuster wrote:

> Jim schrieb am 04.06.2024 um 21:29:
>> On Tue, Jun  4, 2024 at 20:31 (+0200), Taco Hoekwater wrote:

 On 4 Jun 2024, at 20:16, Wolfgang Schuster 
  wrote:

 Jim schrieb am 04.06.2024 um 19:48:

 > I did not realize the wiki software did that.  On reflection I suppose 
 > that
 > is useful in many (most?) cases.  But I'd argue that it is not always a 
 > good
 > thing, such as in this case.  (If nothing else, it might mislead a n00b
 > into thinking that you should get output for text preceding \starttext.)

>>> Here is the documentation for the  tag extension:

>>> https://wiki.contextgarden.net/Help:Context

>> Hi Taco,

>> thanks very much for the link.  But, ummm, what it says there seems to
>> contradict what Wolfgang told me in the other response to my message.

>> [[ I see Wolfgang edited the \blank wiki page to move the text in question
>> to after \starttext, but I'm sure if you don't believe what I say in the
>> next paragraph, you can grab the previous version. ]]

>> Specifically, the example in the (previous) \blank wiki page does, indeed,
>> have a \starttext and \stoptext.  So, according to the page you mention
>> above, another \starttext and \stoptext should *not* be added.  And yet the
>> (previous) \blank page example does print the text (as well as the bullets)
>> before the \starttext.  Is there a discrepancy between what
>> .../Help:Context says and what actually happens?

> When you take a look at the settings which are applied here you can see
> \setupbodyfont[8pt] which is the reason why the text appears, compare

>  begin example
> Before \tex{starttext}

> \starttext
> After \tex{starttext}.
> \stoptext
>  end example

> with

>  begin example
> \setupbodyfont[12pt]

> Before \tex{starttext}

> \starttext
> After \tex{starttext}.
> \stoptext
>  end example

> The second example loads a font before the text appear in the document which
> is the reason why you can see it.

Thanks Wolfgang,

all is now becoming clear.  :-)

Jim

P.S. Well, "all" about this, I still have lots of questions about other things.
___
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: Number in a circle

2024-06-04 Thread Bruce Horrocks


> On 4 Jun 2024, at 19:00, Kip Warner  wrote:
> 
> On Tue, 2024-06-04 at 18:19 +0100, Bruce Horrocks wrote:
>> 1) I installed Ubuntu 14.04 It comes with context pre-installed but
>> it's broken.
> 
> Hey Bruce. Just an FYI, but Trusty Tahr (14.04) is over a decade old.

Typo - 24.04 (phew!)

—
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: ConTeXt source from XML

2024-06-04 Thread Hans Hagen

On 6/4/2024 9:21 PM, Christoph Edenhauser wrote:

Dear Pablo, dear list

That's great, thank you very much for your suggestion.
That seems to me to be a very elegant solution to the next two problems 
that were actually still ahead of me.


And now to my initial question, which I didn't specify precisely enough.

I have the following workflow in mind:
1. I have an XML file (TEI-XML),
2. then, following your brilliant suggestion, I will create an 
xml-analyze-template.tex file and customise it.

3. As you suggest, now one would actually use
     context --environment xml-analyze-template.tex file.xml
     to typeset in a pdf file.
But I would like to convert all the XML nodes into the ConTeXt 
typesetting language, and then edit/correct the text and maybe some 
structure in this *.tex file.


And here comes my question: Can I use context to convert my XML-file 
'file.xml' into a ConTeXt-file 'file.tex' instead of typesetting it as a 
'file.pdf'.


What do you want to tweak. HEre is the lowest level approach:



test 1


test 2

test 3


But quite some can be done when processing and there are mechanisms to 
inject e.g. page breaks using processing instruction. Probablyh not all 
is documented.


There is a xml-mkiv-tricks.tex file in the distribution (no pdf is seems 
so I need to add that one.)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

___
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: https://wiki.contextgarden.net/Command/blank

2024-06-04 Thread Wolfgang Schuster

Jim schrieb am 04.06.2024 um 21:29:

On Tue, Jun  4, 2024 at 20:31 (+0200), Taco Hoekwater wrote:


On 4 Jun 2024, at 20:16, Wolfgang Schuster  
wrote:



Jim schrieb am 04.06.2024 um 19:48:



I did not realize the wiki software did that.  On reflection I suppose that
is useful in many (most?) cases.  But I'd argue that it is not always a good
thing, such as in this case.  (If nothing else, it might mislead a n00b
into thinking that you should get output for text preceding \starttext.)



Here is the documentation for the  tag extension:



https://wiki.contextgarden.net/Help:Context


Hi Taco,

thanks very much for the link.  But, ummm, what it says there seems to
contradict what Wolfgang told me in the other response to my message.

[[ I see Wolfgang edited the \blank wiki page to move the text in question
to after \starttext, but I'm sure if you don't believe what I say in the
next paragraph, you can grab the previous version. ]]

Specifically, the example in the (previous) \blank wiki page does, indeed,
have a \starttext and \stoptext.  So, according to the page you mention
above, another \starttext and \stoptext should *not* be added.  And yet the
(previous) \blank page example does print the text (as well as the bullets)
before the \starttext.  Is there a discrepancy between what
.../Help:Context says and what actually happens?


When you take a look at the settings which are applied here you can see 
\setupbodyfont[8pt] which is the reason why the text appears, compare


 begin example
Before \tex{starttext}

\starttext
After \tex{starttext}.
\stoptext
 end example

with

 begin example
\setupbodyfont[12pt]

Before \tex{starttext}

\starttext
After \tex{starttext}.
\stoptext
 end example

The second example loads a font before the text appear in the document 
which is the reason why you can see it.


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] Re: https://wiki.contextgarden.net/Command/blank

2024-06-04 Thread Jim
On Tue, Jun  4, 2024 at 20:31 (+0200), Taco Hoekwater wrote:

>> On 4 Jun 2024, at 20:16, Wolfgang Schuster 
>>  wrote:

>> Jim schrieb am 04.06.2024 um 19:48:

>>> I did not realize the wiki software did that.  On reflection I suppose that
>>> is useful in many (most?) cases.  But I'd argue that it is not always a good
>>> thing, such as in this case.  (If nothing else, it might mislead a n00b
>>> into thinking that you should get output for text preceding \starttext.)

> Here is the documentation for the  tag extension:

> https://wiki.contextgarden.net/Help:Context

Hi Taco,

thanks very much for the link.  But, ummm, what it says there seems to
contradict what Wolfgang told me in the other response to my message.

[[ I see Wolfgang edited the \blank wiki page to move the text in question
   to after \starttext, but I'm sure if you don't believe what I say in the
   next paragraph, you can grab the previous version. ]]

Specifically, the example in the (previous) \blank wiki page does, indeed,
have a \starttext and \stoptext.  So, according to the page you mention
above, another \starttext and \stoptext should *not* be added.  And yet the
(previous) \blank page example does print the text (as well as the bullets)
before the \starttext.  Is there a discrepancy between what
.../Help:Context says and what actually happens?

Thanks.
Jim
___
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: ConTeXt source from XML

2024-06-04 Thread Christoph Edenhauser

Dear Pablo, dear list

That's great, thank you very much for your suggestion.
That seems to me to be a very elegant solution to the next two problems 
that were actually still ahead of me.


And now to my initial question, which I didn't specify precisely enough.

I have the following workflow in mind:
1. I have an XML file (TEI-XML),
2. then, following your brilliant suggestion, I will create an 
xml-analyze-template.tex file and customise it.

3. As you suggest, now one would actually use
    context --environment xml-analyze-template.tex file.xml
    to typeset in a pdf file.
But I would like to convert all the XML nodes into the ConTeXt 
typesetting language, and then edit/correct the text and maybe some 
structure in this *.tex file.


And here comes my question: Can I use context to convert my XML-file 
'file.xml' into a ConTeXt-file 'file.tex' instead of typesetting it as a 
'file.pdf'.


Best regards, Christoph

Am 04.06.24 um 17:21 schrieb Pablo Rodriguez via ntg-context:

Hi Christoph,

not clear to me whether you meant an environment (a format file) with
the ConTeXt generated file.

In that case, this might help:

   context --extra=xml --analyze --template your-file.xml

With that template, you may run:

   context --environment=xml-analyze-template.tex your-file.xml

BTW, there are two typos in xml-analyze-template.tex (lines 8-9):

   - \startxmlsetup should read \startxmlsetups.
   - \xmlsetsetups should read \xmlsetsetup.

But consider that this only flushes text with no formatting (you will
have all text in a single paragraph.

If this is not what you need, a more detailed (or simply more verbose)
explanation) might help.

Just in case it might 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://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: Vanishing floats with location=split and \start ... \stopsplittext within

2024-06-04 Thread Kirill Davidov
On 6/4/24 21:22, Hans Hagen wrote:
> best add a missing \stopplacecodelisting
That one's on me, thank you. Unfortunately, this does not fix the main
issue. Checking the MWE's logs reveals that the splitting command found
nothing to split, even if there's enough text for multiple pages. My
best guess is that something goes awry when checking how much vertical
space is available, since uncommenting the filler line leaves no space
for an additional line in the page.

On 6/4/2024 3:57 PM, Давыдов, Кирилл Александрович wrote:
> On a related note, one can also observe that with specific amounts of
> text a float may end up being split in two on a single page, however I
> could not replicate it.
Replicated it:
\definefloat[codelisting][codelistings]
\setupcaption[codelisting][location=top]
\setuplabeltext[english][codelisting=Listing ]
\showboxes
\starttext
%\dorecurse{37}{line\crlf} % splits fine up to this point
\dorecurse{38}{line\crlf} % split on the same page
%\dorecurse{39}{line\crlf} % float vanishes, "there is nothing to split"
%\dorecurse{40}{line\crlf} % all fine
\startplacecodelisting[
    title=My great C program on display!,
    location=split,
]
\startsplittext
\tt\dorecurse{6}{\input zapf}
\stopsplittext
\stopplacecodelisting
\stoptext
___
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: https://wiki.contextgarden.net/Command/blank

2024-06-04 Thread Jim
On Tue, Jun  4, 2024 at 20:14 (+0200), Wolfgang Schuster wrote:

> Jim schrieb am 04.06.2024 um 19:48:

>> I did not realize the wiki software did that.  On reflection I suppose that
>> is useful in many (most?) cases.  But I'd argue that it is not always a good
>> thing, such as in this case.  (If nothing else, it might mislead a n00b
>> into thinking that you should get output for text preceding \starttext.)

> The reason why you get no text isn't that you wrote it before \starttext but
> that no font was loaded yet. By default ConTeXt postpones the loading of the
> default fonts until \starttext because when you use a different font on your
> document this is normally before \starttext and with the postponing there is
> no need to load a unused font.

> At the point where you load a font with \setupbodyfont text even if it
> appears before \starttext is shown as expected but this isn't recommended.

>> If you (or some other knowledgeable person reading this) don't (doesn't)
>> mind another question,...
>> Is the bullet symbol not from some font?  If so, why is that font loaded in
>> time to see the bullet?

> When no font has been loaded yet with \setupbodyfont ConTeXt prints text
> which is put in a \hbox in a monospaced font as shown in the example below.

>  begin example
> This is before \tex{starttext}.

> \hbox{This is also before \tex{starttext}}

> \starttext
> This is after \tex{starttext}.
> \stoptext
>  end example

Thanks again.  Without looking at the code, I (boldly) conclude that the
bullet is in an \hbox.

While I'm curious about why text in an \hbox is printed, I'm thinking that
I may not have need to know.  ;-)

Jim
___
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: https://wiki.contextgarden.net/Command/blank

2024-06-04 Thread Taco Hoekwater


> On 4 Jun 2024, at 20:16, Wolfgang Schuster 
>  wrote:
> 
> Jim schrieb am 04.06.2024 um 19:48:
> 
>> I did not realize the wiki software did that.  On reflection I suppose that
>> is useful in many (most?) cases.  But I'd argue that it is not always a good
>> thing, such as in this case.  (If nothing else, it might mislead a n00b
>> into thinking that you should get output for text preceding \starttext.)

Here is the documentation for the  tag extension:

https://wiki.contextgarden.net/Help:Context

Best wishes,
Taco___
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: missing space with French quotation

2024-06-04 Thread Peter Münster
On Thu, May 30 2024, Peter Münster wrote:

> Is this a bug or a feature?

And if it’s a bug, will it be fixed?

TIA for any hints,
-- 
   Peter
___
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: https://wiki.contextgarden.net/Command/blank

2024-06-04 Thread Wolfgang Schuster

Jim schrieb am 04.06.2024 um 19:48:


I did not realize the wiki software did that.  On reflection I suppose that
is useful in many (most?) cases.  But I'd argue that it is not always a good
thing, such as in this case.  (If nothing else, it might mislead a n00b
into thinking that you should get output for text preceding \starttext.)


The reason why you get no text isn't that you wrote it before \starttext 
but that no font was loaded yet. By default ConTeXt postpones the 
loading of the default fonts until \starttext because when you use a 
different font on your document this is normally before \starttext and 
with the postponing there is no need to load a unused font.


At the point where you load a font with \setupbodyfont text even if it 
appears before \starttext is shown as expected but this isn't recommended.



If you (or some other knowledgeable person reading this) don't (doesn't)
mind another question,...
Is the bullet symbol not from some font?  If so, why is that font loaded in
time to see the bullet?


When no font has been loaded yet with \setupbodyfont ConTeXt prints text 
which is put in a \hbox in a monospaced font as shown in the example below.


 begin example
This is before \tex{starttext}.

\hbox{This is also before \tex{starttext}}

\starttext
This is after \tex{starttext}.
\stoptext
 end example

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] Re: Number in a circle

2024-06-04 Thread Kip Warner
On Tue, 2024-06-04 at 18:19 +0100, Bruce Horrocks wrote:
> 1) I installed Ubuntu 14.04 It comes with context pre-installed but
> it's broken.

Hey Bruce. Just an FYI, but Trusty Tahr (14.04) is over a decade old.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


signature.asc
Description: This is a digitally signed message part
___
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: https://wiki.contextgarden.net/Command/blank

2024-06-04 Thread Jim
On Tue, Jun  4, 2024 at 19:30 (+0200), Wolfgang Schuster wrote:

> Jim schrieb am 04.06.2024 um 18:01:
>> Hi,

>> When I run Example 1 given there, I get three bullet symbols, but no
>>  "column N ..."
>> text.

>> Note that the
>>  \starttext
>> is *after* the \startitemize ... \stopitemize

>> Q1: Is my ConTeXt installation broken, or is the wiki page showing output
>> that does not correspond to the input?

>> Q2: If the wiki page is inconsistent, is there an easy fix?

>> Q3: If my installation is correct, why do I get bullet symbols *before*
>>  \starttext ?

> The wiki adds \starttext at the start and \stoptext at the end of each
> example
> and the \starttext/\stoptext pair which is part is just ignored.

> When you try to run the example as is there is no text before \starttext
> because
> no font has been loaded yet (you can add \setupbodyfont[modern] before
> \startitemize to make the text visible).

Hi Wolfgang,

Thanks for the (prompt!) answer.

I did not realize the wiki software did that.  On reflection I suppose that
is useful in many (most?) cases.  But I'd argue that it is not always a good
thing, such as in this case.  (If nothing else, it might mislead a n00b
into thinking that you should get output for text preceding \starttext.)

If you (or some other knowledgeable person reading this) don't (doesn't)
mind another question,...
Is the bullet symbol not from some font?  If so, why is that font loaded in
time to see the bullet?

And finally, might it make sense for the wiki software to do something like
this:
if grep '\\starttext'  >/dev/null 2>&1
then
process the example from the wiki
else
augment the wiki example with \starttext and \stoptext
process the augmented wiki example
fi

Cheers.
Jim
___
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: https://wiki.contextgarden.net/Command/blank

2024-06-04 Thread Wolfgang Schuster

Jim schrieb am 04.06.2024 um 18:01:

Hi,

When I run Example 1 given there, I get three bullet symbols, but no
 "column N ..."
text.

Note that the
 \starttext
is *after* the \startitemize ... \stopitemize

Q1: Is my ConTeXt installation broken, or is the wiki page showing output
 that does not correspond to the input?

Q2: If the wiki page is inconsistent, is there an easy fix?

Q3: If my installation is correct, why do I get bullet symbols *before*
 \starttext ?


The wiki adds \starttext at the start and \stoptext at the end of each 
example

and the \starttext/\stoptext pair which is part is just ignored.

When you try to run the example as is there is no text before \starttext 
because

no font has been loaded yet (you can add \setupbodyfont[modern] before
\startitemize to make the text visible).

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] Re: Number in a circle

2024-06-04 Thread Bruce Horrocks


> On 1 Jun 2024, at 01:48, Bruce Horrocks  wrote:
> 
> I'm not sure there is a need to do any more than Adam Reviczky is already 
> doing. When I find a bit of time I'll install a Ubuntu 24.04 into a VM and 
> see what version of Context is installed, likewise Debian.


TL;DR: OMG! I thought Ubuntu was supposed to be Linux made easy?

1) I installed Ubuntu 14.04 It comes with context pre-installed but it's broken.

bruce@bruce-VMware-Virtual-Platform:-$ which context
/usr/bin/context

bruce@bruce-VMware-Virtual-Platform:~$ context --version
mtxrun  | unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua'


2) I removed the pre-installed context, added the reviczky PPA from 
launchpad.net as an alternative package source and re-installed.

bruce@bruce-VMware-Virtual-Platform:~$ sudo apt remove context
[output snipped]

bruce@bruce-VMware-Virtual-Platform:-$ sudo add-apt-repository ppa:reviczky
[output snipped]

bruce@bruce-VMware-Virtual-Platform:-$ sudo apt install context
[output snipped]

bruce@bruce-VMware-Virtual-Platform:~$ context --version
mtx-context | ConTeXt Process Management 1.04
mtx-context |
mtx-context | main context file: 
/usr/share/texmf/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2023.05.05 18:36
mtx-context | main context file: 
/usr/share/texmf/tex/context/base/mkxl/context.mkxl
mtx-context | current version: 2023.05.05 18:36


This at least works but it's an ancient version. I couldn't find any way to 
access the 2024 dated version referenced in the PPA/launchpad site.


Conclusion:

Not sure where this leaves us. Ubutu complained about the PPA ot having a 
'release' file - so this may be a bug with the PPS config which is stopping 
Ubuntu from downloading from that PPA. Or it may be this will bnever work?

Whatever the problem is, the suggestion of getting Context into the Deb build 
seems like the way to go.

—
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] https://wiki.contextgarden.net/Command/blank

2024-06-04 Thread Jim
Hi,

When I run Example 1 given there, I get three bullet symbols, but no
"column N ..."
text.

Note that the
\starttext
is *after* the \startitemize ... \stopitemize

Q1: Is my ConTeXt installation broken, or is the wiki page showing output
that does not correspond to the input?

Q2: If the wiki page is inconsistent, is there an easy fix?

Q3: If my installation is correct, why do I get bullet symbols *before*
\starttext ?

Thanks.

Jim
___
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: Vanishing floats with location=split and \start ... \stopsplittext within

2024-06-04 Thread Hans Hagen via ntg-context

On 6/4/2024 3:57 PM, Давыдов, Кирилл Александрович wrote:

Greetings,

I have run into an issue whilst using \start ... \stopsplittext. I 
intended to use it for large code listings (using the t-vim module), 
however floats with location=split using that environment seem to vanish 
if there is nearly not enough text before the float to fill a page. Not 
only that, a second float like that seems to lead to fatal errors 
related to an unclosed group, however the document compiles regardless. 
The following MWE is an example of this. I am using ConTeXt version 
2024.05.27 18:16.


\definefloat[codelisting][codelistings]
\setupcaption[codelisting][location=top]
\setuplabeltext[english][codelisting=Listing ]

%\showboxes
\starttext

\input knuth
\input knuth
\input knuth
\input knuth
% Filler. Filler. Filler. Filler. % uncomment to push out a full page. 
the float will appear


\startplacecodelisting[
     title=My great C program on display!,
     location=split,
]
\startsplittext
\tt \input zapf
\stopsplittext
\stopplacecodelisting

\input ward

\startplacecodelisting[
     title=My second great C program on display!,
     location=split,
]
\startsplittext
\tt \input ward
\stopsplittext

\stoptext

On a related note, one can also observe that with specific amounts of 
text a float may end up being split in two on a single page, however I 
could not replicate it. Additionally, code listings done with t-vim's 
commands seem to lose line numbering within \start ... \stopsplittext in 
splittable floats, but I figure that's more on the module authors. In 
any case, is there more I can do other than not use floats for code 
listings?

best add a missing \stopplacecodelisting

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

___
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: ConTeXt source from XML

2024-06-04 Thread Pablo Rodriguez via ntg-context
On 6/4/24 13:51, Christoph Edenhauser wrote:
> Dear list,
>
> I am currently trying to get into Context and XML. I would like to do
> the typographical fine-tuning in Context and not in the XML document. My
> question is: Is it possible to have ConTeXt output a (preliminary)
> ConTeXt file instead of typesetting a PDF file, for further editing?

Hi Christoph,

not clear to me whether you meant an environment (a format file) with
the ConTeXt generated file.

In that case, this might help:

  context --extra=xml --analyze --template your-file.xml

With that template, you may run:

  context --environment=xml-analyze-template.tex your-file.xml

BTW, there are two typos in xml-analyze-template.tex (lines 8-9):

  - \startxmlsetup should read \startxmlsetups.
  - \xmlsetsetups should read \xmlsetsetup.

But consider that this only flushes text with no formatting (you will
have all text in a single paragraph.

If this is not what you need, a more detailed (or simply more verbose)
explanation) might help.

Just in case it might 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://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] Vanishing floats with location=split and \start ... \stopsplittext within

2024-06-04 Thread Давыдов , Кирилл Александрович
Greetings,

I have run into an issue whilst using \start ... \stopsplittext. I intended
to use it for large code listings (using the t-vim module), however floats
with location=split using that environment seem to vanish if there is
nearly not enough text before the float to fill a page. Not only that, a
second float like that seems to lead to fatal errors related to an unclosed
group, however the document compiles regardless. The following MWE is an
example of this. I am using ConTeXt version 2024.05.27 18:16.

\definefloat[codelisting][codelistings]
\setupcaption[codelisting][location=top]
\setuplabeltext[english][codelisting=Listing ]

%\showboxes
\starttext

\input knuth
\input knuth
\input knuth
\input knuth
% Filler. Filler. Filler. Filler. % uncomment to push out a full page. the
float will appear

\startplacecodelisting[
title=My great C program on display!,
location=split,
]
\startsplittext
\tt \input zapf
\stopsplittext
\stopplacecodelisting

\input ward

\startplacecodelisting[
title=My second great C program on display!,
location=split,
]
\startsplittext
\tt \input ward
\stopsplittext

\stoptext

On a related note, one can also observe that with specific amounts of text
a float may end up being split in two on a single page, however I could not
replicate it. Additionally, code listings done with t-vim's commands seem
to lose line numbering within \start ... \stopsplittext in splittable
floats, but I figure that's more on the module authors. In any case, is
there more I can do other than not use floats for code listings?
___
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
___


  1   2   3   4   5   6   7   8   9   10   >