Re: [NTG-context] How to display the pages of a particular section in another PDF?

2022-12-05 Thread Joel via ntg-context
 Thanks so much! It took some work for me to figure out how to make it work, 
but it now works great!
--Joel

On Monday, December 5, 2022 at 05:15:49 AM MST, Hans Hagen via ntg-context 
 wrote:  
 
 On 12/4/2022 11:30 PM, Joel via ntg-context wrote:
> I can use this code to display page 5 from a PDF:
> 
> \externalfigure[filename.pdf][page=5]
> 
> I am making a teacher's guide for a workbook (workbook.pdf). I need to 
> be able to display on the page all pages of a particular section.
> 
> The teacher's guide uses the same section titles as the workbook, e.g.:
> 
> 17-A: Title
> 17-B: Title
> 
> In other words, there is 1:1 pairing of section titles in the teacher's 
> guide and the workbook.
> 
> Is there any way to tell ConTeXt to display all of the pages for a 
> particular section?
> 
> \externalfigure[filename.pdf][section=17A]
prototype attached (first process crap, then load)

Hans

-
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

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


[NTG-context] \hpos in math

2022-12-05 Thread Gavin via ntg-context
Hello List,

I am working on a project which combines graphics with formulas, like this:



hposQuestion.pdf
Description: Adobe PDF document


My code for creating this formula is attached. It works well, but I have a 
couple of questions that could make it work better.

1) Is there a mathematics version of \hpos? The contents of \hpos are set as 
text, even when \hpos is in mathematics, so I wrote an \mpos macro that uses 
\hpos but sets the contents as display-style math. This isn’t great for 
spacing, and it does't adapt to different math styles. \framed has a math 
version, \mframed, that sets the contents in the appropriate math style. If 
anyone know a way to accomplish that with \hpos, I’d love to know.

2) Is there a way to limit the scope of the \hpos labels to a single formula. 
This could turn into a book length project, with several formulas per page and 
several connections per formula. If every \hpos in the entire book needs a 
unique identifier, I could go mad. Under no circumstances will I connect one 
formula to another, so I’d like to be able to use something like 
\hpos{A}{…}…\hpos{B}{…} in each formula. Any suggestions?

I’ve got to say, LMTX is an absolutely amazing tool for this project, which 
includes complicated networks of connections above and below many formulas. The 
integration of TeX, MetaPost, and Lua makes this project tremendous fun.

Thanks!
Gavin

P.S. For the curious, I’m using a method for doing General Relativity based on 
spinors rather than tensors, following the methods of Penrose and Rindler in 
their 1985 books “Spinors and Space-time.” In the typesetting example above, 
the e_\alpha and e_{\dot\beta} are basis spinors (one left-handed, one 
right-handed). The e^\mu is the Infeld-van der Waerden symbol relating the spin 
basis to the coordinate basis. The connections are spinor index contractions. 
The formula above relates the components of the Infeld-van der Waerden symbol 
to the Pauli sigma matrices. This relationship only works in flat space, so 
this is an easy example! [Penrose and Rindler, vol 1 p. 125] 



hposQuestion.tex
Description: Binary data
___
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] Cron /var/www/aanhet.net/context/bin/cron/context-mirror

2022-12-05 Thread Cron Daemon via ntg-context
receiving incremental file list
 ./
 ctan.lsr
 document-2.htm
 download-1.htm
 download-2.htm
 logo-ade.png
 logo-cts.png
 logo-pod.png
 rss.xml
 show-fil.pdf
 context/latest/
 context/latest/cont-mpd.zip
 context/latest/cont-ppc.zip
 context/latest/cont-sci.zip
 context/latest/cont-tmf.zip
 context/latest/cont-tst.7z
 context/latest/cont-tst.tar.xz
 context/latest/cont-tst.zip
 
 sent 101,495 bytes  received 20,717,586 bytes  4,626,462.44 bytes/sec
 total size is 449,084,229  speedup is 21.57


Running archiver:

New dir: /var/www/aanhet.net/context//htdocs/archives/context-2022-12-05.23
172164244   
/var/www/aanhet.net/context//htdocs/archives/context-2022-12-05.23/latest
126745317   
/var/www/aanhet.net/context//htdocs/archives/context-2022-12-05.23/current
18956262
/var/www/aanhet.net/context//htdocs/archives/context-2022-12-05.23/alpha
126707516   
/var/www/aanhet.net/context//htdocs/archives/context-2022-12-05.23/beta
444577435   
/var/www/aanhet.net/context//htdocs/archives/context-2022-12-05.23
444577435   total
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] How to display the pages of a particular section in another PDF?

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

On 12/5/2022 7:23 PM, Pablo Rodriguez via ntg-context wrote:

On 12/5/22 18:30, Hans Hagen via ntg-context wrote:

On 12/5/2022 5:39 PM, Pablo Rodriguez via ntg-context wrote:

[...]
it would be great to have something like:

\loadsection[1] [2] [3]
[...]

that is not flexible ... we're talking about a rather special
application, so what I can add is a simple helper that returns the first
and last page of a section


That would be great for me.


keep in mind that it is also a biut fragile as one never know where the
last one ends


I wondered whether \doifreference{\lastsectionpage[file][reference]}
would make sense here, but this would probably be a way of unnecesarily
complicating things...

for sure complicating, as i have no cleu what that would mean

Hans

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

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

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


Re: [NTG-context] TEXpage cropping math

2022-12-05 Thread Gavin via ntg-context
Hi Pablo and Mikael,

offset=none does exactly what I need. Thank you, both!

Gavin


> On Dec 5, 2022, at 11:40 AM, Pablo Rodriguez via ntg-context 
>  wrote:
> 
> On 12/5/22 13:42, Mikael Sundqvist via ntg-context wrote:
>> Hi,
>> 
>> One usually need an offset.
> 
> ... or even none (which seems to work in this case):
> 
>  \startTEXpage[offset=none]
>$E_1$
>  \stopTEXpage
> 
> Just in case it might help,
> 
> Pablo
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___

___
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] TEXpage cropping math

2022-12-05 Thread Pablo Rodriguez via ntg-context
On 12/5/22 13:42, Mikael Sundqvist via ntg-context wrote:
> Hi,
> 
> One usually need an offset.

... or even none (which seems to work in this case):

  \startTEXpage[offset=none]
$E_1$
  \stopTEXpage

Just in case it might help,

Pablo

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

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


Re: [NTG-context] How to display the pages of a particular section in another PDF?

2022-12-05 Thread Pablo Rodriguez via ntg-context
On 12/5/22 18:30, Hans Hagen via ntg-context wrote:
> On 12/5/2022 5:39 PM, Pablo Rodriguez via ntg-context wrote:
>> [...]
>> it would be great to have something like:
>>
>>\loadsection  [1] [2] [3]
>> [...]
> that is not flexible ... we're talking about a rather special 
> application, so what I can add is a simple helper that returns the first 
> and last page of a section

That would be great for me.

> keep in mind that it is also a biut fragile as one never know where the 
> last one ends

I wondered whether \doifreference{\lastsectionpage[file][reference]}
would make sense here, but this would probably be a way of unnecesarily
complicating things...

Many thanks for your help,

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

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


Re: [NTG-context] How to display the pages of a particular section in another PDF?

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

On 12/5/2022 5:39 PM, Pablo Rodriguez via ntg-context wrote:

On 12/5/22 13:13, Hans Hagen via ntg-context wrote:

On 12/4/2022 11:30 PM, Joel via ntg-context wrote:

I can use this code to display page 5 from a PDF:
[...]
\externalfigure[filename.pdf][section=17A]


prototype attached (first process crap, then load)


Hi Hans,

it would be great to have something like:

   \loadsection [1] [2] [3]

   1FILE
   2REFERENCE
   3inherits from \setupexternalfigure

Just in case it may be relevant to the discussion.
that is not flexible ... we're talking about a rather special 
application, so what I can add is a simple helper that returns the first 
and last page of a section


