[NTG-context] Re: Why don't footnotes appear in floats or figures?

2024-04-23 Thread Joel via ntg-context
 Okay, I've been trying many things with this \startpostponing code--if I 
understand what's happening, its moving the figures to a later page. I'm not 
sure that's quite ideal, its not fully working with my actual documents, and 
leaves lots of empty white space, when I'm already in a situation where I need 
to reduce page count.
So I thought an alternative route:
(1) have a code that checks "what is current footnote number?" that sets that 
as a variable
\def\currentfoodnote{\somevariableincontextthatgetsfoodnotenumber}
(2) adjust my placefigure macro such that the footnote is outside the 
placefigure, but color it white so its invisible:
\define\showafigure{

\cite[author2019]<--somehow hide this invisible
 
\placefigure{Caption\superscript{\currentfootnote}}}{\externalfigure[cow][width=\textwidth]}
 <--this places a superscript number inside the caption, but it isn't the true 
marker(3) in the caption, place a superscript number with value to 
\currentfootnoteIts basically a fake footnote, just a superscript number of the 
same value as the real footnote.


Shouldn't this result work? Any idea how I can get current footnote value?
--Joel

   On Monday, April 22, 2024 at 07:22:24 AM MDT, vm via ntg-context 
 wrote:  
 
 

On 22/04/2024 14:38, Joel via ntg-context wrote:
> Is this the correct way to be using the \startpostponing code (see 
> example below)?
> 
> \starttext
>      \input knuth
> \startpostponing
>      \placefigure{Caption\footnote{message 
> A}}{\externalfigure[cow][width=\textwidth]}
> \stoppostponing
> \stoppostponing



double stop ?

___
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: Why don't footnotes appear in floats or figures?

2024-04-22 Thread vm via ntg-context



On 22/04/2024 14:38, Joel via ntg-context wrote:
Is this the correct way to be using the \startpostponing code (see 
example below)?


\starttext
     \input knuth
\startpostponing
     \placefigure{Caption\footnote{message 
A}}{\externalfigure[cow][width=\textwidth]}

\stoppostponing
\stoppostponing




double stop ?

___
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: Why don't footnotes appear in floats or figures?

2024-04-22 Thread Joel via ntg-context
 I've managed to get a minimum working example. If you check, you'll see the 
5th footnote inside a placefigure doesn't render anywhere:
\starttext

    \input knuth
    \placefigure{Caption\footnote{message 
A}}{\externalfigure[cow][width=\textwidth]}
    \input knuth
    \placefigure{Caption\footnote{message 
B}}{\externalfigure[cow][width=\textwidth]}
    \input knuth
    \placefigure{Caption\footnote{message 
C}}{\externalfigure[cow][width=\textwidth]}
    \input knuth
    \placefigure{Caption\footnote{message 
D}}{\externalfigure[cow][width=\textwidth]}
    \input knuth
    \placefigure{Caption\footnote{message 
E}}{\externalfigure[cow][width=\textwidth]}
    \input knuth
    \placefigure{Caption\footnote{message 
F}}{\externalfigure[cow][width=\textwidth]}

\stoptext


Is this the correct way to be using the \startpostponing code (see example 
below)?
\starttext
    \input knuth
\startpostponing
    \placefigure{Caption\footnote{message 
A}}{\externalfigure[cow][width=\textwidth]}
\stoppostponing
\stoppostponing
    \input knuth
\startpostponing
    \placefigure{Caption\footnote{message 
B}}{\externalfigure[cow][width=\textwidth]}
\stoppostponing
    \input knuth
\startpostponing
    \placefigure{Caption\footnote{message 
C}}{\externalfigure[cow][width=\textwidth]}
\stoppostponing
    \input knuth
\startpostponing
    \placefigure{Caption\footnote{message 
D}}{\externalfigure[cow][width=\textwidth]}
\stoppostponing
    \input knuth
\startpostponing
    \placefigure{Caption\footnote{message 
E}}{\externalfigure[cow][width=\textwidth]}
\stoppostponing
    \input knuth
\startpostponing
    \placefigure{Caption\footnote{message 
F}}{\externalfigure[cow][width=\textwidth]}
\stoppostponing
\stoptext




On Monday, April 22, 2024 at 02:31:30 AM MDT, Hans Hagen via ntg-context 
 wrote:  
 
 On 4/22/2024 2:45 AM, Joel via ntg-context wrote:
> I'm three days out from sending my work to an editor, and found some 
> serious problem: many footnotes just aren't rendering.
> 
> I have a history text that uses ConTeXt-SBL for the citations, as such, 
> it has lots of footnotes. Sometimes the footnotes are just in the main 
> text, but sometimes also in figure captions, inside floats, inside 
> tables that are inside floats, inside tabulations inside floats, etc.
> 
> What I find alarming is it is frequently not rendering all of the 
> footnote messages at the bottom of the page. The actual footnote number 
> within the body is rendered, but no number is listed in at the bottom of 
> the page. So I might see a list of footnotes, for instance, on page 1, I 
> only get footnotes 1, 2, 3, 5, and 6, but 4 was mysteriously skipped.
> 
> 
> ---
> 1 message
> 2 message
> 3 message
> 5 message
> 6 message
> 
> After a lot of trial-and-error and checking logs and checking my BibTeX 
> files for errors, running everything through BibTex Tidy, etc., and 
> failures to make a minimum working example, I found a single pattern:
> 
> If the footnote marker appears on the SAME page as the footnote text, it 
> has no problem rendering the footnote. But, if ConTeXt decides to move a 
> float a page or two later on--as it frequently seems to do---such that 
> the footnote marker and footnote text at bottom of page should be on 
> DIFFERENT pages, the footnote message at the bottom of the page won't 
> render.
> 
> I've seen some 2+ year old mailing list posts suggesting ConTeXt might 
> have issues with footnotes; they appear to be similar to my issue--is 
> that still a problem? Is there a fix or workaround? Old fixes I could 
> finding in the mailing list don't seem to work with current versions of 
> ConTeXt anymore.
you need to consider the complications of such notes ...

- tex needs to take the notes into account when determining a page break
- it does so by the insert mechanism
- when floats can't be placed they also become inserts (top and bottom)
- when there are inserts in inserts th eproblem becomes more complex (so 
notes inside floats)
- in traditional tex deeply burried inserts disappearm less so in lmtx

There are things that are hard to get right. This works:

\startpostponing
    \startplacefigure[location=here,title={test \footnote{oeps 1}}]
        \blackrule[width=1tw]
        here
        \footnote{hello 1} and
        \footnote{hello 2} and
        \footnote{hello 3} done
    \stopplacefigure
\stoppostponing

\dorecurse{10}{\samplefile{tufte}\par}

Because here the inserts (notes) will migrate but even then one can get 
them out of order (unless we renumber, which then is sensitiev for 
oscillation).

I occasionally wonder if top floats could be done more directly but 
bottom notes still would have an out-of-sync problem




-
                                          Hans Hagen | PRAGMA ADE
              Ridd

[NTG-context] floats re-ordering and numbering

2024-04-22 Thread denis.maier
Hi,

I've found that occasionally the order of floats change, but the numbering 
still reflects the order in the input file. Is that the intended behaviour? Is 
there a way to number to floats according to their order in the (visual) output?

Best,
Denis

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

\setupfloats[compress=no]
\setupfloat[figure][default=top]

\starttext

\input knuth

\placefigure{Cow 1}{\externalfigure[cow][
width=.5\textwidth,
]}
\placefigure{Cow 2}{\externalfigure[cow][
width=.8\textwidth,
]}

\placefigure{Cow 3}{\externalfigure[cow][
width=.7\textwidth,
]}

\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: Weird (?) float placement for specific widths of image

2024-04-19 Thread Pablo Rodriguez via ntg-context
On 4/19/24 17:48, Denis Maier via ntg-context wrote:
> Hi again,
>
> just a quick follow up on this one. Can anyone reproduce this?

Hi Denis,

I can reproduce it.

> Would be good to know how this can be fixed. I have this in a real
> document, and as I’m typesetting a XML source I cannot just adjust
> slightly adjust the dimensions to get rid of that.

It seems that you can place the figures somehow
(https://www.pragma-ade.nl/general/qrcs/setup-en.pdf#page=169):

See the extreme example:

  \showframe\showgrid\showstruts
  \setupexternalfigures
  [location={local,global,default}]
  \starttext
  \placefigure{A Cow}{\externalfigure[cow][
  height=.5\textheight,
      ]}

  \placefigure{A Cow}{\externalfigure[cow][
  height=.3\textheight,
  %height=.4\textheight,
      ]}

  \placefigure{A Cow}{\externalfigure[cow][
  width=3cm,
  %width=2cm,
      ]}

  \placefigure[inleft]{A Cow}{\externalfigure[cow][width=2cm]}

  \placefigure[inright]{A Cow}{\externalfigure[cow][width=2cm]}
  \stoptext

Just in case it helps,

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

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


[NTG-context] Re: Weird (?) float placement for specific widths of image

2024-04-19 Thread Denis Maier via ntg-context
Hi again,

 

just a quick follow up on this one. Can anyone reproduce this?

Would be good to know how this can be fixed. I have this in a real document,
and as I'm typesetting a XML source I cannot just adjust slightly adjust the
dimensions to get rid of that.

 

Best,

Denis

 

 

Von: denisma...@mailbox.org  
Gesendet: Mittwoch, 10. April 2024 13:37
An: 'ntg-context@ntg.nl' 
Betreff: Weird (?) float placement for specific widths of image

 

Hi, 

 

another graphics/floats question: consider the following example

 

%

 

\setupexternalfigures

[location={local,global,default}]

 

\starttext

 

\placefigure{A Cow}{\externalfigure[cow][

height=.5\textheight,

]}

 

\placefigure{A Cow}{\externalfigure[cow][

height=.3\textheight,

%height=.4\textheight,

]}

 

 

\placefigure{A Cow}{\externalfigure[cow][

width=3cm,

%width=2cm,

]}

 

\placefigure{A Cow}{\externalfigure[cow][width=2cm]}

 

\placefigure{A Cow}{\externalfigure[cow][width=2cm]}

 

\stoptext%

 

On the first page, the images appear stacked above each other while on the
second page they appear next to each other.

 

It took me some time to reproduce this behaviour, and I can't claim to
understand what is happening. But it seems to be related to the specific
widths of the images. When I change them to other values the behaviour
disappears. Is this a bug? Anything I can do about this?

 

Best

Denis

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

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


[NTG-context] Re: Wiki - question about Command/ pages which start with a space character

2024-04-14 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 14.04.2024 um 14:53:

Am 14.04.24 um 14:46 schrieb Wolfgang Schuster:

garu...@azules.eu schrieb am 14.04.2024 um 12:41:

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?


The command pages which start with an underscore are probably leftovers
when Taco changed a page from manual command descriptions to auto
generated tables.

In the process to change the page he makes a copy of the current page
with an underscore at the beginning which is deleted after the change
but it's possible he forgot to delete a few of them.

When you notice no difference between both versions of a command page
you can delete all of the forgotten pages.


No!

These are the general pages in opposite to instance pages, e.g. 
"startsection" and "startchapter" are instances of "_startsection"?


https://wiki.contextgarden.net/Command/_placefloat is the general page 
for the instances placefigure, placetable etc.


My bad, thank you for the correction!

Wolfgang

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

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


[NTG-context] Re: Wiki - question about Command/ pages which start with a space character

2024-04-14 Thread Henning Hraban Ramm

Am 14.04.24 um 14:46 schrieb Wolfgang Schuster:

garu...@azules.eu schrieb am 14.04.2024 um 12:41:

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?


The command pages which start with an underscore are probably leftovers
when Taco changed a page from manual command descriptions to auto
generated tables.

In the process to change the page he makes a copy of the current page
with an underscore at the beginning which is deleted after the change
but it's possible he forgot to delete a few of them.

When you notice no difference between both versions of a command page
you can delete all of the forgotten pages.


No!

These are the general pages in opposite to instance pages, e.g. 
"startsection" and "startchapter" are instances of "_startsection"?


https://wiki.contextgarden.net/Command/_placefloat is the general page 
for the instances placefigure, placetable etc.


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] Weird (?) float placement for specific widths of image

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

 

another graphics/floats question: consider the following example

 

%

 

\setupexternalfigures

[location={local,global,default}]

 

\starttext

 

\placefigure{A Cow}{\externalfigure[cow][

height=.5\textheight,

]}

 

\placefigure{A Cow}{\externalfigure[cow][

height=.3\textheight,

%height=.4\textheight,

]}

 

 

\placefigure{A Cow}{\externalfigure[cow][

width=3cm,

%width=2cm,

]}

 

\placefigure{A Cow}{\externalfigure[cow][width=2cm]}

 

\placefigure{A Cow}{\externalfigure[cow][width=2cm]}

 

\stoptext%

 

On the first page, the images appear stacked above each other while on the
second page they appear next to each other.

 

It took me some time to reproduce this behaviour, and I can't claim to
understand what is happening. But it seems to be related to the specific
widths of the images. When I change them to other values the behaviour
disappears. Is this a bug? Anything I can do about this?

 

Best

Denis

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

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


[NTG-context] Re: blank line and \placefigure

2024-04-06 Thread Thomas Meyer

Here is a minimal example that better describes my problem.
It seems to depend on the size of the image. 30 mm and 40 mm width 
works, 35 mm does not.
I have not tested height, although the image I want to use would be 
portrait format.


\setuplayout[grid=yes]
\setupinterlinespace[line=15pt]
\starttext
\input{knuth}
\startlinecorrection
\placefigure[left, none]
[]{}\externalfigure[cow.pdf][width=40mm]
\input{knuth}
\stoplinecorrection
\stoptext

Thomas

Am 06.04.24 um 13:43 schrieb Wolfgang Schuster:

Henning Hraban Ramm schrieb am 06.04.2024 um 12:56:

Am 06.04.24 um 12:48 schrieb Thomas Meyer:
how can I suppress a blank line between a text paragraph and 
\placefigure?

I get one there, but I don't want it.


Did you try
\setupfloat[figure][spacebefore=,]
?
or "none" or "{disable,nowhite,back}"


You can set the space only for *all* floats, e.g.

    \setupfloat[spacebefore=...,spaceafter=...]

and not for a single float type only.

Wolfgang

___ 

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


maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net 
(mirror)

archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___ 

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

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


[NTG-context] Re: blank line and \placefigure

2024-04-06 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 06.04.2024 um 12:56:

Am 06.04.24 um 12:48 schrieb Thomas Meyer:
how can I suppress a blank line between a text paragraph and 
\placefigure?

I get one there, but I don't want it.


Did you try
\setupfloat[figure][spacebefore=,]
?
or "none" or "{disable,nowhite,back}"


You can set the space only for *all* floats, e.g.

    \setupfloat[spacebefore=...,spaceafter=...]

and not for a single float type only.

Wolfgang

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

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


[NTG-context] Re: blank line and \placefigure

2024-04-06 Thread Henning Hraban Ramm

Am 06.04.24 um 12:48 schrieb Thomas Meyer:

how can I suppress a blank line between a text paragraph and \placefigure?
I get one there, but I don't want it.


Did you try
\setupfloat[figure][spacebefore=,]
?
or "none" or "{disable,nowhite,back}"

https://wiki.contextgarden.net/Command/setupfloat
https://wiki.contextgarden.net/Command/blank

HTH
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] blank line and \placefigure

2024-04-06 Thread Thomas Meyer

Hi folks,

how can I suppress a blank line between a text paragraph and \placefigure?
I get one there, but I don't want it.

Thanks and greetings on a sunny weekend
Thomas
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: How to get an image to fill the maximum available space?

2024-03-30 Thread Hans Hagen

On 3/30/2024 12:07 PM, Bruce Horrocks wrote:




On 30 Mar 2024, at 09:38, Henning Hraban Ramm  wrote:

Am 30.03.24 um 03:15 schrieb Joel via ntg-context:

I have code like this:
 \placefigure[here, force]{my caption}{%
 \externalfigure[#1][frame=on, maxheight=1.2\textwidth, 
maxwidth=\textwidth]%
 }%
