[NTG-context] Re: context not producing synctex output that my synctex program can use

2023-11-15 Thread Jim
Henning and Hans,

thanks for the replies.  I have two follow-up questions below, as well as
some other comments which other synctex users might find useful.

On Sun, Nov 12, 2023 at 10:26 (+0100), Henning Hraban Ramm wrote:

> Am 12.11.23 um 00:59 schrieb Jim:
>> Hi,

>> I've read the wiki, looked at workflows-synctex.tex, searched the web, and
>> scratched my head, all to no avail.  So here I am, cap in hand...

>> When I run context, I get a .synctex file which has some information in it,
>> but I can't find any invocation of synctex to return anything useful.  Nor
>> does the okular example in the wiki (https://wiki.contextgarden.net/SyncTeX)
>> work for me.  Ocular starts, but always on the first page, regardless of
>> what line number I give it.

>> On the other hand, pdftex creates a .synctex file which my copy of synctex
>> find useful.

>> I am using the synctex from the current version of texlive:
>> This is SyncTeX command line utility, version 1.5

>> Can anyone either
>> (a) enlighten me on what I am doing wrong; or
>> (b) definitively confirm that context is not currently playing nicely with
>> synctex (the wiki notwithstanding) and I should give up this quest for
>> now.

> ConTeXt doesn’t work with the synctex binary, but with
> mtxrun --script synctex

Thanks for that pointer.

Q1: Should that be in the wiki (https://wiki.contextgarden.net/SyncTeX)
somewhere?

When I try that out, for example with
mtxrun --script synctex --edit --name=a.tex --line=222 a.tex 
I am rewarded with
sandbox | variable 'linenumber' has no checker
(I tried various variations on that line I won't bore you with, but I keep
getting that error message.)

I also tried
mtxrun --script synctex --goto --page=4 --x=100 --y=100 a.synctex 
and that silently returns without apparently doing anything.  (While I
don't have a 'scite' editor, I created a program called 'scite' that pops a
message up on the screen if it is called.)

Similar to --edit,
mtxrun --script synctex --goto --page=19 --x=400 --y=180 --tolerance=99 
--editor=scite  a.synctex
complains
sandbox | variable 'tolerance' has no checker

Although I don't know lua, the code is easy enough to read, but a short
dive in to mtx-synctex.lua did not enlighten me.

Q2: any enlightening comments on why I am getting these complaints.

In any case, --find and --report (appear to) give meaningful results, so I
can work with those.

> Unfortunately, it’s not a drop-in replacement, so it doesn’t work with most
> editors. (I was thinking about a translating wrapper script, but didn’t do
> anything yet.)

So much code to write, so little time ...:-)

My immediate concern is forward search (i.e., editor tells viewer which
page to display) and that one should be easy for me to create a wrapper.
(I use emacs + auctex, which calls the synctex program, so writing my own
synctex wrapper looks easy.  Hopefully I won't regret using the word "easy"
later.)


> AFAIK TeXshop (MacOS) is the only TeX editor that supports ConTeXt’s
> workflow.

I've been thinking of patching some of evince's more annoying features,
if I do, maybe I should look into making it work with context.

> ConTeXt’s synctex format is much simpler than the “standard” LaTeX one and
> should be at least as good, but alas it needs support from the editors.

Indeed!




On Sun, Nov 12, 2023 at 12:00 (+0100), Hans Hagen wrote:

> On 11/12/2023 10:26 AM, Henning Hraban Ramm wrote:
>> Am 12.11.23 um 00:59 schrieb Jim:
>>> Hi,

>>> 

>> ConTeXt doesn’t work with the synctex binary, but with
>> mtxrun --script synctex

> afaik there is no binary ... there is a library that has to be compiled into
> a pdf viewer that intercept some 'goto the text file' command and then
> launches an editor (afik the library has some heuristics build in wrt boxes
> and nesting and so); at the tex end there is also a library that kicks in
> addiional code for nodes and the backend (which is why enabling synctex will
> have an impact on runtime)

> wrt the synctex file, that one is generated by context (so we don't use the
> synctex code in luatex and as luametatex has no backend there it's even
> completely absent ... context generates the file itself which is also a bit
> more efficient)

>> Unfortunately, it’s not a drop-in replacement, so it doesn’t work with
>> most editors. (I was thinking about a translating wrapper script, but
>> didn’t do anything yet.)

>> AFAIK TeXshop (MacOS) is the only TeX editor that supports ConTeXt’s
>> workflow.

> indeed texshop uses the approach that avoids the library and just calls
> mtxrun to figure out t

[NTG-context] Re: context not producing synctex output that my synctex program can use

2023-11-12 Thread Hans Hagen

On 11/12/2023 10:26 AM, Henning Hraban Ramm wrote:

Am 12.11.23 um 00:59 schrieb Jim:

Hi,

I've read the wiki, looked at workflows-synctex.tex, searched the web, 
and

scratched my head, all to no avail.  So here I am, cap in hand...

When I run context, I get a .synctex file which has some information 
in it,
but I can't find any invocation of synctex to return anything useful.  
Nor
does the okular example in the wiki 
(https://wiki.contextgarden.net/SyncTeX)

work for me.  Ocular starts, but always on the first page, regardless of
what line number I give it.

On the other hand, pdftex creates a .synctex file which my copy of 
synctex

find useful.

I am using the synctex from the current version of texlive:
 This is SyncTeX command line utility, version 1.5

Can anyone either
(a) enlighten me on what I am doing wrong; or
(b) definitively confirm that context is not currently playing nicely 
with
 synctex (the wiki notwithstanding) and I should give up this 
quest for

 now.


ConTeXt doesn’t work with the synctex binary, but with
mtxrun --script synctex


afaik there is no binary ... there is a library that has to be compiled 
into a pdf viewer that intercept some 'goto the text file' command and 
then launches an editor (afik the library has some heuristics build in 
wrt boxes and nesting and so); at the tex end there is also a library 
that kicks in addiional code for nodes and the backend (which is why 
enabling synctex will have an impact on runtime)


wrt the synctex file, that one is generated by context (so we don't use 
the synctex code in luatex and as luametatex has no backend there it's 
even completely absent ... context generates the file itself which is 
also a bit more efficient)


Unfortunately, it’s not a drop-in replacement, so it doesn’t work with 
most editors. (I was thinking about a translating wrapper script, but 
didn’t do anything yet.)


AFAIK TeXshop (MacOS) is the only TeX editor that supports ConTeXt’s 
workflow.


indeed texshop uses the approach that avoids the library and just calls 
mtxrun to figure out the file/line that relates to the position; this is 
more reliable because there is no need to recompile a viewer when 
synctex updates


you can run

  mtxrun --script synctex

on the synctex file and check what areas are there

ConTeXt’s synctex format is much simpler than the “standard” LaTeX one 
and should be at least as good, but alas it needs support from the editors.
simpler in the sense that we only output what is needed for the 
synchronization to work reliable; fwiw, my collegue already for many 
years uses context with synctex enabled with sumatra pdf in pretty 
complex setups: a mix of tex and xml files with deeply nested inputs and 
it works ok (so we also get to the right spot in an (included) xml file)


for synctex to work one has to call context with --synctex or put a 
directive on the topline of the file. Otherwise you won't get the right 
jobname. Of course it then still depends on the pdf viewer + lib used if 
things work out as expected.


there isn't much we can do about the viewer part unless tit is not 
locked into the binary but as flexible like the texshop viewer is


Hans

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

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

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


[NTG-context] Re: context not producing synctex output that my synctex program can use

2023-11-12 Thread Henning Hraban Ramm

Am 12.11.23 um 00:59 schrieb Jim:

Hi,

I've read the wiki, looked at workflows-synctex.tex, searched the web, and
scratched my head, all to no avail.  So here I am, cap in hand...

When I run context, I get a .synctex file which has some information in it,
but I can't find any invocation of synctex to return anything useful.  Nor
does the okular example in the wiki (https://wiki.contextgarden.net/SyncTeX)
work for me.  Ocular starts, but always on the first page, regardless of
what line number I give it.

On the other hand, pdftex creates a .synctex file which my copy of synctex
find useful.

I am using the synctex from the current version of texlive:
 This is SyncTeX command line utility, version 1.5

Can anyone either
(a) enlighten me on what I am doing wrong; or
(b) definitively confirm that context is not currently playing nicely with
 synctex (the wiki notwithstanding) and I should give up this quest for
 now.


ConTeXt doesn’t work with the synctex binary, but with
mtxrun --script synctex

Unfortunately, it’s not a drop-in replacement, so it doesn’t work with 
most editors. (I was thinking about a translating wrapper script, but 
didn’t do anything yet.)


AFAIK TeXshop (MacOS) is the only TeX editor that supports ConTeXt’s 
workflow.


ConTeXt’s synctex format is much simpler than the “standard” LaTeX one 
and should be at least as good, but alas it needs support from the editors.


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] context not producing synctex output that my synctex program can use

2023-11-11 Thread Jim
Hi,

I've read the wiki, looked at workflows-synctex.tex, searched the web, and
scratched my head, all to no avail.  So here I am, cap in hand...

When I run context, I get a .synctex file which has some information in it,
but I can't find any invocation of synctex to return anything useful.  Nor
does the okular example in the wiki (https://wiki.contextgarden.net/SyncTeX)
work for me.  Ocular starts, but always on the first page, regardless of
what line number I give it.

On the other hand, pdftex creates a .synctex file which my copy of synctex
find useful.

I am using the synctex from the current version of texlive:
This is SyncTeX command line utility, version 1.5

Can anyone either
(a) enlighten me on what I am doing wrong; or
(b) definitively confirm that context is not currently playing nicely with
synctex (the wiki notwithstanding) and I should give up this quest for
now.

Thanks very much.

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

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


[NTG-context] Problems with line numbered program listings

2023-10-04 Thread Bruce Horrocks
I'm trying to typeset some program listings with annotations alongside. I've 
tried both columns and tabulate but both have (different) issues:

1) Plain \typefile won't allow the line numbers to be in the text - they stay 
in the margin whch I don't want.

2) \typefile using a \definedtyping name does work and works in \columns as 
well. This is great until my listing is too long to fit on a page and then I'd 
rather have the column continue onto the next page but \columns balances of 
course.

3) \tabulate allows a single cell to continue down over the page exactly as I'd 
like, but the line numbers disappear altogether. (And it has to be a single 
cell because the program listings are in source files that I want to include 
using \typefile rather than re-enter to avoid typos.)

