From: thierry horsin via ntg-context <ntg-context@ntg.nl>
To: ntg-context@ntg.nl
Cc: thierry horsin <horsin@free.fr>
Subject: Re: getting line numbers
Date: Sat, 4 Sep 2021 09:01:54 +0200 [thread overview]
Message-ID: <c986e5f0-7592-abe7-5c1d-374ce5613323@free.fr> (raw)
In-Reply-To: <mailman.418.1630685069.1197.ntg-context@ntg.nl>
Hi and thank you Aditaya and again Hans.
By the way, just for fun , is there a(n easy) way to get the linenumber
in the tex file ?
Thanks
On 03/09/2021 18:04, ntg-context-request@ntg.nl wrote:
>
> ------------------------------
>
> Message: 4
> Date: Fri, 3 Sep 2021 14:16:40 +0200
> From: Hans Hagen <j.hagen@xs4all.nl>
> To: mailing list for ConTeXt users <ntg-context@ntg.nl>
> Cc: Thierry Horsin <horsin@free.fr>
> Subject: Re: [NTG-context] getting line numbers
> Message-ID: <807e4b7c-97ae-e20e-3207-28393544c5e5@xs4all.nl>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> in this case, thinking a bit different is easier ...
>
> \starttext
>
> \startbuffer[MyBuffer]
> #include <iostream>
>
> using namespace std;
> int mysum(int,int);
> int a; int b;
> int main () {
> a=2; b=9;
> cout << mysum(a,b) << endl;
> return 0;
> }
> int mysum(int a, int b) {
> return a+b;
> }
> \stopbuffer
>
> We compile and run:
>
> \typebuffer[MyBuffer][option=C]
>
> \startluacode
> io.savedata("test.cpp",buffers.getcontent("MyBuffer"))
> --os.execute("g++ -o test test.cpp")
> --os.execute("./test > test.tmp")
> os.execute("echo done > test.tmp")
> buffers.assign("MyBuffer",io.loaddata("test.tmp"))
> \stopluacode
>
> And get:
>
> \typebuffer[MyBuffer]
>
> Or just:
>
> \typefile{test.tmp}
>
> \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
> -----------------------------------------------------------------
>
>
> ------------------------------
>
> ------------------------------
>
> Message: 6
> Date: Fri, 3 Sep 2021 09:53:58 -0400 (EDT)
> From: Aditya Mahajan <adityam@umich.edu>
> To: Thierry Horsin via ntg-context <ntg-context@ntg.nl>
> Subject: Re: [NTG-context] getting line numbers
> Message-ID:
> <nycvar.YAK.7.77.849.2109030949370.477524@ervasbepr.pvz.zptvyy.pn>
> Content-Type: text/plain; charset=US-ASCII
>
> On Fri, 3 Sep 2021, Thierry Horsin via ntg-context wrote:
>
>
> https://github.com/adityam/filter
>
> Behind the scenes, it works by saving the content in an external file and then
> running it through any external program. It also allows for caching the
> result, and has many options for customizing the behavior.
>
> 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
___________________________________________________________________________________
next parent reply other threads:[~2021-09-04 7:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.418.1630685069.1197.ntg-context@ntg.nl>
2021-09-04 7:01 ` thierry horsin via ntg-context [this message]
2021-09-04 8:35 ` Hans Hagen via ntg-context
2021-09-04 10:18 ` Thierry Horsin via ntg-context
2021-09-03 10:58 Thierry Horsin via ntg-context
2021-09-03 12:16 ` Hans Hagen via ntg-context
2021-09-03 12:20 ` Thierry Horsin via ntg-context
2021-09-03 13:53 ` Aditya Mahajan via ntg-context
2021-09-03 16:26 ` Hans Hagen via ntg-context
2021-09-05 10:26 ` Fabrice Couvreur via ntg-context
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c986e5f0-7592-abe7-5c1d-374ce5613323@free.fr \
--to=ntg-context@ntg.nl \
--cc=horsin@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).