I need some images to appear in a book. I need them to keep their proper 
ratios, but scale up to the maximize the available space.
The image can't be more than \textwidth wide, and can't ever be more than 
1.2\textwidth high.
The problem I am getting with this code, and it does seem to be limiting the 
images to be not bigger than those two dimensions above, is some of the images, 
for reasons I can't understand, are appearing really tiny and aren't scaling up 
to fill as much space as is possible. I can't explain why this is 
happening--the images themselves are very very high resolution.
Is there any way to modify the code to make sure the image stretches up to be 
the biggest it can, without exceeding the sizes I've listed?


Hi Joel,

AFAIK, if you don’t set at least either height or width, ConTeXt uses the 
image’s resolution setting to calculate its size, and that is often useless.

(Maybe there’s also something wrong with ConTeXt’s max width/height, I don’t 
know; I’m still planning to carefully check all options of image processing…)

You could try if "factor=fit" or "factor=max" yields the results you want.


As Hraban says, you only need to set one of height or width and Context works 
out the other.

For your case I think you just need width=\textwidth, so

   \externalfigure[#1][frame=on,width=\textwidth,maxheight=1.2\textwidth]%

where maxheight imposes the height size limit you mention.

If you still have problems with tiny images then I suspect that is a different 
issue - something to do with the image file and the metadata about the image 
size maybe? If you can share an affected image then perhaps start another 
question with an MWE and upload the image somewhere.

% \externalfigure
% [t:/sources/cow.pdf]
% [frame=on,factor=max]

\externalfigure
[t:/sources/mill.png]
[frame=on,factor=max,maxwidth=\textwidth,maxheight=.8\textheight]


-
  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: How to get an image to fill the maximum available space?

2024-03-30 Thread Bruce Horrocks


> On 30 Mar 2024, at 09:38, Henning Hraban Ramm  wrote:
> 
> Am 30.03.24 um 03:15 schrieb Joel via ntg-context:
>> I have code like this:
>> \placefigure[here, force]{my caption}{%
>> \externalfigure[#1][frame=on, maxheight=1.2\textwidth, 
>> maxwidth=\textwidth]%
>> }%
>> I need some images to appear in a book. I need them to keep their proper 
>> ratios, but scale up to the maximize the available space.
>> The image can't be more than \textwidth wide, and can't ever be more than 
>> 1.2\textwidth high.
>> The problem I am getting with this code, and it does seem to be limiting the 
>> images to be not bigger than those two dimensions above, is some of the 
>> images, for reasons I can't understand, are appearing really tiny and aren't 
>> scaling up to fill as much space as is possible. I can't explain why this is 
>> happening--the images themselves are very very high resolution.
>> Is there any way to modify the code to make sure the image stretches up to 
>> be the biggest it can, without exceeding the sizes I've listed?
> 
> Hi Joel,
> 
> AFAIK, if you don’t set at least either height or width, ConTeXt uses the 
> image’s resolution setting to calculate its size, and that is often useless.
> 
> (Maybe there’s also something wrong with ConTeXt’s max width/height, I don’t 
> know; I’m still planning to carefully check all options of image processing…)
> 
> You could try if "factor=fit" or "factor=max" yields the results you want.

As Hraban says, you only need to set one of height or width and Context works 
out the other.

For your case I think you just need width=\textwidth, so

  \externalfigure[#1][frame=on,width=\textwidth,maxheight=1.2\textwidth]%

where maxheight imposes the height size limit you mention.

If you still have problems with tiny images then I suspect that is a different 
issue - something to do with the image file and the metadata about the image 
size maybe? If you can share an affected image then perhaps start another 
question with an MWE and upload the image somewhere.

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: How to get an image to fill the maximum available space?

2024-03-30 Thread Henning Hraban Ramm

Am 30.03.24 um 03:15 schrieb Joel via ntg-context:

I have code like this:

     \placefigure[here, force]{my caption}{%
         \externalfigure[#1][frame=on, maxheight=1.2\textwidth, 
maxwidth=\textwidth]%

     }%

I need some images to appear in a book. I need them to keep their proper 
ratios, but scale up to the maximize the available space.


The image can't be more than \textwidth wide, and can't ever be more 
than 1.2\textwidth high.


The problem I am getting with this code, and it does seem to be limiting 
the images to be not bigger than those two dimensions above, is some of 
the images, for reasons I can't understand, are appearing really tiny 
and aren't scaling up to fill as much space as is possible. I can't 
explain why this is happening--the images themselves are very very high 
resolution.


Is there any way to modify the code to make sure the image stretches up 
to be the biggest it can, without exceeding the sizes I've listed?


Hi Joel,

AFAIK, if you don’t set at least either height or width, ConTeXt uses 
the image’s resolution setting to calculate its size, and that is often 
useless.


(Maybe there’s also something wrong with ConTeXt’s max width/height, I 
don’t know; I’m still planning to carefully check all options of image 
processing…)


You could try if "factor=fit" or "factor=max" yields the results you want.

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] How to get an image to fill the maximum available space?

2024-03-29 Thread Joel via ntg-context
I have code like this:

    \placefigure[here, force]{my caption}{%        
\externalfigure[#1][frame=on, maxheight=1.2\textwidth, maxwidth=\textwidth]%
    }%
I need some images to appear in a book. I need them to keep their proper 
ratios, but scale up to the maximize the available space.
The image can't be more than \textwidth wide, and can't ever be more than 
1.2\textwidth high.
The problem I am getting with this code, and it does seem to be limiting the 
images to be not bigger than those two dimensions above, is some of the images, 
for reasons I can't understand, are appearing really tiny and aren't scaling up 
to fill as much space as is possible. I can't explain why this is 
happening--the images themselves are very very high resolution.
Is there any way to modify the code to make sure the image stretches up to be 
the biggest it can, without exceeding the sizes I've listed?
--Joel
___
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 include an an svg file?

2024-03-13 Thread Jean-Pierre Delange
Hraban,
Thank a lot for these clarifications !
Jean-Pierre


> Le 13 mars 2024 à 13:41, Henning Hraban Ramm  a écrit :
> 
> Am 13.03.24 um 13:14 schrieb Jean-Pierre Delange:
>> Hi Hraban & Seyal
>> I can confirm that converting the *.svg file into a *.pdf file displays the 
>> colour shades correctly ...
>> (I used Gimp to export the smile.svg file to a smile03.pdf file).
> 
> Gimp is a really bad choice in this case, since it converts vectors into 
> pixels.
> And if you place a PDF, no further conversion is needed.
> 
> If you have problems with SVGs, use Inkscape (or some commercial alternative 
> like Affinity Designer or Adobe Illustrator) for PDF conversion.
> 
>> The MWE below works correctly, even if you have to make finer adjustments to 
>> place the figure in a precise position on the page. As I'm in the process of 
>> enriching and clarifying a few pages of the ConTeXt wiki and the French 
>> wikibook, I'm interested in the details concerning the position of figures, 
>> images and photos etc. So please let me know (in private mail) how you make 
>> your documents (a MWE will do).
> 
> Position options:
> * relative placement as floats, i.e. \placefigure
> * absolute placement on layers, i.e. \setlayer
> * relative corrections with \offset (also within floats)
> 
> 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: how to include an an svg file?

2024-03-13 Thread Henning Hraban Ramm

Am 13.03.24 um 13:14 schrieb Jean-Pierre Delange:

Hi Hraban & Seyal

I can confirm that converting the *.svg file into a *.pdf file displays 
the colour shades correctly ...

(I used Gimp to export the smile.svg file to a smile03.pdf file).


Gimp is a really bad choice in this case, since it converts vectors into 
pixels.

And if you place a PDF, no further conversion is needed.

If you have problems with SVGs, use Inkscape (or some commercial 
alternative like Affinity Designer or Adobe Illustrator) for PDF conversion.


The MWE below works correctly, even if you have to make finer 
adjustments to place the figure in a precise position on the page. As 
I'm in the process of enriching and clarifying a few pages of the 
ConTeXt wiki and the French wikibook, I'm interested in the details 
concerning the position of figures, images and photos etc. So please let 
me know (in private mail) how you make your documents (a MWE will do).


Position options:
* relative placement as floats, i.e. \placefigure
* absolute placement on layers, i.e. \setlayer
* relative corrections with \offset (also within floats)

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] multicolumn title and abstact (bachotex) using tugboat.mkxl

2024-03-07 Thread Damien Thiriet via ntg-context

Hello,


I am currently writing my paper for last year's BachoTeX proceedings.
I am using tugboat.mkxl module to design the layout.

In bachotex proceedings, the author's data and abstract are on a single 
column and the article is usually typeset on two columns.

Comments in tugboat.mkxl states:

%D We have several column mechanisms and they all serve a different 
purpose. Here we
%D use pagecolumns. They support much of what we can do in single 
columns, but of
%D course there are exceptions. Floats can go into columns of aremoved 
to the top or
%D bottom when there is no room. We don't span mid column. Notes can go 
in columns
%D or at the end. We can start with a single column (for titles and 
such).


I can't figure out which part of the file should be used/adapted to 
start with a single column.
What I did is to put datas and abstract in a frame and use \placefigure. 
As stated in pagecolumns
manual, everything is put on the top of next page. (BTW, there is a 
typo: «of aremoved»)


I don't know, whether this MWE helps is relevant, but just in case, here 
is what I did:


* copy tugboat.mkxl to a new file p-bachotex.mkxl
* changed p-bachotex.mkxl like this:

\startsetups bachotex:naglowek:columns
\defineframedtext [Dane]
\setupframedtext
[Dane]
[width=18cm ,
 align=normal,
 frame=no]
\definenarrower
[Streszczenia]
[2*middle]

\startplacefigure [location={here,none}]
{\startDane
{\tfa\getvariable{tugboat}{author}}\par
\getvariable{tugboat}{address}\par
{\tt\getvariable{tugboat}{email}}\par

\startStreszczenia
\doifelsebufferempty {abstract} {
% no abstract
} {
\blank[line]

\enforced\let\\\endgraf
\setups[tugboat:abstract:setup]
\startAbstracts[title={Abstract}]
\stopAbstracts
}
\stopStreszczenia
\stopDane}
\stopplacefigure
\stopsetups

\startsetups tugboat:article:start

  \starttext

\setups{tugboat:columns:presets}

\setups{tugboat:banner:setup:\getvariable{tugboat}{type}}

\setupheadertexts
[\setups{tugboat:banner:text:article}]
[pagenumber]

\setuppagenumber
[number=\getvariable{tugboat}{page}]

\startmode[columns]
\startpagecolumns
\stopmode

\setups[tugboat:introduction:article]
\doifmodeelse{columns}{
\setups{bachotex:naglowek:columns}
} {
\setups{bachotex:naglowek:nocolumns}
}

\stopsetups

My article begins so:

\enablemode [columns]
\usemodule [bachotex]

% skipped tugboat variables for this MWE

\StartAbstract
  \input tufte
\StopAbstract
\StartArticle
   \input knuth
\StopArticle

Thank you for your help

Damien T
___
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: [ flowing figures ]

2024-01-11 Thread Henning Hraban Ramm

Am 11.01.24 um 16:15 schrieb vm via ntg-context:
How can I wrap an externalfigure into a box that can be placed within 
running text?


\externalfigure[dummy][frame=on]

With or without a \placefigure


Should I wrap the externalfigure into a start/stop buffer, then place it?


I don’t see why.

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] Question about drawing flowchart using chart module

2023-12-27 Thread Jeong Dal via ntg-context
Dear all,

I tried to draw a flow chart using the module[chart].
Following the examples, I draw one.

The problem is that the size of the chart is not changed even though I changed 
the numbers dx,dy, width, height, and maxwidth in the \setupFLOWcharts

Please tell me how to resize the chart.

Thank you.

Dalyoung

%%
\usemodule[chart]

\starttext

\startFLOWchart[bigger]
  \setupFLOWcharts
  [option=test,
   nx=3,
   ny=6,
   dx=\bodyfontsize,
   dy=\bodyfontsize,
   width=6cm,%.5\bodyfontsize,
   height=10cm,%.3\bodyfontsize,
   maxwidth=.5\textwidth
   ]

  \startFLOWcell 
\name{a} \location{2,1} \shape{loop} \text{start}  
\connection[bt]{b}
  \stopFLOWcell
  \startFLOWcell 
\name{b} \location{2,2} \shape{79} \text{input $a,b$} 
\connection[bt]{c} 
  \stopFLOWcell
  \startFLOWcell 
\name{c} \location{2,3} \shape{decision} \text{$a-b > 0$}  
\connection[lt]{d}  \comment[l]{Yes}
\connection[rt]{g}  \comment[r]{No}
  \stopFLOWcell
  \startFLOWcell 
\name{d} \location{1,5} \shape{76} \text{$a$ is bigger \\ than $b$} 
 
\connection[bt]{f}
  \stopFLOWcell
  \startFLOWcell 
\name{e} \location{2,5} \shape{76} \text{$b$ is bigger \\ than $a$} 
 
\connection[bt]{f}
  \stopFLOWcell
  \startFLOWcell 
\name{g} \location{3,4} \shape{decision} \text{$a - b < 0$}  
\connection[lt]{e}\comment[l]{Yes}
\connection[bt]{h}\comment[b]{No}
  \stopFLOWcell
  \startFLOWcell 
\name{h} \location{3,5} \shape{76} \text{$a$ is equal \\ to $b$}  
\connection[bt]{f}
  \stopFLOWcell
  \startFLOWcell 
\name{f} \location{2,6} \shape{loop} \text{stop}  
  \stopFLOWcell
\stopFLOWchart

\placefigure
  [here][fig:bigger]
  {Which is bigger?}
  {\tx\setupFLOWcharts\FLOWchart[bigger]}

\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 (was \placefigure[location=here...] problem)

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

On 12/9/2023 4:33 PM, Aditya Mahajan wrote:

On Sat, 9 Dec 2023, Wolfgang Schuster wrote:


\starttext

\startlines
\type{\frac{1}{3}}: \m{\frac{1}{3}}
\type{\xfrac{1}{3}}: \m{\xfrac{1}{3}}
\type{\xxfrac{1}{3}}: \m{\xxfrac{1}{3}}
\type{\tfrac{1}{3}}: \m{\tfrac{1}{3}}
\type{\sfrac{1}{3}}: \m{\sfrac{1}{3}}
\type{\frac{1}{3}}: \m{\frac{1}{3}}
\type{\dfrac{1}{3}}: \m{\dfrac{1}{3}}
\type{\cfrac{1}{3}}: \m{\cfrac{1}{3}}
\type{\vfrac{1}{3}}: \m{\vfrac{1}{3}}
\type{\hfrac{1}{3}}: \m{\hfrac{1}{3}}
\stoplines

\stoptext


Or, for inline math, $\sqrt{1/3}$.

radicals are somewhat special to deal with:

- multidimensional delimiter
- vertical spacing inside
- horizontal spacing oustside
- anchoring degrees
- left and right radicals
- more consistent rules (char based)
- size dependent additional spacing (avoid clash)
- normalize size across formula
- lack of granularity in variants sizes

by now we have dealt with all of that (some not in the current release), 
think of additional control in the engine, compensation for insufficient 
opentype math features, companion fonts with more sizes


there will always be suboptimal cases but the average is ok (we put 
radical - character kerning on hold because it is a lot of definitions) 
and we don't want to add hard to fight heuristics


so to inline: in most cases the solution that Adirya suggests will work 
out okay with respect toline spacing


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: Fractions (was \placefigure[location=here...] problem)

2023-12-09 Thread Wolfgang Schuster

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!

Wolfgang

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

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


[NTG-context] Re: Fractions (was \placefigure[location=here...] problem)

2023-12-09 Thread Aditya Mahajan
On Sat, 9 Dec 2023, Wolfgang Schuster wrote:

> \starttext
> 
> \startlines
> \type{\frac{1}{3}}: \m{\frac{1}{3}}
> \type{\xfrac{1}{3}}: \m{\xfrac{1}{3}}
> \type{\xxfrac{1}{3}}: \m{\xxfrac{1}{3}}
> \type{\tfrac{1}{3}}: \m{\tfrac{1}{3}}
> \type{\sfrac{1}{3}}: \m{\sfrac{1}{3}}
> \type{\frac{1}{3}}: \m{\frac{1}{3}}
> \type{\dfrac{1}{3}}: \m{\dfrac{1}{3}}
> \type{\cfrac{1}{3}}: \m{\cfrac{1}{3}}
> \type{\vfrac{1}{3}}: \m{\vfrac{1}{3}}
> \type{\hfrac{1}{3}}: \m{\hfrac{1}{3}}
> \stoplines
> 
> \stoptext