\dostepwiserecurse {\firstsectionpage[crap][chapter:3]} 
{\lastsectionpage[crap][chapter:3]} {1} {

\startpagemakeup
\externalfigure[crap.pdf][page=#1]
\stoppagemakeup
}

\dostepwiserecurse {\firstsectionpage[crap][chapter:5]} 
{\lastsectionpage[crap][chapter:5]} {1} {

\dontleavehmode
\externalfigure[crap.pdf][page=#1,width=3cm,frame=on]%
\space\allowbreak
}

keep in mind that it is also a biut fragile as one never know where the 
last one ends


Hans



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

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

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


Re: [NTG-context] How to display the pages of a particular section in another PDF?

2022-12-05 Thread Pablo Rodriguez via ntg-context
On 12/5/22 13:13, Hans Hagen via ntg-context wrote:
> On 12/4/2022 11:30 PM, Joel via ntg-context wrote:
>> I can use this code to display page 5 from a PDF:
>> [...]
>> \externalfigure[filename.pdf][section=17A]
>
> prototype attached (first process crap, then load)

Hi Hans,

it would be great to have something like:

  \loadsection  [1] [2] [3]

  1 FILE
  2 REFERENCE
  3 inherits from \setupexternalfigure

Just in case it may be relevant to the discussion.

Many thanks for your help,

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

maillist : ntg-context@ntg.nl / https://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] TEXpage cropping math

2022-12-05 Thread Mikael Sundqvist via ntg-context
Hi,

One usually need an offset. Try

try \startTEXpage[offset=1sp]

/Mikael

On Mon, Dec 5, 2022 at 1:39 PM Gavin via ntg-context  wrote:
>
> Hi List
>
> I’m having trouble with \startTEXpage cropping off tops and bottoms of 
> equations. For example.
>
> \startTEXpage
>   $E_1$
> \stopTEXpage
>
> Produces:
>
> Any suggestions?
>
> Gavin___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] TEXpage cropping math

2022-12-05 Thread Gavin via ntg-context
Hi List

I’m having trouble with \startTEXpage cropping off tops and bottoms of 
equations. For example.

\startTEXpage
  $E_1$
\stopTEXpage

Produces: 

TEXpage.pdf
Description: Adobe PDF document


Any suggestions?

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

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


Re: [NTG-context] How to display the pages of a particular section in another PDF?

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

On 12/4/2022 11:30 PM, Joel via ntg-context wrote:

I can use this code to display page 5 from a PDF:

\externalfigure[filename.pdf][page=5]

I am making a teacher's guide for a workbook (workbook.pdf). I need to 
be able to display on the page all pages of a particular section.


The teacher's guide uses the same section titles as the workbook, e.g.:

17-A: Title
17-B: Title

In other words, there is 1:1 pairing of section titles in the teacher's 
guide and the workbook.


Is there any way to tell ConTeXt to display all of the pages for a 
particular section?


\externalfigure[filename.pdf][section=17A]

prototype attached (first process crap, then load)

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
-

\startluacode
document.foundsection = { first = 0, last  = 0 }

function document.loadsection(filename,reference)
local data = job.loadother(file.addsuffix(filename,"tuc"))
if data then
local lists = data.structures.lists.collected
local pages = data.structures.pages.collected
if lists and pages then
for i=1,#lists do
local li = lists[i]
if li.references.reference == reference then
local first = 1
local last  = pages[#pages].number
local level = li.metadata.level
first = li.references.realpage
for j=i+1,#lists do
local lj = lists[j]
if lj.metadata.level == level then
last = lj.references.realpage - 1
break
end
end
document.foundsection.first = first
document.foundsection.last  = last
end
end
end
end
end
\stopluacode

% it depends what interface one wants ... we could have
%
% \externalfigure[crap.pdf][section=] % takes from crap
%
% but we need more inpiut and discussion for that

\starttexdefinition DoWithSection #1#2
\startpagemakeup
\externalfigure[#1.pdf][page=#2]
\stoppagemakeup
\stoptexdefinition

\starttexdefinition LoadSectionsA #1#2
\ctxlua{document.loadsection("#1","#2")}
\doifnot{\cldcontext{document.foundsection.first}} {0} {
\dostepwiserecurse
{\cldcontext{document.foundsection.first}}
{\cldcontext{document.foundsection.last}}
{1}
{
\DoWithSection{#1}{\recurselevel}
}
}
\stoptexdefinition

\starttexdefinition spaces LoadSectionsB #1#2
\ctxlua{
document.loadsection("#1","#2")
if document.foundsection.first > 0 then
for i=document.foundsection.first,document.foundsection.last do
context.DoWithSection("#1",i)
end
end
}
\stoptexdefinition

\starttext

\LoadSectionsA{crap}{chapter:3}

\LoadSectionsB{crap}{chapter:2}

\stoptext
\starttext

\dorecurse{10}{
\startchapter[title=Chapter #1,reference=chapter:#1]
\dorecurse{10}{
\startsubject[title=Subject #1]
\dorecurse{2}{\samplefile{tufte}\par}
\stopsubject
\startsection[title=Section #1.##1,reference=#1.##1]
\dorecurse{10}{\samplefile{tufte}\par}
\stopsection
}
\stopchapter
}

\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] How to display the pages of a particular section in another PDF?

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

Am 04.12.22 um 23:30 schrieb Joel via ntg-context:

I can use this code to display page 5 from a PDF:

\externalfigure[filename.pdf][page=5]

I am making a teacher's guide for a workbook (workbook.pdf). I need to 
be able to display on the page all pages of a particular section.


The teacher's guide uses the same section titles as the workbook, e.g.:

17-A: Title
17-B: Title

In other words, there is 1:1 pairing of section titles in the teacher's 
guide and the workbook.


Is there any way to tell ConTeXt to display all of the pages for a 
particular section?


\externalfigure[filename.pdf][section=17A]


Use a loop in Lua or TeX:

https://wiki.contextgarden.net/System_Macros/Loops_and_Recursion

\dostepwiserecurse {5} {17} {1} 
{\externalfigure[filename.pdf][page=\recurselevel]}


or

\startluacode

for s=5, 17 do
  context.externalfigure({"filename.pdf"},{page=s})
end

\stopluacode

(untested)

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

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


Re: [NTG-context] How to display the pages of a particular section in another PDF?

2022-12-05 Thread Denis Maier via ntg-context
Don’t know about ConTeXt. But maybe you might want to have a look at pdftk. You 
could try to produce per-section pdfs and include those.

Best,
Denis

Von: ntg-context  Im Auftrag von Joel via 
ntg-context
Gesendet: Sonntag, 4. Dezember 2022 23:31
An: Mailing List for ConTeXt Users 
Cc: Joel 
Betreff: [NTG-context] How to display the pages of a particular section in 
another PDF?

I can use this code to display page 5 from a PDF:

\externalfigure[filename.pdf][page=5]
I am making a teacher's guide for a workbook (workbook.pdf). I need to be able 
to display on the page all pages of a particular section.

The teacher's guide uses the same section titles as the workbook, e.g.:

17-A: Title
17-B: Title

In other words, there is 1:1 pairing of section titles in the teacher's guide 
and the workbook.

Is there any way to tell ConTeXt to display all of the pages for a particular 
section?


\externalfigure[filename.pdf][section=17A]

--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] \externalfigure problem with displaying external images via https://live.contextgarden.net

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

Am 05.12.22 um 09:05 schrieb Aditya Mahajan via ntg-context:

On Mon, 5 Dec 2022, Jaroslav Hajtmar via ntg-context wrote:

Does anyone know what the problem might be? Why online ConTeXt is not read my 
PDF file and on other side read another PDF file? What does onlineConText not 
like?
I need to get my application for printing archive certificates working again...


I am guessing it is a security setting to avoid DOS attack (imagine forcing the 
server to download a ridiculously large file, etc.).


While that would be good to avoid abuse from external services like this 
one, the problem is just that the source is called via http, but the 
server redirects to https – ConTeXt doesn’t follow redirections.


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] \externalfigure problem with displaying external images via https://live.contextgarden.net

2022-12-05 Thread Aditya Mahajan via ntg-context
On Mon, 5 Dec 2022, Jaroslav Hajtmar via ntg-context wrote:
> Does anyone know what the problem might be? Why online ConTeXt is not read my 
> PDF file and on other side read another PDF file? What does onlineConText not 
> like?
> I need to get my application for printing archive certificates working 
> again...

I am guessing it is a security setting to avoid DOS attack (imagine forcing the 
server to download a ridiculously large file, etc.).

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

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