Questions about an Idea for a feature in LyX
Richard Kimberly Heck
rikiheck at gmail.com
Fri May 3 00:31:23 UTC 2024
On 5/2/24 18:28, matan guedj wrote:
> Hello,
> I don't really know how the mail listing works, new to the concept.
> I've had a few questions revolving around an idea recently trying to
> teach myself pgfplots.
> I'm fairly new to LyX and LaTeX in general (started using both in
> January) and I'm also no programmer but I wanted to add a new feature
> to LyX of a plotting tool.
> What I'm thinking of is on the math bar or some other bar, add a plot
> icon that will open a window with all the parameters for the mostly
> used plots (2D/3D, Cartesian/polar/spherical..., scatter/bars/pie...,
> parametric curves or surfaces, implicit functions, vector fields, and
> more).
> I'm still learning pgfplots but it follows a fairly simple and well
> defined formula for most of the plots so it most likely can be automated.
> And now it opens some questions:
>
> 1. Is there a way I can start work on it as a personal project (I
> specifically want it to be a personal thing, to see if I'm capable of
> this, and also it can't look bad on the resume), and when I believe
> it's done and an acceptable feature, present it to the developers and
> implement it for the next version?
Yes, this is an open source project, so anyone can work on it. Whether
something gets accepted into the codebase is a different question, but
this seems like something that could be useful to a lot of people. Doing
what you describe will take some real programming, though we'll all be
happy to point you in the right direction. That kind of discussion is
better on lyx-devel, though.
I should probably warn you that, with 2.4.0 about to be released, it
will be a while before the next major release. The sort of thing you
describe would mean storing new info in the LyX file, which changes the
format of the file. That can only be done at major releases, so this
would have to be for 2.5.0.
That said, LyX already has an extensible ability to include 'external
material'. If you look at Insert> File> External Material, you'll see
all kinds of options there. It would not be difficult to add a pgfplot
option, I think. This would not provide for the dialog you describe, but
it would be a start. See Ch 7 of the Embedded Objects help file for how
this can be done.
I can at least imagine a way of indicating in the external template an
extra 'page' in the settings dialog that would allow for choosing of
options, etc, like you describe. So it might not be necessary to write a
completely new dialog, etc.
> 2. I also thought that the output on the LyX document itself would be
> a new environment (like the math environment) that can render those
> plots directly into LyX document without the need to compile the
> document to check if the plot is what you really wanted, so how do I
> create such an environment?
LyX already has the ability to display all kinds of things, so I don't
think that would be difficult. Basically, LyX just needs to be told how
to convert the file into some graphics format it can display. This can
be done with 'external material' already.
Riki
More information about the lyx-users
mailing list