Or, for inline math, $\sqrt{1/3}$. 

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

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


[NTG-context] Re: Fractions (was \placefigure[location=here...] problem)

2023-12-09 Thread Wolfgang Schuster

Fabrice Couvreur schrieb am 09.12.2023 um 16:13:

Hi Wolfgang,
I'm reading this thread and I'm interested because I type a lot of 
text with mathematical formulas.
In fact, I find that \dfrac{} creates unsightly leading space and that 
\frac{} is too small. What is the difference between \frac{} and 
\tfrac{} ?


\frac switches the math style while \tfrac (textstyle), \dfrac 
(displaystyle) and \sfrac (scriptstyle) enforce a certain style.


 begin example
\startbuffer[frac]
\frac{1}{2} + \dfrac{1}{2} - \tfrac{1}{2} + \sfrac{1}{2}
\stopbuffer

\starttext

\startformula
\getbuffer[frac]
\stopformula

\m{\getbuffer[frac]}

\startformula
  \frac
    {\getbuffer[frac]}
    {\getbuffer[frac]}
\stopformula

\m{\frac
  {\getbuffer[frac]}
  {\getbuffer[frac]}}

\stoptext
 end example

Wolfgang

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

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


[NTG-context] Re: Fractions (was \placefigure[location=here...] problem)

2023-12-09 Thread anton . chigurh
Thanks :-)
___
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 (was \placefigure[location=here...] problem)

2023-12-09 Thread Fabrice Couvreur
Hi Wolfgang,
I'm reading this thread and I'm interested because I type a lot of text
with mathematical formulas.
In fact, I find that \dfrac{} creates unsightly leading space and that
\frac{} is too small. What is the difference between \frac{} and \tfrac{} ?
Fabrice

Le sam. 9 déc. 2023 à 14:00, Henning Hraban Ramm  a écrit :

> Am 09.12.23 um 14:43 schrieb Wolfgang Schuster:
> > anton.chig...@mail.com schrieb am 09.12.2023 um 14:15:
> > \startlines
> > \type{\frac{1}{3}}: \m{\frac{1}{3}}
> > \type{\xfrac{1}{3}}: \m{\xfrac{1}{3}}
> > \type{\xxfrac{1}{3}}: \m{\xxfrac{1}{3}}
> > \type{\tfrac{1}{3}}: \m{\tfrac{1}{3}}
> > \type{\sfrac{1}{3}}: \m{\sfrac{1}{3}}
> > \type{\frac{1}{3}}: \m{\frac{1}{3}}
> > \type{\dfrac{1}{3}}: \m{\dfrac{1}{3}}
> > \type{\cfrac{1}{3}}: \m{\cfrac{1}{3}}
> > \type{\vfrac{1}{3}}: \m{\vfrac{1}{3}}
> > \type{\hfrac{1}{3}}: \m{\hfrac{1}{3}}
> > \stoplines
>
> There’s also \vulgarfraction{1}{3} (but probably not suitable for your
> application).
>
> 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: Fractions (was \placefigure[location=here...] problem)

2023-12-09 Thread Henning Hraban Ramm

Am 09.12.23 um 14:43 schrieb Wolfgang Schuster:

anton.chig...@mail.com schrieb am 09.12.2023 um 14:15:
\startlines
\type{\frac{1}{3}}: \m{\frac{1}{3}}
\type{\xfrac{1}{3}}: \m{\xfrac{1}{3}}
\type{\xxfrac{1}{3}}: \m{\xxfrac{1}{3}}
\type{\tfrac{1}{3}}: \m{\tfrac{1}{3}}
\type{\sfrac{1}{3}}: \m{\sfrac{1}{3}}
\type{\frac{1}{3}}: \m{\frac{1}{3}}
\type{\dfrac{1}{3}}: \m{\dfrac{1}{3}}
\type{\cfrac{1}{3}}: \m{\cfrac{1}{3}}
\type{\vfrac{1}{3}}: \m{\vfrac{1}{3}}
\type{\hfrac{1}{3}}: \m{\hfrac{1}{3}}
\stoplines


There’s also \vulgarfraction{1}{3} (but probably not suitable for your 
application).


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] Fractions (was \placefigure[location=here...] problem)

2023-12-09 Thread Wolfgang Schuster

anton.chig...@mail.com schrieb am 09.12.2023 um 14:15:

I worked, ;-), thanks.
Let me ask you another thing, how can I avoid messing up the
line spacing by using \sqrt and \frac, the line that follows these has increased
line spacing in the pdf output

code:
Find the normal and shearing stresses on an oblique plane defined by
$l=\sqrt{\frac{3}{13}}$, $m=\sqrt{\frac{1}{13}}$, and $n=\sqrt{\frac{9}{13}}$.


Complete working minimal examples are preferred over code snippets.

To avoid single lines with different spacing you can either increase the 
line spacing for all
lines with \setupinterlinespace or you use a different fraction command 
which uses

smaller numbers or creates inline fractions.

\starttext

\startlines
\type{\frac{1}{3}}: \m{\frac{1}{3}}
\type{\xfrac{1}{3}}: \m{\xfrac{1}{3}}
\type{\xxfrac{1}{3}}: \m{\xxfrac{1}{3}}
\type{\tfrac{1}{3}}: \m{\tfrac{1}{3}}
\type{\sfrac{1}{3}}: \m{\sfrac{1}{3}}
\type{\frac{1}{3}}: \m{\frac{1}{3}}
\type{\dfrac{1}{3}}: \m{\dfrac{1}{3}}
\type{\cfrac{1}{3}}: \m{\cfrac{1}{3}}
\type{\vfrac{1}{3}}: \m{\vfrac{1}{3}}
\type{\hfrac{1}{3}}: \m{\hfrac{1}{3}}
\stoplines

\stoptext

Wolfgang

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

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


[NTG-context] Re: \placefigure[location=here...] problem

2023-12-09 Thread anton . chigurh
I worked, ;-), thanks.
Let me ask you another thing, how can I avoid messing up the
line spacing by using \sqrt and \frac, the line that follows these has increased
line spacing in the pdf output

code:
Find the normal and shearing stresses on an oblique plane defined by
$l=\sqrt{\frac{3}{13}}$, $m=\sqrt{\frac{1}{13}}$, and $n=\sqrt{\frac{9}{13}}$.
___
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: \placefigure[location=here...] problem

2023-12-09 Thread Wolfgang Schuster

anton.chig...@mail.com schrieb am 09.12.2023 um 11:50:

Hi all,
I am generating a quiz, with eight questions, each
with text and a figure following it. The output was fine till the
fifth question, but then the margin separating the  text of
each question disappeared and the figure got put on the
next page one after the other.
Can anyone suggest what I could be doing wrong?


Without a proper example it's difficult to give an answer.


Do I need to increase the buffer? how?


This is what I have used to place each figure
\startplacefigure[location=here,reference=fig:blah][]{}
  \externalfigure[blah.jpeg][scale=300]
\stopplacefigure


You can try the force option:

\startplacefigure[location=force,reference=fig:blah]
  \externalfigure[blah.jpeg][scale=300]
\stopplacefigure

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] \placefigure[location=here...] problem

2023-12-09 Thread anton . chigurh
Hi all,
I am generating a quiz, with eight questions, each
with text and a figure following it. The output was fine till the
fifth question, but then the margin separating the  text of
each question disappeared and the figure got put on the
next page one after the other.
Can anyone suggest what I could be doing wrong?
Do I need to increase the buffer? how?


This is what I have used to place each figure
\startplacefigure[location=here,reference=fig:blah][]{}
 \externalfigure[blah.jpeg][scale=300]
\stopplacefigure
___
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: Mono font goes inside right inline image

2023-10-28 Thread Mia Bikey
 Thanks, that works great.


On Sat, Oct 28, 2023 at 7:10 PM Hans Hagen  wrote:

> On 10/28/2023 2:25 PM, Henning Hraban Ramm wrote:
> > Am 28.10.23 um 14:17 schrieb Mia Bikey:
> >> Hi,
> >> I was using mono font as my default font but it appears to have issues
> >> with right side inline images.
> >>
> >> Here is a Minimal Working Example:
> >>
> >> ConTeXt  ver: 2023.09.26 18:19 LMTX
> >>
> >> \setupbodyfont[mono]
> >>
> >> \starttext
> >>
> >> Image on the right side gets issues.
> >> \placefigure[right]{}{\externalfigure[dummy]}
> >> \input tufte \\
> >>
> >> Image on the left side is fine.
> >> \placefigure[left]{}{\externalfigure[dummy]}
> >> \input tufte
> >>
> >> \stoptext
> >
> > I fear there’s something generally wrong with mono font calculations,
> > also affecting line breaking, since I get overfull hboxes with code
> > examples all the time.
> mono runs way to wide for decent linebreaks so use
>
> \setupalign[verytolerant,stretch]
>
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: Mono font goes inside right inline image

2023-10-28 Thread Hans Hagen

On 10/28/2023 2:25 PM, Henning Hraban Ramm wrote:

Am 28.10.23 um 14:17 schrieb Mia Bikey:

Hi,
I was using mono font as my default font but it appears to have issues 
with right side inline images.


Here is a Minimal Working Example:

ConTeXt  ver: 2023.09.26 18:19 LMTX

\setupbodyfont[mono]

\starttext

Image on the right side gets issues.
\placefigure[right]{}{\externalfigure[dummy]}
\input tufte \\

Image on the left side is fine.
\placefigure[left]{}{\externalfigure[dummy]}
\input tufte

\stoptext


I fear there’s something generally wrong with mono font calculations, 
also affecting line breaking, since I get overfull hboxes with code 
examples all the time.

mono runs way to wide for decent linebreaks so use

\setupalign[verytolerant,stretch]



-
  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: Mono font goes inside right inline image

2023-10-28 Thread Mia Bikey
Ah that sucks, I really like how the font looks.
I guess I will use some other font then.
Thank You

On Sat, Oct 28, 2023 at 5:56 PM Henning Hraban Ramm  wrote:

> Am 28.10.23 um 14:17 schrieb Mia Bikey:
> > Hi,
> > I was using mono font as my default font but it appears to have issues
> > with right side inline images.
> >
> > Here is a Minimal Working Example:
> >
> > ConTeXt  ver: 2023.09.26 18:19 LMTX
> >
> > \setupbodyfont[mono]
> >
> > \starttext
> >
> > Image on the right side gets issues.
> > \placefigure[right]{}{\externalfigure[dummy]}
> > \input tufte \\
> >
> > Image on the left side is fine.
> > \placefigure[left]{}{\externalfigure[dummy]}
> > \input tufte
> >
> > \stoptext
>
> I fear there’s something generally wrong with mono font calculations,
> also affecting line breaking, since I get overfull hboxes with code
> examples all the time.
>
> 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: Mono font goes inside right inline image

2023-10-28 Thread Henning Hraban Ramm

Am 28.10.23 um 14:17 schrieb Mia Bikey:

Hi,
I was using mono font as my default font but it appears to have issues 
with right side inline images.


Here is a Minimal Working Example:

ConTeXt  ver: 2023.09.26 18:19 LMTX

\setupbodyfont[mono]

\starttext

Image on the right side gets issues.
\placefigure[right]{}{\externalfigure[dummy]}
\input tufte \\

Image on the left side is fine.
\placefigure[left]{}{\externalfigure[dummy]}
\input tufte

\stoptext


I fear there’s something generally wrong with mono font calculations, 
also affecting line breaking, since I get overfull hboxes with code 
examples all the time.


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] Mono font goes inside right inline image

2023-10-28 Thread Mia Bikey
Hi,
I was using mono font as my default font but it appears to have issues with
right side inline images.

Here is a Minimal Working Example:

ConTeXt  ver: 2023.09.26 18:19 LMTX

\setupbodyfont[mono]

\starttext

Image on the right side gets issues.
\placefigure[right]{}{\externalfigure[dummy]}
\input tufte \\

Image on the left side is fine.
\placefigure[left]{}{\externalfigure[dummy]}
\input tufte

\stoptext


This is how it looks.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: Very strange error:

2023-08-14 Thread Xavier B.
d
floatblocks > '3' placed (force)
backend > xmp > using file 
'/home/xan/bin/context-current/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
pages   > flushing realpage 1, userpage 1, subpage 1
floatblocks > order disturbed
floatblocks > '4' placed (force)
pages   > flushing realpage 2, userpage 2, subpage 2
floatblocks > order disturbed
floatblocks > '5' placed (force)
tex error   > tex error on line 540 in file ./dev.tex: The file ended when 
scanning an argument.

200 persones en total \par \startitemize [a, packed] \item 2 de 5 persones 
estan a $A$ \item a cada 4 persones de $A$ li corresponen 3 persones de $B$ 
\item 20\% són de $C$ \item 2/8 són de $D$ \stopitemize \par \head 420 
persones en total \par \startitemize [a, packed] \item $3/4$ de persones estan 
a $A$ \item hi ha una correspondència: 3 de $A$ $\leftrightarrow $ 2 de $B$ 
\item 40\% és de $C$ \item de 5 persones, 4 són de $D$ \stopitemize \par 
\head 245 persones \par \startitemize [a, packed] \item $1/5$ de persones són 
de $A$ \item $20\%$ de persones són de $B$ \item per cada 7 persones de $A$, 
n'hi ha 4 de $C$ \item per cada 49 persones, n'hi ha 1 de $D$ \stopitemize \par 
\head 1800 persones \par \startitemize [a, packed] \item Un $30\%$ és de $A$ 
\item 30 de cada 50 són de $B$ \item cada 5 persones de $B$ li corresponen 2 
persones de $C$ \item $D$ té un 150\% que les persones de $C$ \stopitemize 
\par \stopitemize \par En tots els casos, digueu quantes persones hi hauria en 
el subgrup més nombrós si en total hi hagués 1000 persones. \stopexercici 
\par \startexercici [exercici:proporcionalitat-directa-8]{relacionar diagrames} 
Relacioneu en cada cas els diagrames amb la proporció indicada \par 
\startitemize [A] \par \head Proporcions \par \startitemize [a, packed, 
columns] \item 2 de 5 \item 20\% \item $3/5$ \item 5 a 10 \stopitemize \par 
\head Diagrames \par \startitemize [a, packed, columns] \item \starttikzpicture 
\draw (0,0) -- (5,0); \foreach \x in {0, 1, 2,..., 5} { \draw (\x , -0.2) -- 
(\x , 0.2); \draw (\x ,-0.2) node[anchor=north] {\x }; } \draw [color=blue!50, 
line width=2pt] (0,0) -- (1,0); \stoptikzpicture \par \item \starttikzpicture 
\draw (0,0) -- (5,0); \foreach \x in {0, 1, 2,..., 5} { \draw (\x , -0.2) -- 
(\x , 0.2); \draw (\x ,-0.2) node[anchor=north] {\x }; } \draw [color=red!50, 
line width=2pt] (0,0) -- (2,0); \stoptikzpicture \par \item \starttikzpicture 
\draw (0,0) -- (5,0); \foreach \x in {0, 1, 2,..., 5} { \draw (\x , -0.2) -- 
(\x , 0.2); \draw (\x ,-0.2) node[anchor=north] {\x }; } \draw [color=green!50, 
line width=2pt] (0,0) -- (3,0); \stoptikzpicture \par \item \starttikzpicture 
\draw (0,0) -- (5,0); \foreach \x in {0, 1, 2,..., 5} { \draw (\x , -0.2) -- 
(\x , 0.2); \draw (\x ,-0.2) node[anchor=north] {\x }; } \draw 
[color=orange!50, line width=2pt] (0,0) -- (1.6,0); \stoptikzpicture \par 
\stopitemize \par \stopitemize \par Per a cada proporció, dibuixeu nous 
diagrames que tengui longitud 100. \stopexercici \par \par \startexercici 
[exercici:proporcionalitat-directa-9]{representar a diagrames}Usant el diagrama 
$5 \times 10$ següent (vegeu la figura~\in [figura:diagrama-punts-5x10]) 
representeu la informació donada en cada cas. \par \placefigure [force] 
[figura:diagrama-punts-5x10] {Diagrama de punts $5 \times 10$} { \bTABLE 
[frame=off,align={middle,lohi},width=fit, offset=2mm] \bTR \bTD 
\starttikzpicture \foreach \x in {0,...,9} \foreach \y in {0,...,4} { \draw 
[fill=gray!50] (\x ,\y ) circle (0.25); } \par \stoptikzpicture \eTD \eTR 
\eTABLE } \par \startitemize [a, columns, packed, four] \item 40\% \item 4 de 5 
\item $3/4$ \item 4 a 1 \item 22\% \item $1/8$ \item 5 a 3 \item 3 de 8 
\stopitemize \par Si aquestes informacions corresponguessin a mostres de peixos 
ferits a la mar, calculeu quants peixos malalts hi hauria en una mostra de 3000 
peixos en total. \stopexercici \par \startexercici 
[exercici:proporcionalitat-directa-antic-1]{sou} Na Marta fa feina per hores. 
Si fent 25 hores de feina, na Marta cobra 625 euros, quant cobrarà fent 40 
hores? Quantes hores hauria de fer na Marta per cobrar exactament 2300 euros? 
\stopexercici \par \par \startexercici 
[exercici:proporcionalitat-directa-antic-2]{astronautes} Aquest és la bità
cola d'un projecte espacial: \startitemize [4] \item S'enlairen 5 astronautes, 
amb 200 kg de menjar a una estació espacial \item Al cap de 3 dies, hi ha un 
relleu: se'n van 2 i en vénen 3 \item La tripulació resultant es queda durant 
5 dies més \item Tots els astronautes tornen. L'estació espacial queda buida 
\stopitemize \par Els bastarà el menjar que s'enduen al principi si sabem que 
quatre astronautes mengen en promig 20 kg per dia? \stopexercici \par 
\startexercici [exercici:proporcionalitat-directa-antic-3]{consum de benzina} 
El meu cotxe consumeix 4,5 litres cada cent quilòmetres. \startitemize 
[a,text] \item Quants litres co