You can see each of these effects with the following MWE which first needs a 
file called "three_lines.txt" to be created in the local directory containing 
the lines:
one
two
three

 begin
\setuplinenumbering[location=text,style=\small\tt]
\starttext

Location=text not working in main body
\typefile[numbering=line]{three_lines.txt}

But it does work if a custom typing environment is created.
\definetyping[MyTyping][style=\tt]
\typefile[MyTyping][numbering=line]{three_lines.txt}

Still works if used in a column
\startcolumns
 \typefile[MyTyping][numbering=line]{three_lines.txt}
\column
 :-)
\stopcolumns
\blank

But doesn't work if used in tabulate
\starttabulate[|p|p|]
\NC
 \typefile[MyTyping][numbering=line]{three_lines.txt}
\NC
  No line numbers at all :-(
\NR
\stoptabulate

\stoptext
 end

What I'd most like is for tabulate to allow \typefile with line numbers if at 
all possible.
—
Bruce Horrocks
Hampshire, UK


zz.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] check installed program using Lua

2021-11-02 Thread Pablo Rodriguez via ntg-context
On 11/1/21 5:13 PM, Hans Hagen via ntg-context wrote:
> On 11/1/2021 2:26 PM, Pablo Rodriguez via ntg-context wrote:
>> [...]
>> Is there a way to wrap os.exec() in the sample so that it only runs if
>> "dir" is available?
>>
>> I know that os.name would be an option here, but not in my real world
>> document.
>
> \starttext
>\startluacode
>  if lfs.isfile(tex.jobname .. ".pdf") then
>  context("YES")
>  end
>  if lfs.isfile(file.addsuffix(environment.outputfilename,"pdf")) then
>  context("YES")
>  end
>  if #dir.glob(file.addsuffix(environment.outputfilename,"pdf")) > 0 then
>  context("YES")
>  end
>\stopluacode
> \stoptext

