On 03/20/2018 04:43 PM, Baris Erkus wrote: > > Ok. I was wondering if it was possible to do it from within LyX, > without editing the LyX file. I guess, it is not possible. > > > > Editing LyX file is fine, but it would have been really nice if it had > the capability of making minor changes to the TeX code. >
I believe there are open enhancement requests about this. There really should be a way to do it in the case of math. I don't even think it would be that difficult. We have the LaTeX code. We just need a way to say "Display that, instead of the WYSIWYM stuff". Unfortunately, I do not know my way around the math code nearly well enough to do this. Maybe another option would be for us to extend the "external editor" model to math insets. I believe we will soon have the ability to open ERT with an external editor, for cases where the ERT is fairly complex. Riki > *From:* lyx-users@lists.lyx.org <lyx-users@lists.lyx.org> on behalf of > Paul A. Rubin <parubi...@gmail.com> > *Sent:* Tuesday, March 20, 2018 11:27:54 PM > *To:* lyx-users@lists.lyx.org > *Subject:* Re: Change Latex Math Code > > On 03/20/2018 03:39 PM, Baris Erkus wrote: >> >> Hello, >> >> >> >> Is there a way to change the latex math code in LyX by editing the code? >> >> >> >> For example, if I enter a fraction in math environment using back >> slash like \frac, is there a way to edit this Latex code and make it >> \dfrac simply by placing “d” in front of “f”? >> >> >> >> Baris Erkus >> > Yes, but not (I think) within LyX. Instead, open the .lyx file in your > favorite text editor, make the change and save it. If you do this > while LyX is open (at least LyX 2.3.0; I haven't tried it with earlier > versions), LyX will warn you that the document changed and ask if you > want to reload it. > > If you are not sure exactly what you are looking for in the text > editor, you can open the preview pane (View > Code Preview Pane in > 2.3.0; I think this might have been View > Source or something similar > in previous versions). Set the format selector to LyX and the view > selector to Current Paragraph, then put the cursor in the math formula > you want to change and see what it looks like in the .lyx file. > > Paul >