[NTG-context] Very strange error:

2023-08-14 Thread Xavier B.
After I run context (LMTX version) to my document (attached) I get this error:

tex error   > tex error on line 540 in file ./dev.tex: The file ended when 
scanning an argument.

I don't know how to start...
Can anyone help me?

Thanks,
Xavier

PS: I receive this error after upgrading to MKIV to LMTX. Before with MKIV I 
get no errors.


dev.tex
Description: TeX document
return {
 ["errortype"]=6,
 ["filename"]="./dev.tex",
 ["lastcontext"]="\n200 persones en total \\par \\startitemize [a, packed] 
\\item 2 de 5 persones estan a $A$ \\item a cada 4 persones de $A$ li 
corresponen 3 persones de $B$ \\item 20\\% són de $C$ \\item 2/8 són de $D$ 
\\stopitemize \\par \\head 420 persones en total \\par \\startitemize [a, 
packed] \\item $3/4$ de persones estan a $A$ \\item hi ha una correspondència: 
3 de $A$ $\\leftrightarrow $ 2 de $B$ \\item 40\\% és de $C$ \\item de 5 
persones, 4 són de $D$ \\stopitemize \\par \\head 245 persones \\par 
\\startitemize [a, packed] \\item $1/5$ de persones són de $A$ \\item $20\\%$ 
de persones són de $B$ \\item per cada 7 persones de $A$, n'hi ha 4 de $C$ 
\\item per cada 49 persones, n'hi ha 1 de $D$ \\stopitemize \\par \\head 1800 
persones \\par \\startitemize [a, packed] \\item Un $30\\%$ és de $A$ \\item 
30 de cada 50 són de $B$ \\item cada 5 persones de $B$ li corresponen 2 
persones de $C$ \\item $D$ té un 150\\% que les persones de $C$ \\stopitemize 
\\par \\stopitemize \\par En tots els casos, digueu quantes persones hi hauria 
en el subgrup més nombrós si en total hi hagués 1000 persones. 
\\stopexercici \\par \\startexercici 
[exercici:proporcionalitat-directa-8]{relacionar diagrames} Relacioneu en cada 
cas els diagrames amb la proporció indicada \\par \\startitemize [A] \\par 
\\head Proporcions \\par \\startitemize [a, packed, columns] \\item 2 de 5 
\\item 20\\% \\item $3/5$ \\item 5 a 10 \\stopitemize \\par \\head Diagrames 
\\par \\startitemize [a, packed, columns] \\item \\starttikzpicture \\draw 
(0,0) -- (5,0); \\foreach \\x in {0, 1, 2,..., 5} { \\draw (\\x , -0.2) -- (\\x 
, 0.2); \\draw (\\x ,-0.2) node[anchor=north] {\\x }; } \\draw [color=blue!50, 
line width=2pt] (0,0) -- (1,0); \\stoptikzpicture \\par \\item 
\\starttikzpicture \\draw (0,0) -- (5,0); \\foreach \\x in {0, 1, 2,..., 5} { 
\\draw (\\x , -0.2) -- (\\x , 0.2); \\draw (\\x ,-0.2) node[anchor=north] {\\x 
}; } \\draw [color=red!50, line width=2pt] (0,0) -- (2,0); \\stoptikzpicture 
\\par \\item \\starttikzpicture \\draw (0,0) -- (5,0); \\foreach \\x in {0, 1, 
2,..., 5} { \\draw (\\x , -0.2) -- (\\x , 0.2); \\draw (\\x ,-0.2) 
node[anchor=north] {\\x }; } \\draw [color=green!50, line width=2pt] (0,0) -- 
(3,0); \\stoptikzpicture \\par \\item \\starttikzpicture \\draw (0,0) -- (5,0); 
\\foreach \\x in {0, 1, 2,..., 5} { \\draw (\\x , -0.2) -- (\\x , 0.2); \\draw 
(\\x ,-0.2) node[anchor=north] {\\x }; } \\draw [color=orange!50, line 
width=2pt] (0,0) -- (1.6,0); \\stoptikzpicture \\par \\stopitemize \\par 
\\stopitemize \\par Per a cada proporció, dibuixeu nous diagrames que tengui 
longitud 100. \\stopexercici \\par \\par \\startexercici 
[exercici:proporcionalitat-directa-9]{representar a diagrames}Usant el diagrama 
$5 \\times 10$ següent (vegeu la figura~\\in [figura:diagrama-punts-5x10]) 
representeu la informació donada en cada cas. \\par \\placefigure [force] 
[figura:diagrama-punts-5x10] {Diagrama de punts $5 \\times 10$} { \\bTABLE 
[frame=off,align={middle,lohi},width=fit, offset=2mm] \\bTR \\bTD 
\\starttikzpicture \\foreach \\x in {0,...,9} \\foreach \\y in {0,...,4} { 
\\draw [fill=gray!50] (\\x ,\\y ) circle (0.25); } \\par \\stoptikzpicture 
\\eTD \\eTR \\eTABLE } \\par \\startitemize [a, columns, packed, four] \\item 
40\\% \\item 4 de 5 \\item $3/4$ \\item 4 a 1 \\item 22\\% \\item $1/8$ \\item 
5 a 3 \\item 3 de 8 \\stopitemize \\par Si aquestes informacions 
corresponguessin a mostres de peixos ferits a la mar, calculeu quants peixos 
malalts hi hauria en una mostra de 3000 peixos en total. \\stopexercici \\par 
\\startexercici [exercici:proporcionalitat-directa-antic-1]{sou} Na Marta fa 
feina per hores. Si fent 25 hores de feina, na Marta cobra 625 euros, quant 
cobrarà fent 40 hores? Quantes hores hauria de fer na Marta per cobrar 
exactament 2300 euros? \\stopexercici \\par \\par \\startexercici 
[exercici:proporcionalitat-directa-antic-2]{astronautes} Aquest és la bità
cola d'un projecte espacial: \\startitemize [4] \\item S'enlairen 5 
astronautes, amb 200 kg de menjar a una estació espacial \\item Al cap de 3 
dies, hi ha un relleu: se'n van 2 i en vénen 3 \\item La tripulació resultant 
es queda durant 5 dies més \\item Tots els astronautes tornen. L'estació 
espacial queda buida \\stopitemize \\par Els bastarà el menjar que s'enduen al 
principi si sabem que quatre astronautes mengen en promig 20 kg per dia? 
\\stopexercici \\par \\startexercici 
[exercici:proporcionalitat-

Re: [NTG-context] \doifelseoddpage not working as expected

2023-05-29 Thread Henning Hraban Ramm via ntg-context

Am 29.05.23 um 16:47 schrieb Hans Hagen via ntg-context:
Is this also the right approach to check for the current page within a 
float placement?

Like
\startplacefigure[]
 \dontleavehmode\signalrightpage % necessary?
 \doifelserightpage{RIGHT}{LEFT}
 \doifelseoddpage  {ODD  }{EVEN}
\stopplacefigure
?

In my macros from 2015 I’m still using manual right/left page 
versions, and I’d like to enhance them.
I need e.g. different \offset values for \externalfigure depending on 
right/left page.
normally you will use "inner*" and "outer*" placement there as in other 
cases (which uses the same tricks)


I have one macro to place an page-width image with bleed, it uses 
\placefigure[top] and then \offset to move the image, so that it starts 
with bleed on the top side and with/without on the left side depending 
on a parameter that I change manually if the page breaking changes. The 
caption must stay within the type area – that works so far.
But it shouldn’t be necessary to define left/right manually, and that’s 
my question: if these \doifs work correctly within a float placement.


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 really force figure to appear "here"?

2023-05-24 Thread Henning Hraban Ramm via ntg-context

Am 21.05.23 um 15:17 schrieb Wolfgang Schuster via ntg-context:

Joel via ntg-context schrieb am 21.05.2023 um 15:11:
Here, I've created an example that does just that. I want the figure 
to appear immediately after the bold text. Even if a lot of whitespace 
is placed and the figure appears on the next page, that is fine, but I 
don't want the next group of text to appear until *after* the figure. 
This is really confusing my readers.


\starttext
    \input knuth
    \input knuth

    {\boldface This is a short note about the picture. It should 
appear right after this.}

 \placefigure[here,force]{caption}{
 \externalfigure[1.jpg][width=\textwidth]
    }


Get rid of the here keyword and use only force, you can't use both at 
the same time
and one gets ignored (depends whatever is first checked in the float 
mechanism).


I seem to remember it used to work and was even suggested. Then I’d 
consider it a bug/regression.


Does {bottom,force} make sense?

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 really force figure to appear "here"?

2023-05-21 Thread Wolfgang Schuster via ntg-context

Joel via ntg-context schrieb am 21.05.2023 um 15:11:
Here, I've created an example that does just that. I want the figure 
to appear immediately after the bold text. Even if a lot of whitespace 
is placed and the figure appears on the next page, that is fine, but I 
don't want the next group of text to appear until *after* the figure. 
This is really confusing my readers.


\starttext
    \input knuth
    \input knuth

    {\boldface This is a short note about the picture. It should 
appear right after this.}

 \placefigure[here,force]{caption}{
 \externalfigure[1.jpg][width=\textwidth]
    }


Get rid of the here keyword and use only force, you can't use both at 
the same time
and one gets ignored (depends whatever is first checked in the float 
mechanism).


\placefigure[force]{caption}{\externalfigure[1.jpg][width=\textwidth]}

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] How to really force figure to appear "here"?

2023-05-21 Thread Joel via ntg-context
 Here, I've created an example that does just that. I want the figure to appear 
immediately after the bold text. Even if a lot of whitespace is placed and the 
figure appears on the next page, that is fine, but I don't want the next group 
of text to appear until *after* the figure. This is really confusing my readers.
\starttext
    \input knuth
    \input knuth

    {\boldface This is a short note about the picture. It should appear right 
after this.}
    \placefigure[here,force]{caption}{
        \externalfigure[1.jpg][width=\textwidth]
    }

    \input knuth
    \input knuth
    \input knuth
    \input knuth
    \input knuth
    \input knuth

\stoptext

--Joel

On Saturday, May 20, 2023 at 07:49:45 PM MDT, Joel via ntg-context 
 wrote:  
 
 I have been using \placefigure[here, force] to place some graphics, but its 
instead showing other text from the next section, then the picture. In testing, 
this is causing readers to be confused, as they expect to see a picture, but 
its somehow appearing two pages later. I don't care it it requires a huge blank 
area on the page before it, how can I make it so any text after 
\placefigure[here, force] doesn't appear before the figure?
--Joel
___
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] How to really force figure to appear "here"?

2023-05-21 Thread Mikael Sundqvist via ntg-context
Hi,

On Sun, May 21, 2023 at 3:48 AM Joel via ntg-context  wrote:
>
> I have been using \placefigure[here, force] to place some graphics, but its 
> instead showing other text from the next section, then the picture. In 
> testing, this is causing readers to be confused, as they expect to see a 
> picture, but its somehow appearing two pages later. I don't care it it 
> requires a huge blank area on the page before it, how can I make it so any 
> text after \placefigure[here, force] doesn't appear before the figure?
>
> --Joel

You submit no example, but with the one I tried, \placefigure[force]
seems to place the figure at the place where it is called. Doesn't
that work for you?

/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] How to really force figure to appear "here"?

2023-05-20 Thread Joel via ntg-context
I have been using \placefigure[here, force] to place some graphics, but its 
instead showing other text from the next section, then the picture. In testing, 
this is causing readers to be confused, as they expect to see a picture, but 
its somehow appearing two pages later. I don't care it it requires a huge blank 
area on the page before it, how can I make it so any text after 
\placefigure[here, force] doesn't appear before the figure?
--Joel
___
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] SVG ViewBox figure battle

2023-05-19 Thread Thangalin via ntg-context
Hi there!

The following document contains SVG. Save the SVG as "problem.svg" and
run the document through LMTX version 2023.05.08 17:39:

% SOF
\startbuffer[csvg]

  
  

\stopbuffer

\starttext
  % honours viewbox
  \placefigure[none]{}{\includesvgbuffer[csvg]}
  \page
  % dishonours viewbox
  \externalfigure[problem.svg]
\stoptext
% EOF

The ViewBox is ignored when run through Inkscape. Is this because the
--export-area-page option is not being passed when invoked?

Given identical inputs, would it make sense for placefigure and
externalfigure to produce identical results?

Cheers!
___
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] Problem with float and new layout on same page

2022-12-25 Thread peter.hopcroft--- via ntg-context
My MWE below produces this pdf. My problem is that on page 2, the body text 
flows beyond its frame and into the footer distance.

Regards, Peter



Play.pdf
Description: Adobe PDF document



MWE:

\setuppapersize[A4][A3,landscape] \setuparranging[2SIDE] \showframe 

\definelayout[mypage][footerdistance=100mm, ]
\definelayout[odd][reset]   % ??
\definelayout[even][reset]

\starttext
\dorecurse{3}{\input{knuth} }   % change to \dorecurse{2} - it works  properly
\definelayout[2][mypage] 
\dorecurse{2}{\input{knuth} }
\placefigure [leftmargin]
 {} {\externalfigure[greybox][width=\leftmarginwidth]}
\dorecurse{5}{\input{knuth} }
\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] Radial and linear gradients

2022-12-14 Thread Thangalin via ntg-context
Inkscape can export the gradients to PDF.

I was hoping to eliminate Inkscape as an extra piece of software users
have to download to make sure their SVG images are rendered correctly.
By containerizing ConTeXt, MetaPost can be swapped for Inkscape, so
users won't even know. It is, however, a minor duplication to have two
programs that can convert SVG to PDF. (And Inkscape will bloat the
container size.)

For my images, at least, gradients are one of the last features needed
to render them correctly using MetaPost. The other is font rendering
in some cases will be incorrect (e.g., try using Roboto with weight
100). If we have to use Inkscape to ensure tat all SVG images are
rendered correctly, then we'd only want to use MetaPost if we know
that the images don't contain gradients, or would you recommend
avoiding MetaPost altogether for SVG conversion?

Thank you!

On Wed, Dec 14, 2022 at 12:46 AM Hans Hagen via ntg-context
 wrote:
>
> On 12/14/2022 5:46 AM, Thangalin via ntg-context wrote:
> > Hi there!
> >
> > Any thoughts on implementing SVG gradients in MetaPost?
> >
> > % SOF
> > \startbuffer[csvg]
> > http://www.w3.org/2000/svg;
> > xmlns:xlink="http://www.w3.org/1999/xlink; viewBox="0 0 115.669
> > 115.669"> > cy="167.114" r="57.834" fx="124.515" fy="167.114"
> > gradientTransform="translate(-17.77 -18.4)"
> > gradientUnits="userSpaceOnUse"/> > offset="0"/> > stop-opacity="0"/> > transform="translate(-48.91 -90.879)"> > fill-opacity=".5" d="M48.769 90.936H164.64V206.96H48.769z"/> > cx="106.745" cy="148.713" r="57.834" fill="url(#b)"
> > fill-rule="evenodd"/>
> > \stopbuffer
> >
> > \starttext
> >\placefigure{}{\includesvgbuffer[csvg][conversion=mp]}
> > \stoptext
> > % EOF
> >
> > See attached a comparison of the PDF generated using ConTeXt and the
> > PNG file generated by exporting from Inkscape.
> these gradients definitions get crazier by the day ... does inkscape
> output a bitmap or vector pdf
>
> given what we do with context i'm not sure we should support everything
> that pops up (mapping all onto mp and then pdf ...)
>
> 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
> ___


inkscape-gradient.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
___


Re: [NTG-context] Radial and linear gradients

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

On 12/14/2022 5:46 AM, Thangalin via ntg-context wrote:

Hi there!

Any thoughts on implementing SVG gradients in MetaPost?

% SOF
\startbuffer[csvg]
http://www.w3.org/2000/svg;
xmlns:xlink="http://www.w3.org/1999/xlink; viewBox="0 0 115.669
115.669">
\stopbuffer

\starttext
   \placefigure{}{\includesvgbuffer[csvg][conversion=mp]}
\stoptext
% EOF

See attached a comparison of the PDF generated using ConTeXt and the
PNG file generated by exporting from Inkscape.
these gradients definitions get crazier by the day ... does inkscape 
output a bitmap or vector pdf


given what we do with context i'm not sure we should support everything 
that pops up (mapping all onto mp and then pdf ...)


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] Radial and linear gradients

2022-12-13 Thread Thangalin via ntg-context
Hi there!

Any thoughts on implementing SVG gradients in MetaPost?

% SOF
\startbuffer[csvg]
http://www.w3.org/2000/svg;
xmlns:xlink="http://www.w3.org/1999/xlink; viewBox="0 0 115.669
115.669">
\stopbuffer

\starttext
  \placefigure{}{\includesvgbuffer[csvg][conversion=mp]}
\stoptext
% EOF

See attached a comparison of the PDF generated using ConTeXt and the
PNG file generated by exporting from Inkscape.

Many thanks!


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


Re: [NTG-context] How to set the vertical spacing between a sequence of images?

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

Am 25.10.22 um 02:32 schrieb Joel via ntg-context:
I have code like this which randomly pulls a page from `comic2.pdf` and 
displays it, scaled to fit \textwidth, then displays four more random 
pages afterwares.


\starttext
     \dorecurse{5}{
             \placefigure[force, 
none]{}{\framed[frame=off]{\externalfigure[comic2.pdf][page=\randomnumber{1}{34}, width=\textwidth]}}

         }
\stoptext

The problem is I need to adjust the vertical space between the images. 
It seems to be set to some lineheight or such, but I need the distance 
between each image to be at 1/50th or 0.02 of \textwidth. ...though the 
last image can have the ordinary gap afterwards.


How can I se the vertical spacing between this sequence of image to 
0.02\textwidth?


Do you need floats at all? Otherwise a combination might fit your needs, 
and there you can setup the distances.


https://wiki.contextgarden.net/Combinations

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] How to set the vertical spacing between a sequence of images?

2022-10-24 Thread Joel via ntg-context
I have code like this which randomly pulls a page from `comic2.pdf` and 
displays it, scaled to fit \textwidth, then displays four more random pages 
afterwares.

\starttext    \dorecurse{5}{
            \placefigure[force, 
none]{}{\framed[frame=off]{\externalfigure[comic2.pdf][page=\randomnumber{1}{34},
 width=\textwidth]}}
        }\stoptext
The problem is I need to adjust the vertical space between the images. It seems 
to be set to some lineheight or such, but I need the distance between each 
image to be at 1/50th or 0.02 of \textwidth. ...though the last image can have 
the ordinary gap afterwards.
How can I se the vertical spacing between this sequence of image to 
0.02\textwidth?
--Joel
___
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
___


[NTG-context] Lopsided circles

2022-10-18 Thread Thangalin via ntg-context
Using 2022.09.11 20:44, there appears to be a problem with rendering
some circular forms, such as:

% SOT
\startbuffer[circle]



\stopbuffer

\starttext
  \placefigure{}{\includesvgbuffer[circle][conversion=mp]}
\stoptext
% EOT

In Inkscape, this renders as a full circle without any deformation.
___
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] SVG path conversion misalignment

2022-09-11 Thread Thangalin via ntg-context
Hi there,

% SOT
\startbuffer[dna]

\stopbuffer

\starttext
  \placefigure{}{\includesvgbuffer[dna][conversion=mp]}
\stoptext
% EOT

In the PDF that's generated, the curve of the gray semi-circle is malformed
with respect to the blackground. It's like there's a small chip. The
expected result is shown here:

https://i.ibb.co/n7s8GPT/dna.png

Looks like a small precision error in some of the pathing or
transformation/rotation calculations.
___
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] Is rendering furigana over horizontal or vertical japanese text doable in ConTeXt?

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

On 8/21/2022 12:10 PM, Wolfgang Schuster via ntg-context wrote:

黄复雄 via ntg-context schrieb am 21.08.2022 um 10:24:

Currently, the ruby module does not seem to support cjk fonts? I have
a preliminary implementation of furigana(pinyin in Chinese) as:
attached a variant (no pdf attached) using wolfgangs font definition 
plus some more


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-% in font-imp-scripts, line 145, comment a few lines
%
% orientate = function(character)
% local width  = character.width or 0
% local height = character.height or 0
% local depth  = character.depth or 0
% -- character.width   = height + depth + rightshift + 
rightshift
% character.height  = width - downshift
% character.depth   = shift
% -- character.xoffset = height + rightshift
% -- character.yoffset = - downshift
% -- character.orientation = orientation
% end

\definefontfeature
[vertical]
[vertical={%
orientation=3,%
down=.1,%
right=.1,%
ranges={%
cjkcompatibility,%
cjkcompatibilityforms,%
cjkcompatibilityideographs,%
cjkcompatibilityideographssupplement,%
cjkradicalssupplement,%
  % cjkstrokes,%
cjksymbolsandpunctuation,%
cjkunifiedideographs,%
cjkunifiedideographsextensiona,%
cjkunifiedideographsextensionb,%
cjkunifiedideographsextensionc,%
cjkunifiedideographsextensiond,%
cjkunifiedideographsextensione,%
cjkunifiedideographsextensionf,%
}%
}]

\definefont[NotoCJKvertical][NotoSanstc-Regular*default,vertical @ 24pt]
\definefont[NotoCJKverticalBold][NotoSanstc-Bold*default,vertical @ 48pt]

\definefallbackfamily [documentfont] [rm] [Noto Serif CJK SC] 
[preset=range:chinese,features={default,vertical}]
\definefallbackfamily [documentfont] [ss] [Noto Sans CJK SC]  
[preset=range:chinese,features={default,vertical}]
\definefallbackfamily [documentfont] [tt] [Noto Sans Mono CJK SC] 
[preset=range:chinese,features={default,vertical}]

\definefontfamily [documentfont] [rm] [Noto Serif]
\definefontfamily [documentfont] [ss] [Noto Sans]
\definefontfamily [documentfont] [tt] [Noto Sans Mono]

\setupbodyfont [documentfont,24pt]

\setuppapersize
 [A4,landscape,rotated,270]
 [A4,portrait]

\setuplayout[middle]

\showframe

\setuphead
  [chapter]
  [numbercolor=darkred,
   conversion=chinesenumerals]

\setuptolerance
  [verytolerant,stretch]

\setupinterlinespace
  [40pt]

\setuplayout
  [color=darkblue]

\setuppagenumbering
  [location=footer]

\defineconversionset
  [pagenumber]
  []
  [chinesenumerals]

\protected\def\stripe#1{\hbox orientation 0 yoffset 3pt{\strut #1}}

\setscript[hangul]

\starttext

% \startscript[hangul]

\chapter{通用规}

\placefigure
  [left,none]
  {汉字表}
  {\framed
 [width=4cm,
  height=2\lineheight,
  frame=off,
  backgroundcolor=darkgreen,
  foregroundcolor=white,
  background=color]
 {汉字表}}

\dorecurse{40}{%
通用规\ruby{范}{x}汉字表 \stripe{test #1}
}

% \stopscript

\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] Bug (?) with \placefigure[right]

2022-08-16 Thread Wolfgang Schuster via ntg-context

Bruce Horrocks via ntg-context schrieb am 16.08.2022 um 18:11:

Things start to go awry after about 5 or 6 iterations, 12 shows it up clearly 
with three or so nearly blank (except for the subject) pages produced.

\setuppapersize [A5] [A5]
\starttext
\dorecurse{12}{
\subject{Some heading}
\placefigure[right] {} {\externalfigure[cow.pdf] [width=3cm]}
\input lorem
}
\stoptext

I actually want \placefigure[right,none] in my real doc but that also goes awry.
LMTX current version: 2022.08.05 11:44

My actual requirement is to have a set of short biographies, including a small 
'passport' photo, for each contributor to a book. So any suggestions on how to 
wrap text around the photo that avoids this issue would be welcome.


\setuppapersize [A5] [A5]

\starttext

\dorecurse{12}
  {\subject{Some heading}
   \starthanging[right]{\externalfigure[cow.pdf][width=3cm]}
   \samplefile{lorem}
   \stophanging}

\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] Bug (?) with \placefigure[right]

2022-08-16 Thread Bruce Horrocks via ntg-context
Things start to go awry after about 5 or 6 iterations, 12 shows it up clearly 
with three or so nearly blank (except for the subject) pages produced.

\setuppapersize [A5] [A5]
\starttext
\dorecurse{12}{
\subject{Some heading}
\placefigure[right] {} {\externalfigure[cow.pdf] [width=3cm]}
\input lorem
}
\stoptext

I actually want \placefigure[right,none] in my real doc but that also goes awry.
LMTX current version: 2022.08.05 11:44

My actual requirement is to have a set of short biographies, including a small 
'passport' photo, for each contributor to a book. So any suggestions on how to 
wrap text around the photo that avoids this issue would be welcome.
—
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] SVG text clipping issue

2022-06-29 Thread Thangalin via ntg-context
Text that's tight against its viewbox gets clipped:

https://i.ibb.co/BGQVzzx/text-clipped.png

Here's the code:

% SOF
\startbuffer[svg]
http://www.w3.org/2000/svg;
   xmlns:svg="http://www.w3.org/2000/svg;>
  
  16p13.3

\stopbuffer

