[NTG-context] Re: chapter counter?

2024-08-26 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 26.08.2024 um 20:14:

Am 26.08.24 um 17:57 schrieb Wolfgang Schuster:

Henning Hraban Ramm schrieb am 26.08.2024 um 17:41:

Hi,
I’d like to check the chapter number like

\ifodd\rawcountervalue[chapter]
What an odd chapter!
\fi

but apparently the counter isn’t called "chapter", or I’m doing it 
wrong otherwise.

Could you enlighten me?


\namedheadnumber{chapter}


Thank you, but it doesn’t work in my setup where I’m trying to change a 
background image depending on the chapter number:


\defineoverlay[BG][\start
\ifodd\namedheadnumber{chapter}\relax
\externalfigure[bgimage][height=\overlayheight]
\else
\mirror{\externalfigure[bgimage][height=\overlayheight]}
\fi
\stop]

This is then used with

\setlayerframed[papier][background=BG]

I guess it’s expanded only once.

But it was a bad idea anyway, I wanted more than two variants and now 
just set them as a uservariable.


Without more information there is no way to provide a solution but for 
the archive there is below a solution to get mirrored images for even 
chapters. The background has also a check an image before the start of 
the first chapter.


\setupexternalfigure[location=default]

\defineoverlay
  [BackGround]
  [\ifzeronum\namedheadnumber{chapter}\relax
 %
   \orelse\ifodd\namedheadnumber{chapter}\relax
 \externalfigure[mill][factor=min]%
   \else
 \mirror{\externalfigure[mill][factor=min]}%
   \fi]

\setupbackgrounds[page][background=BackGround]

\starttext

FooBar

\chapter{Foo}

\chapter{Bar}

\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] Faulty PDF output files after updating to version 2024.06.14

2024-06-16 Thread Ralph

Hi,


while trying out the new version of ConTeXt LMTX (2024.06.14 09:18) I 
encountered some problems related to the PDF output files.


First, I tried to print a single page of the excellent new math manual 
(many thanks to everyone involved in creating it, it’s great for 
beginners like me and surely for experienced users too), but I noticed 
that all of the extensibles in the formulas (like the bar in \frac, 
\sqrt, long integral signs, and probably more) have disappeared. 
Everything else was printed correctly.


After investigating, I found out that Okular on Linux converts the PDF 
file to PostScript before printing (at least on my system), and I was 
able to replicate this behavior by converting it manually to PostScript 
with Poppler (pdftops in.pdf out.ps) or Ghostscript (pdf2ps in.pdf out.ps).


Printing from Firefox was not affected for me as it did not convert to 
PostScript.


I was unable to reproduce this with my own documents (created with 
ConTeXt LMTX 2024.05.31 18:50), so I decided to try this with the new 
version. And with it, that was indeed reproducible.


To ensure that this is the PDF’s fault, I decided to try this on Windows 
with Adobe Acrobat Reader on a different Computer with another fresh 
installation of ConTeXt. But it wasn’t any better:


Adobe Acrobat Reader displayed two different error messages when trying 
to scroll through or zoom in on the math manual:
1. “An error exists on this page. Acrobat may not display the page 
correctly. Please contact the person who created the PDF document to 
correct the problem.”

2. “There was an error processing a page. A number is out of range.”
Sometimes the first one is shown, sometimes the second one.

Additionally, some parts of the manual were blank (they were displayed 
correctly in Okular, Firefox, and many more viewers), I suspect those 
who contain extensibles in formulas. Following example leads to the same 
behaviour:


\setuppapersize[S33]    % Just to make page smaller
\setupbodyfont[modern, 11pt]
\starttext
Hello.
\startformula
\frac{a^2 + b^2}{1} = c^2
\stopformula
\page
Hello.
\startformula
a^2 + b^2 = c^2
\stopformula
\stoptext

The first page is empty in Acrobat Reader, whereas it’s displayed 
correctly in all other PDF viewers I tried. But again, when converting 
to PostScript, the fraction bar vanishes. The second page is fine.


I attached the faulty example.pdf file and some screenshots of it opened 
in different PDF viewers, and of the math manual. The screenshot of the 
math manual opened in Acrobat Reader shows that the second half of the 
page is completely gone. example_pdftops-ps2pdf.pdf is example.pdf 
converted to PostScript with Poppler and then converted to PDF again 
with Ghostscript (attaching the PostScript file isn’t possible because 
of file size). Opened in Okular or other Poppler based viewers you’ll 
see a dot instead of the fraction bar (which gets infinitely smaller 
while zooming-in), and openend in Firefox, MuPDF or Acrobat Reader 
you’ll see a cut off bar.


One last thing, for some reason “\italiansqrt” on page 52 of the math 
manual is converted perfectly fine to PostScript (at least it looks right).


Please let me know if you would like me to provide more information.


Best,
Ralph


example.pdf
Description: Adobe PDF document


example_pdftops-ps2pdf.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: How to improve appearance of bars in frac, sqrt, etc. on screens?

2024-06-13 Thread Otared Kavian
Hi Ralph,I don’t see any pixels in the PDF file when I typeset your code snipet (on MacOS 11.7.10). Here is what I get.Best regards: Otared

fraction-bar-pixels.pdf
Description: Adobe PDF document
On 13 Jun 2024, at 13:10, Ralph <ralph.2...@email-postfach.info> wrote:

  


  
  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.nlwebpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)archive  : https://github.com/contextgarden/contextwiki : https://wiki.contextgarden.net___
Otared Kaviane-mail: ota...@gmail.comPhone: +33 6 88 26 70 95

___
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: 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, &nnbsp; 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.&nnbsp;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 h

[NTG-context] Re: setuphead in connection with the command argument

2024-05-30 Thread Bruce Horrocks


> On 30 May 2024, at 23:25, Gerion Entrup  wrote:
> 
> Am Donnerstag, 30. Mai 2024, 18:49:08 MESZ schrieb Bruce Horrocks:
>> 
>>> On 30 May 2024, at 15:15, Gerion Entrup  wrote:
>>> 
>>> Let's begin with a minimal example:
>>> ```
>>> \define[2]\MyChapter{%
>>> #1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
>>> }
>> 
>> Stop there!
>> 
>> Use \definehead to create your own variation of a heading - much more 
>> robust. Something like the following (untested):
>> 
>>  \startsetups PlaceSubTitleAndIntro
>>% Set font and and style etc for the subtitle here
>>\structureuservariable(subtitle)
>> 
>>% Set font and style etc for the intro text here
>>\structureuservariable(intro)
>>  \stopsetups
>> 
>>  \definehead [MyChapter] [chapter]
>>  \setuphead [MyChapter]
>>[ style={...}, % heading style
>>  after={\setup{PlaceSubTitleAndIntro}},
>>]
>> 
>>  \starttext
>>  \startMyChapter[title={Foo}]
>>[ subtitle={Bar},
>>  intro={Some explanation},
>>]
>>  The text of the chapter
>>  \stopMyChapter
>>  \stoptext
> 
> Thanks for the input. A comparable example is also listed in the wiki.
> I like the approach for placing subtitle and intro alone. However, I also 
> want to style chapter number and chapter title separately.

Any setuphead commands that apply to MyChapter also apply to chapter so you 
should be able to use exactly the same styling commands.

> I'm also not sure, if an extra heading (MyChapter) is needed, since all my 
> chapters are styled in this way.
> Isn't it possible to define "after" of chapter directly?

Yes, I think it is possible to just use \setuphead [chapter] instead of 
\setuphead [MyChapter] with the rest remaining the same.

The only reason I don't do it is that if something goes wrong, I know I have an 
original version of \chapter readily to hand to compare against for debugging.

Regards,
—
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: setuphead in connection with the command argument

2024-05-30 Thread Gerion Entrup
Am Donnerstag, 30. Mai 2024, 18:49:08 MESZ schrieb Bruce Horrocks:
> 
> > On 30 May 2024, at 15:15, Gerion Entrup  wrote:
> > 
> > Let's begin with a minimal example:
> > ```
> > \define[2]\MyChapter{%
> > #1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
> > }
> 
> Stop there!
> 
> Use \definehead to create your own variation of a heading - much more robust. 
> Something like the following (untested):
> 
>   \startsetups PlaceSubTitleAndIntro
> % Set font and and style etc for the subtitle here
> \structureuservariable(subtitle)
> 
> % Set font and style etc for the intro text here
> \structureuservariable(intro)
>   \stopsetups
> 
>   \definehead [MyChapter] [chapter]
>   \setuphead [MyChapter]
> [ style={...}, % heading style
>   after={\setup{PlaceSubTitleAndIntro}},
> ]
> 
>   \starttext
>   \startMyChapter[title={Foo}]
> [ subtitle={Bar},
>   intro={Some explanation},
> ]
>   The text of the chapter
>   \stopMyChapter
>   \stoptext

Thanks for the input. A comparable example is also listed in the wiki.
I like the approach for placing subtitle and intro alone. However, I also want 
to style chapter number and chapter title separately.
I'm also not sure, if an extra heading (MyChapter) is needed, since all my 
chapters are styled in this way.
Isn't it possible to define "after" of chapter directly?

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: setuphead in connection with the command argument

2024-05-30 Thread Bruce Horrocks


> On 30 May 2024, at 15:15, Gerion Entrup  wrote:
> 
> Let's begin with a minimal example:
> ```
> \define[2]\MyChapter{%
> #1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
> }

Stop there!

Use \definehead to create your own variation of a heading - much more robust. 
Something like the following (untested):

  \startsetups PlaceSubTitleAndIntro
% Set font and and style etc for the subtitle here
\structureuservariable(subtitle)

% Set font and style etc for the intro text here
\structureuservariable(intro)
  \stopsetups

  \definehead [MyChapter] [chapter]
  \setuphead [MyChapter]
[ style={...}, % heading style
  after={\setup{PlaceSubTitleAndIntro}},
]

  \starttext
  \startMyChapter[title={Foo}]
[ subtitle={Bar},
  intro={Some explanation},
]
  The text of the chapter
  \stopMyChapter
  \stoptext

—
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: setuphead in connection with the command argument

2024-05-30 Thread Gerion Entrup
Hi Tomáš,

first, thank you for the answer.

Am Donnerstag, 30. Mai 2024, 16:47:36 MESZ schrieb Tomáš Hála:
> Hi Gebrion,
> 
> > ## Font size + ## Bold text
> 
> for font size etc., you can use 
>   \setuphead [chapter] [style={\setupbodyfont[11pt]}]  or
>   \setuphead [chapter] [style=\tf]
> 
>   \setuphead [chapter] [style=\bf]

So this sentence of the wiki [1] is wrong (documentation of the command 
argument)?:
> Command to use for typesetting the title; overrules all other styling. First 
> argument is the number, second the title text.

If I see it right, `style=` only affects the typesetting of `#1` and `#2`, so I 
need setupbodyfont _and_ switchtobodyfont, didn't I?
Also, when I want #1 and #2 to be in different sizes, I choose the "base" size 
with style=\setupbodyfont and adjust it further with switchtobodyfont just for 
one the the argument?

All in all, the correct documentation would be:
> Command to use for typesetting the title. First argument is the number, 
> second the title text. Styling of these parameters can be achieved only by 
> specifying style=.


> > ## Line breaks + ## Framed
> > How can I achieve line breaks?
> 
> \define[2]\MyChapter{%
>   \framedtext{%
>  #1 #2:\\
>  \structureuservariable{subtitle}\\
>  (\structureuservariable{intro})
>   }
> }

This produces an extra line break between '#2' and ':', I don't get why. 
Otherwise, it looks quite nice.


