From: Florent Michel <florent.m42@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] Re: Calling C code from ConTeXt LMTX
Date: Sun, 15 Sep 2024 22:11:37 +0100 [thread overview]
Message-ID: <CALOhoeLJEXLwtt-FToBvcE2+AW=S+b70Mx=jZ_t+U-AE7+ANWQ@mail.gmail.com> (raw)
In-Reply-To: <0F3B2569-C75B-47EA-9D34-289A55BF0C65@scorecrow.com>
[-- Attachment #1.1: Type: text/plain, Size: 2247 bytes --]
Thanks Bruce for your very helpful reply!
The reason for my question was indeed consistency, e.g. ensuring figure
captions stay up to date with what the figures show when changing
parameters. Thinking more about it, the second solution you mention seems
to be a better option, though - I can simply define the parameters in an
external file and read it from both the PDF solver and ConTeXt to ensure
consistency. Thanks for mentioning it!
Thank you also for mentioning \executesystemcommand, which I was not aware
of!
Best regards,
Florent
Le dim. 15 sept. 2024 à 21:31, Bruce Horrocks <ntg@scorecrow.com> a écrit :
>
>
> > On 14 Sep 2024, at 21:46, Florent Michel <florent.m42@gmail.com> wrote:
> >
> > TL;DR: Could building LuaMetaTeX with the `-fPIC` flag for the Lua
> library have negative consequences? Is there a better way to be able to
> call external C functions from ConTeXt?
>
> This seems a bit drastic. Why can’t you achieve what you want to achieve
> by using other methods?
>
> For example you could setup a workflow whereby you pre-calculate your DE’s
> and format the results to include as input files. Or you could
> pre-calculate your DEs and plot them using one of any number of plotting
> programs and include the plots as TIFFs or PNGs.
>
> If you’re familiar with compiling C code using tools like `make` then why
> not use a makefile to control the production of your DE plots and your
> ConTeXt document to ensure that everything is consistent?
>
> If you absolutely must run the DE calculations as the ConTeXt document is
> processed then there is \executesystemcommand.
>
> —
> 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
>
> ___________________________________________________________________________________
>
[-- Attachment #1.2: Type: text/html, Size: 3112 bytes --]
[-- Attachment #2: Type: text/plain, Size: 511 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2024-09-15 21:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-14 20:46 [NTG-context] " Florent Michel
2024-09-15 20:29 ` [NTG-context] " Bruce Horrocks
2024-09-15 21:11 ` Florent Michel [this message]
2024-09-16 10:59 ` Bruce Horrocks
2024-09-16 11:15 ` Henning Hraban Ramm
2024-09-16 12:06 ` Bruce Horrocks
2024-09-16 12:58 ` Florent Michel
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='CALOhoeLJEXLwtt-FToBvcE2+AW=S+b70Mx=jZ_t+U-AE7+ANWQ@mail.gmail.com' \
--to=florent.m42@gmail.com \
--cc=ntg-context@ntg.nl \
/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).