isteinbrecher / latex2ai

LaTeX Plugin for Adobe Illustrator
MIT License
168 stars 5 forks source link

Allow user to set default LaTeX header #170

Open MGG1996 opened 1 month ago

MGG1996 commented 1 month ago

For me personally, I often need to change the color of formulas or add Unicode encoded characters to them. Of course, I can open the LaTeX2AI_header.tex file after each new project and modify its contents, but always remember those macros and commands are not very user-friendly.

So would it be possible to provide an option in the configuration screen to allow the user to edit the default LaTeX2AI_header.tex file contents once and for all.

isteinbrecher commented 1 month ago

This is an interesting feature request. However, I am not sure if this is easily doable within LaTeX2AI. Two (not perfect) workarounds:

  1. What you can always do, is put the Illustrator documents that should use the same header in the same directory
  2. Use the \input command in to point to a global file (this still requires to edit the header after creation)
MGG1996 commented 1 month ago

Greetings @isteinbrecher,

This feature is what I saw in other software's latex plugin, I think it is very user friendly, so I share it with you, hope to provide a little inspiration to improve latex2AI.

Of course, not every software uses the same implementation logic, and it doesn't matter if the same operation can't be realized in LaTeX2AI. As you said, LaTeX2AI is capable of realizing the same effect, it just requires a little more effort from the user.

BTW, I have another idea besides the two options you provided. In fact, it is entirely possible to add enough rich latex packages, such as "color", "ctex", and corresponding setup commands, such as "\xeCJKsetup{CJKmath=true}", to the tex file of the source code. Subsequently recompile to get the plugin. In this way, most of their needs can already be met, even if the user does not have the flexibility to customize the contents of the default header file.