> > I also want to set everything except of the intro in a flushright 
> > environment but do not know how. I tried:
> 
> As above: 
>   \framedtext[align=flushright]{%

That works, thank you!


Best,
Gerion

> --
> 
> On Thu, May 30, 2024 at 02:15:01PM +, Gerion Entrup wrote:
> > Hi,
> > 
> > I'm trying to adapt the format of chapters in my document and have a few 
> > questions regarding setuphead.
> > My aim is to have the chapter (title) on a separate page with an additional 
> > intro in different text sizes for title, subtitle and the intro.
> > I chose to use the "command=" argument in setuphead for that.
> > However, I'm not quite sure about it's internals.
> > 
> > Let's begin with a minimal example:
> > ```
> > \define[2]\MyChapter{%
> > #1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
> > }
> > 
> > \setuphead[title, chapter][command=\MyChapter]
> > 
> > \setupbodyfont[11pt]
> > 
> > \starttext
> > \startchapter[title=foo][subtitle=bar, intro={some explanation}]
> > some text
> > \stopchapter
> > \stoptext
> > ```
> > This produces 1.pdf.
> > 
> > 
> > ## Font size
> > 
> > What is the reason that that the font of the chapter is bigger? How can I 
> > reset it to normal size? This does not work at all:
> > ```
> > \define[2]\MyChapter{%
> > \setupbodyfont[11pt] #1 #2: \structureuservariable{subtitle} 
> > (\structureuservariable{intro})
> > }
> > ```
> > However, changing to a bigger font works somehow. Is there a factor applied 
> > to the font size internally? For example:
> > ```
> > \define[2]\MyChapter{%
> > \setupbodyfont[20pt] #1 #2: \structureuservariable{subtitle} 
> > (\structureuservariable{intro})
> > }
> > ```
> > produces 2.pdf (the chapter font is not 20pt).
> > 
> > 
> > ## Line breaks
> > 
> > How can I achieve line breaks?
> > This does not work:
> > ```
> > \define[2]\MyChapter{%
> > #1 #2:\\
> > \structureuservariable{subtitle}\\
> > (\structureuservariable{intro})
> > }
> > ```
> > (see 3.pdf)
> > 
> > I also want to set everything except of the intro in a flushright 
> > environment but do not know how. I tried:
> > ```
> > \define[2]\MyChapter{%
> > \startalignment[flushright]
> > #1 #2:\\
> > \structureuservariable{subtitle}\\
> > \stopalignment
> > \structureuservariable{intro}
> > }
> > ```
> > (see 4.pdf, no change)
> > 
> > 
> > ## Bold text
> > 
> > I tried to get the text bold. However, `#1` and `#2` does not seem to 
> > follow this.
> > ```
> > \define[2]\MyChapter{%
> > \bold #1 #2: \structureuservariable{subtitle} 
> > (\structureuservariable{intro})
> > }
> > ```
> > 
> > ## Makeups
> > 
> > The best solution, I had so far, was to define a makeup, but I don't get it 
> > to work with text with mixed alignment and it does not solve the font size 
> >

[NTG-context] Re: setuphead in connection with the command argument

2024-05-30 Thread Tomáš Hála
Hi Gebrion,

> ## Font size + ## Bold text

for font size etc., you can use 
  \setuphead [chapter] [style={\setupbodyfont[11pt]}]  or
  \setuphead [chapter] [style=\tf]

  \setuphead [chapter] [style=\bf]

> ## Line breaks + ## Framed
> How can I achieve line breaks?

\define[2]\MyChapter{%
  \framedtext{%
 #1 #2:\\
 \structureuservariable{subtitle}\\
 (\structureuservariable{intro})
  }
}

> I also want to set everything except of the intro in a flushright environment 
> but do not know how. I tried:

As above: 
  \framedtext[align=flushright]{%

The best,

Tomáš

--

On Thu, May 30, 2024 at 02:15:01PM +, Gerion Entrup wrote:
> Hi,
> 
> I'm trying to adapt the format of chapters in my document and have a few 
> questions regarding setuphead.
> My aim is to have the chapter (title) on a separate page with an additional 
> intro in different text sizes for title, subtitle and the intro.
> I chose to use the "command=" argument in setuphead for that.
> However, I'm not quite sure about it's internals.
> 
> Let's begin with a minimal example:
> ```
> \define[2]\MyChapter{%
>   #1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
> }
> 
> \setuphead[title, chapter][command=\MyChapter]
> 
> \setupbodyfont[11pt]
> 
> \starttext
> \startchapter[title=foo][subtitle=bar, intro={some explanation}]
> some text
> \stopchapter
> \stoptext
> ```
> This produces 1.pdf.
> 
> 
> ## Font size
> 
> What is the reason that that the font of the chapter is bigger? How can I 
> reset it to normal size? This does not work at all:
> ```
> \define[2]\MyChapter{%
>   \setupbodyfont[11pt] #1 #2: \structureuservariable{subtitle} 
> (\structureuservariable{intro})
> }
> ```
> However, changing to a bigger font works somehow. Is there a factor applied 
> to the font size internally? For example:
> ```
> \define[2]\MyChapter{%
>   \setupbodyfont[20pt] #1 #2: \structureuservariable{subtitle} 
> (\structureuservariable{intro})
> }
> ```
> produces 2.pdf (the chapter font is not 20pt).
> 
> 
> ## Line breaks
> 
> How can I achieve line breaks?
> This does not work:
> ```
> \define[2]\MyChapter{%
> #1 #2:\\
> \structureuservariable{subtitle}\\
> (\structureuservariable{intro})
> }
> ```
> (see 3.pdf)
> 
> I also want to set everything except of the intro in a flushright environment 
> but do not know how. I tried:
> ```
> \define[2]\MyChapter{%
> \startalignment[flushright]
> #1 #2:\\
> \structureuservariable{subtitle}\\
> \stopalignment
> \structureuservariable{intro}
> }
> ```
> (see 4.pdf, no change)
> 
> 
> ## Bold text
> 
> I tried to get the text bold. However, `#1` and `#2` does not seem to follow 
> this.
> ```
> \define[2]\MyChapter{%
> \bold #1 #2: \structureuservariable{subtitle} 
> (\structureuservariable{intro})
> }
> ```
> 
> ## Makeups
> 
> The best solution, I had so far, was to define a makeup, but I don't get it 
> to work with text with mixed alignment and it does not solve the font size 
> problem:
> ```
> \definemakeup[chapter][align=left, top=]
> \define[2]\MyChapter{%
> \startmakeup[chapter]
> #1 #2:\\
> \structureuservariable{subtitle}\\
> \stopmakeup
> (\structureuservariable{intro})
> }
> ```
> (see 5.pdf)
> 
> ## Framed
> 
> I also have tried this but it does not bring any linebreaks:
> ```
> \define[2]\MyChapter{%
> \framed[frame=off, offset=0pt]{#1\\#2:\\ 
> \structureuservariable{subtitle}\\ (\structureuservariable{intro})}
> }
> ```
> (see 6.pdf)
> 
> I hope you can shed some light into setuphead with command. I search on the 
> wiki, Stackoverflow and the manuals but didn't really find anything.
> 
> Best,
> Gerion
> 







> % 1.pdf
> \define[2]\MyChapter{%
>   #1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
> }
> 
> % % 2.pdf
> % \define[2]\MyChapter{%
> % \setupbodyfont[20pt] #1 #2: \structureuservariable{subtitle} 
> (\structureuservariable{intro})
> % }
> 
> % % 3.pdf
> % \define[2]\MyChapter{%
> % #1 #2:\\
> % \structureuservariable{subtitle}\\
> % (\structureuservariable{intro})
> % }
> 
> % % 4.pdf
> % \define[2]\MyChapter{%
> % \startalignment[flushright]
> % #1 #2:\\
> % \structureuservariable{subtitle}\\
> % \stopalignment
> % \structureuservariable{intro}
> % }
> 
> % % 5.pdf
> % \definemakeup[chapter][align=left, top=]
> % \define[2]\MyChapter{%
> % \startmakeup[ch

[NTG-context] Re: setuphead in connection with the command argument

2024-05-30 Thread Gerion Entrup
The chapter format that I want to achieve in the end is nearly the one in the 
attachment (excerpt of Christian Dietrich's PhD thesis).

Best
Gerion


Am Donnerstag, 30. Mai 2024, 16:15:01 MESZ schrieb Gerion Entrup:
> Hi,
> 
> I'm trying to adapt the format of chapters in my document and have a few 
> questions regarding setuphead.
> My aim is to have the chapter (title) on a separate page with an additional 
> intro in different text sizes for title, subtitle and the intro.
> I chose to use the "command=" argument in setuphead for that.
> However, I'm not quite sure about it's internals.
> 
> Let's begin with a minimal example:
> ```
> \define[2]\MyChapter{%
>   #1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
> }
> 
> \setuphead[title, chapter][command=\MyChapter]
> 
> \setupbodyfont[11pt]
> 
> \starttext
> \startchapter[title=foo][subtitle=bar, intro={some explanation}]
> some text
> \stopchapter
> \stoptext
> ```
> This produces 1.pdf.
> 
> 
> ## Font size
> 
> What is the reason that that the font of the chapter is bigger? How can I 
> reset it to normal size? This does not work at all:
> ```
> \define[2]\MyChapter{%
>   \setupbodyfont[11pt] #1 #2: \structureuservariable{subtitle} 
> (\structureuservariable{intro})
> }
> ```
> However, changing to a bigger font works somehow. Is there a factor applied 
> to the font size internally? For example:
> ```
> \define[2]\MyChapter{%
>   \setupbodyfont[20pt] #1 #2: \structureuservariable{subtitle} 
> (\structureuservariable{intro})
> }
> ```
> produces 2.pdf (the chapter font is not 20pt).
> 
> 
> ## Line breaks
> 
> How can I achieve line breaks?
> This does not work:
> ```
> \define[2]\MyChapter{%
> #1 #2:\\
> \structureuservariable{subtitle}\\
> (\structureuservariable{intro})
> }
> ```
> (see 3.pdf)
> 
> I also want to set everything except of the intro in a flushright environment 
> but do not know how. I tried:
> ```
> \define[2]\MyChapter{%
> \startalignment[flushright]
> #1 #2:\\
> \structureuservariable{subtitle}\\
> \stopalignment
> \structureuservariable{intro}
> }
> ```
> (see 4.pdf, no change)
> 
> 
> ## Bold text
> 
> I tried to get the text bold. However, `#1` and `#2` does not seem to follow 
> this.
> ```
> \define[2]\MyChapter{%
> \bold #1 #2: \structureuservariable{subtitle} 
> (\structureuservariable{intro})
> }
> ```
> 
> ## Makeups
> 
> The best solution, I had so far, was to define a makeup, but I don't get it 
> to work with text with mixed alignment and it does not solve the font size 
> problem:
> ```
> \definemakeup[chapter][align=left, top=]
> \define[2]\MyChapter{%
> \startmakeup[chapter]
> #1 #2:\\
> \structureuservariable{subtitle}\\
> \stopmakeup
> (\structureuservariable{intro})
> }
> ```
> (see 5.pdf)
> 
> ## Framed
> 
> I also have tried this but it does not bring any linebreaks:
> ```
> \define[2]\MyChapter{%
> \framed[frame=off, offset=0pt]{#1\\#2:\\ 
> \structureuservariable{subtitle}\\ (\structureuservariable{intro})}
> }
> ```
> (see 6.pdf)
> 
> I hope you can shed some light into setuphead with command. I search on the 
> wiki, Stackoverflow and the manuals but didn't really find anything.
> 
> Best,
> Gerion
> 
> 



chapter.pdf
Description: Adobe PDF document


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] setuphead in connection with the command argument

2024-05-30 Thread Gerion Entrup
Hi,

I'm trying to adapt the format of chapters in my document and have a few 
questions regarding setuphead.
My aim is to have the chapter (title) on a separate page with an additional 
intro in different text sizes for title, subtitle and the intro.
I chose to use the "command=" argument in setuphead for that.
However, I'm not quite sure about it's internals.

Let's begin with a minimal example:
```
\define[2]\MyChapter{%
#1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
}

\setuphead[title, chapter][command=\MyChapter]

\setupbodyfont[11pt]

\starttext
\startchapter[title=foo][subtitle=bar, intro={some explanation}]
some text
\stopchapter
\stoptext
```
This produces 1.pdf.


## Font size

What is the reason that that the font of the chapter is bigger? How can I reset 
it to normal size? This does not work at all:
```
\define[2]\MyChapter{%
\setupbodyfont[11pt] #1 #2: \structureuservariable{subtitle} 
(\structureuservariable{intro})
}
```
However, changing to a bigger font works somehow. Is there a factor applied to 
the font size internally? For example:
```
\define[2]\MyChapter{%
\setupbodyfont[20pt] #1 #2: \structureuservariable{subtitle} 
(\structureuservariable{intro})
}
```
produces 2.pdf (the chapter font is not 20pt).


## Line breaks

How can I achieve line breaks?
This does not work:
```
\define[2]\MyChapter{%
#1 #2:\\
\structureuservariable{subtitle}\\
(\structureuservariable{intro})
}
```
(see 3.pdf)

I also want to set everything except of the intro in a flushright environment 
but do not know how. I tried:
```
\define[2]\MyChapter{%
\startalignment[flushright]
#1 #2:\\
\structureuservariable{subtitle}\\
\stopalignment
\structureuservariable{intro}
}
```
(see 4.pdf, no change)


## Bold text

I tried to get the text bold. However, `#1` and `#2` does not seem to follow 
this.
```
\define[2]\MyChapter{%
\bold #1 #2: \structureuservariable{subtitle} 
(\structureuservariable{intro})
}
```

## Makeups

The best solution, I had so far, was to define a makeup, but I don't get it to 
work with text with mixed alignment and it does not solve the font size problem:
```
\definemakeup[chapter][align=left, top=]
\define[2]\MyChapter{%
\startmakeup[chapter]
#1 #2:\\
\structureuservariable{subtitle}\\
\stopmakeup
(\structureuservariable{intro})
}
```
(see 5.pdf)

## Framed

I also have tried this but it does not bring any linebreaks:
```
\define[2]\MyChapter{%
\framed[frame=off, offset=0pt]{#1\\#2:\\ \structureuservariable{subtitle}\\ 
(\structureuservariable{intro})}
}
```
(see 6.pdf)

I hope you can shed some light into setuphead with command. I search on the 
wiki, Stackoverflow and the manuals but didn't really find anything.

Best,
Gerion



1.pdf
Description: Adobe PDF document


2.pdf
Description: Adobe PDF document


3.pdf
Description: Adobe PDF document


4.pdf
Description: Adobe PDF document


5.pdf
Description: Adobe PDF document


6.pdf
Description: Adobe PDF document
% 1.pdf
\define[2]\MyChapter{%
	#1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
}

% % 2.pdf
% \define[2]\MyChapter{%
% 	\setupbodyfont[20pt] #1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
% }

% % 3.pdf
% \define[2]\MyChapter{%
% #1 #2:\\
% \structureuservariable{subtitle}\\
% (\structureuservariable{intro})
% }

% % 4.pdf
% \define[2]\MyChapter{%
% \startalignment[flushright]
% #1 #2:\\
% \structureuservariable{subtitle}\\
% \stopalignment
% \structureuservariable{intro}
% }

% % 5.pdf
% \definemakeup[chapter][align=left, top=]
% \define[2]\MyChapter{%
% \startmakeup[chapter]
% #1 #2:\\
% \structureuservariable{subtitle}\\
% \stopmakeup
% (\structureuservariable{intro})
% }


% % 6.pdf
% \define[2]\MyChapter{%
% \framed[frame=off, offset=0pt]{#1\\#2:\\ \structureuservariable{subtitle}\\ (\structureuservariable{intro})}
% }

\setuphead[title, chapter][command=\MyChapter]

\setupbodyfont[11pt]

\starttext
\startchapter[title=foo][subtitle=bar, intro={some explanation}]
some text
\stopchapter
\stoptext


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: Wiki - test/proposal to further clarify documentation

2024-05-19 Thread garulfo
> So is the plan to go through each of the main headings in the left side-bar 
> and make the same type of change?
Yes. 

Maybe new ones will have to be added
___
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: Wiki - test/proposal to further clarify documentation

2024-05-18 Thread Bruce Horrocks
On 17 May 2024, at 21:40, garu...@azules.eu wrote:
> 
> I have tested on 2 pages :
> - https://wiki.contextgarden.net/Sciences (only mathematics part)
> - https://wiki.contextgarden.net/Fonts
> 
> After these tests, I think this may help users to find their way around the 
> various sources of documentation :
> In one small table he/she has an overview of the documentation for a given 
> topic,  :
> - the few key tutorials
> - link to one "main wiki page" about the topic
> - the few key manuals
> - the reference for commands

The fonts page is a lot better than before[1], IMHO. I would prefer the table 
were 90% width rather than 50 but that is minor.

So is the plan to go through each of the main headings in the left side-bar and 
make the same type of change?

> 
> I'm not sure I've selected the few documents that are considered by the 
> community as the key tutorials.
> Thanks for your feedback again.

I don't think that is a problem - the Wiki can be updated by others as long as 
the layout/structure of the page is clear so people know where to add links.

> PS : in order to benefit from mediawiki page organization features, I moved 
> some pages, for example
> wiki.contextgarden.net/blablabla
> ==> wiki.contextgarden.net/Topic/blablabla


[1] Previous style for reference: 
<https://web.archive.org/web/20231116125758/https://wiki.contextgarden.net/Fonts>
—
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: no effect of \definefontfeature for adobevariablefontprototype

2024-05-12 Thread Hans Hagen

On 5/9/2024 10:38 PM, garu...@azules.eu wrote:

Hi,

trying to work with variable fonts, I am stuck at the very beginning.

I can't see any effect of weight parameter.
Using adobevariablefontprototypebold and adobevariablefontprototypelight is 
working.

\starttext

\definefontfeature[whatever][axis={weight:150}]%
\definedfont[name:adobevariablefontprototype*whatever]foo@bar

\definefontfeature[whatever][axis={weight:350}]%
\definedfont[name:adobevariablefontprototype*whatever]foo@bar

\definefontfeature[whatever][axis={weight:550}]%
\definedfont[name:adobevariablefontprototype*whatever]foo@bar

\definefontfeature[whatever][axis={weight:750}]%
\definedfont[name:adobevariablefontprototype*whatever]foo@bar

\stoptext

Can it be something from with my font file ?

\starttext

\definefontfeature[whatever01][default][axis={weight=0250}]
\definefontfeature[whatever02][default][axis={weight=0500}]
\definefontfeature[whatever03][default][axis={weight=0750}]
\definefontfeature[whatever04][default][axis={weight=1000}]

\definefontfeature[whatever10][default][axis={=000}]
\definefontfeature[whatever20][default][axis={=050}]
\definefontfeature[whatever30][default][axis={=075}]
\definefontfeature[whatever40][default][axis={=100}]

\definefontfeature[whatever11][default][axis={weight=0250,=000}]
\definefontfeature[whatever22][default][axis={weight=0500,=050}]
\definefontfeature[whatever33][default][axis={weight=0750,=075}]
\definefontfeature[whatever44][default][axis={weight=1000,=100}]

\definedfont[name:adobevariablefontprototype*whatever01]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever02]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever03]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever04]foo@bar\blank

\definedfont[name:adobevariablefontprototype*whatever10]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever20]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever30]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever40]foo@bar\blank

\definedfont[name:adobevariablefontprototype*whatever11]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever22]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever33]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever44]foo@bar\par

\stoptext


-
  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] no effect of \definefontfeature for adobevariablefontprototype

2024-05-09 Thread garulfo
Hi,

trying to work with variable fonts, I am stuck at the very beginning.

I can't see any effect of weight parameter.
Using adobevariablefontprototypebold and adobevariablefontprototypelight is 
working.

\starttext

\definefontfeature[whatever][axis={weight:150}]%
\definedfont[name:adobevariablefontprototype*whatever]foo@bar

\definefontfeature[whatever][axis={weight:350}]%
\definedfont[name:adobevariablefontprototype*whatever]foo@bar

\definefontfeature[whatever][axis={weight:550}]%
\definedfont[name:adobevariablefontprototype*whatever]foo@bar

\definefontfeature[whatever][axis={weight:750}]%
\definedfont[name:adobevariablefontprototype*whatever]foo@bar

\stoptext

Can it be something from with my font file ? 

Thanks,
Garulfo
___
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: what are the interaction between \showframe and \realpageno in \startuseMPgraphic ?

2024-04-24 Thread Wolfgang Schuster

garu...@azules.eu schrieb am 20.04.2024 um 23:00:

I can not figure out why this progress bar only works when \showframe is 
activated.
When you comment on \showframe, it's as if \realpageno is at zero.
(current version: 2024.04.01 08:59)

\showframe

\startuseMPgraphic{MonGraphisme_MP}
   numeric n ; n := \number\realpageno ;
   numeric m ; m := \number\lastpageno ;
   numeric h ; h := \overlayheight ;
   numeric w ; w := \overlaywidth ;
   numeric e ; e := 3mm;
   numeric r ; r := (((n-1)/(m-1))*w);
   fill fullsquare xscaled w yscaled e shifted (w/2, h/2) withcolor darkblue ;
   fill fullsquare xscaled r yscaled e shifted (r/2, h/2) withcolor darkred;
\stopuseMPgraphic

\defineoverlay [MonGraphisme_OL] [\useMPgraphic{MonGraphisme_MP}]

\setupbackgrounds [footer] [rightmargin] [background={MonGraphisme_OL}]

\starttext
\dorecurse{10}{\input tufte\page}
\stoptext

Any clue is warmly welcome


You need

    \setupbackgrounds[state=repeat]

which is set when you use \showframe.

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] what are the interaction between \showframe and \realpageno in \startuseMPgraphic ?

2024-04-20 Thread garulfo
I can not figure out why this progress bar only works when \showframe is 
activated.
When you comment on \showframe, it's as if \realpageno is at zero.
(current version: 2024.04.01 08:59)

\showframe

\startuseMPgraphic{MonGraphisme_MP}
  numeric n ; n := \number\realpageno ;
  numeric m ; m := \number\lastpageno ;
  numeric h ; h := \overlayheight ;
  numeric w ; w := \overlaywidth ;
  numeric e ; e := 3mm;
  numeric r ; r := (((n-1)/(m-1))*w);
  fill fullsquare xscaled w yscaled e shifted (w/2, h/2) withcolor darkblue ;
  fill fullsquare xscaled r yscaled e shifted (r/2, h/2) withcolor darkred;
\stopuseMPgraphic

\defineoverlay [MonGraphisme_OL] [\useMPgraphic{MonGraphisme_MP}]

\setupbackgrounds [footer] [rightmargin] [background={MonGraphisme_OL}]

\starttext
\dorecurse{10}{\input tufte\page}
\stoptext

Any clue is warmly welcome
___
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] Wiki - question about Command/ pages which start with a space character

2024-04-14 Thread garulfo
Hi all,

Is it on purpose that 128 pages "https://wiki.contextgarden.net/Command/ 
" start with a space character ?
I didn't find an explanation in https://wiki.contextgarden.net/Command

For example, these two pages exist :
- https://wiki.contextgarden.net/Command/startbuffer
- https://wiki.contextgarden.net/Command/_startbuffer

If it is on purpose: 
- What is the purpose, and which page should contain which documentation?

If it is not: 
- Is there a way to automatically merge the content of the couple of pages, and 
to remove the "wrong" pages, or should it be done manually ?

Thanks for your help.

List :
Command/ attachment
Command/ background
Command/ bar
Command/ beginblock
Command/ button
Command/ characterkerning
Command/ comment
Command/ completecombinedlist
Command/ completelistoffloats
Command/ completelistofsorts
Command/ completelistofsynonyms
Command/ completeregister
Command/ copylabeltext
Command/ ctxfunction
Command/ ctxfunctiondefinition
Command/ currentlabel
Command/ delimitedtext
Command/ description
Command/ enumeration
Command/ fence
Command/ fraction
Command/ framed
Command/ framedtext
Command/ getbuffer
Command/ hbox
Command/ help
Command/ high
Command/ highlight
Command/ label
Command/ labellanguage
Command/ labeltext
Command/ labeltexts
Command/ language
Command/ leftlabeltext
Command/ linenote
Command/ low
Command/ lowhigh
Command/ lowmidhigh
Command/ margindata
Command/ mathcommand
Command/ mathdoubleextensible
Command/ mathextensible
Command/ mathframed
Command/ mathmatrix
Command/ mathornament
Command/ mathoverextensible
Command/ mathovertextextensible
Command/ mathradical
Command/ mathtriplet
Command/ mathunderextensible
Command/ mathundertextextensible
Command/ mathunstacked
Command/ nextparagraphs
Command/ note
Command/ ornament
Command/ paragraphs
Command/ placecombinedlist
Command/ placefloat
Command/ placelistoffloats
Command/ placelistofsorts
Command/ placelistofsynonyms
Command/ placement
Command/ placepairedbox
Command/ placeregister
Command/ presetlabeltext
Command/ referenceformat
Command/ register
Command/ rightlabeltext
Command/ script
Command/ section
Command/ seeregister
Command/ setupcombinedlist
Command/ setupitemgroup
Command/ setuplabeltext
Command/ setuppairedbox
Command/ setupregister
Command/ shift
Command/ sorting
Command/ startattachment
Command/ startbackground
Command/ startbuffer
Command/ startcolumnset
Command/ startcomment
Command/ startdelimitedtext
Command/ startdescription
Command/ starteffect
Command/ startenumeration
Command/ startfittingpage
Command/ startfloattext
Command/ startformula
Command/ startframedtext
Command/ starthelp
Command/ startindentedtext
Command/ startitemgroup
Command/ startlabeltext
Command/ startlinenote
Command/ startlines
Command/ startmakeup
Command/ startmathalignment
Command/ startmathcases
Command/ startmathmatrix
Command/ startmixedcolumns
Command/ startnarrower
Command/ startnote
Command/ startpagecolumns
Command/ startparagraphs
Command/ startparallel
Command/ startplacefloat
Command/ startplacepairedbox
Command/ startsection
Command/ startsectionblock
Command/ startstartstop
Command/ startstop
Command/ startstyle
Command/ starttabulate
Command/ starttextbackground
Command/ starttyping
Command/ startviewerlayer
Command/ startxtable
Command/ stoplinenote
Command/ style
Command/ synonym
Command/ textbackground
Command/ textnote
Command/ tooltip
Command/ type
Command/ typebuffer
Command/ unit
___
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: Local alternative to \input

2024-03-04 Thread Denis Maier via ntg-context
Hi,

Aren’t environments used for setups (and not for textual content). Maybe a 
buffer may be what you want ?

https://wiki.contextgarden.net/Command/startbuffer

 

Best,

Denis

 

 

Von: Jeroen  
Gesendet: Montag, 4. März 2024 06:15
An: mailing list for ConTeXt users 
Betreff: [NTG-context] Re: Local alternative to \input

 

With a single environment it seems to work, though when I expand it to 
multiple, it does not seem to work anymore

 

\starttext

SomeText \\
\environment aaa \\
SomeText \\
\environment bbb \\
SomeText \\

\startenvironment aaa
\samplefile{lorem}
\stopenvironment

\startenvironment bbb
\samplefile{tufte}
\stopenvironment

\stoptext

 

Op do 4 jan 2024 om 20:14 schreef Henning Hraban Ramm mailto:te...@fiee.net> >:

Am 04.01.24 um 18:00 schrieb Jeroen:
> I just would like to have a lot of mark-up for combined figures and 
> tables etc moved out of the way, similar to this. I am loosing the 
> general documetn flow because of all this markup. Would there be a 
> construction similar to this:
> 
> \starttext
> 
> \environment foo
> \environment bar
> 
> \startenvironment foo
> this is a lot of text
> \stopenvironment
> 
> \startenvironment bar
> and this is another piece of text
> \stopenvironment
> 
> \stoptext

An environment is a separate file.
\environment is like \input with a few more checks, e.g. it loads the 
file only once.

e.g.

-- file "env_foo.tex" --
\startenvironment env_foo
% settings
\stopenvironment
--


-- file document.tex --
\environment env_foo

\starttext
% whatever
\stoptext
--

Instead of the call within your document, you can also call

context --environment=env_foo.tex document

(Usually that makes only sense in XML workflows.)

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

maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl>  / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
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: Local alternative to \input

2024-03-03 Thread Jeroen
With a single environment it seems to work, though when I expand it to
multiple, it does not seem to work anymore

\starttext

SomeText \\
\environment aaa \\
SomeText \\
\environment bbb \\
SomeText \\

\startenvironment aaa
\samplefile{lorem}
\stopenvironment

\startenvironment bbb
\samplefile{tufte}
\stopenvironment

\stoptext

Op do 4 jan 2024 om 20:14 schreef Henning Hraban Ramm :

> Am 04.01.24 um 18:00 schrieb Jeroen:
> > I just would like to have a lot of mark-up for combined figures and
> > tables etc moved out of the way, similar to this. I am loosing the
> > general documetn flow because of all this markup. Would there be a
> > construction similar to this:
> >
> > \starttext
> >
> > \environment foo
> > \environment bar
> >
> > \startenvironment foo
> > this is a lot of text
> > \stopenvironment
> >
> > \startenvironment bar
> > and this is another piece of text
> > \stopenvironment
> >
> > \stoptext
>
> An environment is a separate file.
> \environment is like \input with a few more checks, e.g. it loads the
> file only once.
>
> e.g.
>
> -- file "env_foo.tex" --
> \startenvironment env_foo
> % settings
> \stopenvironment
> --
>
>
> -- file document.tex --
> \environment env_foo
>
> \starttext
> % whatever
> \stoptext
> --
>
> Instead of the call within your document, you can also call
>
> context --environment=env_foo.tex document
>
> (Usually that makes only sense in XML workflows.)
>
> 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: Local alternative to \input

2024-01-04 Thread Henning Hraban Ramm

Am 04.01.24 um 18:00 schrieb Jeroen:
I just would like to have a lot of mark-up for combined figures and 
tables etc moved out of the way, similar to this. I am loosing the 
general documetn flow because of all this markup. Would there be a 
construction similar to this:


\starttext

\environment foo
\environment bar

\startenvironment foo
this is a lot of text
\stopenvironment

\startenvironment bar
and this is another piece of text
\stopenvironment

\stoptext


An environment is a separate file.
\environment is like \input with a few more checks, e.g. it loads the 
file only once.


e.g.