\starttext
   \placefigure[]{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF
___
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
___


Re: [NTG-context] SVG text alignment issue

2022-06-29 Thread Thangalin via ntg-context
Thanks for checking this. Unfortunately, introducing \hbox didn't work; the
text is still off-center with respect to the vertical line:

https://i.ibb.co/hYGfdgZ/text-align.png

For comparison, the SVG file loaded into Inkscape appears similar to:

https://i.ibb.co/KF3PBkw/inkscape-alignment.png

Note how the text is vertically centered above the vertical line.

To me, it looks like the text, after a rotational transform, is being
written to the baseline rather than (cap height + descender height) / 2,
which seems to be a MetaPost conversion issue? There's another, possibly
related issue, which I'll provide in a separate thread.

Here's the code:

% SOF
\pushoverloadmode \unprotect

\permanent\tolerant\protected\def\includesvgfile[#1]#*[#2]%
   {\hbox\bgroup % no \dontleavehmode
\getdummyparameters[\c!offset=\zeropoint,#2]%
\clf_includesvgfile{#1}\dimexpr\dummyparameter\c!offset\relax
\egroup}

\permanent\tolerant\protected\def\includesvgbuffer[#1]#*[#2]%
   {\hbox\bgroup % no \dontleavehmode
\getdummyparameters[\c!offset=\zeropoint,#2]%
\clf_includesvgbuffer{#1}\dimexpr\dummyparameter\c!offset\relax
\egroup}

\protect \popoverloadmode

\startbuffer[svg]
http://www.w3.org/2000/svg;
   xmlns:svg="http://www.w3.org/2000/svg;>
  
  16p13.3

\stopbuffer

\starttext
   \placefigure[]{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF
___
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
___


Re: [NTG-context] SVG text alignment issue

2022-06-29 Thread Hans Hagen via ntg-context

On 6/29/2022 4:35 AM, Aditya Mahajan via ntg-context wrote:

On Mon, 27 Jun 2022, Thangalin via ntg-context wrote:


In the following example, the line and text should be aligned to the
middle  when LMTX converts the SVG figure using MP. (Note that you may have
to install Roboto, but the font isn't the issue.)

% SOF
\startbuffer[svg]
http://www.w3.org/2000/svg;
xmlns:svg="http://www.w3.org/2000/svg;>
   
   16p13.3

\stopbuffer

\starttext
\placefigure[]{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF


This has nothing to do with SVG. Looking at the definition of 
\includesvgbuffer, here is a simpler example illustrating the issue:

 \starttext
 \startplacefigure[location=here, title={Test}]
   \dontleavehmode\begingroup
   \startMPcode
 draw fullcircle scaled 2cm;
   \stopMPcode\endgroup
 \stopplacefigure
 \stoptext

One way to "fix" the alignment is to wrap everything in an hbox:


\placefigure[]{}{\hbox{\includesvgbuffer[svg][conversion=mp]}}

Maybe there is a simple way to modify the definition of includesvgbuffer so 
that an \hbox is not needed.

Thanks for checking it. Can you test with

\pushoverloadmode \unprotect

\permanent\tolerant\protected\def\includesvgfile[#1]#*[#2]%
  {\hbox\bgroup % no \dontleavehmode
   \getdummyparameters[\c!offset=\zeropoint,#2]%
   \clf_includesvgfile{#1}\dimexpr\dummyparameter\c!offset\relax
   \egroup}

\permanent\tolerant\protected\def\includesvgbuffer[#1]#*[#2]%
  {\hbox\bgroup % no \dontleavehmode
   \getdummyparameters[\c!offset=\zeropoint,#2]%
   \clf_includesvgbuffer{#1}\dimexpr\dummyparameter\c!offset\relax
   \egroup}

\protect \popoverloadmode

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


Re: [NTG-context] SVG text alignment issue

2022-06-28 Thread Aditya Mahajan via ntg-context
On Mon, 27 Jun 2022, Thangalin via ntg-context wrote:

> In the following example, the line and text should be aligned to the
> middle  when LMTX converts the SVG figure using MP. (Note that you may have
> to install Roboto, but the font isn't the issue.)
> 
> % SOF
> \startbuffer[svg]
> width="25mm"
>height="70mm"
>viewBox="0 0 25 70"
>xmlns="http://www.w3.org/2000/svg;
>xmlns:svg="http://www.w3.org/2000/svg;>
> d="m 12.51,63.971412 v -12.4787"
>  id="path2"
>  style="fill:none;fill-opacity:1;stroke:#00;stroke-opacity:1" />
> x="-48.831322"
>  y="15.60547"
>  id="text4933-8-6"
>  transform="rotate(-90)"
> 
>  
> style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;font-family:Roboto;-inkscape-font-specification:'Roboto,
> Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal">id="tspan159594-1"
>x="-48.831322"
>y="15.60547"
> 
>  
> style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;font-family:Roboto;-inkscape-font-specification:'Roboto,
> Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal">16p13.3
> 
> \stopbuffer
> 
> \starttext
>\placefigure[]{}{\includesvgbuffer[svg][conversion=mp]}
> \stoptext
> % EOF

This has nothing to do with SVG. Looking at the definition of 
\includesvgbuffer, here is a simpler example illustrating the issue:

\starttext
\startplacefigure[location=here, title={Test}]
  \dontleavehmode\begingroup
  \startMPcode
draw fullcircle scaled 2cm;
  \stopMPcode\endgroup
\stopplacefigure
\stoptext

One way to "fix" the alignment is to wrap everything in an hbox:


   \placefigure[]{}{\hbox{\includesvgbuffer[svg][conversion=mp]}}

Maybe there is a simple way to modify the definition of includesvgbuffer so 
that an \hbox is not needed.


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
___


[NTG-context] SVG text alignment issue

2022-06-28 Thread Thangalin via ntg-context
In the following example, the line and text should be aligned to the
middle  when LMTX converts the SVG figure using MP. (Note that you may have
to install Roboto, but the font isn't the issue.)

% SOF
\startbuffer[svg]
http://www.w3.org/2000/svg;
   xmlns:svg="http://www.w3.org/2000/svg;>
  
  16p13.3

\stopbuffer

\starttext
   \placefigure[]{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF
___
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
___


Re: [NTG-context] How to print a random whole number between x and y?

2022-06-17 Thread Wolfgang Schuster via ntg-context

Joel via ntg-context schrieb am 17.06.2022 um 16:10:
I was using this code for a long time in my document. I have a PDF 
with 10 pages, and this would randomly display one of those pages:


    \ctxlua{math.randomseed( os.time() )}

        \getrandomnumber \n {1} {10}

     \placefigure[force, 
none]{}{\framed[frame=off]{\externalfigure[comic.pdf][page=\n, 
width=\textwidth]}}


For reasons I cannot understand, after an update of ConTeXt, the code 
no longer works, though trying to reduce it to a minimum working 
example it works, so I cannot figure out what is wrong in my code.


Undefined control sequence

 ...domseed( os.time() )} \par \getrandomnumber \n
{1} {10} \par \placefigure...
\doifsomething #1->\edef \m_syst_string_one {#1
}\ifx \m_syst_string_one \emp...
\event ... {#6}{{\bf #6}} \par \doifsomething {#7}
{#7 } \par \doifsomething ...


Is there another solution for generating a random whole number between 
1 and 10?


Without a better example there is no way to tell what's wrong with your 
document. The most likely answer is that you try to expand part of your 
code which contains the \getrandomnumber line but since \n isn't defined 
yet you get the error message.


What you can try is to replace \getrandomnumber and "page=\n" with 
"page=\randomnumber{...}{...}".


\startbuffer[dummyfile]
\dorecurse{10}{\centerbox{\definedfont[Sans sa 10]Page \recurselevel}}
\stopbuffer

\setuplayout[page]

\starttext

%\getrandomnumber\n{1}{10}
%\typesetbuffer[dummyfile][page=\n]

\typesetbuffer[dummyfile][page=\randomnumber{1}{10}]

\stoptext

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


[NTG-context] How to print a random whole number between x and y?

2022-06-17 Thread Joel via ntg-context
I was using this code for a long time in my document. I have a PDF with 10 
pages, and this would randomly display one of those pages:
    \ctxlua{math.randomseed( os.time() )}
        
        \getrandomnumber \n {1} {10}
    
        \placefigure[force, 
none]{}{\framed[frame=off]{\externalfigure[comic.pdf][page=\n, 
width=\textwidth]}}
    
For reasons I cannot understand, after an update of ConTeXt, the code no longer 
works, though trying to reduce it to a minimum working example it works, so I 
cannot figure out what is wrong in my code.
Undefined control sequence

 ...domseed( os.time() )} \par \getrandomnumber \n 
  {1} {10} \par \placefigure...
\doifsomething #1->\edef \m_syst_string_one {#1
   }\ifx \m_syst_string_one \emp...
\event ... {#6}{{\bf #6}} \par \doifsomething {#7}
  {#7 } \par \doifsomething ...

Is there another solution for generating a random whole number between 1 and 10?
--Joel
___
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
___


Re: [NTG-context] Why are some images rendered very tiny?

2022-06-15 Thread Henning Hraban Ramm via ntg-context

Am 15.06.22 um 18:11 schrieb Joel via ntg-context:
I wrote this macro to display images in my book. It should place the 
image to the left, filling ~50% of \textwidth, then the caption is to 
the right.


\setupcaption[location=right, minwidth=.5\textwidth]
\define[4]\figureis{%
     \placefigure{#2, Courtesy #3, photo no. 
#1\nocite[#4]{}}{\externalfigure[#1][maxheight=.7\paperheight, 
maxwidth=.5\paperwidth, minwidth=.5\paperwidth]}

}

#1 = filename, other variables are used for reference/credit details.

The problem is, somehow some images are inexplicably displayed very tiny 
on the page. I check the image file and they are not small, but somehow 
is rendered small with the code above.


What is wrong in my code?


There are no parameters "minwidth" or "minheight", see 
https://wiki.contextgarden.net/Command/setupexternalfigure


It’s probable that your pictures have a high resolution (dpi) defined, 
so ConTeXt displays them according to that in their “natural” size.


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


[NTG-context] Why are some images rendered very tiny?

2022-06-15 Thread Joel via ntg-context
I wrote this macro to display images in my book. It should place the image to 
the left, filling ~50% of \textwidth, then the caption is to the right.

\setupcaption[location=right, minwidth=.5\textwidth]
\define[4]\figureis{%
    \placefigure{#2, Courtesy #3, photo no. 
#1\nocite[#4]{}}{\externalfigure[#1][maxheight=.7\paperheight, 
maxwidth=.5\paperwidth, minwidth=.5\paperwidth]}
}
#1 = filename, other variables are used for reference/credit details.

The problem is, somehow some images are inexplicably displayed very tiny on the 
page. I check the image file and they are not small, but somehow is rendered 
small with the code above.

What is wrong in my code?
--Joel
___
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
___


[NTG-context] is \version[temporary] still alive?

2022-05-22 Thread Steffen Wolfrum via ntg-context
Hi,

testing this mwe I’d expect some indicators detecting overfull lines.

At least on my machine (ConTeXt  ver: 2022.01.21 20:13 LMTX) nothing happens:

\setuppapersize[A6]
% Tell ConTeXt where the windmill picture is
\setupexternalfigures[location={default}]
\version[temporary]

\section{Slithy toves}

% Top right of page will show successful reference '< fig2'
% Left margin will mention unsuccessful reference 'figNothing->'
See \in{Figure}[fig2] and \in{Figure}[figNothing].

% Top right of page will show new-created anchors '> fig1' and '> fig2'
% Top right of page will show successfully placed floats
\placefigure[here][fig1]{First windmill}{
   \externalfigure[mill][width=1cm]
}
\placefigure[here][fig2]{Second windmill}{
   \externalfigure[mill][width=1cm]
}

\startcolumns[n=3]
   % Overfull lines will have slugs in colum margins.
   \input linden 

   % Underfull hboxes get no warning
   x
\stopcolumns


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


Re: [NTG-context] SVG style ignored after double semicolon

2022-05-09 Thread Heinrich Paeßens via ntg-context
ok, let’s get smarter.
how about sanitizing the svg-file from JFreeSVG with svgo or svgcleaner or nano 
or else?
And as a side effect you’d have the file optimized, ie. a smaller size 
(lossless I suppose) …
and are you sure that the ;;-issue is the only bug? After sanitizing you’ll 
never know but that should be ok.

I’ve checked this. For your example it’s ok.

> svgo in.svg
> in.svg:
> Done in 24 ms!
> 0.091 KiB - 26.9% = 0.066 KiB

> svgcleaner /Users/hp/in2.svg /Users/hp/out2.svg
> Your image is 9.36% smaller now.

 ,__,
 {o,o}
./)_)
 -»-»-

> On 9. May 2022, at 19:01, Heinrich Paeßens via ntg-context 
> mailto:ntg-context@ntg.nl>> wrote:
> 
> Yes, now I see, but isn’t there sth missing in the export from JFreeSVG, that 
> were supposed to fill in between the semicolons? If not, why don’t you just 
> post-process, if possible … 
> … sth like 
> 
> > gsed ’s/;;/;/g' in.svg > out.svg
> 
> ;-)
> 
> 
> 
>> On 9. May 2022, at 17:42, Thangalin > <mailto:thanga...@gmail.com>> wrote:
>> 
>> Hi Heinrich,
>> 
>> Use the SVG I provided. R and Renjin use two different SVG generators. 
>> Renjin uses JFreeSVG when exporting as SVG. As you pointed out, there are no 
>> issues with R because it will export an SVG file without any double 
>> semicolons.
>> 
>> In other words, try this:
>> 
>> \startbuffer[svg]
>> 
>>   > style="stroke:rgb(0,0,0);;fill:none" />
>> 
>> \stopbuffer
>> 
>> \starttext
>>   \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
>> \stoptext
>> 
>> If you get a black square, that's the bug. If you get a white square, then 
>> there's something different about our environment setups.
>> 
>> Cheers!
>> 
>> 
>> On Mon, May 9, 2022 at 1:55 AM Heinrich Paeßens > <mailto:paess...@me.com>> wrote:
>> Hi there
>> 
>> I can compile your example without any tweaks, hence could not reproduce any 
>> error.
>> 
>> cheers
>> Heinrich
>> 
>> ———
>> 
>> R version 4.2.0 (2022-04-22) -- "Vigorous Calisthenics"
>> Copyright (C) 2022 The R Foundation for Statistical Computing
>> Platform: x86_64-apple-darwin17.0 (64-bit)
>> 
>> [R.app GUI 1.78 (8075) x86_64-apple-darwin17.0]
>> 
>> > svg("/Users/hp/filename.svg");
>> > plot(rnorm(200));
>> > dev.off()
>> null device 
>>   1 
>> > 
>> 
>> ———
>> 
>> % !TEX program = lmtx
>> 
>> \starttext
>>   \externalfigure[/Users/hp/filename.svg][conversion=mp]
>> \stoptext
>> 
>> ———
>> 
>> 
>> 
>> 
>>> On 9. May 2022, at 08:10, Thangalin via ntg-context >> <mailto:ntg-context@ntg.nl>> wrote:
>>> 
>>> Here's a screenshot comparing ConTeXt's PDF output (left) with KeenWrite's 
>>> preview for the same SVG document:
>>> 
>>> https://i.ibb.co/68nqwrg/render-r-plot.png 
>>> <https://i.ibb.co/68nqwrg/render-r-plot.png>
>>> 
>>> I've filed a bug against Renjin's SVG exporter.
>>> 
>>> Any guidance on how to fix this is greatly appreciated.
>>> 
>>> ___
>>> 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> / 
>>> http://www.ntg.nl/mailman/listinfo/ntg-context 
>>> <http://www.ntg.nl/mailman/listinfo/ntg-context>
>>> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / 
>>> http://context.aanhet.net <http://context.aanhet.net/>
>>> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
>>> <https://bitbucket.org/phg/context-mirror/commits/>
>>> wiki : http://contextgarden.net <http://contextgarden.net/>
>>> ___
>> 
> 
> ___
> 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> / 
> http://www.ntg.nl/mailman/listinfo/ntg-context 
> <http://www.ntg.nl/mailman/listinfo/ntg-context>
> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / 
> http://context.aanhet.net <http://context.aanhet.net/>
> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
> <https://bitbucket.org/phg/context-mirror/commits/>
> wiki : http://contextgarden.net <http://contextgarden.net/>
> ___

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


Re: [NTG-context] SVG style ignored after double semicolon

2022-05-09 Thread Heinrich Paeßens via ntg-context
Yes, now I see, but isn’t there sth missing in the export from JFreeSVG, that 
were supposed to fill in between the semicolons? If not, why don’t you just 
post-process, if possible … 
… sth like 

> gsed ’s/;;/;/g' in.svg > out.svg

;-)



> On 9. May 2022, at 17:42, Thangalin  wrote:
> 
> Hi Heinrich,
> 
> Use the SVG I provided. R and Renjin use two different SVG generators. Renjin 
> uses JFreeSVG when exporting as SVG. As you pointed out, there are no issues 
> with R because it will export an SVG file without any double semicolons.
> 
> In other words, try this:
> 
> \startbuffer[svg]
> 
>style="stroke:rgb(0,0,0);;fill:none" />
> 
> \stopbuffer
> 
> \starttext
>   \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
> \stoptext
> 
> If you get a black square, that's the bug. If you get a white square, then 
> there's something different about our environment setups.
> 
> Cheers!
> 
> 
> On Mon, May 9, 2022 at 1:55 AM Heinrich Paeßens  <mailto:paess...@me.com>> wrote:
> Hi there
> 
> I can compile your example without any tweaks, hence could not reproduce any 
> error.
> 
> cheers
> Heinrich
> 
> ———
> 
> R version 4.2.0 (2022-04-22) -- "Vigorous Calisthenics"
> Copyright (C) 2022 The R Foundation for Statistical Computing
> Platform: x86_64-apple-darwin17.0 (64-bit)
> 
> [R.app GUI 1.78 (8075) x86_64-apple-darwin17.0]
> 
> > svg("/Users/hp/filename.svg");
> > plot(rnorm(200));
> > dev.off()
> null device 
>   1 
> > 
> 
> ———
> 
> % !TEX program = lmtx
> 
> \starttext
>   \externalfigure[/Users/hp/filename.svg][conversion=mp]
> \stoptext
> 
> ———
> 
> 
> 
> 
>> On 9. May 2022, at 08:10, Thangalin via ntg-context > <mailto:ntg-context@ntg.nl>> wrote:
>> 
>> Here's a screenshot comparing ConTeXt's PDF output (left) with KeenWrite's 
>> preview for the same SVG document:
>> 
>> https://i.ibb.co/68nqwrg/render-r-plot.png 
>> <https://i.ibb.co/68nqwrg/render-r-plot.png>
>> 
>> I've filed a bug against Renjin's SVG exporter.
>> 
>> Any guidance on how to fix this is greatly appreciated.
>> 
>> ___
>> 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> / 
>> http://www.ntg.nl/mailman/listinfo/ntg-context 
>> <http://www.ntg.nl/mailman/listinfo/ntg-context>
>> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / 
>> http://context.aanhet.net <http://context.aanhet.net/>
>> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
>> <https://bitbucket.org/phg/context-mirror/commits/>
>> wiki : http://contextgarden.net <http://contextgarden.net/>
>> ___
> 

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


Re: [NTG-context] SVG style ignored after double semicolon

2022-05-09 Thread Thangalin via ntg-context
Hi Heinrich,

Use the SVG I provided. R and Renjin use two different SVG generators.
Renjin uses JFreeSVG when exporting as SVG. As you pointed out, there are
no issues with R because it will export an SVG file without any double
semicolons.

In other words, try this:

\startbuffer[svg]

  

\stopbuffer

\starttext
  \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext

If you get a black square, that's the bug. If you get a white square, then
there's something different about our environment setups.

Cheers!


On Mon, May 9, 2022 at 1:55 AM Heinrich Paeßens  wrote:

> Hi there
>
> I can compile your example without any tweaks, hence could not reproduce
> any error.
>
> cheers
> Heinrich
>
> ———
>
> R version 4.2.0 (2022-04-22) -- "Vigorous Calisthenics"
> Copyright (C) 2022 The R Foundation for Statistical Computing
> Platform: x86_64-apple-darwin17.0 (64-bit)
>
> [R.app GUI 1.78 (8075) x86_64-apple-darwin17.0]
>
> > svg("/Users/hp/filename.svg");
> > plot(rnorm(200));
> > dev.off()
> null device
>   1
> >
>
> ———
>
> % !TEX program = lmtx
>
> \starttext
>   \externalfigure[/Users/hp/filename.svg][conversion=mp]
> \stoptext
>
> ———
>
>
>
>
> On 9. May 2022, at 08:10, Thangalin via ntg-context 
> wrote:
>
> Here's a screenshot comparing ConTeXt's PDF output (left) with KeenWrite's
> preview for the same SVG document:
>
> https://i.ibb.co/68nqwrg/render-r-plot.png
>
> I've filed a bug against Renjin's SVG exporter.
>
> Any guidance on how to fix this is greatly appreciated.
>
>
> ___
> 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
>
> ___
>
>
>
___
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
___


Re: [NTG-context] SVG style ignored after double semicolon

2022-05-08 Thread Thangalin via ntg-context
Hi again,

In tex/texmf-context/tex/context/base/mkxl/mlib-svg.lmt the following regex
appears a few times (line 1502, 1556, and 1570):

gmatch(VAR,"%s*([^:]+):%s*([^;]+);?")

It may be helpful to first normalize the string by appending a semicolon to
the end, allowing for:

for w in (VAR .. ";"):gmatch("([^;]*);") do ...

Splitting 'w' afterwards on the colon within key:value pairs would still be
necessary, so maybe that approach is a wash.

Aside, when I made changes to the file, I couldn't get either a report() or
a print() statement to show up in the output, even when running with
--debug. Any hints on how to sprinkle debug info into the code? Or was I
barking up the wrong source file?

Cheers!

On Sun, May 8, 2022 at 1:33 AM Thangalin  wrote:

> Hey hey,
>
> The following produces a filled square, rather than an empty one:
>
> \startbuffer[svg]
> 
>style="stroke:rgb(0,0,0);;fill:none" />
> 
> \stopbuffer
>
> \starttext
>   \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
> \stoptext
>
> Remove the extra semicolon to get the expected result:
>
> 
>style="stroke:rgb(0,0,0);fill:none" />
> 
>
> It appears that a style immediately following two semicolons is ignored.
>
> The SVG was generated using the following R code:
>
> svg("filename.svg");
> plot(rnorm(200));
> dev.off()
>
> Arguably, R's SVG routines could be a bit tighter. Can the MP SVG parser
> code be relaxed to skip "empty" semicolons?
>
> $ context --version
> mtx-context | current version: 2022.05.02 16:19
>
> Much appreciated.
>
___
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
___


[NTG-context] SVG style ignored after double semicolon

2022-05-08 Thread Thangalin via ntg-context
Hey hey,

The following produces a filled square, rather than an empty one:

\startbuffer[svg]

  

\stopbuffer

\starttext
  \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext

Remove the extra semicolon to get the expected result:


  


It appears that a style immediately following two semicolons is ignored.

The SVG was generated using the following R code:

svg("filename.svg");
plot(rnorm(200));
dev.off()

Arguably, R's SVG routines could be a bit tighter. Can the MP SVG parser
code be relaxed to skip "empty" semicolons?

$ context --version
mtx-context | current version: 2022.05.02 16:19

Much appreciated.
___
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
___


Re: [NTG-context] Crediting copyright on photographs

2022-05-05 Thread Bruce Horrocks via ntg-context
Thank-you Adam, Hraban and Richard for your suggestions.

In the end it was remarkably simple:

\starttext
\definecollector[example]
\setcollector [example] {\externalfigure[cow][width=6cm,frame=off]}
\setcollector [example] [corner={right,bottom},location={right,top}]
{\rotate[rotation=90]{\copyright A great artist}}
\placefigure [ ] [fig:cow] {A fine figure of a cow} 
{\composedcollector{example}}
\stoptext

In the above the cow is drawn with the figure caption below as normal and with 
the copyright text running upwards along the edge of the right-hand edge of the 
image. And if you want to fine tune the space between the image and the text 
then it's easy to \framed the text and play around with the size and offsets.

—
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 / 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
___


Re: [NTG-context] Crediting copyright on photographs

2022-05-05 Thread Richard Mahoney via ntg-context
Bruce,

I tend to do something such as the following:

\startplacefigure[reference={fig:0007},location={here},title={{\it
Vīkṣya}, 5b},list={Ch.\ {\sc ix}\TI {\it Vīkṣya}, 5b}]

\externalfigure[plates/01-09/01-09-07-
c.jpg][scale=1000,frame=off,equalwidth=325pt]

{{\NI}{\tfx \copyright\ 2012 Sylvain {\sc Brocquet}.}}

\stopplacefigure


You can find the result in v. 1, p. 257:

Murugaiyan, Appasamy & Parlier-Renault, Édith (2021) (Eds) Whispering
of Inscriptions:
South Indian Epigraphy and Art History: Papers from an International
Symposium in memory
of Professor Noboru Karashima (Paris, 12–13 October 2017). Oxford:
Indica et Buddhica.

OA PDF here:

https://indica-et-buddhica.org/publications/murugaiyan-appasamy-parlier-renault-edith/whispering-of-inscriptions-south-indian-epigraphy-and-art-history



Best, Richard



-- 
T +6433121699  M +64210640216
rmaho...@indica-et-buddhica.org
https://indica-et-buddhica.org/

Indica et Buddhica
Littledene  Bay Road  Oxford  NZ
NZBN: 9429041761809


-Original Message-
From: Henning Hraban Ramm via ntg-context 
Reply-To: mailing list for ConTeXt users 
To: ntg-context@ntg.nl
Cc: Henning Hraban Ramm 
Subject: Re: [NTG-context] Crediting copyright on photographs
Date: Thu, 5 May 2022 08:54:52 +0200
Mailer: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:91.0)
Gecko/20100101 Thunderbird/91.8.1
X-Spam-Score: 0.0

Am 04.05.22 um 23:59 schrieb Bruce Horrocks via ntg-context:
> I need to include the copyright acknowledgement / photographer
> credit on an image but I'm not sure what's the best way to do it.
> 
> Option 1: I can add the acknowledgement to the end of the
> \placefigure caption text:
> 
> e.g.   \placefigure{A picture of a cow. Image of a cow that may or
> may not be under copyright
> anymore.}{\externalfigure[cow][height=6cm]}
> 
> then the copyright bit will appear in the Table of Figures which I
> don't really want to happen. Is there a way to truncate this?

Using

\startplacefigure[title={complete caption}, list={description in the 
table of figures}]...\stopplacefigure

you can have different caption texts, like for titles.


> Option 2: some magazines print the copyright credit running up the
> side of the image, independently of the caption. I'd quite like to
> do this and wondered if anyone had already written something they
> could share?

I often use \ininner{\rotate[location=fit]{Copyright notice}}, but
it’s 
a hassle to get the placement right, don’t use it within the caption. 
Using \setlayer is most reliable.


Hraban
__
_
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
__
_

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


Re: [NTG-context] Crediting copyright on photographs

2022-05-05 Thread Henning Hraban Ramm via ntg-context

Am 04.05.22 um 23:59 schrieb Bruce Horrocks via ntg-context:

I need to include the copyright acknowledgement / photographer credit on an 
image but I'm not sure what's the best way to do it.

Option 1: I can add the acknowledgement to the end of the \placefigure caption 
text:

e.g.   \placefigure{A picture of a cow. Image of a cow that may or may not be 
under copyright anymore.}{\externalfigure[cow][height=6cm]}

then the copyright bit will appear in the Table of Figures which I don't really 
want to happen. Is there a way to truncate this?


Using

\startplacefigure[title={complete caption}, list={description in the 
table of figures}]...\stopplacefigure


you can have different caption texts, like for titles.



Option 2: some magazines print the copyright credit running up the side of the 
image, independently of the caption. I'd quite like to do this and wondered if 
anyone had already written something they could share?


I often use \ininner{\rotate[location=fit]{Copyright notice}}, but it’s 
a hassle to get the placement right, don’t use it within the caption. 
Using \setlayer is most reliable.



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


Re: [NTG-context] Crediting copyright on photographs

2022-05-04 Thread Adam Reviczky via ntg-context
Hi Bruce,

The Layers page has some examples (
https://wiki.contextgarden.net/Layers#Place_labels_on_pictures) and the
Collectors page as well (https://wiki.contextgarden.net/Collectors).

Some MWE:

\starttext
\definelayer  [figure][width=\overlaywidth,height=\overlayheight]
\defineoverlay[figure][{\directsetup{figure}\tightlayer[figure]}]
\startsetups figure
\setlayerframed[figure][frame=off,preset=rightbottom]{\copyright\ 2022}
\stopsetups
\externalfigure[cow][background={foreground,figure}]
\stoptext

\starttext
\definecollector[example]
\setcollector [example] {\externalfigure[cow][width=4cm,frame=off]}
\setcollector [example]
[corner={right,bottom},location={left,top}]{\copyright\ 2022}
\composedcollector{example}
\stoptext

Adam

On Wed, May 4, 2022 at 11:01 PM Bruce Horrocks via ntg-context <
ntg-context@ntg.nl> wrote:

> I need to include the copyright acknowledgement / photographer credit on
> an image but I'm not sure what's the best way to do it.
>
> Option 1: I can add the acknowledgement to the end of the \placefigure
> caption text:
>
> e.g.   \placefigure{A picture of a cow. Image of a cow that may or may not
> be under copyright anymore.}{\externalfigure[cow][height=6cm]}
>
> then the copyright bit will appear in the Table of Figures which I don't
> really want to happen. Is there a way to truncate this?
>
>
> Option 2: some magazines print the copyright credit running up the side of
> the image, independently of the caption. I'd quite like to do this and
> wondered if anyone had already written something they could share?
>
> —
> 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 /
> 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
>
> ___
>
___
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
___


[NTG-context] Crediting copyright on photographs

2022-05-04 Thread Bruce Horrocks via ntg-context
I need to include the copyright acknowledgement / photographer credit on an 
image but I'm not sure what's the best way to do it.

Option 1: I can add the acknowledgement to the end of the \placefigure caption 
text:

e.g.   \placefigure{A picture of a cow. Image of a cow that may or may not be 
under copyright anymore.}{\externalfigure[cow][height=6cm]}

then the copyright bit will appear in the Table of Figures which I don't really 
want to happen. Is there a way to truncate this?


Option 2: some magazines print the copyright credit running up the side of the 
image, independently of the caption. I'd quite like to do this and wondered if 
anyone had already written something they could share?

—
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 / 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
___


Re: [NTG-context] Full-page Figure?

2022-03-30 Thread śrīrāma via ntg-context
On Tuesday, March 29, 2022 4:18 AM Michael Urban via ntg-context wrote:
> Is there a simple way to accomplish this?

Aside from the other solution using makeup, a simpler way might be to just use 
the 'page' option for positioning the float. The following MWE achieves the 
same result as that with the makeup:

  \setuppagenumbering[alternative=doublesided]
  \setupexternalfigures[location=default]

  \setupheadertexts[]
  \setupheadertexts[chapter][\date]
  \setupfootertexts[pagenumber]

  \starttext
  \startchapter [title={Chapter title}]
  \dorecurse{2}{\samplefile{knuth}}
  \placefigure[page]{a floating cow}{\externalfigure[cow]} 
  \dorecurse{4}{\samplefile{knuth}}
  \blank

  \dorecurse{2}{\samplefile{tufte}}
  \stopchapter
  \stoptext

  Sreeram


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


Re: [NTG-context] Full-page Figure?

2022-03-30 Thread Michael Urban via ntg-context
Almost there.  But if I add \setuppagenumbering  [alternative=doublesided]
to the example, there is a blank page before the makeup page, and an unnumbered 
blank page after.  If I add doublesided=no to the
\setupmakeup options, the unnumbered blank page is not there, but there is 
still a blank page before.  It is seemingly forcing
a right-hand page for some reason I do not understand.

Mike


> On Mar 28, 2022, at 6:37 PM, śrīrāma via ntg-context  
> wrote:
> 
> On Tuesday, March 29, 2022 4:18 AM Michael Urban via ntg-context wrote:
>> Is there a simple way to accomplish this?
> 
> I suppose you need 'postponing'. See
>  https://wiki.contextgarden.net/Command/startpostponing
> [One can specify a page explicitly, or, more conveniently, an offset]
> 
> First, we define a makeup and enable header, footer and page for it. Then we 
> can put the float inside the makeup and wrap it with 
> \start...\stoppostponing. Here is a MWE:
> 
> %%% start example
>  \setupexternalfigures[location=default]
>  \definemakeup
>[FloatPage]
>  \setupmakeup
>[FloatPage]
>[headerstate=normal,
>   pagestate=start,
>   align=middle,
> footerstate=normal]
> 
>  \setupheadertexts[]
>  \setupheadertexts[chapter][\date]
>  \setupfootertexts[pagenumber]
> 
>  \starttext
>  \startchapter [title={Chapter title}]
>\startpostponing[+1]
>  \startFloatPagemakeup
>  \placefigure{a floating cow}{\externalfigure[cow]}
>  \stopFloatPagemakeup
>\stoppostponing
>  \dorecurse{6}{\samplefile{knuth}}
>  \blank
> 
>  \dorecurse{2}{\samplefile{tufte}}
>  \stopchapter
>  \stoptext
> %%% stop example
> 
> Of course, I think some manual hand-tuning is required (in the final stages 
> of the document) in deciding the right place to put the postponing block and 
> in deciding what offset is best.
> 
> Sreeram
> 
> 
> ___
> 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
> ___

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


Re: [NTG-context] Full-page Figure?

2022-03-28 Thread śrīrāma via ntg-context
On Tuesday, March 29, 2022 4:18 AM Michael Urban via ntg-context wrote:
> Is there a simple way to accomplish this?

I suppose you need 'postponing'. See
  https://wiki.contextgarden.net/Command/startpostponing
[One can specify a page explicitly, or, more conveniently, an offset]

First, we define a makeup and enable header, footer and page for it. Then we 
can put the float inside the makeup and wrap it with \start...\stoppostponing. 
Here is a MWE:

%%% start example
  \setupexternalfigures[location=default]
  \definemakeup
[FloatPage]
  \setupmakeup
[FloatPage]
[headerstate=normal,
   pagestate=start,
   align=middle,
 footerstate=normal]

  \setupheadertexts[]
  \setupheadertexts[chapter][\date]
  \setupfootertexts[pagenumber]

  \starttext
  \startchapter [title={Chapter title}]
\startpostponing[+1]
  \startFloatPagemakeup
  \placefigure{a floating cow}{\externalfigure[cow]}
  \stopFloatPagemakeup
\stoppostponing
  \dorecurse{6}{\samplefile{knuth}}
  \blank

  \dorecurse{2}{\samplefile{tufte}}
  \stopchapter
  \stoptext
%%% stop example

Of course, I think some manual hand-tuning is required (in the final stages of 
the document) in deciding the right place to put the postponing block and in 
deciding what offset is best.

Sreeram


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


Re: [NTG-context] "Flushbottom" / \setupalign[line] in LMTX

2022-03-09 Thread Denis Maier via ntg-context
I forgot to include the link to my original question: 
https://www.mail-archive.com/ntg-context@ntg.nl/msg98171.html

Von: Maier, Denis Christian (UB)
Gesendet: Mittwoch, 9. März 2022 17:51
An: 'mailing list for ConTeXt users' 
Betreff: "Flushbottom" / \setupalign[line] in LMTX

Hi everyone,

a quick follow-up to todays monthly meeting: A couple of months ago I ran into 
issues getting "flushbottom" typesetting right. See:

Today, some of these issues seem to have been fixed. But I still have the 
impression that vertical glue is still not working completely reliable. Below 
are a couple of examples.

While the second example seems to work ok with \setupalign[height] the last 
line differs if we have different font size, cf. e.g. page 3 and 4.

Best,
Denis

% From the Wiki : https://wiki.contextgarden.net/Flush_bottom %%
\setupalign[line]

\def\Par{bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
  bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla}
\def\Fig{\placefigure{A figure.}{\framed{\vbox to 5cm{bla
\def\Tab{\placetable{A table.}{\framed{\vbox to 5cm{bla
\starttext
\section{Section}\Par\Par\Par\Fig\Par\Par\par\Par\par\Tab
\Par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\Par\Par\Par
\section{Section}\Par\Par\Par\Fig\Par\Par\par\Par\par\Tab
\Par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\Par\Par\Par
\section{Section}\Par\Par\Par\Fig\Par\Par\par\Par\par\Tab
\Par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\Par\Par\Par
\stoptext
%%%

% Another Example %%%
\setuppapersize[A5][A5]
\showframe
\setupalign[line]
% \setupalign[height]
\setupdelimitedtext[blockquote]
   [
   before={\setupindenting[yes]\tfx\setupinterlinespace},
   spacebefore=medium,
   indentnext=no,
   leftmargin=no,
   rightmargin=no,
   ]

\starttext

\subject{asdf}

\dorecurse{5}{

\input knuth

\startblockquote
\input ward
\stopblockquote

\input knuth

\input ward

\subject{asdf}

\input knuth

\startblockquote
\input ward
\stopblockquote

\input knuth

}

\stoptext
%%%
___
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
___


[NTG-context] "Flushbottom" / \setupalign[line] in LMTX

2022-03-09 Thread Denis Maier via ntg-context
Hi everyone,

a quick follow-up to todays monthly meeting: A couple of months ago I ran into 
issues getting "flushbottom" typesetting right. See:

Today, some of these issues seem to have been fixed. But I still have the 
impression that vertical glue is still not working completely reliable. Below 
are a couple of examples.

While the second example seems to work ok with \setupalign[height] the last 
line differs if we have different font size, cf. e.g. page 3 and 4.

Best,
Denis

% From the Wiki : https://wiki.contextgarden.net/Flush_bottom %%
\setupalign[line]

\def\Par{bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
  bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla}
\def\Fig{\placefigure{A figure.}{\framed{\vbox to 5cm{bla
\def\Tab{\placetable{A table.}{\framed{\vbox to 5cm{bla
\starttext
\section{Section}\Par\Par\Par\Fig\Par\Par\par\Par\par\Tab
\Par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\Par\Par\Par
\section{Section}\Par\Par\Par\Fig\Par\Par\par\Par\par\Tab
\Par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\Par\Par\Par
\section{Section}\Par\Par\Par\Fig\Par\Par\par\Par\par\Tab
\Par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\Par\Par\Par
\stoptext
%%%

% Another Example %%%
\setuppapersize[A5][A5]
\showframe
\setupalign[line]
% \setupalign[height]
\setupdelimitedtext[blockquote]
   [
   before={\setupindenting[yes]\tfx\setupinterlinespace},
   spacebefore=medium,
   indentnext=no,
   leftmargin=no,
   rightmargin=no,
   ]

\starttext

\subject{asdf}

\dorecurse{5}{

\input knuth

\startblockquote
\input ward
\stopblockquote

\input knuth

\input ward

\subject{asdf}

\input knuth

\startblockquote
\input ward
\stopblockquote

\input knuth

}

\stoptext
%%%
___
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
___


Re: [NTG-context] How to stop \placefigure from floating off to some other page?

2022-01-30 Thread Henning Hraban Ramm via ntg-context

Am 30.01.22 um 00:44 schrieb Bruce Horrocks via ntg-context:

On 29 Jan 2022, at 21:30, Joel via ntg-context  wrote:


When I used `\placefigure`, ConTeXt often puts the figure on a completely 
different page, my readership of young students is getting confused where the 
image is. How can I have all of my `\placefigure` in the entire document appear 
exactly where called, even if that means having to place it on a new page with 
lots of space before it or even a new page afterwards? I need it to show up in 
the order it was called. I think `\setupexternalfigures[location=]` should 
provide the solution, but cann't figure what is the correct location, I'm not 
seeing that in the manual anywhere.


Use the force Luke...

e.g.
\placefigure [force] [fig1] {Caption} {\externalfigure [filename.png]}

The location= option is for where on the page (e.g. in a margin, in the main 
text) the picture will go, the actual page it appears on is controlled by 
'here' or 'force' or the default which is to float along until it finds what it 
thinks is a good place.


Not really. "here" and "force" are just options for location, i.e.
location={here,force}
should mostly do what you want.

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


Re: [NTG-context] How to stop \placefigure from floating off to some other page?

2022-01-29 Thread Bruce Horrocks via ntg-context
On 29 Jan 2022, at 21:30, Joel via ntg-context  wrote:
> 
> When I used `\placefigure`, ConTeXt often puts the figure on a completely 
> different page, my readership of young students is getting confused where the 
> image is. How can I have all of my `\placefigure` in the entire document 
> appear exactly where called, even if that means having to place it on a new 
> page with lots of space before it or even a new page afterwards? I need it to 
> show up in the order it was called. I think 
> `\setupexternalfigures[location=]` should provide the solution, but cann't 
> figure what is the correct location, I'm not seeing that in the manual 
> anywhere.

Use the force Luke...

e.g.
\placefigure [force] [fig1] {Caption} {\externalfigure [filename.png]}

The location= option is for where on the page (e.g. in a margin, in the main 
text) the picture will go, the actual page it appears on is controlled by 
'here' or 'force' or the default which is to float along until it finds what it 
thinks is a good place.

—
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 / 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
___


[NTG-context] How to stop \placefigure from floating off to some other page?

2022-01-29 Thread Joel via ntg-context
When I used `\placefigure`, ConTeXt often puts the figure on a completely 
different page, my readership of young students is getting confused where the 
image is. How can I have all of my `\placefigure` in the entire document appear 
exactly where called, even if that means having to place it on a new page with 
lots of space before it or even a new page afterwards? I need it to show up in 
the order it was called. I think `\setupexternalfigures[location=]` should 
provide the solution, but cann't figure what is the correct location, I'm not 
seeing that in the manual anywhere.
___
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
___


Re: [NTG-context] Counter names

2022-01-20 Thread Hans Hagen via ntg-context

On 1/20/2022 2:24 PM, Joaquín Ataz López via ntg-context wrote:
Good morning to all. I would like to ask where I can find information 
about the name of the different counters that are handled in ConTeXt, in 
order to manipulate them manually.


I guess the number of internal ConTeXt counters will be tremendous. But 
I would like to know what the "most common" counters are called, for 
example the ones that control the different structural units (chapter, 
section...) or the elements of a structured list, etc.


I have tried to apply \incrementcounter or \decrementcounter to some 
counters that also exist in TeX as, for example, chapter, section... but 
I don't get any result.


most counters are 'protected' from messing them up and section related 
counters are kind of grouped anyway and have their own system


other counters, like those for floats are more directly accessible

\starttext

\chapter{test}

\setupheadnumber[chapter][+5]

\placefigure{}{}

\chapter{test}

\placefigure{}{}

\setcounter[figure][4]

\placefigure{}{}

\stoptext

chemical combination endnote figure footnote formula graphic
intermezzo itemgroup:itemize itemgroup:itemize:note linenote
paragraph realpage subpage table textnote:note userpage

otherw will be defined when you create instances

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


Re: [NTG-context] \externafigure and \at do not work together

2021-10-31 Thread Bruce Horrocks via ntg-context
I thought it was necessary to use one of the derivations of \placefloat in 
order to get the reference generated. In your case this would be \placefigure 
thus:

\starttext
\placefigure [ ] [clock] { } {\externalfigure[clock.jpg]}
\at[clock] refers to a clock
\stoptext


> On 31 Oct 2021, at 12:49, a badin via ntg-context  wrote:
> 
> The fix is not really a fix thought, as it makes the image of the
> figure disappear.
> Still don't know how to make a .jpg work with \at
> 
> On Sun, 31 Oct 2021 at 13:07, a badin  wrote:
>> 
>> Hello, perhaps this is how it is supposed to work, but:
>> 
>> \externalfigure[clock.jpg][clock]
>> \starttext
>> \at[clock] refers to a clock
>> \stoptext
>> 
>> produces "?? refers to a clock", instead of "1 refers a clock" --- the
>> wiki of \at says, that labels of figures can be refered to. Is this a
>> bug, or can only some labels be refered to? I was able to fix it
>> using:
>> 
>> \reference[clock]{\externalfigure[clock.jpg]}
>> \starttext
>> \at[clock] refers to a clock
>> \stoptext
>> 
>> and
>> 
>> \externalfigure[clock][]
>> \starttext
>> \at
>> \stoptext
>> 
>> produces an interesting artwork... so I thought maybe this could be a
>> bug. LMTX 2021.10.21
>> 
>> Best,
>> Andrej
> ___
> 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
> ___

—
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 / 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
___


[NTG-context] new upload

2021-10-13 Thread Hans Hagen via ntg-context

Hi,

This midweek upload has something new. There has been some discussion 
about footnotes and one thing I noticed when playing with some new 
possibilities is that the stretch in topskip (we use a default amount 
that long ago was derived from plain tex and is relative to the body 
font size) influences the pagebreaks in relation to inserts (footnotes) 
in a more significant way than one would expect.


I also noticed that this stretch component is one of the reasons why 
sometimes a side float shape will carry over to a next page in spite of 
there being room. This relates to \brokenpenalty.


At the end of this mail are some tests that demonstrate this. As a 
consequence we now have a "ntop" parameter as well as a shaping related 
penalty primitives (parameters):


  \shapingpenaltiesmode"FF% set all (future) bits (currently 4)
  \shapingpenalty\plushundred % don't go too high

which is currently not enabled by default but might be in upcoming 
versions; this also depends on user feedback. It's a non intrusive 
extension the LuaMetaTeX engine. I have this setting in my local 
preferences file.


Hans


% test code (for Massimiliano and Hraban to play with)

\starttext

\showframe

% this is the current default behaviour; we have a topskip with
% quite some stretch and that stretch is taken into account
% when tex calculates the badness; watch the next page

\dorecurse{4}{
\bgroup
\shapingpenaltiesmode\zerocount
\showmakeup[penalty]
    \placefigure[left]{}{}
\input tufte \par
\egroup
}

\page EMPTY \page

% the ntop is new and when >= 0 it is a multiplier for the number
% of lines stretch, here we have one line; watch the next page

\dorecurse{4}{
\bgroup
\shapingpenaltiesmode\zerocount
\setupinterlinespace[ntop=1]
\showmakeup[penalty]
    \placefigure[left]{}{}
\input tufte \par
\egroup
}

\page EMPTY \page

% these shaping parameters will discourage a linebreak within a
% shape; the placement macro checked available space but that
% doesn't mean that there can be no linebreak

\dorecurse{4}{
\bgroup
\showmakeup[penalty]
\shapingpenaltiesmode"FF\relax
\shapingpenalty\plushundred
\placefigure[left]{}{}
\input tufte \par
\egroup
}

\page EMPTY \page

% the next pages show the effect of changed topskip on page breaks
% with footnotes

\dorecurse{10}{
[#1] \input tufte \footnote{\input{tufte}} \par
}

\page EMPTY \page

\setupinterlinespace[ntop=2]

\dorecurse{10}{
[#1] \input tufte \footnote{\input{tufte}} \par
}

\page EMPTY \page

\setupinterlinespace[ntop=0]

\dorecurse{10}{
[#1] \input tufte \footnote{\input{tufte}} \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 / 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
___


Re: [NTG-context] Placing SVG icons and text side by side

2021-10-07 Thread Hans Hagen via ntg-context

On 10/7/2021 11:24 AM, noib3 via ntg-context wrote:
How can I place an SVG icon "inline", i.e. side by side to some text? 
Here's my MWE


```
\useURL
   [github]
   [https://github.com/test <https://github.com/test>]
   []
   [github.com/test <http://github.com/test>]

\starttext
   \placefigure[none]{}{\externalfigure[github.svg][width=17.5pt]}
   \from[github]
\stoptext

\figuresymbol[github.svg][conversion=mp,height=2ex]


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


Re: [NTG-context] Placing SVG icons and text side by side

2021-10-07 Thread Henning Hraban Ramm via ntg-context


> Am 07.10.2021 um 11:24 schrieb noib3 via ntg-context :
> 
> How can I place an SVG icon "inline", i.e. side by side to some text? Here's 
> my MWE
> 
> ```
> \useURL
>   [github]
>   [https://github.com/test]
>   []
>   [github.com/test]
> 
> \starttext
>   \placefigure[none]{}{\externalfigure[github.svg][width=17.5pt]}
>   \from[github]
> \stoptext
> ```

Just use \externalfigure, since \placefigure creates a float.

If that’s not enough to keep it together, try a \hbox{}

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


[NTG-context] Placing SVG icons and text side by side

2021-10-07 Thread noib3 via ntg-context
How can I place an SVG icon "inline", i.e. side by side to some text?
Here's my MWE

```
\useURL
  [github]
  [https://github.com/test]
  []
  [github.com/test]

\starttext
  \placefigure[none]{}{\externalfigure[github.svg][width=17.5pt]}
  \from[github]
\stoptext
```

I have attached a screenshot of the output and the SVG file.
___
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
___


[NTG-context] Blank line after \item: MkIV vs LMTX and how to properly get rid of it

2021-09-30 Thread Vladimir Lomov via ntg-context
Hello.

Consider the following small example:

 8< --
\starttext

\startitemize[n]
\item \input tufte
\item \placefigure[right,none]{}{\externalfigure[cow]}%
  \input tufte
\item \blank[overlay]%
  \placefigure[right,none]{}{\externalfigure[cow]}%
  \input tufte
\stopitemize

\startitemize[n,intext]
\item \input tufte
\item \placefigure[right,none]{}{\externalfigure[cow]}%
  \input tufte
\item \blank[overlay]%
  \placefigure[right,none]{}{\externalfigure[cow]}%
  \input tufte
\stopitemize

\stoptext
 8< --

I see a difference in MkIV and LMTX work:
- MkIV always put a blank line despite '\blank[overlay]' command;
- with \blank[overlay] and 'intext' option LMTX clutters item label (number in
  this case).

Q1: is this the expected behavior for MkIV and LMTX? I found a recipe with
  \blank[overlay] in the mailing list.
Q2: is it expected that LMTX will clutter item label when I use
  \blank[overlay]? I suspect the answer is "yes" due to the option name.
Q3: how to prevent blank line insertion in such case: an item with text
  framing a picture (on right side or on left side but the picture is below
  the item label)?

---
WBR, Vladimir Lomov

-- 
Without freedom of choice there is no creativity.
-- Kirk, "The return of the Archons", stardate 3157.4


signature.asc
Description: PGP signature
___
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
___


Re: [NTG-context] Control of Titles appearing in \completelistoftables and \completelistoffigures

2021-08-25 Thread Richard Mahoney via ntg-context

Brilliant, just what was needed. Thank you.

Richard



-- 
T +6433121699  M +64210640216  E rmaho...@indica-et-buddhica.org
IM https://t.me/rmahoney  W https://indica-et-buddhica.org/

Indica et Buddhica  Littledene  Bay Road  Oxford  NZ

-Original Message-
From: Taco Hoekwater 
To: Richard Mahoney , mailing list
for ConTeXt users 
Subject: Re: [NTG-context] Control of Titles appearing in
\completelistoftables and \completelistoffigures
Date: Wed, 25 Aug 2021 08:48:24 +0200
Mailer: Apple Mail (2.3654.120.0.1.13)
X-Spam-Score: 0.0

Hi,

There is \startplacefigure / \startplacetable , which has a ‘list’ key

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

Best wishes,
Taco

> On 25 Aug 2021, at 05:20, Richard Mahoney via ntg-context
>  wrote:
> 
> List,
> 
> I've been wondering if there is some syntax that one can use in:
> 
> \placetable or \placefigure
> 
> to control the Table of Figure Title appearing in:
> 
> \completelistoftables and \completelistoffigures
> 
> 
> At the moment one can do this for the output of:
> 
> \completecontent
> 
> with something such as the following:
> 
> \startsection[title={Title in body},list={Title in contents}]
> 
> 
> Such a thing would be *extremely* useful for a current 
> publication. :)
> 
> 
> Best, Richard
> 
> 
> 
> -- 
> T +6433121699  M +64210640216  E rmaho...@indica-et-buddhica.org
> IM https://t.me/rmahoney  W https://indica-et-buddhica.org/
> 
> Indica et Buddhica  Littledene  Bay Road  Oxford  NZ
> 
> ___
> 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
> 
> ___

Taco Hoekwater
Elvenkind BV




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


Re: [NTG-context] Control of Titles appearing in \completelistoftables and \completelistoffigures

2021-08-25 Thread Taco Hoekwater via ntg-context
Hi,

There is \startplacefigure / \startplacetable , which has a ‘list’ key

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

Best wishes,
Taco

> On 25 Aug 2021, at 05:20, Richard Mahoney via ntg-context 
>  wrote:
> 
> List,
> 
> I've been wondering if there is some syntax that one can use in:
> 
> \placetable or \placefigure
> 
> to control the Table of Figure Title appearing in:
> 
> \completelistoftables and \completelistoffigures
> 
> 
> At the moment one can do this for the output of:
> 
> \completecontent
> 
> with something such as the following:
> 
> \startsection[title={Title in body},list={Title in contents}]
> 
> 
> Such a thing would be *extremely* useful for a current 
> publication. :)
> 
> 
> Best, Richard
> 
> 
> 
> -- 
> T +6433121699  M +64210640216  E rmaho...@indica-et-buddhica.org
> IM https://t.me/rmahoney  W https://indica-et-buddhica.org/
> 
> Indica et Buddhica  Littledene  Bay Road  Oxford  NZ
> ___
> 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
> ___

Taco Hoekwater
Elvenkind BV






— 
Taco Hoekwater  E: t...@bittext.nl
genderfluid (all pronouns)



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


[NTG-context] Control of Titles appearing in \completelistoftables and \completelistoffigures

2021-08-24 Thread Richard Mahoney via ntg-context
List,

I've been wondering if there is some syntax that one can use in:

\placetable or \placefigure

to control the Table of Figure Title appearing in:

\completelistoftables and \completelistoffigures


At the moment one can do this for the output of:

\completecontent

with something such as the following:

\startsection[title={Title in body},list={Title in contents}]


Such a thing would be *extremely* useful for a current 
publication. :)


Best, Richard



-- 
T +6433121699  M +64210640216  E rmaho...@indica-et-buddhica.org
IM https://t.me/rmahoney  W https://indica-et-buddhica.org/

Indica et Buddhica  Littledene  Bay Road  Oxford  NZ
___
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   >