Many thanks for your reply, Hans.

I can see that I explained my question poorly, but your code fits me in
other case.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] check installed program using Lua

2021-11-02 Thread Pablo Rodriguez via ntg-context
On 11/1/21 3:10 PM, Taco Hoekwater via ntg-context wrote:
>> [...]
>> Is there a way to wrap os.exec() in the sample so that it only runs if
>> "dir" is available?
>
> if os.which(‘dir’) then
>   ...
> end
>
> But note that os.which() may be unreliable in various cases (like it
> will fail for shell/command interpreter builtins, in cron jobs, in
> special scripted environments, and may incorrectly succeed for
> disabled/forbidden commands), as it just runs through the PATH
> environment variable to check for executable file existence.
Many thanks for your reply, Taco.

This is exactly what I needed.

> Often times, it is better to just try to run the command to see if
> that produces satisfactory results.
It makes sense, but I cannot do that on foreign computers.

Many thanks for your help again,

Pablo

--
http://www.ousia.tk
___
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] check installed program using Lua

2021-11-01 Thread Hans Hagen via ntg-context

On 11/1/2021 2:26 PM, Pablo Rodriguez via ntg-context wrote:

Dear list,

is there a way if a program is installed on the computer using Lua.

I have the following sample:

   \starttext
   \startluacode
   filename = tex.jobname .. ".pdf"
   os.exec("dir " .. filename)
   \stopluacode
   \stoptext