-- file "env_foo.tex" --
\startenvironment env_foo
% settings
\stopenvironment
--


-- file document.tex --
\environment env_foo

\starttext
% whatever
\stoptext
--

Instead of the call within your document, you can also call

context --environment=env_foo.tex document

(Usually that makes only sense in XML workflows.)

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: Fractions

2023-12-10 Thread Gavin via ntg-context
Hello fraction fascinated friends,

> On Dec 10, 2023, at 5:24 AM, Henning Hraban Ramm  wrote:
> 
> Am 09.12.23 um 23:30 schrieb Mikael Sundqvist:
>> Hi,
>> On Sat, Dec 9, 2023 at 4:39 PM Wolfgang Schuster
>>  wrote:
>>> 
>>> Fabrice Couvreur schrieb am 09.12.2023 um 17:19:
>>> 
>>> Very clear !
>>> In typography for Mathematics books, what choice should we make for the 
>>> best possible result ?
>>> 
>>> A question better answered by Mikael or Aditya!
>> Thank you for your trust, Wolfgang. I am not sure I have something
>> valuable to say in addition to Adityas suggestion \frac{1/3} in inline
>> math. In any case, I attach a passage, with suggestions inspired by
>> Lansburgh's book (iin Swedish). Not sure the file size makes it
>> through to the list, though.
> 
> Thank you!
> 
> I usually only need simple inline fractions like 1/n, 1/2 or 3/8 in text.
> With these and \frac, the spacing below the numerator (depth) is too big, 
> while the denominator sticks too tightly to the fraction bar.
> (Of course I use regular numbers for fractions, not mediaeval.)
> 
> Usually I’d prefer “vulgar fractions”, but \vulgarfraction looks “horrible” 
> in comparison to the few usual fractions contained in fonts (like ½ & ¾).
> 
> I tried to use the OpenType fraction features to no avail.
> 
> So I’m still looking for “the best” solution for simple fractions inline.
> 
> Hraban

I also use fractions frequently, so I’ve tried a few things.

Some fonts have superior and inferior numbers that can be used to make small 
slash fractions. I’ve done this, but my method is not pretty. Hraban suggested 
using font features for this, but I haven’t learned how to do that. Any advice 
is welcome.

Example code below uses the Libertinus font, which has these superior and 
inferior numbers, to produce sample paragraph demonstrating a few options for 
fractions in text.

Gavin


\usetypescriptfile[libertinus]
\setupbodyfont [libertinus,11pt]%
\setupinterlinespace[line=3.1ex]

\define\fracone{\getnamedglyphdirect{libertinus}{onesuperior}} % 1
\define\fracthree{\getnamedglyphdirect{libertinus}{threesuperior}} % 3
\define\fracnine{\getnamedglyphdirect{libertinus}{ninesuperior}} % 9

\define\thirteenths{\textfraction\getnamedglyphdirect{libertinus}{oneinferior}\getnamedglyphdirect{libertinus}{threeinferior}}
 % /13

\define\onethirteenth{\text{\fracone\thirteenths}} % 1/13
\define\threethirteenths{\text{\fracthree\thirteenths}} % 3/13
\define\ninethirteenths{\text{\fracnine\thirteenths}} % 9/13

\starttext
Some small fractions are already available in many fonts, like \onehalf\ and 
\onethird. Others can be built using superior and inferior numbers in some 
fonts. This includes the fractions required to
find the normal and shearing stresses on an oblique plane defined by 
$l=\sqrt{\threethirteenths}$, $m=\sqrt{\onethirteenth}$, and 
$n=\sqrt{\ninethirteenths}$.
Of course, you could just find the normal and shearing stresses on an oblique 
plane defined by $l=\sqrt{3/13}$, $m=\sqrt{1/13}$, and $n=\sqrt{9/13}$.
Vulgar fractions are between these extremes.
Find the normal and shearing stresses on an oblique plane defined by 
$l=\sqrt{\vfrac{3}{13}}$, $m=\sqrt{\vfrac{1}{13}}$, and 
$n=\sqrt{\vfrac{9}{13}}$.
I included more text than strictly necessary in this example to demonstrate the 
effect on line spacing.
\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: Fractions

2023-12-10 Thread Henning Hraban Ramm

Am 09.12.23 um 23:30 schrieb Mikael Sundqvist:

Hi,

On Sat, Dec 9, 2023 at 4:39 PM Wolfgang Schuster
 wrote:


Fabrice Couvreur schrieb am 09.12.2023 um 17:19:

Very clear !
In typography for Mathematics books, what choice should we make for the best 
possible result ?

A question better answered by Mikael or Aditya!


Thank you for your trust, Wolfgang. I am not sure I have something
valuable to say in addition to Adityas suggestion \frac{1/3} in inline
math. In any case, I attach a passage, with suggestions inspired by
Lansburgh's book (iin Swedish). Not sure the file size makes it
through to the list, though.


Thank you!

I usually only need simple inline fractions like 1/n, 1/2 or 3/8 in text.
With these and \frac, the spacing below the numerator (depth) is too 
big, while the denominator sticks too tightly to the fraction bar.

(Of course I use regular numbers for fractions, not mediaeval.)

Usually I’d prefer “vulgar fractions”, but \vulgarfraction looks 
“horrible” in comparison to the few usual fractions contained in fonts 
(like ½ & ¾).


I tried to use the OpenType fraction features to no avail.

So I’m still looking for “the best” solution for simple fractions inline.

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: xmlpos values doubled

2023-11-22 Thread Hans Hagen

On 11/22/2023 2:30 AM, Benjamin Buchmuller wrote:

Hi list,

I came across this old thread as I was trying to use \xmlpos{#1} to 
"dynamically" create references such as \item[mystep:\xmlpos{#1}] to be 
referenced when other elements of this node are parsed at a later point.

In fact, it seems that \xmlpos{#1} returns duplicate values. This might indeed 
be the intended meaning of \xmlpos{#1} as it seems related to the XML query 
foo/bar/index() which only looks up the position in the parent node. (I noticed 
that if I run this repeatedly, I get somehow different values from times to 
times. I can't say why.)

Anyways, I was wondering if there is a TeX command to access the absolute 
position of an element in the tree? Similar to foo/bar[rootposition()] (or 
foo/bar[order()]? – Can't make sense of the entry in the XML manual.)
normally elements are unique, and within n xml instance #1 itself is 
rather unique (but the same even over runs i.e. when it goes via the tuc 
file)


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: xmlpos values doubled

2023-11-21 Thread Benjamin Buchmuller
Hi list,

I came across this old thread as I was trying to use \xmlpos{#1} to 
"dynamically" create references such as \item[mystep:\xmlpos{#1}] to be 
referenced when other elements of this node are parsed at a later point. 

In fact, it seems that \xmlpos{#1} returns duplicate values. This might indeed 
be the intended meaning of \xmlpos{#1} as it seems related to the XML query 
foo/bar/index() which only looks up the position in the parent node. (I noticed 
that if I run this repeatedly, I get somehow different values from times to 
times. I can't say why.)

Anyways, I was wondering if there is a TeX command to access the absolute 
position of an element in the tree? Similar to foo/bar[rootposition()] (or 
foo/bar[order()]? – Can't make sense of the entry in the XML manual.)

Thank you for your help!


Benjamin


> Hi Ben,
> 
> I think that both \xmlpos and \xmldepth give weird results.
> 
> With this minimal sample:
> 
> \startbuffer[text]
> first level
> second level
> third level
> third level
> 
> second level
> third level
> third level
> 
> second level
> third level
> third level
> 
> 
> \stopbuffer
> 
> \startxmlsetups xml:text
> \xmlsetsetup{#1}{doc|s|ss}{xml:*}
> \stopxmlsetups
> 
> \xmlregistersetup{xml:text}
> 
> \startxmlsetups xml:doc
> \chapter{\xmlpos{#1}\letterat\xmldepth{#1}: \xmlflush{#1}}
> \stopxmlsetups
> 
> \startxmlsetups xml:s
> \section{\xmlpos{#1}\letterat\xmldepth{#1}: \xmlflush{#1}}
> \stopxmlsetups
> 
> \startxmlsetups xml:ss
> \subsection{\xmlpos{#1}\letterat\xmldepth{#1}: \xmlflush{#1}}
> \stopxmlsetups
> 
> \setuphead[chapter,section,subsection][before=,after=,]
> \starttext
> \xmlprocessbuffer{main}{text}{}
> \stoptext
> 
> \xmldepth shows values that I think are +1 than they should be.
> 
> \xmlpos counts in pairs and not in units (as you wrote, 2, 4, 6...).
> 
> Hans, could you check whether this is working as expected?
> 
> Sorry, but if this isn’t a bug, I have no idea of what I may be missing.
> 
> 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] Vertically aligned alternating fillers

2023-11-16 Thread Marco Patzer
Hi!

A while back Wolfgang presented a nice solution for alternating
fillers:

  https://www.mail-archive.com/ntg-context@ntg.nl/msg67677.html

It works if the text has a constant width. But if the width changes,
the alternating look is lost. Is there a way to align the dots
vertically even if the text has variable width? Example:

\usemodule
  [visual]

\definefiller
  [pavel-0]
  [alterntive=symbol,
   method=global,
   width=2em,
   leftmargin=.5em,
   rightmargin=.5em,
   symbol=\clap{.}]

\definefiller
  [pavel-1]
  [pavel-0]
  [align=left]

\definefiller
  [pavel-2]
  [pavel-0]
  [align=middle]

\newconditional\PavelState
\global\setfalse\PavelState

\define\PavelFiller
  {\ifconditional\PavelState
 \global\setfalse\PavelState
 \filler[pavel-1]%%
   \else
 \global\settrue\PavelState
 \filler[pavel-2]%%
   \fi}

\def\oneword
  {\getrandomnumber\n{1}{100}\fakenwords{1}{\n}}

\starttext
  %% dots are vertically aligned
  \dorecurse{6}{%%
Foo \PavelFiller Bar\par}

  \hairline

  %% dots are not aligned
  \dorecurse{6}{%%
\oneword\PavelFiller\oneword\par}
\stoptext

Marco

LMTX 2023.09.04 19:15
___
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: placing \externalfigure

2023-11-12 Thread Hans Hagen

On 11/12/2023 5:30 PM, Marco Patzer wrote:

On Sun, 12 Nov 2023 16:34:00 +0100
Hans van der Meer via ntg-context  wrote:


In placing \externalfigure[file] I observe the figure is placed with
its bottom on the baseline, thus:

 [externalfigure]
--- baseline

I looked into the option list of setupexternalfigure but could not
find one whereby the location with respect to the baseline is either
top, bottom or center.


Maybe this is what you're looking for:

\useMPlibrary [dum]
\setuplayout  [grid=yes]
\showgrid

\starttext
   foo \externalfigure[][][location=high]   bar \blank [5*line]
   foo \externalfigure[][][location=middle] bar \blank [5*line]
   foo \externalfigure[][][location=low]    bar
\stoptext


This variant:

\useMPlibrary [dum]

\starttext

foo \figuresymbol[] bar

foo \figuresymbol[][height=1cm,depth=\strutdepth] bar

foo \figuresymbol[][height=3ex,depth=2ex] bar

\stoptext

gives the lines proepr dimensions.

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: placing \externalfigure

2023-11-12 Thread Marco Patzer
On Sun, 12 Nov 2023 16:34:00 +0100
Hans van der Meer via ntg-context  wrote:

> In placing \externalfigure[file] I observe the figure is placed with
> its bottom on the baseline, thus:
> 
> [externalfigure]
> --- baseline
> 
> I looked into the option list of setupexternalfigure but could not
> find one whereby the location with respect to the baseline is either
> top, bottom or center.

Maybe this is what you're looking for:

\useMPlibrary [dum]
\setuplayout  [grid=yes]
\showgrid

\starttext
  foo \externalfigure[][][location=high]   bar \blank [5*line]
  foo \externalfigure[][][location=middle] bar \blank [5*line]
  foo \externalfigure[][][location=low]bar
\stoptext

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

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


[NTG-context] Vebatim text: Preserve empty lines

2023-08-16 Thread Alex Leray

Hello,

is there a way to preserve empty lines in typing env?

By default it is removing them.

Thanks

* * *

\definetyping[custom]
\setuptyping[custom][
space=normal,
lines=yes,
tab=4,
]

\starttext
\startcustom
Foo



Bar



Baz
\stopcustom

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: Why overbar is so big

2023-08-13 Thread Mikael Sundqvist
Hi,

On Sun, Aug 13, 2023 at 9:13 AM Xavier B.  wrote:
>
> So,
>
> Finally is it a bug in MKIV? It seems you fix some kind of bug in your 
> messages. Is it true?
>
> > The output with Luametatex is correct but Luatex creates a raised bar
> > (and different linebreaking).
> >
> > \showglyphs
> >
> > \startTEXpage[offset=1ex]
> >  \ruledhbox{$\overline{OA} = \overbar  {OA} = 4.2$}
> >  \par
> >  \ruledhbox{$\underline   {OA} = \underbar {OA} = 4.2$}
> >  \par
> >  \ruledhbox{$\widetilde   {OA} = \widebar  {OA} = 4.2$}
> >  \par
> >  \ruledhbox{$\overbracket {OA} = \underbracket {OA} = 4.2$}
> > \stopTEXpage
> >
> > I'll add a 'force fix in spite of extensible being present' in mkiv. In
> > lmtx we always fix also because we drop in nicer shapes (watch the round
> > tips in lm and fancy tips in antykwa) and concluded that fonts will
> > remain as they are.
> >
> > Hans
>
> As you suggested, I will give a try to LMTX but be aware most user still use 
> MKIV until most distros upgrade the texlive version of context to LMTX.
>
> Regards,
> Xavier

One can also try to instead use the accent mechanism instead of a stacker:

% engine=luatex

\definemathtopaccent[widebar] ["0305]

\startTEXpage[offset=3pt]
$\overbar{OA}$

$\widebar{OA}$
\stopTEXpage

The \widebar is defined (almost) like that in lmtx.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Why overbar is so big

2023-08-13 Thread Hans Hagen via ntg-context

On 8/13/2023 9:08 AM, Xavier B. wrote:

So,

Finally is it a bug in MKIV? It seems you fix some kind of bug in your 
messages. Is it true?


Not really. It's a a bug in the fonts (that will stay if only for 
compaibility reasons). There is a catch in mkiv that compensates for it 
but only when characters are not there. So, for these two I now force 
the catch.


In lmtx we have a bit different approach: we just assuem they are wrong 
in all fonts and fix them or replace them. We also have a more advanced 
math engine so we can control placement better.


There are also 'font parameters' involved that can be bad (i guess that 
designers can't really test math font parameters). In lmtx we have more 
of them, beyond what opentype math provides.


All of this is handled in goodie files. That mechanism is present in 
mkiv but no one ever bothered to spent time on it. That said: the last 
two years Mikeal and I spent a *lot* of time on math and we don't really 
look back at mkiv / mkii also because there is way more neat things now 
(most probably go unnoticed) ... you can read about it in some documents 
that come with context, articles in tugboat, and there are talks by 
Mikael at tug meetings on YT.



 The output with Luametatex is correct but Luatex creates a raised bar
 (and different linebreaking).

\showglyphs

\startTEXpage[offset=1ex]
  \ruledhbox{$\overline{OA} = \overbar  {OA} = 4.2$}
  \par
  \ruledhbox{$\underline   {OA} = \underbar {OA} = 4.2$}
  \par
  \ruledhbox{$\widetilde   {OA} = \widebar  {OA} = 4.2$}
  \par
  \ruledhbox{$\overbracket {OA} = \underbracket {OA} = 4.2$}
\stopTEXpage

I'll add a 'force fix in spite of extensible being present' in mkiv. In
lmtx we always fix also because we drop in nicer shapes (watch the round
tips in lm and fancy tips in antykwa) and concluded that fonts will
remain as they are.

Hans


As you suggested, I will give a try to LMTX but be aware most user still use 
MKIV until most distros upgrade the texlive version of context to LMTX.
It's not that hard to install lmtx alongside. If distributions take from 
texlive then likely you also end up with files that are not needed (base 
package) and lack some fonts (esp math) by default. You'd also benefit 
from the last couple of years advancements. Keep in mind that for a long 
term tex (document) project a snapshot approach is healthy because you 
never know what a distribution adds / replaces (esp fonts can be a mess 
and you want to know what you use).


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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: Why overbar is so big

2023-08-13 Thread Xavier B.
So,

Finally is it a bug in MKIV? It seems you fix some kind of bug in your 
messages. Is it true?

> The output with Luametatex is correct but Luatex creates a raised bar 
> (and different linebreaking).
> 
> \showglyphs
> 
> \startTEXpage[offset=1ex]
>  \ruledhbox{$\overline{OA} = \overbar  {OA} = 4.2$}
>  \par
>  \ruledhbox{$\underline   {OA} = \underbar {OA} = 4.2$}
>  \par
>  \ruledhbox{$\widetilde   {OA} = \widebar  {OA} = 4.2$}
>  \par
>  \ruledhbox{$\overbracket {OA} = \underbracket {OA} = 4.2$}
> \stopTEXpage
> 
> I'll add a 'force fix in spite of extensible being present' in mkiv. In 
> lmtx we always fix also because we drop in nicer shapes (watch the round 
> tips in lm and fancy tips in antykwa) and concluded that fonts will 
> remain as they are.
> 
> Hans

As you suggested, I will give a try to LMTX but be aware most user still use 
MKIV until most distros upgrade the texlive version of context to LMTX.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: Why overbar is so big

2023-08-12 Thread Hans Hagen via ntg-context

On 8/12/2023 11:46 AM, Wolfgang Schuster wrote:

Hans Hagen via ntg-context schrieb am 12.08.2023 um 11:13:

On 8/12/2023 10:10 AM, Xavier B. wrote:

The font is the default:
\setupbodyfont [modern, 12pt] % modern o cmr, 11pt

I use Linux (arch derivative).

Looks ok here (see atached). Does the modern-math.lfg file have:

    AccentTopShiftUp = -60,
    FlattenedAccentTopShiftUp    = -60,

I assume it has the same lm math font as we use.


Do you test with Luatex?


Only when asked.

The output with Luametatex is correct but Luatex creates a raised bar 
(and different linebreaking).

\showglyphs

\startTEXpage[offset=1ex]
\ruledhbox{$\overline{OA} = \overbar  {OA} = 4.2$}
\par
\ruledhbox{$\underline   {OA} = \underbar {OA} = 4.2$}
\par
\ruledhbox{$\widetilde   {OA} = \widebar  {OA} = 4.2$}
\par
\ruledhbox{$\overbracket {OA} = \underbracket {OA} = 4.2$}
\stopTEXpage

I'll add a 'force fix in spite of extensible being present' in mkiv. In 
lmtx we always fix also because we drop in nicer shapes (watch the round 
tips in lm and fancy tips in antykwa) and concluded that fonts will 
remain as they are.


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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Why overbar is so big

2023-08-12 Thread Wolfgang Schuster

Hans Hagen via ntg-context schrieb am 12.08.2023 um 11:13:

On 8/12/2023 10:10 AM, Xavier B. wrote:

The font is the default:
\setupbodyfont [modern, 12pt] % modern o cmr, 11pt

I use Linux (arch derivative).

Looks ok here (see atached). Does the modern-math.lfg file have:

    AccentTopShiftUp = -60,
    FlattenedAccentTopShiftUp    = -60,

I assume it has the same lm math font as we use.


Do you test with Luatex?

The output with Luametatex is correct but Luatex creates a raised bar 
(and different linebreaking).


Wolfgang

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Why overbar is so big

2023-08-12 Thread Xavier B.
The font is the default:
\setupbodyfont [modern, 12pt] % modern o cmr, 11pt

I use Linux (arch derivative).

Xavier

On Fri, 11 Aug 2023 21:38:00 +0200
"Xavier B."  ha escrit:

> If you run
> 
> \starttext
> 
> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod 
> tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, 
> quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 
> consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse 
> cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non 
> proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
> $\overbar{OA} = 4,2$
> \stoptext
> 
> Then the overbar has the bar in a very long altitude.
> Can you please, see the output attached.
> 
> Thanks in advance,
> Xavier
> 
> PS: I use context version:mtx-context | ConTeXt Process Management 1.04
> mtx-context |
> mtx-context | main context file: 
> /usr/share/texmf-dist/tex/context/base/mkiv/context.mkiv
> mtx-context | current version: 2023.03.10 12:15
> mtx-context | main context file: 
> /usr/share/texmf-dist/tex/context/base/mkxl/context.mkxl
> mtx-context | current version: 2023.03.10 12:15
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: Why overbar is so big

2023-08-11 Thread Thangalin
Looks fine to me.

Current version: 2023.08.10 02:59

Running on Linux.

What fonts are you using?

On Fri, Aug 11, 2023 at 12:38 PM Xavier B.  wrote:

> If you run
>
> \starttext
>
> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
> tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
> veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
> commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
> velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
> cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
> est laborum.
> $\overbar{OA} = 4,2$
> \stoptext
>
> Then the overbar has the bar in a very long altitude.
> Can you please, see the output attached.
>
> Thanks in advance,
> Xavier
>
> PS: I use context version:mtx-context | ConTeXt Process Management 1.04
> mtx-context |
> mtx-context | main context file:
> /usr/share/texmf-dist/tex/context/base/mkiv/context.mkiv
> mtx-context | current version: 2023.03.10 12:15
> mtx-context | main context file:
> /usr/share/texmf-dist/tex/context/base/mkxl/context.mkxl
> mtx-context | current version: 2023.03.10 12:15
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___


t.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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Why overbar is so big

2023-08-11 Thread Xavier B.
If you run

\starttext

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor 
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis 
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu 
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in 
culpa qui officia deserunt mollit anim id est laborum.
$\overbar{OA} = 4,2$
\stoptext

Then the overbar has the bar in a very long altitude.
Can you please, see the output attached.

Thanks in advance,
Xavier

PS: I use context version:mtx-context | ConTeXt Process Management 1.04
mtx-context |
mtx-context | main context file: 
/usr/share/texmf-dist/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2023.03.10 12:15
mtx-context | main context file: 
/usr/share/texmf-dist/tex/context/base/mkxl/context.mkxl
mtx-context | current version: 2023.03.10 12:15


c.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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Tracker for hyphens at the end of lines

2023-08-09 Thread denis.maier
Keith, you can also check hyphenations using a script:

-- check-hyphens.lua
--[[ 
analyze hyphenations based on a ConTeXt log file
enable hyphenation tracking in the ConTeXt file with
\enabletrackers[hyphenation.applied]
then run this script with
lua check-hyphens.lua input_file whitelist.ending
for the input_file we assume .log, so no need to add this
for the whitelist a file ending has to be supplied
the whitelist is optional
]] 

-- local lines = string.splitlines(io.loaddata("oeps.tex")or "") or { }

-- local pprint = require('pprint')

function main (input_file, whitelist_file)
local lines = lines_from(input_file .. ".log")
local whitelist = {}
if whitelist_file == nil then
whitelist = {}
else 
whitelist = lines_from(whitelist_file)
end
--pprint (lines)
--pprint (whitelist)
local filteredWordlist = filterHyphenationsWordlist
(cleanLines
(getHyphenationLines(lines)), 
whitelist)
-- pprint(filteredWordlist)
saveResultsToFile(filteredWordlist, 'check-hyphens.log')
end

-- see if the file exists

-- http://lua-users.org/wiki/FileInputOutput

-- see if the file exists
function file_exists(file)
local f = io.open(file, "rb")
if f then f:close() end
return f ~= nil
end
  
-- get all lines from a file, returns an empty 
-- list/table if the file does not exist
function lines_from(file)
if not file_exists(file) then return {} end
local lines = {}
for line in io.lines(file) do 
lines[#lines + 1] = line
end
return lines
end

-- String testing
function starts_with(str, start)
return str:sub(1, #start) == start
end

-- get relevant lines
function getHyphenationLines(lines)
local lines_with_hyphenations = {}
for k,v in pairs(lines) do
if 
(starts_with(v, "hyphenated") 
and not string.find(v, "start hyphenated words") 
and not string.find(v, "stop hyphenated words"))
then table.insert(lines_with_hyphenations, v) end
end
return lines_with_hyphenations
end

-- String cleaning
-- wrapper functions

function cleanLines (xs)
local cleanedLines = {}
for k,v in pairs(xs) do
table.insert(cleanedLines, cleanLine(v))
end
return cleanedLines
end

function cleanLine (x)
return removeTrailingPunctuation(getWord(x))
end

-- 1. Start reading at colon 
function getWord(x)
-- wir lesen aber Zeichen 26
return string.sub(x,26)
end

-- 2. Remove trailing punctuation
function removeTrailingPunctuation (x)
if string.find(x, ',') then
return x:sub(1, -2)
else
return x
end
end

-- test if word is in second list
function inList (x, list)
for k,v in ipairs(list) do
if v == x then
return true
end
end
return nil
end

-- Filter hyphenated words based on second list (whitelist)
function filterHyphenationsWordlist (xs, list)
local result = {}
for k,v in ipairs(xs) do
if not inList(v, list) then table.insert (result, v) end
end
return result
end

function saveResultsToFile(results, output_file)
-- Opens a file in write mode
output_file = io.open("check_hyphens.log", "w")
-- sets the default output file as output_file
io.output(output_file)
-- iterate oiver 
for k,v in ipairs(results) do
io.write(v..'\n')
end
-- closes the open file
io.close(output_file)
end

-- Run
main(arg[1], arg[2])

> -Ursprüngliche Nachricht-
> Von: Keith McKay 
> Gesendet: Dienstag, 1. August 2023 20:22
> An: mailing list for ConTeXt users 
> Betreff: [NTG-context] Re: Tracker for hyphens at the end of lines
> 
> Thanks Hans!
> 
> I'm never disappointed, always amazed with ConTeXt!
> 
> This is just what I was looking for.
> 
> Best Wishes
> 
> Keith McKay
> 
> On 01/08/2023 18:10, Hans Hagen via ntg-context wrote:
> > On 8/1/2023 4:54 PM, Keith McKay wrote:
> >> Hi colleagues,
> >>
> >> Is there a tracker for highlighting hyphens at the end of lines
> >> similar the way underfull and overfull boxes can be displayed with a
> >> coloured bar at the end of the offending line?
> >>
> >> I have looked at the wiki page "Reviewing hyphenation" and it has a
> >> solution for mkii from 2009 which, I would think, won't be suitable
> >> for present day ConTeXt. I have tried searching for hyphens using
> >> Skim and Adobe Acrobate viewers but although they find hyphenation in
> >> line they don't recognise hyphens at the edge of lines.
> >>
> >> Any help would be appreciated.
> > I suppose y

[NTG-context] Re: Tracker for hyphens at the end of lines

2023-08-01 Thread Keith McKay

Thanks Hans!

I'm never disappointed, always amazed with ConTeXt!

This is just what I was looking for.

Best Wishes

Keith McKay

On 01/08/2023 18:10, Hans Hagen via ntg-context wrote:

On 8/1/2023 4:54 PM, Keith McKay wrote:

Hi colleagues,

Is there a tracker for highlighting hyphens at the end of lines 
similar the way underfull and overfull boxes can be displayed with a 
coloured bar at the end of the offending line?


I have looked at the wiki page "Reviewing hyphenation" and it has a 
solution for mkii from 2009 which, I would think, won't be suitable  
for present day ConTeXt. I have tried searching for hyphens using 
Skim and Adobe Acrobate viewers but although they find hyphenation in 
line they don't recognise hyphens at the edge of lines.


Any help would be appreciated.

I suppose you would be disappointed it there was no tracker ...

\enabletrackers[hyphenation.applied.console]
\enabletrackers[hyphenation.applied.visualize]

you even get a file with the hyphenated words

You can see all of them with

\disabledirectives[backend.cleanup.flatten]
\bitwiseflip \normalizelinemode -\flattendiscretionariesnormalizecode
\showmakeup[discretionary]

weren't it that i had to provide the directive for this to work well 
(disbale flattening) so for that you have to wait till we update


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://www.ntg.nl/mailman/listinfo/ntg-context

webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Tracker for hyphens at the end of lines

2023-08-01 Thread Hans Hagen via ntg-context

On 8/1/2023 4:54 PM, Keith McKay wrote:

Hi colleagues,

Is there a tracker for highlighting hyphens at the end of lines similar 
the way underfull and overfull boxes can be displayed with a coloured 
bar at the end of the offending line?


I have looked at the wiki page "Reviewing hyphenation" and it has a 
solution for mkii from 2009 which, I would think, won't be suitable  for 
present day ConTeXt. I have tried searching for hyphens using Skim and 
Adobe Acrobate viewers but although they find hyphenation in line they 
don't recognise hyphens at the edge of lines.


Any help would be appreciated.

I suppose you would be disappointed it there was no tracker ...

\enabletrackers[hyphenation.applied.console]
\enabletrackers[hyphenation.applied.visualize]

you even get a file with the hyphenated words

You can see all of them with

\disabledirectives[backend.cleanup.flatten]
\bitwiseflip \normalizelinemode -\flattendiscretionariesnormalizecode
\showmakeup[discretionary]

weren't it that i had to provide the directive for this to work well 
(disbale flattening) so for that you have to wait till we update


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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Tracker for hyphens at the end of lines

2023-08-01 Thread Keith McKay

Hi colleagues,

Is there a tracker for highlighting hyphens at the end of lines similar 
the way underfull and overfull boxes can be displayed with a coloured 
bar at the end of the offending line?


I have looked at the wiki page "Reviewing hyphenation" and it has a 
solution for mkii from 2009 which, I would think, won't be suitable  for 
present day ConTeXt. I have tried searching for hyphens using Skim and 
Adobe Acrobate viewers but although they find hyphenation in line they 
don't recognise hyphens at the edge of lines.


Any help would be appreciated.

Keith McKay

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: MP setup for a progress bar

2023-07-05 Thread Aditya Mahajan
On Tue, 4 Jul 2023, Henning Hraban Ramm wrote:

> Thanks to Taco, Robbert and Jules for their work!
> 
> 
> I used the downtime to setup a presentation style with a progress bar in the
> footer. But I get the same (first page) graphics on all pages, and the footer
> background appears under the text area as well as under the margins.

Also see:

https://github.com/adityam/visualcounter

There is a simple progress bar and the documentation shows how to create your 
own as well. 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: {\rm foo {\it bar}}

2023-07-05 Thread Henning Hraban Ramm

Am 05.07.23 um 07:57 schrieb Gerben Wierda:

And the reason probably is that the font is defined as sans serif [ss]?


Well, if you only define a sans font, \rm is somewhat undefined.

You call the upright variant with \tf; \rm switches to the serif font.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: MP setup for a progress bar

2023-07-05 Thread Henning Hraban Ramm

Am 04.07.23 um 22:53 schrieb Wolfgang Schuster:

Henning Hraban Ramm schrieb am 04.07.2023 um 22:24:


I used the downtime to setup a presentation style with a progress bar 
in the footer. But I get the same (first page) graphics on all pages, 
and the footer background appears under the text area as well as under 
the margins.


* I thought \useMPgraphics would be enough to re-calculate on every page?
* How can I set a background to the footer area, but page width?
* I tried \overlaywidth as well as OverlayWidth in the MP graphic – 
how do I get the page size?


You need \setupbackgrounds[state=repeat].


Thank you!
But \setupbackgrounds[footer][text][background=Blocks,state=repeat] 
doesn’t work.

Does this make sense if I don’t want layers in _all_ areas to repeat?


\setuppapersize[SW]

\startuseMPgraphic{Blocks}
fill unitsquare xysized (OverlayWidth * PageNumber / LastPageNumber, 
OverlayHeight) withcolor blue;


Thank you – so RealPageNumber/NOfPages was wrong? I got that from 
simpleslides.


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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: {\rm foo {\it bar}}

2023-07-04 Thread Gerben Wierda
And the reason probably is that the font is defined as sans serif [ss]?Sent from my iPhoneOn 5 Jul 2023, at 00:12, Gerben Wierda  wrote:Found it (I think)\definefontfamily defines tf= but the text says \rmIf I use \tf in the text it works.If I use \rm in the text it works for default Latin Modern but not for any font defined. This is true regardless of using rm= or tf= in the definition.So, it seems to be the combination of using definefontfamily and \rmOn 4 Jul 2023, at 23:48, Gerben Wierda  wrote:Also doesn't work with ConTeXt  ver: 2023.06.22 14:13 LMTX  fmt: 2023.7.4  int: english/englishOn 4 Jul 2023, at 23:42, Gerben Wierda  wrote:On 4 Jul 2023, at 23:26, Wolfgang Schuster  wrote:Gerben Wierda schrieb am 04.07.2023 um 23:17:After erasing the font cache and regenerating LM was doing it right again.Helvetica did not, but maybe I made a mistake in\definefontfamily  [helvetica]  [ss]  [Helvetica]  [tf=style:Regular,   bf=style:Bold,   it=style:Oblique,   bi=style:Bold Oblique]Does it work when you remove the manual assignments to tf, it, etc. or when you use lowercase names (without spaces), e.g. "bi=boldoblique" (or "bi=bolditalic").No and no. With th elatter it doesn't load Helvetica at all, Error shown:selectfont      > the requested font 'Helvetica' has no files for the 'tf' alternative, Latin Modern is used instead.mkiv lua stats  > loaded fonts: 4 files: latinmodern-math.otf, lmroman10-italic.otf, lmroman10-regular.otf, lmsans10-regular.otfWith my original it does load (but no italic):mkiv lua stats  > loaded fonts: 4 files: helvetica.ttc, latinmodern-math.otf, lmroman10-italic.otf, lmroman10-regular.otfErase cache, regenerate formats, reload fonts (force) does give another (probably unrelated) error:fonts           | names | identifying system font files with suffix 'ttf'fonts           | names | globbing path '/Library/Fonts/**.ttf'fonts           | names | globbing path '/System/Library/Fonts/**.ttf'otf reader      | fatal error in file '/System/Library/Fonts/SFCompactRounded.ttf': ...-64/tex/texmf-context/tex/context/base/mkiv/font-dsp.lua:3689: attempt to index a nil value (field '?')stack traceback:	...-64/tex/texmf-context/tex/context/base/mkiv/font-otr.lua:2344: in metamethod 'index'	...-64/tex/texmf-context/tex/context/base/mkiv/font-dsp.lua:3689: in local 'reader'	...-64/tex/texmf-context/tex/context/base/mkiv/font-otr.lua:2089: in upvalue 'readtable'Gerben Wierda (LinkedIn, Mastodon)R&A IT Strategy (main site)Book: Chess and the Art of Enterprise ArchitectureBook: Mastering ArchiMate___If your question is of interest to others as well, please add an entry to the Wiki!maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-contextwebpage  : https://www.pragma-ade.nl / http://context.aanhet.netarchive  : https://bitbucket.org/phg/context-mirror/commits/wiki : https://contextgarden.net___
Gerben Wierda (LinkedIn, Mastodon)R&A IT Strategy (main site)Book: Chess and the Art of Enterprise ArchitectureBook: Mastering ArchiMate

___If your question is of interest to others as well, please add an entry to the Wiki!maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-contextwebpage  : https://www.pragma-ade.nl / http://context.aanhet.netarchive  : https://bitbucket.org/phg/context-mirror/commits/wiki : https://contextgarden.net___
Gerben Wierda (LinkedIn, Mastodon)R&A IT Strategy (main site)Book: Chess and the Art of Enterprise ArchitectureBook: Mastering ArchiMate

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: {\rm foo {\it bar}}

2023-07-04 Thread Gerben Wierda
Found it (I think)

\definefontfamily defines tf= but the text says \rm

If I use \tf in the text it works.
If I use \rm in the text it works for default Latin Modern but not for any font 
defined. This is true regardless of using rm= or tf= in the definition.

So, it seems to be the combination of using definefontfamily and \rm

> On 4 Jul 2023, at 23:48, Gerben Wierda  wrote:
> 
> Also doesn't work with ConTeXt  ver: 2023.06.22 14:13 LMTX  fmt: 2023.7.4  
> int: english/english
> 
>> On 4 Jul 2023, at 23:42, Gerben Wierda > > wrote:
>> 
>> 
>> 
>>> On 4 Jul 2023, at 23:26, Wolfgang Schuster 
>>> >> > wrote:
>>> 
>>> Gerben Wierda schrieb am 04.07.2023 um 23:17:
 After erasing the font cache and regenerating LM was doing it right again.
 
 Helvetica did not, but maybe I made a mistake in
 
 \definefontfamily
   [helvetica]
   [ss]
   [Helvetica]
   [tf=style:Regular,
bf=style:Bold,
it=style:Oblique,
bi=style:Bold Oblique]
>>> 
>>> Does it work when you remove the manual assignments to tf, it, etc. or when 
>>> you use lowercase names (without spaces), e.g. "bi=boldoblique" (or 
>>> "bi=bolditalic").
>> 
>> No and no. With th elatter it doesn't load Helvetica at all, Error shown:
>> selectfont  > the requested font 'Helvetica' has no files for the 'tf' 
>> alternative, Latin Modern is used instead.
>> mkiv lua stats  > loaded fonts: 4 files: latinmodern-math.otf, 
>> lmroman10-italic.otf, lmroman10-regular.otf, lmsans10-regular.otf
>> 
>> With my original it does load (but no italic):
>> mkiv lua stats  > loaded fonts: 4 files: helvetica.ttc, 
>> latinmodern-math.otf, lmroman10-italic.otf, lmroman10-regular.otf
>> 
>> 
>> Erase cache, regenerate formats, reload fonts (force) does give another 
>> (probably unrelated) error:
>> 
>> fonts   | names | identifying system font files with suffix 'ttf'
>> fonts   | names | globbing path '/Library/Fonts/**.ttf'
>> fonts   | names | globbing path '/System/Library/Fonts/**.ttf'
>> otf reader  | fatal error in file 
>> '/System/Library/Fonts/SFCompactRounded.ttf': 
>> ...-64/tex/texmf-context/tex/context/base/mkiv/font-dsp.lua:3689: attempt to 
>> index a nil value (field '?')
>> stack traceback:
>>  ...-64/tex/texmf-context/tex/context/base/mkiv/font-otr.lua:2344: in 
>> metamethod 'index'
>>  ...-64/tex/texmf-context/tex/context/base/mkiv/font-dsp.lua:3689: in 
>> local 'reader'
>>  ...-64/tex/texmf-context/tex/context/base/mkiv/font-otr.lua:2089: in 
>> upvalue 'readtable'
>> 
>> 
>> Gerben Wierda (LinkedIn , Mastodon 
>> )
>> R&A IT Strategy  (main site)
>> Book: Chess and the Art of Enterprise Architecture 
>> 
>> Book: Mastering ArchiMate 
>> 
>> ___
>> If your question is of interest to others as well, please add an entry to 
>> the Wiki!
>> 
>> maillist : ntg-context@ntg.nl  / 
>> https://www.ntg.nl/mailman/listinfo/ntg-context 
>> 
>> webpage  : https://www.pragma-ade.nl  / 
>> http://context.aanhet.net 
>> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
>> 
>> wiki : https://contextgarden.net 
>> ___
> 
> Gerben Wierda (LinkedIn , Mastodon 
> )
> R&A IT Strategy  (main site)
> Book: Chess and the Art of Enterprise Architecture 
> 
> Book: Mastering ArchiMate 
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___

Gerben Wierda (LinkedIn , Mastodon 
)
R&A IT Strategy  (main site)
Book: Chess and the Art of Enterprise Architecture 
Book: Mastering ArchiMate 

___
If your question is of inte

[NTG-context] Re: {\rm foo {\it bar}}

2023-07-04 Thread Gerben Wierda
Also doesn't work with ConTeXt  ver: 2023.06.22 14:13 LMTX  fmt: 2023.7.4  int: 
english/english

> On 4 Jul 2023, at 23:42, Gerben Wierda  wrote:
> 
> 
> 
>> On 4 Jul 2023, at 23:26, Wolfgang Schuster 
>> > > wrote:
>> 
>> Gerben Wierda schrieb am 04.07.2023 um 23:17:
>>> After erasing the font cache and regenerating LM was doing it right again.
>>> 
>>> Helvetica did not, but maybe I made a mistake in
>>> 
>>> \definefontfamily
>>>   [helvetica]
>>>   [ss]
>>>   [Helvetica]
>>>   [tf=style:Regular,
>>>bf=style:Bold,
>>>it=style:Oblique,
>>>bi=style:Bold Oblique]
>> 
>> Does it work when you remove the manual assignments to tf, it, etc. or when 
>> you use lowercase names (without spaces), e.g. "bi=boldoblique" (or 
>> "bi=bolditalic").
> 
> No and no. With th elatter it doesn't load Helvetica at all, Error shown:
> selectfont  > the requested font 'Helvetica' has no files for the 'tf' 
> alternative, Latin Modern is used instead.
> mkiv lua stats  > loaded fonts: 4 files: latinmodern-math.otf, 
> lmroman10-italic.otf, lmroman10-regular.otf, lmsans10-regular.otf
> 
> With my original it does load (but no italic):
> mkiv lua stats  > loaded fonts: 4 files: helvetica.ttc, latinmodern-math.otf, 
> lmroman10-italic.otf, lmroman10-regular.otf
> 
> 
> Erase cache, regenerate formats, reload fonts (force) does give another 
> (probably unrelated) error:
> 
> fonts   | names | identifying system font files with suffix 'ttf'
> fonts   | names | globbing path '/Library/Fonts/**.ttf'
> fonts   | names | globbing path '/System/Library/Fonts/**.ttf'
> otf reader  | fatal error in file 
> '/System/Library/Fonts/SFCompactRounded.ttf': 
> ...-64/tex/texmf-context/tex/context/base/mkiv/font-dsp.lua:3689: attempt to 
> index a nil value (field '?')
> stack traceback:
>   ...-64/tex/texmf-context/tex/context/base/mkiv/font-otr.lua:2344: in 
> metamethod 'index'
>   ...-64/tex/texmf-context/tex/context/base/mkiv/font-dsp.lua:3689: in 
> local 'reader'
>   ...-64/tex/texmf-context/tex/context/base/mkiv/font-otr.lua:2089: in 
> upvalue 'readtable'
> 
> 
> Gerben Wierda (LinkedIn , Mastodon 
> )
> R&A IT Strategy  (main site)
> Book: Chess and the Art of Enterprise Architecture 
> 
> Book: Mastering ArchiMate 
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl  / 
> https://www.ntg.nl/mailman/listinfo/ntg-context 
> 
> webpage  : https://www.pragma-ade.nl  / 
> http://context.aanhet.net 
> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
> 
> wiki : https://contextgarden.net 
> ___

Gerben Wierda (LinkedIn , Mastodon 
)
R&A IT Strategy  (main site)
Book: Chess and the Art of Enterprise Architecture 
Book: Mastering ArchiMate 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: {\rm foo {\it bar}}

2023-07-04 Thread Gerben Wierda


> On 4 Jul 2023, at 23:26, Wolfgang Schuster 
>  wrote:
> 
> Gerben Wierda schrieb am 04.07.2023 um 23:17:
>> After erasing the font cache and regenerating LM was doing it right again.
>> 
>> Helvetica did not, but maybe I made a mistake in
>> 
>> \definefontfamily
>>   [helvetica]
>>   [ss]
>>   [Helvetica]
>>   [tf=style:Regular,
>>bf=style:Bold,
>>it=style:Oblique,
>>bi=style:Bold Oblique]
> 
> Does it work when you remove the manual assignments to tf, it, etc. or when 
> you use lowercase names (without spaces), e.g. "bi=boldoblique" (or 
> "bi=bolditalic").

No and no. With th elatter it doesn't load Helvetica at all, Error shown:
selectfont  > the requested font 'Helvetica' has no files for the 'tf' 
alternative, Latin Modern is used instead.
mkiv lua stats  > loaded fonts: 4 files: latinmodern-math.otf, 
lmroman10-italic.otf, lmroman10-regular.otf, lmsans10-regular.otf

With my original it does load (but no italic):
mkiv lua stats  > loaded fonts: 4 files: helvetica.ttc, latinmodern-math.otf, 
lmroman10-italic.otf, lmroman10-regular.otf


Erase cache, regenerate formats, reload fonts (force) does give another 
(probably unrelated) error:

fonts   | names | identifying system font files with suffix 'ttf'
fonts   | names | globbing path '/Library/Fonts/**.ttf'
fonts   | names | globbing path '/System/Library/Fonts/**.ttf'
otf reader  | fatal error in file 
'/System/Library/Fonts/SFCompactRounded.ttf': 
...-64/tex/texmf-context/tex/context/base/mkiv/font-dsp.lua:3689: attempt to 
index a nil value (field '?')
stack traceback:
...-64/tex/texmf-context/tex/context/base/mkiv/font-otr.lua:2344: in 
metamethod 'index'
...-64/tex/texmf-context/tex/context/base/mkiv/font-dsp.lua:3689: in 
local 'reader'
...-64/tex/texmf-context/tex/context/base/mkiv/font-otr.lua:2089: in 
upvalue 'readtable'


Gerben Wierda (LinkedIn , Mastodon 
)
R&A IT Strategy  (main site)
Book: Chess and the Art of Enterprise Architecture 
Book: Mastering ArchiMate 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: {\rm foo {\it bar}}

2023-07-04 Thread Bruce Horrocks


> On 30 Jun 2023, at 10:47, Gerben Wierda  wrote:
> 
> If I typeset
> 
> {\rm foo{\it bar}}
> 
> bar is not in italic

It is in italic for me in ConTeXt  ver: 2023.06.04 

> if I typeset
> 
> {\it bar}
> 
> it is.
> 
> What am I missing?
> 
> Gerben Wierda (LinkedIn, Mastodon)
> R&A IT Strategy (main site)
> Book: Chess and the Art of Enterprise Architecture
> Book: Mastering ArchiMate

—
Bruce Horrocks
Hampshire, UK

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: {\rm foo {\it bar}}

2023-07-04 Thread Wolfgang Schuster

Gerben Wierda schrieb am 04.07.2023 um 23:17:
After erasing the font cache and regenerating LM was doing it right 
again.


Helvetica did not, but maybe I made a mistake in

\definefontfamily
[helvetica]
  [ss]
[Helvetica]
[tf=style:Regular,
   bf=style:Bold,
   it=style:Oblique,
bi=style:Bold Oblique]


Does it work when you remove the manual assignments to tf, it, etc. or 
when you use lowercase names (without spaces), e.g. "bi=boldoblique" (or 
"bi=bolditalic").


Wolfgang

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: {\rm foo {\it bar}}

2023-07-04 Thread Gerben Wierda
After erasing the font cache and regenerating LM was doing it right again.

Helvetica did not, but maybe I made a mistake in

\definefontfamily
  [helvetica]
  [ss]
  [Helvetica]
  [tf=style:Regular,
   bf=style:Bold,
   it=style:Oblique,
   bi=style:Bold Oblique]

\starttext
{\rm The quick brown fox jumped over the lazy dog {\it Optima}}
\setupbodyfont[helvetica]
{\rm The quick brown fox jumped over the lazy dog {\it Optima}}
\stoptext


> On 4 Jul 2023, at 22:52, Bruce Horrocks  wrote:
> 
> 
> 
>> On 30 Jun 2023, at 10:47, Gerben Wierda > <mailto:gerben.wie...@rna.nl>> wrote:
>> 
>> If I typeset
>> 
>> {\rm foo{\it bar}}
>> 
>> bar is not in italic
> 
> It is in italic for me in ConTeXt  ver: 2023.06.04 
> 
>> if I typeset
>> 
>> {\it bar}
>> 
>> it is.
>> 
>> What am I missing?
>> 
>> Gerben Wierda (LinkedIn, Mastodon)
>> R&A IT Strategy (main site)
>> Book: Chess and the Art of Enterprise Architecture
>> Book: Mastering ArchiMate
> 
> —
> Bruce Horrocks
> Hampshire, UK

Gerben Wierda (LinkedIn <https://www.linkedin.com/in/gerbenwierda>, Mastodon 
<https://newsie.social/@gctwnl>)
R&A IT Strategy <https://ea.rna.nl/> (main site)
Book: Chess and the Art of Enterprise Architecture <https://ea.rna.nl/the-book/>
Book: Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/>

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: MP setup for a progress bar

2023-07-04 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 04.07.2023 um 22:24:

Thanks to Taco, Robbert and Jules for their work!


I used the downtime to setup a presentation style with a progress bar 
in the footer. But I get the same (first page) graphics on all pages, 
and the footer background appears under the text area as well as under 
the margins.


* I thought \useMPgraphics would be enough to re-calculate on every page?
* How can I set a background to the footer area, but page width?
* I tried \overlaywidth as well as OverlayWidth in the MP graphic – 
how do I get the page size?


You need \setupbackgrounds[state=repeat].

\setuppapersize[SW]

\startuseMPgraphic{Blocks}
fill unitsquare xysized (OverlayWidth * PageNumber / LastPageNumber, 
OverlayHeight) withcolor blue;

%setbounds currentpicture to OverlayBox;
\stopuseMPgraphic

\defineoverlay[Blocks][\useMPgraphic{Blocks}]

\setupbackgrounds[state=repeat]

\setupbackgrounds[footer][text][background=Blocks]

\starttext

\dorecurse{10}{\recurselevel\page}

\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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] MP setup for a progress bar

2023-07-04 Thread Henning Hraban Ramm

Thanks to Taco, Robbert and Jules for their work!


I used the downtime to setup a presentation style with a progress bar in 
the footer. But I get the same (first page) graphics on all pages, and 
the footer background appears under the text area as well as under the 
margins.


* I thought \useMPgraphics would be enough to re-calculate on every page?
* How can I set a background to the footer area, but page width?
* I tried \overlaywidth as well as OverlayWidth in the MP graphic – how 
do I get the page size?


"""
\setuppapersize[SW]

\startuseMPgraphic{Blocks}
fill unitsquare xysized (800 * RealPageNumber/NOfPages, 50) withcolor blue;
\stopuseMPgraphic

\defineoverlay[Blocks][\useMPgraphic{Blocks}]

\setupbackgrounds[footer][background={Blocks}]

\starttext

\dorecurse{10}{\recurselevel\page}

\stoptext
"""

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] {\rm foo {\it bar}}

2023-07-04 Thread Gerben Wierda
If I typeset

{\rm foo{\it bar}}

bar is not in italic

if I typeset

{\it bar}

it is.

What am I missing?

Gerben Wierda (LinkedIn <https://www.linkedin.com/in/gerbenwierda>, Mastodon 
<https://newsie.social/@gctwnl>)
R&A IT Strategy <https://ea.rna.nl/> (main site)
Book: Chess and the Art of Enterprise Architecture <https://ea.rna.nl/the-book/>
Book: Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/>

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

Re: [NTG-context] right and left arrowfill

2023-06-23 Thread Carlos via ntg-context
On Fri, Jun 23, 2023 at 01:38:23PM +0200, Hans Hagen via ntg-context wrote:
> On 6/23/2023 12:43 PM, Carlos via ntg-context wrote:
> > On Thu, Jun 22, 2023 at 03:32:25PM +0200, Hans van der Meer via ntg-context 
> > wrote:
> > > \starttext
> > > x \rightarrowfill x
> > > 
> > > x \leftarrowfill x
> > > 
> > > hbox to 5cm:
> > > 
> > > y\hbox to5cm{\rightarrowfill}y
> > > 
> > > y\hbox to5cm{\leftarrowfill}y
> > > \stoptext
> > > 
> > > But obviously not in an dimensioned \hbox, whereas Knuth's version does 
> > > that too.
> > > 
> > > 
> > > 
> > > > On 22 Jun 2023, at 15:11, Hans Hagen via ntg-context 
> > > >  wrote:
> > > > 
> > > > x \rightarrowfill x
> > > > 
> > > > x \leftarrowfill x
> > > 
> > > yours sincerely
> > > dr. Hans van der Meer
> > > 
> > > 
> > 
> > I find this interesting. I agree with Hans vdM.
> > 
> > So what would be the acceptable standard given an x length of a glue?
> > 
> > In the above examples, it's all preset.
> > 
> > Is a rule of thumb — no pun intended here — to apply thereafter
> > a glue, in this case a \vrule that follows the box and precedes the
> > other glue? that is, the \rightarrowfill or \leftarrowfill?
> > 
> > I mean. Once you get the glues messed up, the whole box crumbles.
> 
> I'm not sure how you can mess up glue so that the box is no longer a box.
> Boxes remain boxes.

I guess that's the same mentality behind a fixed glue in LMTX, while
trying not to mess up the box. Back to point A and the main reason of the
op's question. 

Then again, the only way to resemble what TeX does is by re/defining
and copied verbatim from The TeXbook  both rightarrowfill and
leftarrowfill

and unlike with TeX in which an 

\hbox to 1in{\vrule \rightarrowfill \ 1cm \leftarrowfill\vrule} 

it says 1cm but it'd be more than that, and accurately so 


> 
> > How good would \meaning be here, notwithstanding the valuable info of
> > the macro it provides, if it can't print out, let alone source it up,
> > the more accurate dimension, let alone the measurement.
> 
> I don't follow. Does this come from ChapGPT?
> 

That's funny. 

But as chatgpt says:
"Sorry about that. \meaning\rightarrowfill is 
\begingroup \scratchunicode 8594\relax \adaptivebox [mathfiller][alterna­
tive=8594]{\hss \strut \hss }\endgroup "

That's what lmtx returned after Hans vdM sample


> > So, one would need to know the preset layout of the page to have an idea
> > about it?
> > 
> > Hans H. pulled the old modified trick of 'works here'.
> 
> Well, when used in a paragraph it works indeed. No trick involved. But as it
> uses a specific mechanism in an hbox you need to trigger that (unless you
> want to add overhead that will kake tex crawl).
> 
> > Like a magician… now all of a sudden evetything works, but unlike TeX's
> 
> Not sure what this refers to. Much of TeX is magick but what is bad about
> that?
> 
> > \hbox to 1in{\vrule \rightarrowfill \ 1in \leftarrowfill\vrule}
> > 
> > or
> > 
> > \hbox to 1cm{\vrule \rightarrowfill \ 1cm \leftarrowfill\vrule}
> > 
> > which gives an accurate description, not to mention measurement,
> 
> It depends on what you expect. First of all, your assumption that the arrow
> fill is the same as in plain tex is wrong.

Why would it be wrong? 

When I type 

\hbox to 3cm{\rightarrowfill} without a vrule

that's what I would normally expect


> 
> (1) one can define an arrow fill using a leader that uses some (happen to be
> present in tex math fonts) glyphs: repeated minuses followed by some magic
> kern and an arrow head.
> 

Can you apply it to pagination without breaking? 

Highly doubt it.


> (2) You can hope that the magick kern is right and that the minus aligns
> with the arrows bar.
> 
> (3) You also assume that the math font matches the text font.
> 
> (4) Normally an arrow fill is something math anyway. Where there can also be
> something on top or below, or where it can be a top or bottom accent.
> 
> > a
> > 
> > \vbox to 5pt{x\vrule\rightarrowfill \ x \leftarrowfill\vrule\ x}
> > 
> > or
> > 
> > x \rightarrowfill x
> > x \leftarrowfill x
> > 
> > or
> > 
> > \vbox to 3pt{x\vrule\rightarrowfill \  \leftarrowfill\vrule\ x}
> > 
> > \ \rightarrowfill \
> > \ \leftarrowfill \
> > 
> > 
> > in LMTX doesn&#x

Re: [NTG-context] right and left arrowfill

2023-06-23 Thread Hans Hagen via ntg-context

On 6/23/2023 12:43 PM, Carlos via ntg-context wrote:

On Thu, Jun 22, 2023 at 03:32:25PM +0200, Hans van der Meer via ntg-context 
wrote:

\starttext
x \rightarrowfill x

x \leftarrowfill x

hbox to 5cm:

y\hbox to5cm{\rightarrowfill}y

y\hbox to5cm{\leftarrowfill}y
\stoptext

But obviously not in an dimensioned \hbox, whereas Knuth's version does that 
too.




On 22 Jun 2023, at 15:11, Hans Hagen via ntg-context  wrote:

x \rightarrowfill x

x \leftarrowfill x


yours sincerely
dr. Hans van der Meer




I find this interesting. I agree with Hans vdM.

So what would be the acceptable standard given an x length of a glue?

In the above examples, it's all preset.

Is a rule of thumb — no pun intended here — to apply thereafter
a glue, in this case a \vrule that follows the box and precedes the
other glue? that is, the \rightarrowfill or \leftarrowfill?

I mean. Once you get the glues messed up, the whole box crumbles.


I'm not sure how you can mess up glue so that the box is no longer a 
box. Boxes remain boxes.



How good would \meaning be here, notwithstanding the valuable info of
the macro it provides, if it can't print out, let alone source it up,
the more accurate dimension, let alone the measurement.


I don't follow. Does this come from ChapGPT?


So, one would need to know the preset layout of the page to have an idea
about it?

Hans H. pulled the old modified trick of 'works here'.


Well, when used in a paragraph it works indeed. No trick involved. But 
as it uses a specific mechanism in an hbox you need to trigger that 
(unless you want to add overhead that will kake tex crawl).



Like a magician… now all of a sudden evetything works, but unlike TeX's


Not sure what this refers to. Much of TeX is magick but what is bad 
about that?



\hbox to 1in{\vrule \rightarrowfill \ 1in \leftarrowfill\vrule}

or

\hbox to 1cm{\vrule \rightarrowfill \ 1cm \leftarrowfill\vrule}

which gives an accurate description, not to mention measurement,


It depends on what you expect. First of all, your assumption that the 
arrow fill is the same as in plain tex is wrong.


(1) one can define an arrow fill using a leader that uses some (happen 
to be present in tex math fonts) glyphs: repeated minuses followed by 
some magic kern and an arrow head.


(2) You can hope that the magick kern is right and that the minus aligns 
with the arrows bar.


(3) You also assume that the math font matches the text font.

(4) Normally an arrow fill is something math anyway. Where there can 
also be something on top or below, or where it can be a top or bottom 
accent.



a

\vbox to 5pt{x\vrule\rightarrowfill \ x \leftarrowfill\vrule\ x}

or

x \rightarrowfill x
x \leftarrowfill x

or

\vbox to 3pt{x\vrule\rightarrowfill \  \leftarrowfill\vrule\ x}

\ \rightarrowfill \
\ \leftarrowfill \


in LMTX doesn't say much

What should it say? You get a space, an arrow and a discarded space.

That said: I think you miss a few points here:

(1) I know Hans vd Meer well and he knows ConTeXt well. He's quite 
capable of figuring out how to use advanced features and I bet he likes 
the following variant of arrows in text. Next time we meet I'll show him 
some more adaptive tricks (although I bet he can figure them out himself).


\starttext

% \setupexternalfigures
%   [location={default,global}]

% \startsetups adaptive:test
% \setbox\usedadaptivebox\hbox to \usedadaptivewidth yoffset 
-\usedadaptivedepth \bgroup

% \externalfigure
%   [cow.pdf]
%   [width=\usedadaptivewidth,
%height=\dimexpr\usedadaptiveheight+\usedadaptivedepth\relax]%
%\egroup
% \stopsetups

\startsetups adaptive:test
\setbox\usedadaptivebox\hbox to \usedadaptivewidth yoffset .25ex 
\bgroup

\startMPcode
drawarrow ((0,0) -- (\the\usedadaptivewidth,0)) randomized 
(ExHeight/2);

\stopMPcode
   \egroup
\stopsetups

\dorecurse{5}{
\dostepwiserecurse{1}{150}{1}{%
this~#1.##1 is~#1.##1 test~#1.##1
{\adaptivebox[strut=yes,setups=adaptive:test]{\strut}}
}
\blank
}

\stoptext

(2) If someone wants a plain (or fot that matter latex) solution then 
one can use these macro packages or write a macro that mimicks 
expectations.


(3) I don't like "Hans H. pulled the old modified trick of 'works 
here'." kind of remarks because they have a rather negative undertone 
and I don't know how to read that.



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, 

Re: [NTG-context] Fallbacks in text font interfere with math accents

2023-06-10 Thread Henning Hraban Ramm via ntg-context

Am 10.06.23 um 19:46 schrieb Mikael Sundqvist via ntg-context:

Hi,

On Sat, Jun 10, 2023 at 10:06 AM Henning Hraban Ramm via ntg-context
 wrote:


Hi, this is probably for Hans & Mikael, but maybe someone else has a hint:

If I set a fallback for my body font to catch all missing characters,
some math accents get replaced by small bold uppercase characters (I
found hat by K and ring by T so far).

I tried [fallbacks=] for math to no avail.

My example uses Cambria, but it’s the same with other fonts.

(BTW, in \bar{b} with Libertinus, the bar looks too high.)


I leave the font fallbacks to Hans or somebody else, but for the \bar
one can argue that the "305 glyph in Libertinus Math sits too high.
This is adjusted for in the goodie file in the next upload.


I could fix a few math accents (e.g. widebar) by limiting my 
replacements to necessary glyphs, but many other problems remain (e.g. 
breve, check, dot, widehat). It also affects the sizing of limiters and 
e.g. underbraces.


Why do font fallbacks for non-math fonts affect math at all?

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Fallbacks in text font interfere with math accents

2023-06-10 Thread Mikael Sundqvist via ntg-context
Hi,

On Sat, Jun 10, 2023 at 10:06 AM Henning Hraban Ramm via ntg-context
 wrote:
>
> Hi, this is probably for Hans & Mikael, but maybe someone else has a hint:
>
> If I set a fallback for my body font to catch all missing characters,
> some math accents get replaced by small bold uppercase characters (I
> found hat by K and ring by T so far).
>
> I tried [fallbacks=] for math to no avail.
>
> My example uses Cambria, but it’s the same with other fonts.
>
> (BTW, in \bar{b} with Libertinus, the bar looks too high.)

I leave the font fallbacks to Hans or somebody else, but for the \bar
one can argue that the "305 glyph in Libertinus Math sits too high.
This is adjusted for in the goodie file in the next upload.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Fallbacks in text font interfere with math accents

2023-06-10 Thread Henning Hraban Ramm via ntg-context

Hi, this is probably for Hans & Mikael, but maybe someone else has a hint:

If I set a fallback for my body font to catch all missing characters, 
some math accents get replaced by small bold uppercase characters (I 
found hat by K and ring by T so far).


I tried [fallbacks=] for math to no avail.

My example uses Cambria, but it’s the same with other fonts.

(BTW, in \bar{b} with Libertinus, the bar looks too high.)

Hraban


\definefontfallback[symbolaFB]
  [file:symbola.otf]
  [0x0-0xF]
  [check=no,force=no]

\definefontfallback[arialFB]
  [name:arialunicodems]
  [0x0-0xF]
  [check=no,force=no,rscale=0.85]

\starttypescript [contextstart]
  \definetypeface [contextstart] [rm] [serif] [cambria]
[default][fallbacks=symbolaFB]
  \definetypeface [contextstart] [ss] [sans]  [segoe]
[default][fallbacks=arialFB]
  \definetypeface [contextstart] [tt] [mono]  [modern]
[default][fallbacks=arialFB]
  \definetypeface [contextstart] [mm] [math]  [cambria]
[default]
\stoptypescript

\setupbodyfont[contextstart,12pt]

\starttext

\im{\hat{H} \widehat{HAT} \bar{b} \widebar{bar}}

\im{\mathring{+} \mathring{±} \mathring{x}}

\stoptext

mathtest.tex
Description: TeX document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Feynman Diagrams

2023-04-12 Thread Aditya Mahajan via ntg-context
al Public License
%% along with this program; if not, write to the Free Software
%% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%% 

%% \CheckSum{924}
%% \CharacterTable
%%  {Upper-case\A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case\a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits\0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \! Double quote  \" Hash (number) \#
%%   Dollar\$ Percent   \% Ampersand \&
%%   Acute accent  \' Left paren\( Right paren   \)
%%   Asterisk  \* Plus  \+ Comma \,
%%   Minus \- Point \. Solidus   \/
%%   Colon \: Semicolon \; Less than \<
%%   Equals\= Greater than  \> Question mark \?
%%   Commercial at \@ Left bracket  \[ Backslash \\
%%   Right bracket \] Circumflex\^ Underscore\_
%%   Grave accent  \` Left brace\{ Vertical bar  \|
%%   Right brace   \} Tilde \~}
%%

def subgraph (expr x, y, wd, ht) =
  begingroup
save c, ne, nw, sw, se;
pair c, ne, nw, sw, se;
sw = (x,y);
se = sw + (wd,0);
nw = sw + (0,ht);
ne = sw + (wd,ht);
c = .5[sw,ne];
enddef;
def endsubgraph =
  endgroup
enddef;
if known cmbase:
  errhelp
"feynmf will only work with plain Metafont, as described in the book.";
  errmessage "feynmf: CMBASE detected.  Please use the PLAIN base.";
  forever:
errmessage "No use in trying!  You'd better eXit now ...";
errorstopmode;
  endfor
fi
vardef parse_RCS (suffix RCS) (expr s) =
  save n, c;
  numeric n, RCS[];
  string c;
  RCS[0] := 0;
  for n = 1 upto length (s):
c := substring (n-1,n) of s;
exitif ((RCS[0] > 0) and (c = " "));
if ((c = "0") or (c = "1") or (c = "2")
or (c = "3") or (c = "4") or (c = "5")
or (c = "6") or (c = "7") or (c = "8")
or (c = "9")):
  if RCS[0] = 0:
RCS[0] := 1;
RCS[RCS[0]] := 0;
  fi
  RCS[RCS[0]] := 10 * RCS[RCS[0]] + scantokens (c);
elseif c = ".":
  RCS[0] := RCS[0] + 1;
  RCS[RCS[0]] := 0;
else:
fi
  endfor
enddef;
vardef require_RCS_revision expr s =
  save n, TeX_rev, mf_rev;
  numeric n;
  parse_RCS (TeX_rev, s);
  parse_RCS (mf_rev, "$Revision: 1.30 $");
  for n = 1 upto min (2, TeX_rev[0], mf_rev[0]):
if TeX_rev[n] > mf_rev[n]:
  errhelp
"Your version of `feynmf.sty' is higher that of your `feynmf.mf'.";
  errmessage "feynmf: Metafont macros out of date";
elseif TeX_rev[n] < mf_rev[n]:
  errhelp
"Your version of `feynmf.mf' is higher that of your `feynmf.sty'.";
  errmessage "feynmf: LaTeX style out of date";
fi
exitif (TeX_rev[n] <> mf_rev[n]);
  endfor
enddef;
vardef cullit = \ enddef;
color foreground;
foreground = black;
vardef beginchar (expr c, wd, ht, dp) =
  LaTeX_file := "";
  beginfig(c);
w:=wd;
h:=ht;
enddef;
string LaTeX_file;
vardef endchar =
  setbounds currentpicture to (0,0)--(w,0)--(w,h)--(0,h)--cycle;
  if LaTeX_file <> "":
write EOF to LaTeX_file;
LaTeX_file := "";
  fi
  endfig
enddef;
bp# := bp;
cc# := cc;
cm# := cm;
dd# := dd;
in# := in;
mm# := mm;
pc# := pc;
pt# := pt;
vardef define_blacker_pixels(text t) =
  forsuffixes $=t:
$:=$.#;
  endfor
enddef;
picture unitpixel;
unitpixel = nullpicture;
addto unitpixel contour unitsquare;
def t_ = \ enddef;
boolean feynmfwizard;
feynmfwizard := false;
thin# := 1pt#; % dimension of the lines
thick# := 2thin#;
arrow_len# := 4mm#;
arrow_ang := 15;
curly_len# := 3mm#;
dash_len# := 3mm#; % 'photon' lines
dot_len# := 2mm#; % 'photon' lines
wiggly_len# := 4mm#; % 'photon' lines
wiggly_slope := 60;
zigzag_len# := 2mm#;
zigzag_width# := 2thick#;
decor_size# := 5mm#;
dot_size# := 2thick#;
define_blacker_pixels (thick, thin,
  dash_len, dot_len, wiggly_len, curly_len,
  zigzag_len, zigzag_width, arrow_len, decor_size, dot_size);
def shrink expr s =
  begingroup
  if shrinkables <> "":
save tmp_;
forsuffixes $ = scantokens shrinkables:
  if known $.#:
tmp_ := $.#;
save $;
$.# := s * tmp_;
define_blacker_pixels ($);
  else:
tmp_ := $;
save $;
$ := s * tmp_;
  fi
endfor
  fi
enddef;
def endshrink =
  endgroup
enddef;
string shrinkables;
shrinkables := "";
vardef addto_shrinkables (text l) =
  forsuffixes $ = l:
shrinkables := shrinkables & "," & str $;
  endfor
en

Re: [NTG-context] Text editors

2023-03-26 Thread Henning Hraban Ramm via ntg-context

Am 26.03.23 um 10:22 schrieb Alexandre Christe via ntg-context:
I'm wondering what kind of typesetting system / syntax highlighting / 
completion you're using.


Active development happens for Visual Studio Code; I use VSCodium 
besides Atom.


Usable support for ConTeXt in Atom is available at 
https://codeberg.org/fiee/language-context
It’s a bit unkempt, since I stopped working on it when Atom was 
discontinued. I didn’t try the fork Pulsar yet (https://pulsar-edit.dev).

Atom’s git client is better than VSC’s, and I like its search bar better.

Also there’s COW: https://context-on-web.eu

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] \definemathfence broken in latest

2023-03-25 Thread Mikael Sundqvist via ntg-context
Hi,

I think command=yes was changed into define=yes.

/Mikael

Den sön 26 mars 2023 04:31Gavin via ntg-context  skrev:

> Hi List,
>
> The command \definemathfence seems to not be working as it did in other
> recent LMTX. MWE:
>
> \definemathfence[abs][bar][command=yes]
>
> \starttext
> \startformula
> \abs{v} = \frac{1.32}{1.41} = 0.935
> \stopformula
> \stoptext
>
> This causes an error, complaining that \abs is undefined. However, workes
> fine with
>
> ConTeXt  ver: 2023.02.07 19:06 LMTX  fmt: 2023.3.14  int: english/english
>
> Should I be doing this differently?
>
> Gavin
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] \definemathfence broken in latest

2023-03-25 Thread Gavin via ntg-context
Hi List,

The command \definemathfence seems to not be working as it did in other recent 
LMTX. MWE:

\definemathfence[abs][bar][command=yes]

\starttext
\startformula
\abs{v} = \frac{1.32}{1.41} = 0.935
\stopformula
\stoptext

This causes an error, complaining that \abs is undefined. However, workes fine 
with

ConTeXt  ver: 2023.02.07 19:06 LMTX  fmt: 2023.3.14  int: english/english

Should I be doing this differently?

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Typeset multiple pictures not in a strict matrix (\startfloatcombination)

2023-03-08 Thread Hans Hagen via ntg-context

On 3/7/2023 6:54 PM, Gerion Entrup via ntg-context wrote:

Hi,

I'm trying to typeset several pictures as a floatcombination but not in
the form of strict cells of a matrix.

Here is some ASCII art to demonstrate the positions of the pictures:

   ---
   | |
   | |
   ---
 a) Some caption

     -
   |  |  |   |
   |  |  |   |
   |  |  |   |
     -
  b) fooc) foo

  Figure 1.1: Foo Bar


I tried to typeset it with this code (based on 
https://tex.stackexchange.com/a/502903):

\useMPlibrary[dum]
\setupcombinations[alternative=text]

\definefloat[subfigure][local=yes]
\setupcaption[subfigure][numberconversion=a]
\setuplabeltext[subfigure=]

\appendvalue{stopplacefigure}{\resetcounter[subfigure]}

\starttext
\startplacefigure[title=Test]
 \startfloatcombination[nx=1, ny=2]
   \startplacesubfigure[title=Test]
 \externalfigure[dummy][width=4cm,height=1cm]
   \stopplacesubfigure
   \startfloatcombination[nx=2, ny=1]
 \startplacesubfigure[title=Test]
   \externalfigure[dummy][width=4cm,height=1cm]
 \stopplacesubfigure
 \startplacesubfigure[title=Test]
   \externalfigure[dummy][width=4cm,height=1cm]
 \stopplacesubfigure
   \stopfloatcombination
 \stopfloatcombination
\stopplacefigure
\stoptext

However, this does not work (the pictures are all in one row).
Do you have some advice?

you can cheat:

\startplacefigure[title=Test]
\bTABLE[frame=off]
\bTR
\bTD[nx=2,align=middle,offset=overlay]

\dontleavehmode\externalfigure[dummy-1][width=4cm,height=1cm]
\eTD
\eTR
\bTR[toffset=1ex]
\bTD[nx=2,align=middle]
% \placefloatcaption[figure][title=foo]
a) foo
\eTD
\eTR
\bTR[toffset=2ex]
\bTD[align=middle,offset=overlay]
\externalfigure[dummy-2][width=4cm,height=1cm]
\eTD
\bTD[align=middle,offset=overlay]
\externalfigure[dummy-3][width=4cm,height=1cm]
\eTD
\eTR
\bTR[toffset=1ex]
\bTD[align=middle]
% \placefloatcaption[figure][title=foo]
b) foo
\eTD
\bTD[align=middle]
% \placefloatcaption[figure][title=foo]
c) foo
\eTD
\eTR
\eTABLE
\stopplacefigure


-
  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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Typeset multiple pictures not in a strict matrix (\startfloatcombination)

2023-03-07 Thread Gerion Entrup via ntg-context
Hi,

I'm trying to typeset several pictures as a floatcombination but not in
the form of strict cells of a matrix.

Here is some ASCII art to demonstrate the positions of the pictures:

  ---
  | |
  | |
  ---
a) Some caption

    -
  |  |  |   |
  |  |  |   |
  |  |  |   |
    -
 b) fooc) foo

 Figure 1.1: Foo Bar


I tried to typeset it with this code (based on 
https://tex.stackexchange.com/a/502903):

\useMPlibrary[dum]
\setupcombinations[alternative=text]

\definefloat[subfigure][local=yes]
\setupcaption[subfigure][numberconversion=a]
\setuplabeltext[subfigure=]

\appendvalue{stopplacefigure}{\resetcounter[subfigure]}

\starttext
\startplacefigure[title=Test]
\startfloatcombination[nx=1, ny=2]
  \startplacesubfigure[title=Test]
\externalfigure[dummy][width=4cm,height=1cm]
  \stopplacesubfigure
  \startfloatcombination[nx=2, ny=1]
\startplacesubfigure[title=Test]
  \externalfigure[dummy][width=4cm,height=1cm]
\stopplacesubfigure
\startplacesubfigure[title=Test]
  \externalfigure[dummy][width=4cm,height=1cm]
\stopplacesubfigure
  \stopfloatcombination
\stopfloatcombination
\stopplacefigure
\stoptext

However, this does not work (the pictures are all in one row).
Do you have some advice?

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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] structureuservariable as list

2023-02-25 Thread Alex Leray via ntg-context

Dear both,

thanks for your answers.

`doloopovermatch` didn't work for me but this below is achieving what I 
wanted.


Have a good day,

Alex

%%%

\def\dosomething#1{(#1)}

\def\dosomethingtwo#1{* #1\crlf}

\starttext
\startchapter[title={Foo Bar}][
authors={Alice,Bob,Charline},
translators={foo,bar,baz}
]

{\em authors} \\
\commalistsentence[\structureuservariable{authors}][{ \crlf },{ \crlf }]

{\em translators} \\
\processcommacommand[\structureuservariable{translators}]\dosomethingtwo

\doloopoverlist {\structureuservariable{translators}} {
 (#1) \\
}

\stopchapter
\stoptext

%%%

Le 25/02/23 à 11:08, Hans Hagen via ntg-context a écrit :

On 2/24/2023 11:37 PM, Rik Kabel via ntg-context wrote:



Hi,

is it possible to pass a list in a variable? I'd like to pass a list 
of authors:



\startchapter[title={Foo Bar}][authors={Alice, Bob}]

% PSEUDOCODE
% for author in \structureuservariable{authors}
% do print(author + '\crlf')
% done

\stopchapter


Search the wiki. Look for "Comma Separated Lists." There is a variant 
with an author list as an example.


You may need additional brace levels around the list entries.

I'm not sure this is on the wiki ...

\starttext

\startchapter[title={Foo Bar}][authors={Alice, Bob},AUTHORS={Bob,Alice}]

     \doloopovermatch {[^, ]+} {\structureuservariable{authors}}  {
     (#1)\crlf
     }
     \doloopovermatch {[^,]+} {\structureuservariable{authors}}  {
     (#1)\crlf
     }
     \doloopovermatch {[^,]+} {\structureuservariable{AUTHORS}}  {
     (#1)\crlf
     }
     \doloopovermatch {[^,]+} {\structureuservariable{AUTHORS}}  {
     \doloopovermatch {.} {#1}  {
     (##1)
     }
     \crlf
     }

\stopchapter

but feel free to add 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://www.ntg.nl/mailman/listinfo/ntg-context

webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


--
Alexandre Leray
+32 487 947 030

Avez-vous pensé à (vous) offrir Médor ?
https://medor.coop/ideescadeau
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] structureuservariable as list

2023-02-25 Thread Hans Hagen via ntg-context

On 2/24/2023 11:37 PM, Rik Kabel via ntg-context wrote:



Hi,

is it possible to pass a list in a variable? I'd like to pass a list 
of authors:



\startchapter[title={Foo Bar}][authors={Alice, Bob}]

% PSEUDOCODE
% for author in \structureuservariable{authors}
% do print(author + '\crlf')
% done

\stopchapter


Search the wiki. Look for "Comma Separated Lists." There is a variant 
with an author list as an example.


You may need additional brace levels around the list entries.

I'm not sure this is on the wiki ...

\starttext

\startchapter[title={Foo Bar}][authors={Alice, Bob},AUTHORS={Bob,Alice}]

\doloopovermatch {[^, ]+} {\structureuservariable{authors}}  {
(#1)\crlf
}
\doloopovermatch {[^,]+} {\structureuservariable{authors}}  {
(#1)\crlf
}
\doloopovermatch {[^,]+} {\structureuservariable{AUTHORS}}  {
(#1)\crlf
}
\doloopovermatch {[^,]+} {\structureuservariable{AUTHORS}}  {
\doloopovermatch {.} {#1}  {
(##1)
}
\crlf
}

\stopchapter

but feel free to add 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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] structureuservariable as list

2023-02-24 Thread Rik Kabel via ntg-context



Hi,

is it possible to pass a list in a variable? I'd like to pass a list 
of authors:



\startchapter[title={Foo Bar}][authors={Alice, Bob}]

% PSEUDOCODE
% for author in \structureuservariable{authors}
% do print(author + '\crlf')
% done

\stopchapter


Search the wiki. Look for "Comma Separated Lists." There is a variant 
with an author list as an example.


You may need additional brace levels around the list entries.

--
Rik

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] structureuservariable as list

2023-02-24 Thread Alex Leray via ntg-context

Hi,

is it possible to pass a list in a variable? I'd like to pass a list of 
authors:



\startchapter[title={Foo Bar}][authors={Alice, Bob}]

% PSEUDOCODE
% for author in \structureuservariable{authors}
% do print(author + '\crlf')
% done

\stopchapter

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] update

2023-02-24 Thread Otared Kavian via ntg-context
Hi Hans,

Thank you very much for the new update.

Everything seem to work like a charm. In particular I played with the 
\underbrace and \overbrace when adding something under the \underbrace, or 
above the \overbrace, like in 

\startformula
\overbrace{1+x^2+a}^{= -1} +
\underbrace{ax^2 + bx + c}_{=2} = 1
\stopformula

and it works great !

Best regards : Otared

> On 23 Feb 2023, at 22:07, Hans Hagen via ntg-context  
> wrote:
> 
> Hi,
> 
> I uploaded a new version. We further improved Antykwa support,
> 
> \switchtobodyfont[antykwa]
> 
> \startTEXpage[offset=1dk]
>\im{
>f' = f'' = f''' = f'''' =
>a + b + \ldots + c +
>\overbar{x} + \overbar{S} + \bar{x} + \widebar{x}
>}
> 
>\im{
>\fenced[doublebar]{x} =
>\fenced[doublebar][size=1]{x_1} =
>\fenced[doublebar][size=2]{x_2} =
>\fenced[doublebar][size=3]{x_3} =
>\fenced[doublebar][size=4]{x_4} =
>    \fenced[doublebar]{\blackrule[width=1cm,height=1cm]}
>}
> 
>    \im{
>\fenced[bar]{x} =
>\fenced[bar][size=1]{x_1} =
>\fenced[bar][size=2]{x_2} =
>\fenced[bar][size=3]{x_3} =
>\fenced[bar][size=4]{x_4} =
>\fenced[bar]{\blackrule[width=1cm,height=1cm]}
>}
> 
>\im{
>\fenced[brace]{x} =
>\fenced[brace][size=1]{x_1} =
>\fenced[brace][size=2]{x_2} =
>\fenced[brace][size=3]{x_3} =
>\fenced[brace][size=4]{x_4} =
>\fenced[brace]{\blackrule[width=1cm,height=1cm]}
>}
> 
>\im{
>\root[4]{1+x^2+a} +
>\frac{1}{1+x^2+a} +
>\overparent{1+x^2+a} +
>\overbrace{1+x^2+a} +
>\overparent{x} +
>\overbrace{x} +
>\overbrace{i}
>}
> 
> \stopTEXpage
> 
> 
> This time with fancy radical bars, fraction bars, vertical bars, over and 
> underbars etc.
> 
> 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://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___

Otared Kavian
e-mail: ota...@gmail.com
Phone: +33 6 88 26 70 95




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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] update

2023-02-23 Thread Hans Hagen via ntg-context

Hi,

I uploaded a new version. We further improved Antykwa support,

\switchtobodyfont[antykwa]

\startTEXpage[offset=1dk]
\im{
f' = f'' = f''' = f'''' =
a + b + \ldots + c +
\overbar{x} + \overbar{S} + \bar{x} + \widebar{x}
}

\im{
\fenced[doublebar]{x} =
\fenced[doublebar][size=1]{x_1} =
\fenced[doublebar][size=2]{x_2} =
\fenced[doublebar][size=3]{x_3} =
\fenced[doublebar][size=4]{x_4} =
\fenced[doublebar]{\blackrule[width=1cm,height=1cm]}
}

    \im{
\fenced[bar]{x} =
        \fenced[bar][size=1]{x_1} =
        \fenced[bar][size=2]{x_2} =
        \fenced[bar][size=3]{x_3} =
        \fenced[bar][size=4]{x_4} =
\fenced[bar]{\blackrule[width=1cm,height=1cm]}
}

\im{
\fenced[brace]{x} =
\fenced[brace][size=1]{x_1} =
\fenced[brace][size=2]{x_2} =
\fenced[brace][size=3]{x_3} =
\fenced[brace][size=4]{x_4} =
\fenced[brace]{\blackrule[width=1cm,height=1cm]}
}

\im{
\root[4]{1+x^2+a} +
\frac{1}{1+x^2+a} +
\overparent{1+x^2+a} +
\overbrace{1+x^2+a} +
\overparent{x} +
\overbrace{x} +
\overbrace{i}
}

\stopTEXpage


This time with fancy radical bars, fraction bars, vertical bars, over 
and underbars etc.


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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] \typefile not including file and returning success

2023-02-21 Thread Marco Patzer via ntg-context
On Wed, 21 Dec 2022 13:17:15 +0100
Hans Hagen via ntg-context  wrote:

> The next upload will have:
> 
> \adddefaultsuffix[foo,{},crap]
> \adddefaultsuffix[{}]
> 
> \typefile{./crapcrap}
> \typefile{crapcrap}
> 
> which someone has to document on the wiki

Apologies for taking so long. But I just now tested your fix and
wanted to remove the absolute paths from my document and found that
either your fix is not working or I'm doing something wrong
(probably the latter). Example:

# create file “bar”
echo Bar > bar

%% \adddefaultsuffix[foo,{},crap,bar]
\adddefaultsuffix[{}]

\starttext
  Foo
  \typefile{bar}
\stoptext

This does *not* include the file “bar”. As far as I understand:

%% searches for files with no extention
\adddefaultsuffix[{}]

%% searches for files with extension aa, bb, foobar,
%% e.g. file.aa, blurp.bb or example.foobar
\adddefaultsuffix[aa, bb, foobar]

But that's not how it behaves. Can you elaborate?


Marco

LMTX 2023.02.14 17:44
PS: When I get it to work, I'll document it on the wiki.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Section numbering starting from zero, not one

2023-02-16 Thread Hans Hagen via ntg-context

On 2/16/2023 8:07 PM, Alex Leray via ntg-context wrote:

Answering my own question… this fits my needs:

###

\defineconversion[romannumeralszero][0, I, II, III, IV, V, VI, VII, 
VIII, IX, X, XI, XII, XIII, XIV, XV, XVI, XVII, XIII, XIX, XX, XXI]


\setuphead[section][conversion=romannumeralszero]

\starttext
\startsection[title={Section zero}]foo\stopsection

\startsection[title={Section 1}]bar\stopsection
\stoptext

###

Sorry for the noise


you can often find hints in the test suite (many small files)


Le 16/02/23 à 17:32, Alex Leray via ntg-context a écrit :

Hello,

I'd like to have roman numerals prefixed sections, but starting from 
Zero and not One (even if I know that roman numerals don't have a sign 
for 0).


Is there a way to achieve this? My code looks like that at the moment:

###

\setuphead[section][conversion=Romannumerals]

\starttext
\setupheadnumber[section] [-1]
\startsection[title={Section zero}]\stopsection
\startsection[title={Section one}]\stopsection
\stoptext

###

Thank you,

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


maillist : ntg-context@ntg.nl / 
https://www.ntg.nl/mailman/listinfo/ntg-context

webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___




--

-
  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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Section numbering starting from zero, not one

2023-02-16 Thread Alex Leray via ntg-context

Answering my own question… this fits my needs:

###

\defineconversion[romannumeralszero][0, I, II, III, IV, V, VI, VII, 
VIII, IX, X, XI, XII, XIII, XIV, XV, XVI, XVII, XIII, XIX, XX, XXI]


\setuphead[section][conversion=romannumeralszero]

\starttext
\startsection[title={Section zero}]foo\stopsection

\startsection[title={Section 1}]bar\stopsection
\stoptext

###

Sorry for the noise


Le 16/02/23 à 17:32, Alex Leray via ntg-context a écrit :

Hello,

I'd like to have roman numerals prefixed sections, but starting from 
Zero and not One (even if I know that roman numerals don't have a sign 
for 0).


Is there a way to achieve this? My code looks like that at the moment:

###

\setuphead[section][conversion=Romannumerals]

\starttext
\setupheadnumber[section] [-1]
\startsection[title={Section zero}]\stopsection
\startsection[title={Section one}]\stopsection
\stoptext

###

Thank you,

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


maillist : ntg-context@ntg.nl / 
https://www.ntg.nl/mailman/listinfo/ntg-context

webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


--
Alexandre Leray
+32 487 947 030

Avez-vous pensé à (vous) offrir Médor ?
https://medor.coop/ideescadeau
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Subject: Leading spaces verbatim

2023-01-28 Thread Kalouguine Andre via ntg-context
Hi Pablo,

> \showframe
> \setupinteraction[state=start]
> \starttext
> \startbuffer[abc]
> def foo(x):
> if x == 0:
> bar()
> else:
> baz(x)
> foo(x - 1)
> \stopbuffer
> \comment[location=leftmargin,
> space=yes,
> buffer=abc,
> title={Python code}]
> {}\typebuffer[abc]
> \stoptext
> 
> This might solve what you need. At least, this is the approach that I
> use to provide text that can be directly copied.
> 
> I'm on Linux and last time I tested on Windows there were extra lines in
> the comments.

That's actually something I had never thought of, using PDF comments,
thanks!. 
It's a really nice approach, though weirdly it doesn't work on Okular
(Linux+KDE) 
for me, even though attachments worked fine. I'll try and see why that
is. 

What I had in mind was rather the following: 

\starttext 
\starttyping[space=on] 
def foo(x):
y = bar(x) 
if y: 
return x 
return y 
foo(1) 
\stoptyping 
\stoptext

but with ordinary char32 spaces rather than \textcontrolspace
characters. 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Subject: Leading spaces verbatim

2023-01-28 Thread Pablo Rodriguez via ntg-context
On 1/28/23 03:01, Kalouguine Andre via ntg-context wrote:
> Good day to everyone,
> 
> I'm trying to make a verbatim block of text with copiable leading spaces
> so that students can just copy my Python code snippets into their IDE.

Hi André,

I wonder whether I’m getting your point with the following sample:

  \showframe
  \setupinteraction[state=start]
  \starttext
  \startbuffer[abc]
  def foo(x):
  if x == 0:
  bar()
  else:
  baz(x)
  foo(x - 1)
  \stopbuffer
  \comment[location=leftmargin,
space=yes,
buffer=abc,
title={Python code}]
{}\typebuffer[abc]
  \stoptext

This might solve what you need. At least, this is the approach that I
use to provide text that can be directly copied.

I’m on Linux and last time I tested on Windows there were extra lines in
the comments.

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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Unconnected \mathboxanchored produces unexpected results

2022-12-22 Thread Hans Hagen via ntg-context

On 12/22/2022 3:53 PM, Gavin via ntg-context wrote:

Hi Hans, MIkael and list,

I got an unexpected result when I asked for a \mathboxanchored, but then did 
not use it with a connector. I expected the \mathboxanchored contents to be 
typeset as usual, without a connector. Instead I got “ ::: c3” added into the 
formula (“c3” was the anchor’s tag).

MWE and unexpected output below.

Thanks,
Gavin


\starttext

\startboxanchoring[+]
\connectboxanchors[top][top][distance=1ex,arrow=no] {c1}{c2}
%\connectboxanchors[bottom] [bottom] [distance=1ex,arrow=no] {c2}{c3} % <-- I 
decided not to use this connector, producing unexpected results.
\startformula
 \mathboxanchored[nucleus]{c1}{e}^{\dot\alpha}
 \mathboxanchored[nucleus]{c2}{e}_{\mu}
 \mathboxanchored[nucleus]{c3}{e}^{\beta} = \frac{1}{\sqrt{2}}
     \bar\sigma^{\dot\alpha\beta}_{\mu}
\stopformula
\stopboxanchoring

\stoptext

can you try the latest binary fron the farm (remake th eformat)


-
  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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Unconnected \mathboxanchored produces unexpected results

2022-12-22 Thread Gavin via ntg-context
Hi Hans, MIkael and list,

I got an unexpected result when I asked for a \mathboxanchored, but then did 
not use it with a connector. I expected the \mathboxanchored contents to be 
typeset as usual, without a connector. Instead I got “ ::: c3” added into the 
formula (“c3” was the anchor’s tag).

MWE and unexpected output below.

Thanks,
Gavin


\starttext

\startboxanchoring[+]
\connectboxanchors[top][top][distance=1ex,arrow=no] {c1}{c2}
%\connectboxanchors[bottom] [bottom] [distance=1ex,arrow=no] {c2}{c3} % <-- I 
decided not to use this connector, producing unexpected results.
\startformula
\mathboxanchored[nucleus]{c1}{e}^{\dot\alpha}
\mathboxanchored[nucleus]{c2}{e}_{\mu}
\mathboxanchored[nucleus]{c3}{e}^{\beta} = \frac{1}{\sqrt{2}}
    \bar\sigma^{\dot\alpha\beta}_{\mu}
\stopformula
\stopboxanchoring

\stoptext



anchors-002-copy.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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Accent wrecking \mathboxanchored

2022-12-22 Thread Gavin via ntg-context
Hi Hans, Mikael and list,

I’ve been testing the connectors, which work great with the latest upload. One 
problem I found: an accent in the \mathboxanchored causes a "Missing number, 
treated as zero” error and no output. MWE below.

Thanks for all of the improvements. I’m making all kinds of connections!
Gavin


\starttext

\startboxanchoring[+]
\connectboxanchors[top][top][distance=1ex,arrow=no] {c1}{c2}
\connectboxanchors[bottom] [bottom] [distance=1ex,arrow=no] {c2}{c3}
\startformula
\mathboxanchored[nucleus]{c1}{e}^{\dot\alpha}
%\mathboxanchored[nucleus]{c2}{e}_{\mu}% <-- This works, without 
accent
%\mathboxanchored[nucleus]{c2}{\bar{e}}_{\mu} % <-- This does not work, 
with accent
\bar{\mathboxanchored[nucleus]{c2}{e}}_{\mu} % <-- This works, but 
connector punches through accent
\mathboxanchored[nucleus]{c3}{e}^{\beta} = \frac{1}{\sqrt{2}}
\bar\sigma^{\dot\alpha\beta}_{\mu}
\stopformula
\stopboxanchoring

\stoptext

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] \typefile not including file and returning success

2022-12-21 Thread Hans Hagen via ntg-context

On 12/17/2022 6:27 PM, Marco via ntg-context wrote:

On Sat, 17 Dec 2022 17:43:48 +0100
Otared Kavian  wrote:

Thanks for your quick reply.


It seems that one can fool ConTeXt into typing a file without suffix
by giving the path to that file…


That works, I can confirm.


\typefile{/Users/kavian/Context/essais/mkiv/bar-bis}


Hard-coded absolute paths in TeX files are something I avoid, but I
assume that's just for demonstration here.


\typefile{./bar-bis}


That works as well. It's a workaround at least.

But context returning success when it clearly doesn't include the
file is unfortunate. The missing file might go completely unnoticed.
I'd expect an error there.

The next upload will have:

\adddefaultsuffix[foo,{},crap]
\adddefaultsuffix[{}]

\typefile{./crapcrap}
\typefile{crapcrap}

which someone has to document on the wiki

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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] \typefile not including file and returning success

2022-12-17 Thread Marco Patzer via ntg-context
On Sat, 17 Dec 2022 10:41:11 -0800
skyhorse--- via ntg-context  wrote:

> The context wiki says:
>   "When no file extension is specified the extension .tex is assumed."

It's not on the page for typefile:

  https://wiki.contextgarden.net/Command/typefile

And that surely makes sense for TeX (input) files, but not \type'ed
files, which are usually not TeX files.

\startnitpicking

The message

  verbatims   > file 'bar' does not exist

is wrong, the file “bar” exists. Displaying

  verbatims   > file 'bar.txt' does not exist

\stopnitpicking

would be correct. But as I said, assuming \type'ed files are .tex
files does not make sense, IMO.

> By chance, do you have a file named "bar.tex" that would prevent this
> from being an error?

No. It just doesn't produce an error here (or non-success exit code
for that matter).

using LMTX:  2022.12.15 18:12

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] \typefile not including file and returning success

2022-12-17 Thread skyhorse--- via ntg-context

The context wiki says:
  "When no file extension is specified the extension .tex is assumed."

Yes an error message should be displayed.
By chance, do you have a file named "bar.tex" that would prevent this from 
being an error?

skyhorse


-

Otared Kavian via ntg-context  wrote:

> Hi Marco,
> 
> If I create a file named « bar.txt » then
> 
> \starttext
> Nothing to say\dots
> 
> \typefile{bar.txt}
> 
> \stoptext
> 
> gives the correct result. However ConTeXt seems to dislike \typefile{bar} 
> when the filename has no suffix.
> 
> Best regards : Otared
> 
> > On 17 Dec 2022, at 16:06, Marco Patzer via ntg-context  
> > wrote:
> > 
> > Hi!
> > 
> > In the following example the file “bar” is not included:
> > 
> > # create file “bar”
> > echo Bar > bar
> > 
> > # t.tex
> > \starttext
> >  Foo
> >  \typefile{bar}
> > \stoptext
> > 
> > Then run
> > 
> >  context --errors='*' t.tex
> > 
> > The text “bar” is not included in the PDF, only Foo is. The log file
> > shows:
> > 
> >  verbatims   > file 'bar' does not exist
> > 
> > However, the file “bar” clearly does exist. Furthermore, context
> > exits with no error in the log file and a successful exit value:
> > 
> >  context --errors='*' t.tex > /dev/null; echo $?
> >  0
> > 
> > Is this working as intended?
> > 
> > Marco
> > ___
> > If your question is of interest to others as well, please add an entry to 
> > the Wiki!
> > 
> > maillist : ntg-context@ntg.nl / 
> > https://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : https://contextgarden.net
> > ___
> 
> Otared Kavian
> e-mail: ota...@gmail.com
> Phone: +33 6 88 26 70 95
> 
> 
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] \typefile not including file and returning success

2022-12-17 Thread Marco via ntg-context
On Sat, 17 Dec 2022 17:43:48 +0100
Otared Kavian  wrote:

Thanks for your quick reply.

> It seems that one can fool ConTeXt into typing a file without suffix
> by giving the path to that file…

That works, I can confirm.

> \typefile{/Users/kavian/Context/essais/mkiv/bar-bis}

Hard-coded absolute paths in TeX files are something I avoid, but I
assume that's just for demonstration here.

> \typefile{./bar-bis}

That works as well. It's a workaround at least.

But context returning success when it clearly doesn't include the
file is unfortunate. The missing file might go completely unnoticed.
I'd expect an error there.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] \typefile not including file and returning success

2022-12-17 Thread Marco Patzer via ntg-context
On Sat, 17 Dec 2022 16:25:01 +0100
Otared Kavian via ntg-context  wrote:

> If I create a file named « bar.txt » then
> 
> \starttext
> Nothing to say\dots
> 
> \typefile{bar.txt}
> 
> \stoptext
> 
> gives the correct result.

I can confirm that.

> However ConTeXt seems to dislike \typefile{bar} when the filename
> has no suffix.

Is there a way around it? Traditionally there are plenty of files
without suffix (e.g. README, Makefile, configure, etc.)

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] \typefile not including file and returning success

2022-12-17 Thread Otared Kavian via ntg-context
Hi Marco,

If I create a file named « bar.txt » then

\starttext
Nothing to say\dots

\typefile{bar.txt}

\stoptext

gives the correct result. However ConTeXt seems to dislike \typefile{bar} when 
the filename has no suffix.

Best regards : Otared

> On 17 Dec 2022, at 16:06, Marco Patzer via ntg-context  
> wrote:
> 
> Hi!
> 
> In the following example the file “bar” is not included:
> 
> # create file “bar”
> echo Bar > bar
> 
> # t.tex
> \starttext
>  Foo
>  \typefile{bar}
> \stoptext
> 
> Then run
> 
>  context --errors='*' t.tex
> 
> The text “bar” is not included in the PDF, only Foo is. The log file
> shows:
> 
>  verbatims   > file 'bar' does not exist
> 
> However, the file “bar” clearly does exist. Furthermore, context
> exits with no error in the log file and a successful exit value:
> 
>  context --errors='*' t.tex > /dev/null; echo $?
>  0
> 
> Is this working as intended?
> 
> Marco
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___

Otared Kavian
e-mail: ota...@gmail.com
Phone: +33 6 88 26 70 95



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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] \typefile not including file and returning success

2022-12-17 Thread Marco Patzer via ntg-context
Hi!

In the following example the file “bar” is not included:

# create file “bar”
echo Bar > bar

# t.tex
\starttext
  Foo
  \typefile{bar}
\stoptext

Then run

  context --errors='*' t.tex

The text “bar” is not included in the PDF, only Foo is. The log file
shows:

  verbatims       > file 'bar' does not exist

However, the file “bar” clearly does exist. Furthermore, context
exits with no error in the log file and a successful exit value:

  context --errors='*' t.tex > /dev/null; echo $?
  0

Is this working as intended?

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Floating Figure in framed-environment

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

Oliver Sieber via ntg-context schrieb am 19.10.2022 um 11:31:

Dear ConTeXt Users

I am relatively new to context and I am suffering with a problem with the 
framed environment.

I want to use a framed textbox for Definitions in my script. I also want to use 
floating figures.  But this does not work and I haven’t found out why. Maybe I 
totally use it the wrong way. I would appreciate if someone could help me or 
has a tipp.

Here is an example code, where the figure does not behave as expected, i.e. the 
figure is behind the text:

[...]


You have to use the textbackground mechanism to create a block of text 
where floats work as expected.


\definetextbackground
  [Oliver]
  [ location=paragraph,
  corner=round,
   rulethickness=2pt,
  framecolor=black,
   topoffset=1em,
    bottomoffset=1em,
  leftoffset=1em,
 rightoffset=1em,
  before=\blank,
   after=\blank,
  background=]

\setupfloats
  [freeregion=no]

\definedescription
  [Definition]
  [alternative=top,
  text={Definition: },
 title=yes,
    before=\startOliver,
 after=\stopOliver,
 inbetween={\blank[medium]}]

\startbuffer[sampletext]
Carrot cake tiramisu lollipop dragée lollipop marshmallow carrot cake 
sweet pastry. Tiramisu danish jelly tootsie roll tart gummi bears. 
Carrot cake chupa chups cake wafer lemon drops lemon drops tiramisu. 
Chocolate lemon drops sugar plum cheesecake jelly beans sugar plum. 
Tootsie roll cupcake jujubes pie chocolate bar bear claw chupa chups 
shortbread. Candy candy canes jelly-o jelly beans sugar plum muffin 
danish donut. Bonbon lemon drops powder jujubes marshmallow biscuit 
halvah. Powder carrot cake caramels chocolate cake carrot cake jelly-o. 
Topping danish tootsie roll gummi bears oat cake jujubes. Sweet candy 
canes cotton candy pie topping. Jelly-o carrot cake ice cream lemon 
drops macaroon gummies lemon drops tiramisu chocolate cake. Cupcake 
sugar plum shortbread gummi bears tootsie roll. Chocolate cake sugar 
plum macaroon candy canes chocolate bar donut cake icing tootsie roll.

\stopbuffer

\starttext

\startOliver
{\bf Definition: Hello World}
\blank[medium]
\placefigure[right,none]{This is an example of a 
logo.}{\externalfigure[dummy]}

\getbuffer[sampletext]
\stopOliver

\startDefinition[title={Hello World}]
\placefigure[right,none]{This is an example of a 
logo.}{\externalfigure[dummy]}

\getbuffer[sampletext]
\stopDefinition

\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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Floating Figure in framed-environment

2022-10-19 Thread Oliver Sieber via ntg-context
Dear Uschi

Thanks for the example. But unfortunately it behaves similiar. As soon as I 
want to place the figure to the right by using \placefigure
[right]… with floating text to the left. The framed environment behaves 
strange, i.e. it seems to ignore the image.

Just using a centered image works perfectly. I included everything in this 
code, to show exactly, what is not working.

\starttext
\framed[corner=round, rulethickness=2pt, width=\textwidth, align=flushleft, 
offset=1em,background=color,framecolor=black]
{{\bf Box with centered image} \blank[medium] 

\input khatt-en

\placefigure[none]{This is an example of a logo.}{\externalfigure[dummy]}
}

\blank[2cm]



\framed[corner=round, rulethickness=2pt, width=\textwidth, align=flushleft, 
offset=1em,background=color,framecolor=black]
{{\bf Faulty box with floating text, image to the right} \blank[medium] 

\placefigure[right, none]{This is an example of a logo.}{\externalfigure[dummy]}

\input khatt-en
}

\blank[2cm]

{\bf Floating text with image to the right, without box} \blank[medium] 

\placefigure[right, none]{This is an example of a logo.}{\externalfigure[dummy]}

\input khatt-en
\stoptext

Any ideas? 

Thanks a lot in advance.



> Am 19.10.2022 um 13:52 schrieb Ursula Hermann via ntg-context - ntg-context 
> at ntg.nl :
> 
> Dear Oliver, 
> 
> maybe something like this? 
> This is my example: 
> \starttext
> 
> \setuppapersize
>  [A5]
> 
> \setupexternalfigures
>  [location=default]
> 
> \setupindenting
>  [yes, small]
> 
> \setupwhitespace
>  [small]
> 
> \defineframedtext
>  [prettyblock]
>  [width=10cm,
>   indenting={yes, small},
>   background=color, backgroundcolor=lightgreen,
>   foreground=color, foregroundcolor=black,
>   offset=2mm,
>   align=flushleft]
> 
> \starttext
> 
> \startprettyblock
> \setupindenting[next]
>  The Earth, as a habitat for animal life, is in old age and has a fatal
>  illness. Several, in fact.
> 
>  It would be happening whether humans had ever evolved or not.
> 
>  \placefigure
> [][fig:church]
> {Stephanus Church.}
> {\externalfigure[ma-cb-24][width=.4\textwidth]}
> 
> \stopprettyblock
> \setupindenting[next]
> Below, we have two separate columns; but up here, for the nonce, we have but
> the one.
> 
> \startcolumns [n=2]
>  Text, text, text \dots
>  all in the first column
> \column
>  Words, words, words \dots
>  all in the second column.
>  And look ye here! Even more words!
> \stopcolumns
> 
> \stoptext
> 
> Many regards
> Uschi 
> 
> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Oliver Sieber 
> via ntg-context
> Gesendet: Mittwoch, 19. Oktober 2022 11:31
> An: ntg-context@ntg.nl
> Cc: Oliver Sieber 
> Betreff: [NTG-context] Floating Figure in framed-environment
> 
> Dear ConTeXt Users
> 
> I am relatively new to context and I am suffering with a problem with the 
> framed environment.
> 
> I want to use a framed textbox for Definitions in my script. I also want to 
> use floating figures.  But this does not work and I haven’t found out why. 
> Maybe I totally use it the wrong way. I would appreciate if someone could 
> help me or has a tipp.
> 
> Here is an example code, where the figure does not behave as expected, i.e. 
> the figure is behind the text:
> 
> \starttext
> \framed[corner=round, rulethickness=2pt, width=\textwidth, align=flushleft, 
> offset=1em,background=color,framecolor=black]
> {{\bf Definition: Hello World} \blank[medium] 
> 
> \placefigure[right, none]{This is an example of a 
> logo.}{\externalfigure[dummy]}
> 
> Carrot cake tiramisu lollipop dragée lollipop marshmallow carrot cake sweet 
> pastry. Tiramisu danish jelly tootsie roll tart gummi bears. Carrot cake 
> chupa chups cake wafer lemon drops lemon drops tiramisu. Chocolate lemon 
> drops sugar plum cheesecake jelly beans sugar plum. Tootsie roll cupcake 
> jujubes pie chocolate bar bear claw chupa chups shortbread. Candy candy canes 
> jelly-o jelly beans sugar plum muffin danish donut. Bonbon lemon drops powder 
> jujubes marshmallow biscuit halvah. Powder carrot cake caramels chocolate 
> cake carrot cake jelly-o. Topping danish tootsie roll gummi bears oat cake 
> jujubes. Sweet candy canes cotton candy pie topping. Jelly-o carrot cake ice 
> cream lemon drops macaroon gummies lemon drops tiramisu chocolate cake. 
> Cupcake sugar plum shortbread gummi bears tootsie roll. Chocolate cake sugar 
> plum macaroon candy canes chocolate bar donut cake icing tootsie roll.
> }
> \stoptext
> 
> 
> Best regards
> Oli
> ___
> If your 

Re: [NTG-context] Floating Figure in framed-environment

2022-10-19 Thread Ursula Hermann via ntg-context
Dear Oliver, 

maybe something like this? 
This is my example: 
\starttext

\setuppapersize
  [A5]

\setupexternalfigures
  [location=default]

\setupindenting
  [yes, small]

\setupwhitespace
  [small]

\defineframedtext
  [prettyblock]
  [width=10cm,
   indenting={yes, small},
   background=color, backgroundcolor=lightgreen,
   foreground=color, foregroundcolor=black,
   offset=2mm,
   align=flushleft]

\starttext

\startprettyblock
\setupindenting[next]
  The Earth, as a habitat for animal life, is in old age and has a fatal
  illness. Several, in fact.

  It would be happening whether humans had ever evolved or not.

  \placefigure
[][fig:church]
{Stephanus Church.}
{\externalfigure[ma-cb-24][width=.4\textwidth]}

\stopprettyblock
\setupindenting[next]
Below, we have two separate columns; but up here, for the nonce, we have but
the one.

\startcolumns [n=2]
  Text, text, text \dots
  all in the first column
\column
  Words, words, words \dots
  all in the second column.
  And look ye here! Even more words!
\stopcolumns

\stoptext

Many regards
Uschi 

-Ursprüngliche Nachricht-
Von: ntg-context  Im Auftrag von Oliver Sieber via 
ntg-context
Gesendet: Mittwoch, 19. Oktober 2022 11:31
An: ntg-context@ntg.nl
Cc: Oliver Sieber 
Betreff: [NTG-context] Floating Figure in framed-environment

Dear ConTeXt Users

I am relatively new to context and I am suffering with a problem with the 
framed environment.

I want to use a framed textbox for Definitions in my script. I also want to use 
floating figures.  But this does not work and I haven’t found out why. Maybe I 
totally use it the wrong way. I would appreciate if someone could help me or 
has a tipp.

Here is an example code, where the figure does not behave as expected, i.e. the 
figure is behind the text:

\starttext
\framed[corner=round, rulethickness=2pt, width=\textwidth, align=flushleft, 
offset=1em,background=color,framecolor=black]
{{\bf Definition: Hello World} \blank[medium] 

\placefigure[right, none]{This is an example of a logo.}{\externalfigure[dummy]}

Carrot cake tiramisu lollipop dragée lollipop marshmallow carrot cake sweet 
pastry. Tiramisu danish jelly tootsie roll tart gummi bears. Carrot cake chupa 
chups cake wafer lemon drops lemon drops tiramisu. Chocolate lemon drops sugar 
plum cheesecake jelly beans sugar plum. Tootsie roll cupcake jujubes pie 
chocolate bar bear claw chupa chups shortbread. Candy candy canes jelly-o jelly 
beans sugar plum muffin danish donut. Bonbon lemon drops powder jujubes 
marshmallow biscuit halvah. Powder carrot cake caramels chocolate cake carrot 
cake jelly-o. Topping danish tootsie roll gummi bears oat cake jujubes. Sweet 
candy canes cotton candy pie topping. Jelly-o carrot cake ice cream lemon drops 
macaroon gummies lemon drops tiramisu chocolate cake. Cupcake sugar plum 
shortbread gummi bears tootsie roll. Chocolate cake sugar plum macaroon candy 
canes chocolate bar donut cake icing tootsie roll.
}
\stoptext


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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net archive  : 
https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Floating Figure in framed-environment

2022-10-19 Thread Oliver Sieber via ntg-context
Dear ConTeXt Users

I am relatively new to context and I am suffering with a problem with the 
framed environment.

I want to use a framed textbox for Definitions in my script. I also want to use 
floating figures.  But this does not work and I haven’t found out why. Maybe I 
totally use it the wrong way. I would appreciate if someone could help me or 
has a tipp.

Here is an example code, where the figure does not behave as expected, i.e. the 
figure is behind the text:

\starttext
\framed[corner=round, rulethickness=2pt, width=\textwidth, align=flushleft, 
offset=1em,background=color,framecolor=black]
{{\bf Definition: Hello World} \blank[medium] 

\placefigure[right, none]{This is an example of a logo.}{\externalfigure[dummy]}

Carrot cake tiramisu lollipop dragée lollipop marshmallow carrot cake sweet 
pastry. Tiramisu danish jelly tootsie roll tart gummi bears. Carrot cake chupa 
chups cake wafer lemon drops lemon drops tiramisu. Chocolate lemon drops sugar 
plum cheesecake jelly beans sugar plum. Tootsie roll cupcake jujubes pie 
chocolate bar bear claw chupa chups shortbread. Candy candy canes jelly-o jelly 
beans sugar plum muffin danish donut. Bonbon lemon drops powder jujubes 
marshmallow biscuit halvah. Powder carrot cake caramels chocolate cake carrot 
cake jelly-o. Topping danish tootsie roll gummi bears oat cake jujubes. Sweet 
candy canes cotton candy pie topping. Jelly-o carrot cake ice cream lemon drops 
macaroon gummies lemon drops tiramisu chocolate cake. Cupcake sugar plum 
shortbread gummi bears tootsie roll. Chocolate cake sugar plum macaroon candy 
canes chocolate bar donut cake icing tootsie roll.
}
\stoptext


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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Help test a LMTX bug fix: tweaks in PDF generation

2022-10-09 Thread Leah Neukirchen via ntg-context
Henning Hraban Ramm via ntg-context  writes:

> Am 09.10.22 um 17:33 schrieb Leah Neukirchen via ntg-context:
>> Hi,
>> last week we had a long thread about non-printing PDF on this list
>> and
>> together with Hans I tracked down the issue and we found a fix.
>> Since it changes some details of how PDFs are generated by LMTX, we'd
>> like to test this change first on a wide range of software and
>> printers.
>> So please: Try to preview and then try to print the attached PDF;
>> and report back if either preview or printout does not look like
>> the attached reference PNG image (i.e. something is missing,
>> the fonts look different, or have wrong relative size.)
>> If you use other PDF tools in your workflow, please also check they
>> continue to work as before (and just as well as with MKIV-generated PDFs).
>
> Hi Leah, thank you!
>
> I viewed and printed the PDF with pdf.js in Thunderbird, Apple Preview
> and Adobe Acrobat Pro 9 to my Kyocera FS-C5100DN color laserprinter
> via KPDL (PS-compatible) driver.
> I don’t see any font problems, but neither text nor the bar are 100%
> black – is this intentional? Doesn’t look like RGB black, there are no
> other colors involved except in the printout from pdf.js.

Should be all black (CMYK black), but we didn't change this.
Picking from the screenshot I get #00 on Linux with evince, mupdf,
pdf.js.

> pdf.js seems to print as image and blurs the outlines. (I never tried
> to print from pdf.js before, is this normal?)

Yes, unfortunately.  But not related to our changes.

> Hraban

-- 
Leah Neukirchenhttps://leahneukirchen.org/
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Help test a LMTX bug fix: tweaks in PDF generation

2022-10-09 Thread Henning Hraban Ramm via ntg-context

Am 09.10.22 um 17:33 schrieb Leah Neukirchen via ntg-context:

Hi,

last week we had a long thread about non-printing PDF on this list and
together with Hans I tracked down the issue and we found a fix.
Since it changes some details of how PDFs are generated by LMTX, we'd
like to test this change first on a wide range of software and
printers.

So please: Try to preview and then try to print the attached PDF;
and report back if either preview or printout does not look like
the attached reference PNG image (i.e. something is missing,
the fonts look different, or have wrong relative size.)

If you use other PDF tools in your workflow, please also check they
continue to work as before (and just as well as with MKIV-generated PDFs).


Hi Leah, thank you!

I viewed and printed the PDF with pdf.js in Thunderbird, Apple Preview 
and Adobe Acrobat Pro 9 to my Kyocera FS-C5100DN color laserprinter via 
KPDL (PS-compatible) driver.
I don’t see any font problems, but neither text nor the bar are 100% 
black – is this intentional? Doesn’t look like RGB black, there are no 
other colors involved except in the printout from pdf.js.


pdf.js seems to print as image and blurs the outlines. (I never tried to 
print from pdf.js before, is this normal?)


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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] PDF viewer

2022-09-23 Thread Henning Hraban Ramm via ntg-context
ll no PDF viewer on Linux that can handle annotations 
well. (But even Acrobat Reader on MacOS frequently crashes on them; I’m 
using Foxit Reader for annotations, but the one for Linux is too old.)



for development/debugging:
  - show metadata (incl. XMP), e.g. in a sidebar or dialog


You can see all the "regular" metadata, but XMP doesn't work.


That should be easy to add, since pdf.js can handle Tagged PDF (XML 
parser included).



  - show fonts metadata (inclusion etc.)

No.


Pity. Should also not be too difficult, since the viewer needs the data 
anyway.



  - show PDF Boxes (MediaBox, CropBox, TrimBox, BleedBox, ArtBox) as
colored frames, switchable via preferences and menu (bar) item

No.


Of course. There’s no viewer except Adobe Reader that shows these. But 
it’s an important feature for print preparation and should be easy to 
implement.



  - Funding

Overleaf uses pdf.js as its default PDF viewer, so they may perhaps be
willing to help.


At least with SyncTeX support and other closely TeX-related stuff.


I've been using pdf.js almost exclusively for the past few years either
via Firefox or VS Code, and I've never really had any problems. The only
real issue that I've had is that it gets fairly slow with documents over
a few thousand pages long. Otherwise, it seems pretty fast and stable,
and it supports nearly every feature that I tend to need.


Well, documents with thousands of pages are probably unreliable/slow in 
most viewers.



Since it's written in JavaScript, it should be fairly easy to modify,
and it should run on nearly everything.


Thank 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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] PDF viewer

2022-09-22 Thread Max Chernoff via ntg-context

Hi Hraban,

> I compiled a kind of wishlist what we need or look for in a new or 
> enhanced open source PDF viewer, as discussed e.g. at the 2021 meeting.
> 
> https://wiki.contextgarden.net/PDF_viewer
> 
> Feel free to enhance the wiki page or discuss here.

I think that pdf.js (the Firefox PDF viewer) meets most of these
requirements. There are a few requirements that it doesn't meet, but
it's open source and written in JavaScript, so we should be able to add
anything that's missing.

Going down the list on the Wiki:

> in general:
>  - PDF 2.0 compatible

It can open PDF 2.0 files, but I doubt that it supports every single
feature.

>  - proper color and transparency display (respect color profiles)

It supports all of the PDF colour models/profiles for vectors, although
it ignores embedded colour profiles in images.

   https://github.com/mozilla/pdf.js/issues/2856

Regular RGB and CMYK stuff works fine though.

>  - limited JavaScript support (no modification, no file operations)

Yes, although it is quite limited:

   
https://blog.mozilla.org/attack-and-defense/2021/10/14/implementing-form-filling-and-accessibility-in-the-firefox-pdf-viewer/

>  - search

Yes.

>  - update on file change (configurable)

Not by default in Firefox. It works fine in this extension though:

   https://github.com/tomoki1207/vscode-pdfviewer

>  - keyboard control for as much as possible (but also menus/menubars)

Yes

>  - sidebar for bookmarks/ToC

Yes

>  - SyncTeX support

Not in Firefox, although there are patches to enable it:

   
https://github.com/James-Yu/LaTeX-Workshop/blob/cff1a372/viewer/components/synctex.ts
   
https://github.com/tomoki1207/vscode-pdfviewer/blob/92fecdb8/src/pdfPreview.ts

>  - accessibility (e.g. alternative text must work)

I've never used it, but it looks like there's good support:

   
https://blog.mozilla.org/attack-and-defense/2021/10/14/implementing-form-filling-and-accessibility-in-the-firefox-pdf-viewer/

>  - access to file attachments (lower priority)

Surprisingly, yes.

> for presentations:
>  - presentation mode (full screen, no visible controls, on one 
>monitor/beamer of choice)

Yes.

>  - JS for controlling optional content groups (OCGs, Viewer Layers)

You can toggle all the layers in the side panel. I don't think that you
can toggle via buttons or JS though.

>  - inner- and inter-document links must work

Yes; however, inter-document links are sometimes limited depending for
security reasons. I'm sure that this can be configured though.

>  - multimedia support at least via links (suggestion: use “plain Rich
>Media” approach with OS’ default player)

I don't think so, although I guess you could include a video file as an
attachment.

>  - transition effects not necessary (but if the developer has fun
>including them, go on)

No transition effects.

> for forms:
>  - fill in

Yes.

>  - print documents with/without form contents

Yes.

>  - same-ID fields on different pages must be synchronized

No idea.

>  - custom checkmarks/radiobuttons should work & display correctly

Usually it works, sometimes it doesn't. 

>  - JS for calculations

Usually it works, sometimes it doesn't. 

> for annotations (correction workflow; generally just nice to have):
>  - similar to Adobe/Foxit Reader

Reading annotations works, but you can't modify anything.

> for development/debugging:
>  - show metadata (incl. XMP), e.g. in a sidebar or dialog

You can see all the "regular" metadata, but XMP doesn't work.

>  - show fonts metadata (inclusion etc.)

No.

>  - show PDF Boxes (MediaBox, CropBox, TrimBox, BleedBox, ArtBox) as
>colored frames, switchable via preferences and menu (bar) item

No.

>  - check for PDF/A and PDF/X compliance would be nice (integrate
>VeraPDF?)

>  - FOSS license

Yes. (Apache 2.0)

>  - should at least work on Windows, MacOS (preferably 10.14+), Linux
>and *BSD; iOS & Android versions would be nice

It's built in to Firefox, so it works on Windows, macOS, Linux, and the
BSDs. It should also work on mobile, although support is a little
spottier there.

>  - how about (long term) support?

It should be supported as long as Firefox exists.

>  - Funding

Overleaf uses pdf.js as its default PDF viewer, so they may perhaps be
willing to help.

~~

I've been using pdf.js almost exclusively for the past few years either
via Firefox or VS Code, and I've never really had any problems. The only
real issue that I've had is that it gets fairly slow with documents over
a few thousand pages long. Otherwise, it seems pretty fast and stable,
and it supports nearly every feature that I tend to need.

Since it's written in JavaScript, it should be fairly easy to modify,
and it should run on nearly everythin

Re: [NTG-context] How to display these characters

2022-08-05 Thread Henning Hraban Ramm via ntg-context

Am 05.08.22 um 20:07 schrieb Wolfgang Schuster via ntg-context:

juh+ntg-context--- via ntg-context schrieb am 05.08.2022 um 19:04:

\starttyping
foo
└── bar
    ├── baz
    │   └── index.html
    └── index.html

\stoptyping

The source code is generated with the linux command "tree".


I guess that I could define a fallbackfont. Do anyone know the unicode 
range that should be covered and the font that has these characters?


You need box drawing [1] characters.

When you need fonts with a wide range of character the Noto [2] family 
is a good choice.


Yes, also e.g. Segoe UI Symbols, Apple Symbols, Symbola, Droid Sans 
Fallback.


I recently had the same problem and was wondering if there isn’t a 
Metapost module for directory trees?


Hraban

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] How to display these characters

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

juh+ntg-context--- via ntg-context schrieb am 05.08.2022 um 19:04:

Dear all,

I have this:


\starttext

\starttyping
foo
└── bar
    ├── baz
    │   └── index.html
    └── index.html

\stoptyping

\stoptext

The source code is generated with the linux command "tree".

The special characters which indicate the folder depth are not displayed.

I guess that I could define a fallbackfont. Do anyone know the unicode 
range that should be covered and the font that has these characters?


You need box drawing [1] characters.

When you need fonts with a wide range of character the Noto [2] family 
is a good choice.


 begin example
\definefontfamily [noto] [rm] [Noto Serif]
\definefontfamily [noto] [ss] [Noto Sans]
\definefontfamily [noto] [tt] [Noto Sans Mono]
\definetypeface   [noto] [mm] [math] [pagella] [default]

\setupbodyfont [noto]

\starttext

\starttyping
foo
└── bar
    ├── baz
    │   └── index.html
    └── index.html
\stoptyping

\stoptext
 end example

[1] https://unicode.org/charts/PDF/U2500.pdf
[2] https://github.com/notofonts/noto-fonts

Wolfgang

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] How to display these characters

2022-08-05 Thread juh+ntg-context--- via ntg-context


Dear all,

I have this:


\starttext

\starttyping
foo
└── bar
├── baz
│   └── index.html
└── index.html

\stoptyping

\stoptext

The source code is generated with the linux command "tree".

The special characters which indicate the folder depth are not displayed.

I guess that I could define a fallbackfont. Do anyone know the unicode 
range that should be covered and the font that has these characters?


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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] mframed and alignment width

2022-07-14 Thread Hans-Joerg Schurr via ntg-context
Hello everyone,

I'm using \startaligned with pairs and a distance to represent inference steps,
one per row.
Now I would like to sometimes add a vertical bar to the left of the rows and one
below the last row.  I was able to achieve this using \mframed, but now the
contented inside the framed box doesn't span the entire text width.

Here is an example:
\starttext

\startformula
\startalign[m=3, n=1,distance=2em plus 1 fil]
\NC 1 \NC 2 \NC 3 \NR
\NC 4 \NC 5 \NC 6 \NR
\stopalign
\stopformula

\startformula
\mframed[frame=off,bottomframe=on,leftframe=on]{
\startalign[m=3, n=1,distance=2em plus 1 fil]
\NC 1 \NC 2 \NC 3 \NR
\NC 4 \NC 5 \NC 6 \NR
\stopalign}
\stopformula

\stoptext

The second alignment should have the same width as the first one.  I played
around with the options of \mframed, but could not achieve this. :(

I will sneak in a a second small question: how can I adjust the distance between
the rows?

Thank you very much,
 Hans-Jörg
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Overbar bug

2022-07-05 Thread Aditya Mahajan via ntg-context
On Mon, 4 Jul 2022, Johann Birnick via ntg-context wrote:

> please have a look at the following example:
> 
> \starttext
> $\overbar{\alpha} \overbar{\beta}$
> \stoptext
> 
> The first one works just fine, whereas the second one looks very odd.
> (At least in MkIV...)
> 
> Any ideas?

I don't understand why you are using $\overbar$ in math mode. Do you want 
$\bar{\alpha}$ and $\bar{\beta}$?

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


  1   2   3   4   5   6   7   8   9   10   >