Is there a way to wrap os.exec() in the sample so that it only runs if
"dir" is available?

I know that os.name would be an option here, but not in my real world
document.


\starttext
  \startluacode
if lfs.isfile(tex.jobname .. ".pdf") then
context("YES")
end
if lfs.isfile(file.addsuffix(environment.outputfilename,"pdf")) then
context("YES")
end
if #dir.glob(file.addsuffix(environment.outputfilename,"pdf")) > 0 then
context("YES")
end
  \stopluacode
\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] check installed program using Lua

2021-11-01 Thread Taco Hoekwater via ntg-context


> On 1 Nov 2021, at 14:26, Pablo Rodriguez via ntg-context  
> wrote:
> 
> Dear list,
> 
> is there a way if a program is installed on the computer using Lua.
> 
> I have the following sample:
> 
>  \starttext
>  \startluacode
>  filename = tex.jobname .. ".pdf"
>  os.exec("dir " .. filename)
>  \stopluacode
>  \stoptext
> 
> Is there a way to wrap os.exec() in the sample so that it only runs if
> "dir" is available?

if os.which(‘dir’) then
  ...
end

But note that os.which() may be unreliable in various cases (like it will fail 
for shell/command interpreter builtins, in cron jobs, in special scripted 
environments, and may incorrectly succeed for disabled/forbidden commands), as 
it just runs through the PATH environment variable to check for executable file 
existence. 

Often times, it is better to just try to run the command to see if that 
produces satisfactory results.

Best wishes,
taco

— 
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] check installed program using Lua

2021-11-01 Thread Pablo Rodriguez via ntg-context
Dear list,

is there a way if a program is installed on the computer using Lua.

I have the following sample:

  \starttext
  \startluacode
  filename = tex.jobname .. ".pdf"
  os.exec("dir " .. filename)
  \stopluacode
  \stoptext

Is there a way to wrap os.exec() in the sample so that it only runs if
"dir" is available?

I know that os.name would be an option here, but not in my real world
document.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] Including part of a program source file

2018-04-21 Thread Alan Braslau
Can't one also use matching strings in the range={,}, 
(with the command \typefile)?

Alan

On Sat, 21 Apr 2018 17:29:58 +0200
Wolfgang Schuster  wrote:

> The verbatim commands have a range key which let you select parts of
> the code,
> you can use line numbers to include a small block (e.g. range={3,10}
> or range {3,+7})
> or you put labels in your code.
> 
> \startbuffer
> % cmd:one:begin
> \define\FirstCommand
>{\dosingleempty\doFirstCommand}
> 
> \def\doFirstCommand[#1]%
>{This is the definition for the first command}
> % cmd:one:end
> 
> % cmd:two:begin
> \define\SecondCommand
>{\dosingleempty\doSecondCommand}
> 
> \def\doSecondCommand[#1]%
>{This is the definition for the second command}
> % cmd:two:end
> \stopbuffer
> 
> \starttext
> \typebuffer[range={cmd:two:begin,cmd:two:end}]
> \stoptext
> 
> Wolfgang
> > N. Raghavendra <mailto:nyraghu27...@gmail.com>
> > 21. April 2018 um 16:00
> > I am writing some notes using ConTeXt, which involves displaying
> > parts of some program source files. At present, I am manually
> > cutting and pasting the parts into the ConTeXt file. Is it possible
> > to make ConTeXt do that for me? I am thinking of including each
> > part of the Coq sources between tags like this:
> >
> > 
> > $ cat src-file
> > 
> > part_to_be_included_1
> > 
> >
> > 
> > part_to_be_included_2
> > 
> > 
> >
> > I would like to say something like
> >
> > \IncludePart{src-file}{tag-1}
> >
> > in my ConTeXt file to get
> >
> > part_to_be_included_1
> >
> > at that place in the PDF output after I run `context'. I would
> > appreciate any advice on how to go about this.
> >
> > Thanks,
> > Raghu.
> >
> > --
> > N. Raghavendra , http://www.retrotexts.net/
> > Harish-Chandra Research Institute, http://www.hri.res.in/
> > ___
> > 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] Including part of a program source file

2018-04-21 Thread N. Raghavendra
At 2018-04-21T17:29:58+02:00, Wolfgang Schuster wrote:

> The verbatim commands have a range key which let you select parts of
> the code, you can use line numbers to include a small block
> (e.g. range={3,10} or range {3,+7}) or you put labels in your code.

Many thanks! It works perfectly, with something like this:

\starttext

\typefile
  [range={beg:8e1e0cb9:6524:4a9b:a58e:6610c8bcf156,
  end:8e1e0cb9:6524:4a9b:a58e:6610c8bcf156}]
  {../coq/univalence/transport/total_path.v}

\typefile
  [range={beg:8edf79a4:6fe4:4a0c:a1a4:5be2ab413b47,
  end:8edf79a4:6fe4:4a0c:a1a4:5be2ab413b47}]
  {../coq/univalence/transport/path_from.v}

\stoptext

Raghu.

--
N. Raghavendra , http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
___
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] Including part of a program source file

2018-04-21 Thread Wolfgang Schuster
The verbatim commands have a range key which let you select parts of the 
code,
you can use line numbers to include a small block (e.g. range={3,10} or 
range {3,+7})

or you put labels in your code.

\startbuffer
% cmd:one:begin
\define\FirstCommand
  {\dosingleempty\doFirstCommand}

\def\doFirstCommand[#1]%
  {This is the definition for the first command}
% cmd:one:end

% cmd:two:begin
\define\SecondCommand
  {\dosingleempty\doSecondCommand}

\def\doSecondCommand[#1]%
  {This is the definition for the second command}
% cmd:two:end
\stopbuffer

\starttext
\typebuffer[range={cmd:two:begin,cmd:two:end}]
\stoptext

Wolfgang

N. Raghavendra <mailto:nyraghu27...@gmail.com>
21. April 2018 um 16:00
I am writing some notes using ConTeXt, which involves displaying parts
of some program source files. At present, I am manually cutting and
pasting the parts into the ConTeXt file. Is it possible to make ConTeXt
do that for me? I am thinking of including each part of the Coq sources
between tags like this:


$ cat src-file

part_to_be_included_1



part_to_be_included_2



I would like to say something like

\IncludePart{src-file}{tag-1}

in my ConTeXt file to get

part_to_be_included_1

at that place in the PDF output after I run `context'. I would
appreciate any advice on how to go about this.

Thanks,
Raghu.

--
N. Raghavendra , http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
___
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] Including part of a program source file

2018-04-21 Thread N. Raghavendra
I am writing some notes using ConTeXt, which involves displaying parts
of some program source files.  At present, I am manually cutting and
pasting the parts into the ConTeXt file.  Is it possible to make ConTeXt
do that for me?  I am thinking of including each part of the Coq sources
between tags like this:


$ cat src-file

part_to_be_included_1



part_to_be_included_2



I would like to say something like

\IncludePart{src-file}{tag-1}

in my ConTeXt file to get

part_to_be_included_1

at that place in the PDF output after I run `context'.  I would
appreciate any advice on how to go about this.

Thanks,
Raghu.

--
N. Raghavendra , http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
___
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] using ConTeXt/LuaTeX instead of a spreadsheet program

2011-02-16 Thread Taco Hoekwater


On 02/16/11 23:46, Martin Schröder wrote:
> 2011/2/16 Hans Hagen :
>> I would put them in a lua table and access them when needed (you can load
>> that table from an external file)
> 
> Which precision do we have in luatex? Single or double?

double.

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] using ConTeXt/LuaTeX instead of a spreadsheet program

2011-02-16 Thread Martin Schröder
2011/2/16 Hans Hagen :
> I would put them in a lua table and access them when needed (you can load
> that table from an external file)

Which precision do we have in luatex? Single or double?

Best
   Martin
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] using ConTeXt/LuaTeX instead of a spreadsheet program

2011-02-16 Thread Vnpenguin
On Wed, Feb 16, 2011 at 18:47, Paul Menzel
 wrote:
> Dear ConTeXt folks,
>
>
> could you please share your experiences with or point me to a resource
> dealing with the following issue.
>
> I need to evaluate some physics experiments where I have some values
> which got measured. I thought I could use ConTeXt with LuaTeX to do all
> the calculations instead of the calculator and enter the results by hand
> or a spreadsheet program.
>
> Would I enter the values (not many) at the top of the TeX document and
> refer to them in the other places? Is an extra file a better approach?
>
>


In your place, I'll go to MS Excel or Openoffice Calc :)
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] using ConTeXt/LuaTeX instead of a spreadsheet program

2011-02-16 Thread Hans Hagen

On 16-2-2011 6:47, Paul Menzel wrote:

Dear ConTeXt folks,


could you please share your experiences with or point me to a resource
dealing with the following issue.

I need to evaluate some physics experiments where I have some values
which got measured. I thought I could use ConTeXt with LuaTeX to do all
the calculations instead of the calculator and enter the results by hand
or a spreadsheet program.

Would I enter the values (not many) at the top of the TeX document and
refer to them in the other places? Is an extra file a better approach?


I would put them in a lua table and access them when needed (you can 
load that table from an external file)



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] using ConTeXt/LuaTeX instead of a spreadsheet program

2011-02-16 Thread Wolfgang Schuster

Am 16.02.2011 um 18:47 schrieb Paul Menzel:

> Dear ConTeXt folks,
> 
> could you please share your experiences with or point me to a resource
> dealing with the following issue.
> 
> I need to evaluate some physics experiments where I have some values
> which got measured. I thought I could use ConTeXt with LuaTeX to do all
> the calculations instead of the calculator and enter the results by hand
> or a spreadsheet program.
> 
> Would I enter the values (not many) at the top of the TeX document and
> refer to them in the other places? Is an extra file a better approach?

Do you have a example what do you want to achieve?

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] using ConTeXt/LuaTeX instead of a spreadsheet program

2011-02-16 Thread Paul Menzel
Dear ConTeXt folks,


could you please share your experiences with or point me to a resource
dealing with the following issue.

I need to evaluate some physics experiments where I have some values
which got measured. I thought I could use ConTeXt with LuaTeX to do all
the calculations instead of the calculator and enter the results by hand
or a spreadsheet program.

Would I enter the values (not many) at the top of the TeX document and
refer to them in the other places? Is an extra file a better approach?


Thanks,

Paul


[1] http://wiki.contextgarden.net/Programming_in_LuaTeX


signature.asc
Description: This is a digitally signed message part
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Importing program text.

2010-03-27 Thread Peter Münster
On Fri, Mar 26 2010, John Culleton wrote:
> 
> I want to import the text of several programs in my latest book. 
> My requirements are:
> 1. Monospaced font.

\setuptyping[style=\tt]


> 2. Courier or similar typeface

I don't know.


> 3. Smaller than normal typeface (to avoid wraparound.) 

\setuptyping[style=\tx\tt]

Cheers, Peter

-- 
Contact information: http://pmrb.free.fr/contact/


___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Importing program text.

2010-03-26 Thread John Culleton


I want to import the text of several programs in my latest book. 
My requirements are:
1. Monospaced font.
2. Courier or similar typeface
3. Smaller than normal typeface (to avoid wraparound.) 

I have been fiddling with \typefile but I am having trouble accomplishing  
the above. 
-- 
John Culleton
Able Indexers and Typesetters
http://wexfordpress.com

---
-- 
John Culleton
Able Indexers and Typesetters
http://wexfordpress.com
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] concert program

2009-05-07 Thread R. Bastian
Gruezi,

is somewhere a template for a concert program in Context ?

a+



___
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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] start a program with a particular file

2003-06-16 Thread Sytse Knypstra
I followed Adam Lindsay's suggestion and looked up \useexternalsoundtrack 
in core-fig.
But unfortunately I am ignorant of low level TeXnicalities.
I could only figure out that I needed two parameters and by trial and error 
I found that they have to be included in [ and ].
The line:
\gebruikexterngeluidsfragment[muziek][C:/Downloads/MyMusic.mp3]
gave no errors, but not a text `muziek' on which I could click for starting 
the music.

In the past I used the construction
   \stelprogrammasin[gebied=G:/ConTeXt/Imagine/]
   \definieerprogramma[PQRS][PQRS.exe][PQRS]
   \programma[PQRS].
for launching my program PQRS (without opening a file).
Unfortunately I could not get Hans' suggestion
   \naar{programma PQRS}[PQRS.exe]
working for this case, maybe because the fs does not support it?
Neither could I start my program Sila.exe with a particular file `Sila.spf':
   \naar{programma Sila}[Sila.exe(Sila.spf)]
Maybe I should wait until the coming version.

Sytse Knypstra

___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] start a program with a particular file

2003-06-14 Thread Hans Hagen
At 11:12 12/06/2003 +0200, you wrote:
Dear ConTeXt users,

Can anybody tell me whether it is possible to start a program with a 
particular file?
Let's say I want to start mediaplayer with the file MyMusic.wav.


in addition to adam's answer, you can use \goto {something} 
[program(somefile)] to get anything launched that the fs supports, like 
excel sheets and so on windows; in the coming version file embedding is 
also an option (include file in doc, and open it as attachment); i have 
this running now also with user defined launch symbols

Hans

-
  Hans Hagen | PRAGMA ADE | [EMAIL PROTECTED]
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-
   information: http://www.pragma-ade.com/roadmap.pdf
documentation: http://www.pragma-ade.com/showcase.pdf
-
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] start a program with a particular file

2003-06-12 Thread Adam Lindsay
Sytse Knypstra said this at Thu, 12 Jun 2003 11:12:01 +0200:

>Let's say I want to start mediaplayer with the file MyMusic.wav.

Well, for this specific example, why not \useexternalsoundtrack (core-fig)?
Acrobat seems to support a fair number of media types in a cross-platform
way, which could get around relying on mediaplayer being around on any
particular machine...

adam

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay  [EMAIL PROTECTED]
 Computing Dept, Lancaster University   +44(0)1524/594.537
 Lancaster, LA1 4YR, UK Fax:+44(0)1524/593.608
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] start a program with a particular file

2003-06-12 Thread Sytse Knypstra
Dear ConTeXt users,

Can anybody tell me whether it is possible to start a program with a 
particular file?
Let's say I want to start mediaplayer with the file MyMusic.wav.

Thank you,

Sytse Knypstra

___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context