Pasting latex in a lyx file
Hi all, sometime I need to paste some latex code inside a lyx file. When I do this, I lose all the formatting and, in particular, I lose all new lines: this means that what I end up with in my red box in lyx is a complete mess which requires a lot of editing. This is quite annoying: am I missing something which results in this behaviour? Thank you -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users
Re: Pasting latex in a lyx file
Paul, Ctrl+Shift+V works just fine for me, thanks! My fault, and I beg your pardon for this, for not having tried the relative option in "Edit -> Paste Special" : I just tried the "Paste from LaTeX", which doesn't work in my case (I am pasting tikz figures, so @rich: I was referring to the second option). Thank you everybody. :) Il giorno gio 8 apr 2021 alle ore 00:57 Paul A. Rubin ha scritto: > On 4/7/21 6:44 PM, Andrew Parsloe wrote: > > > On 8/04/2021 3:14 am, Paul A. Rubin wrote: > > On 4/7/21 10:14 AM, Mario D wrote: > > Hi all, > > sometime I need to paste some latex code inside a lyx file. > When I do this, I lose all the formatting and, in particular, I lose all > new lines: this means that what I end up with in my red box in lyx is a > complete mess which requires a lot of editing. > > This is quite annoying: am I missing something which results in this > behaviour? > > Thank you > > Have you tried Edit > Paste Special > Paste from LaTeX? Note that this is > used to paste directly into the LyX document, *not* into an ERT box > (ctrl+L). > > Paul > > I usually just use Ctrl+Shift+V to paste text (including lines of LaTeX) > that preserves new lines. It works in an ERT box. (I wasn't aware of the > Paste from LateX option. In fact, there's quite a bit here that has > changed since I last carefully looked at what was offered by the different > menus.) > > Andrew > > Actually, I usually do the same thing (because I forget about the paste > LaTeX option). Sometimes, though, what plops into the ERT box is a mess of > the sort Mario described, and I end up inserting newlines to make it > readable. I'm not sure if the paste special approach avoids that -- I don't > have an example handy at the moment -- but one can hope. > > Paul > > -- > lyx-users mailing list > lyx-users@lists.lyx.org > http://lists.lyx.org/mailman/listinfo/lyx-users > -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users
Shell-escape enabled but not working
Hi, I have a document which uses the external library of tikz, so I need shell escape. I have lyx 2.3.6 so I enabled shell escape via Document->Settings->Formats and check "Allow running of external programs." Nevertheless, when I run pdflatex, I get this error: - ! I can't write on file `myfile_figure0.md5'. \relax l.320 \end{tikzpicture} (Press Enter to retry, or Control-D to exit; default file extension is `.tex') Please type another output file name ! Emergency stop. \relax l.320 \end{tikzpicture} *** (job aborted, file error in nonstop mode) --- Am I missing something? BTW, if I export my lyx file to a latex file and I compile it (with pdflatex --shell-escape), it compiles smoothly. Thank you -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users
Moving around
Hi, when I move around in a file I have a behavior which (to me) does not seem consistent. Please let me explain. If I am inside a text portion of the file, arrows drive me to the close by character, ctrl+arrows to the close by word, shift+arrows select close by character and shift+ctrl+arrows select whole words. Fine. What I can't get used to is what happens when I am inside a (big) formula. Namely, if I use ctrl+arrow I go to to the end (or beginning, depending the arrow) of the formula, which is the same that I get using the Home/End keys. On the contrary, with ctrl+arrow I would like to be driven to the end/beginning of current logical element, that is the same place where the cursor would be if I hit shift+arrow. So, my question is: can it be changed? I tried to change some setting in keyboard shortcuts, but without luck. Maybe I could not figure out the right one. Thank you
Re: Moving around
> > I think the key issue is that LyX understands insets (or perhaps I should > call them subenvironments?) -- things that are argument to LaTeX functions. > So if you create a fraction, which translates to \frac{#1}{#2} with the > arguments substituted, LyX knows what constitutes the numerator and what > constitutes the denominator. I don't think LyX will parse "y = x + 2z" and > recognize "x" as an addend, "2z" as an addend, etc., because there's no > need > to do so in order to translate to LaTeX (nor does LaTeX do that sort of > parsing, AFAIK). > > So I very much doubt, barring a major change to the code, that you can do > better than what it currently does. > > Paul > > Paul, surely I do not demand to lyx to recognize addends in a formula like "y = x + 2z". Maybe I can explain better myself with an example, so please let me write a formula with a few markers for the cursor position. Consider \frac{1}{2} + \left(1+1\right) = 2.5 ^ ^ ^^ ^ A B C D E Wherever I am, if I hit ctrl+right I am driven to E. What I would like is that if I am in A I land in B and if I am in C I go to D Please note that if I hit shift+right and I am in A then all the A-B portion of the formula is selected and similarly if I am in C with shift+right I get C-D selected. This means that lyx can recognize these chunks of code because, as you said, lyx understands insets (or subenvironments, if you prefer). What I have not been able to understand is which function I should bind to ctrl+right so that this combination drives me from A to B or from C to D instead of from everywhere to E Incidentally, I also do not like very much the fact that if in A then shift+right selects all the A-B portion of the formula: in my view, this should be the behavior of ctrl+shift+right, whereas shift+right should select only the very next character (that is, the numerator if I am in A). I wish I have explained better my question. For completeness and reproducibility, I add that some of my current bindings (the ones which seem relevant to me) are: shift+right: char-right-select ctrl+right: word-right ctrl+shift+right: word-right-select Thank you
Fwd: Moving around
Perhaps you can repost your example, between pre and /pre tags? > > Paul > > Paul, sorry you couldn't see the proper formatting. I repost the formula with the tags inside the formula, so it should be clear A \frac{1}{2} B + C \left(1+1\right) D = 2.5 E I can say that I have exactly the same behavior you describe, in any place. In fact, I also use the cua bind, plus a bunch of personal bindings which, however, are not related to moving actions. It seems to me that there is some consensus about the fact that moving/selecting could be improved. Here is what I think. The guidelines should be as follows: Moving: left/right arrow: moves to the previous/next character ctrl+arrow: moves to the previous/next word ctrl+home/end: moves to the begging/end of the line up/down arrow: moves to the previous/next line Selecting: shitf+arrow: selects from current position to the previous/next character shift+ctrl+arrow: selects from current position to the previous/next word shift+ctrl+home/end: selects from current position to the begging/end of the line shitf+up/down arrow: selects from current position to the previous/next line This is actually what really happens when you are in a pure text paragraph. The problem is how to interpret this inside a formula. I do realize that a formula has a much more complex structure and syntax than a text paragraph, yet what happens now is (to me) quite disconnected from what happens inside a text paragraph and I get very confused when I select inside a formula. My suggestion is as follows. Let me put a few more tags: A \frac{ AA 1 AB }{ 2 } B + C \left( CA 1 CB + CD 1 CE \right) D = 2.5 E Moving with (right) arrow is consistent: you go from A to AA then to AB or from C to CA then to CB, CD and CE. Selecting with arrows should be something close to this. That is, selecting the smallest chunk of code possible. At present, selecting with arrows has a complete different behavior depending where you are: - if you are in CA it selects CA-CB (ok) - if you are in C it selects C-D (why? not ok for me) Ctrl+arrow and shift+ctrl+arrow are inconsistent: what happens now is that: - if you are in CA with ctrl+right you go in CE (ok) - if you are in C with ctrl+right you go in E (not ok) and the same when selecting. What I think it should happen is: - if you are in CA with ctrl+right you go in CE (ok) - if you are in C with ctrl+right you go in D (a movement that I cannot perform with any combination) and when selecting: - if you are in CA with shit+ctrl+right you select CA-CE (ok) - if you are in C with shift+ctrl+right you select C-D (that is, the same action that at present is performed by shift+right) Note also that at present Home and ctrl+right arrow behave _exactly_ the same (and the same for the shifted version): this is a waste of resource in my opinion and even a bit confusing. I hope to have explained myself clearly (and not have bored you...)
Re: Fwd: Moving around
Paul, I realize that defining a model for movements/selections inside mathematical environment is complex and there could be different more or less equivalently good solutions. This is job for the developers, if they consider this worth of. Maybe between the many different solutions they could simply choose the one which is easier to implement. In any case, to me it is highly desirable a consistent behavior. Above all, in my opinion, this means the fact that the shifted version of a combination should select the same elements over which you move with the non shifted version. At present this is not the case and I find myself doing and undoing selections. Yes, I know: mainly my fault... yet this doesn't happen to me while I am in a pure text paragraph. >So, what I would find logical and consistent is the following. > > Movement: > left/right arrow move one character (where entering or exiting an inset, such as going into/out of a subscript, counts as a "character" for movement purposes); > ctrl-left/right jumps the adjacent "grouping", where "grouping" is the subtree at the current node if we were to diagram the math inset as a tree; > home/end jumps to the start or end of the entire inset; > ctrl-home/end jumps to the start or end of the buffer (document). > > Selection: shift+any navigation combination selects everything from the current cursor position to where the unshifted key combination would take you. This seems to me a good model. It leaves space for a couple of bindings: ctrl-page up/page down and ctrl-up/down which could be, for example, ctrl-page up/page down jumps to the start/end of the formula ctrl-up/down something else to be decided (or viceversa) and similarly for the shifted version.
Re: Moving around
2016-05-28 17:39 GMT+02:00 Guillaume Munch : > I agree ctrl+arrows could do better. The attached patch implements your > suggestion. > > I guess that I need to apply your patch to the source and the recompile it, don't I? Because I am not very keen on recompiling lyx: I would like to use the repository version
Inserting references to label
After opening the dialog box to insert a reference to a label, when a label is chosen there is a button "Go to label" in order to check whether the label is really the correct one. Good. After having hit this button, it is replaced with "Go back", so that I can get to the original point after having checked the label. Ok. The only drawback, in this, is that when I am back to the original point the label I checked is no longer selected, so that now I know whether it was the right one or not but, possibly, I don't remember its name... :( Am I doing something wrong? To make the dialog box behave even better, maybe it would be nice if when a label is selected then a (small) preview/portion of the formula or of the text is displayed (and maybe it could be chosen by the user whether to activate this option or not).
Re: [PATCH] Inserting references to label
2016-06-07 1:43 GMT+02:00 Richard Heck : > On 06/06/2016 04:57 AM, Mario D wrote: > > After opening the dialog box to insert a reference to a label, when a > > label is chosen there is a button "Go to label" in order to check > > whether the label is really the correct one. Good. > > After having hit this button, it is replaced with "Go back", so that I > > can get to the original point after having checked the label. Ok. > > > > The only drawback, in this, is that when I am back to the original > > point the label I checked is no longer selected, so that now I know > > whether it was the right one or not but, possibly, I don't remember > > its name... :( > > > > Am I doing something wrong? > > No, this is definitely a shortcoming. The attached patch fixes this > behavior, but it seems like a bit of a hack. > > Anyone have a better idea? I could introduce a new variable for this > purpose, but that seems like overkill. > > Richard > > Thank you. Ok, now there are (to me) two interesting patches: this one and the other concerning moving and selecting with ctrl+arrows: is there any chance to see these implemented in a future minor release or should I start thinking about recompiling on my own?
Re: [PATCH] Inserting references to label
I see that this small bug has been fixed with 2.2.1. Yet there still is a small glitch: when I hit "Go back" I am really back to where I was, but the "Ok" button is greyed out, so to insert the reference I have to select a different one and then reselect the previous (if it was the correct one, of course). 2016-06-08 16:46 GMT+02:00 Richard Heck : > On 06/08/2016 03:46 AM, Mario D wrote: > > 2016-06-07 1:43 GMT+02:00 Richard Heck : > >> On 06/06/2016 04:57 AM, Mario D wrote: >> > After opening the dialog box to insert a reference to a label, when a >> > label is chosen there is a button "Go to label" in order to check >> > whether the label is really the correct one. Good. >> > After having hit this button, it is replaced with "Go back", so that I >> > can get to the original point after having checked the label. Ok. >> > >> > The only drawback, in this, is that when I am back to the original >> > point the label I checked is no longer selected, so that now I know >> > whether it was the right one or not but, possibly, I don't remember >> > its name... :( >> > >> > Am I doing something wrong? >> >> No, this is definitely a shortcoming. The attached patch fixes this >> behavior, but it seems like a bit of a hack. >> >> Anyone have a better idea? I could introduce a new variable for this >> purpose, but that seems like overkill. >> >> Richard >> >> > Thank you. > > Ok, now there are (to me) two interesting patches: this one and the other > concerning moving and selecting with ctrl+arrows: is there any chance to > see these implemented in a future minor release or should I start thinking > about recompiling on my own? > > > This one will go into 2.2.2 at least, and probably into 2.2.1. We're > waiting to see if some major problem with 2.2.0 arises that requires a very > fast release. If so, then 2.2.1 will contain only really serious fixes. If > not, then it will contain more. It looks as if the latter is what will > happen, but we'll only make a decision after the release of 2.1.5. > > Richard > > >
Enumerate inside other environment
I know how to nest environments so that I can use enumerate inside another environment in order to produce something looking like: - Theorem. The following are equivalent: 1. First statement. 2. Second statement. - My question is: how can I produce - Theorem. 1. First statement. 2. Second statement. - The only way I could get it was to insert an empty note after the "Theorem", then newline, start the enumerate and finally nest it. Is there a "cleaner" way? I couldn't find anything relevant on lyx manuals. Moreover, how can I produce the following? - Theorem. 1. First statement. 2. Second statement. - For this I couldn't find a workaround. Thank you
Re: Enumerate inside other environment
> > Empty TeX code works, too. Either is a hack to make LyX think the first > line is not empty, since otherwise it will delete it. > > If you do this a lot, you can do something like: > > Format 60 > > Style Theorem* > KeepEmpty 1 > End > > in Local Layout. This tells LyX to allow empty lines in unnumbered > theorems. Then you do not have to do anything special. > > I was asking because I thought I could be missing something but I see that out of the box I can obtain these only with workarounds or new environment, as you suggest. Knowing that, it is fine for me to just insert something to fool lyx when I need it, every now and then. > Moreover, how can I produce the following? > > - > Theorem. >1. First statement. >2. Second statement. > - > > For this I couldn't find a workaround. > > > Put a "protected space" on the first line. (Insert> Formatting> Protected > Space) This makes there by something on that line, but it's invisible. > > Richard > > Many thanks to both of you (you and Paul)
Compilation error with lyx 2.2.2 (and not in 2.2.1)
Hi all, I have a file on which I am currently working. It compiled fine under lyx 2.2.1. Today I upgraded to lyx 2.2.2 and compiling the very same file results in an error which I previously didn't experience. The error is as follows: - Undefined control sequence Let $\sigma\left(f\right)\coloneqq f\left(x_{\sigma\left(1\right)}... The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. -- In other words, the control sequence \coloneqq which was previously known to lyx, is not known any longer. What is happening? TIA
Centering a tabular inside a description
I have a tabular environment inside a description environment (see the attached MWE): I'd like to have it centered but I can't get it. I guess I am missing something simple but what? Thanks test.lyx Description: application/lyx
Re: Centering a tabular inside a description
I knew I was going to make a fool of myself by asking this... :( But sometime one misses the evident. Thank you 2016-11-16 14:15 GMT+01:00 racoon : > On 16.11.2016 13:49, Mario D wrote: > >> I have a tabular environment inside a description environment (see the >> attached MWE): I'd like to have it centered but I can't get it. >> I guess I am missing something simple but what? >> > > Maybe use a box? Dee attachment. > > Daniel > >
Adding qed-like symbol to examples
Hi all, I would like that every example should be closed by a symbol of my choice (say, for example, a black triangle). I tried what is suggested in this answer: http://tex.stackexchange.com/questions/36791/including-end-mark-in-definitions-and-examples-using-amsthm The suggested code works in a plain text file but if I try it in a lyx file I get an error saying that example is already defined, since lyx already defines it (the same error doesn't show for definition since the relative environment in lyx is called "defn"). So the question is: is there a way to use the package thmtools in lyx and avoid such problems? Otherwise, how can I get my goal in lyx? Thank you
Lyx 2.2.3 for Ubuntu 16.04
Hi, maybe I am missing something but in ubuntu 16.04 lyx has not yet been updated: is there any news about if and, in such case, when it will be? Thanks PS: I do have installed lyx PPA: $ cat /etc/apt/sources.list.d/lyx-devel-ubuntu-release-xenial.list deb http://ppa.launchpad.net/lyx-devel/release/ubuntu xenial main
Re: Lyx 2.2.3 for Ubuntu 16.04
It looks like Liv's PPA is no longer update. It is really a pity :( Thank you for the link, anyway. 2017-05-25 19:48 GMT+02:00 Paul A. Rubin : > On 05/25/2017 12:41 PM, Mario D wrote: > >> Hi, >> maybe I am missing something but in ubuntu 16.04 lyx has not yet been >> updated: is there any news about if and, in such case, when it will be? >> >> Thanks >> >> PS: I do have installed lyx PPA: >> >> $ cat /etc/apt/sources.list.d/lyx-devel-ubuntu-release-xenial.list >> deb http://ppa.launchpad.net/lyx-devel/release/ubuntu xenial main >> > I managed to get LyX 2.2.3, but not from Liv's PPA (which is where I > usually obtain it). There's another PPA (deb > http://ppa.launchpad.net/jonathonf/texlive/ubuntu xenial main) that I use > for TeXLive updates, and he has the current version of LyX there. > > That said, I'm hoping that Liv will continue to update his site. > > Paul > >
Background color in a paragraph
Is there a simple way in lyx to change the background color of some text, maybe a paragraph? I have not been able to find a way to do this natively: the only way I could obtain it is by using the "soul" package, then inserting the latex code "\hl{" in ERT just before the the text to be highlighted and then a closing "}" at its end. Thanks
Re: Background color in a paragraph
I tried box with colored background but they don't work properly if the text is more than one line long as in this case the line is not wrapped around. It is possible to get this, but it is not straightforward. Given that I do not use the feature quite often, the hack I proposed is fine for me. Yet, I think it is a feature that would be nice to have natively. 2018-05-04 15:25 GMT+02:00 Bernt Lie : > A couple of years ago, I tried to use Insert/Box/... with colored > background. I wanted to have greyed background for Examples. Didn’t work > well... if I included floating objects (Figures, Tables, etc.), the preview > got messed up. Maybe it works better with floats in ordinary paragraphs – I > haven’t tested that. > > > > But if you have simple paragraphs, that might work. > > > > -B > > > > *From:* lyx-users@lists.lyx.org *On Behalf Of *Mario > D > *Sent:* Friday, May 4, 2018 13:27 > *To:* lyx-users > *Subject:* Background color in a paragraph > > > > Is there a simple way in lyx to change the background color of some text, > maybe a paragraph? > > I have not been able to find a way to do this natively: the only way I > could obtain it is by using the "soul" package, then inserting the latex > code "\hl{" in ERT just before the the text to be highlighted and then a > closing "}" at its end. > > Thanks >
Opening file saved by 2.3 in windows
I am working on a joint project with a colleague. My colleague has windows with Lyx 2.2.3 while I have linux with Lyx 2.3 Now I edited the file but I realized that I used a different Lyx version. You can guess my questions: will he be able to edit the file I am sending to him? If I got it right, he won't so the second question is: how can I share the work I did with him? Thank you. PS: I know I don't need to add anything to a subject which is quite troublesome but I really wish that it will be possible to come soon to a solution of the Windows question: having different versions available on different OSes which produce non-compatible document is a serious flaw to cooperation.
Lyx 2.3.7 on Linux Mint
Hi, I have seen that a new version (2.3.7) has been released. Trying to upgrade to this new version, I tried to install lyx PPA but I get the error "This PPA does not support jammy". My PC runs Linux Mint 21 Vanessa (which is the LTR based on Ubuntu 22.04). How can I upgrade Lyx on my PC? Even if I don't like snaps very much, even a snap would be welcome. Thanks M -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users
Re: Shell-escape enabled but not working
A few months ago I posted about this problem: sadly I got no reply. :( Even more sadly, I have not been to solve the issue! So I am still forced to export my lyx file to a tex file and compile it running "pdflatex -shell-escape" to update pictures, before being able to go on with my work in Lyx. I really don't understand why Lyx doesn't behave like it is intended, since I ticked the right option and this is driving me crazy! Any help is appreciated. Thanks M PS: if needed I can provide a MWE (but I don't know how to provide it: can I attach a file?) Il giorno mer 5 ott 2022 alle ore 20:39 Mario D ha scritto: > Hi, > I have a document which uses the external library of tikz, so I need shell > escape. > > I have lyx 2.3.6 so I enabled shell escape via > > Document->Settings->Formats and check "Allow running of external programs." > > Nevertheless, when I run pdflatex, I get this error: > > - > > ! I can't write on file `myfile_figure0.md5'. > > > > \relax > > l.320 \end{tikzpicture} > > (Press Enter to retry, or Control-D to exit; default file extension is > `.tex') > > Please type another output file name > > ! Emergency stop. > > > > \relax > > l.320 \end{tikzpicture} > > *** (job aborted, file error in nonstop mode) > > --- > > > Am I missing something? > > > BTW, if I export my lyx file to a latex file and I compile it (with > pdflatex --shell-escape), it compiles smoothly. > > > Thank you > -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users
Re: Updated version of lyx on Ubuntu/Mint
I understand. Unlikely I do not have the skills to take care of such a task :( Maybe in the next weeks I can find the time to try to compile, in which case I will give a feed back. Thanks anyway Il giorno ven 17 gen 2025 alle ore 15:00 Scott Kostyshak ha scritto: > > On Fri, Jan 17, 2025 at 02:51:33PM +0100, Mario D wrote: > > Hi there, > > it's a long long time that I have been using lyx (on ubuntu previously and > > on mint now) with great satisfaction, for which I cannot thank enough the > > developers! :)) > > > > For a long (but, helas, shorter) time, I used to keep lyx up to date thank > > to the PPA set up by Liviu Andronic but it has been quite a while that it > > is not mantained. > > > > So my question is: is there the possibility to have sooner or later a new > > PPA for the stable, up to date version of lyx for ubuntu/mint or have I > > better to start learning how to compile and install it myself? > > Hi Mario! > > Unfortunately, there has been no one to volunteer to update the PPA. If > you are by chance interested in learning how to maintain it, please let > us know. > > As for compiling and installing, let us know if you run into any issues. > > Best, > Scott -- lyx-users mailing list lyx-users@lists.lyx.org https://lists.lyx.org/mailman/listinfo/lyx-users
Updated version of lyx on Ubuntu/Mint
Hi there, it's a long long time that I have been using lyx (on ubuntu previously and on mint now) with great satisfaction, for which I cannot thank enough the developers! :)) For a long (but, helas, shorter) time, I used to keep lyx up to date thank to the PPA set up by Liviu Andronic but it has been quite a while that it is not mantained. So my question is: is there the possibility to have sooner or later a new PPA for the stable, up to date version of lyx for ubuntu/mint or have I better to start learning how to compile and install it myself? Many thanks -- lyx-users mailing list lyx-users@lists.lyx.org https://lists.lyx.org/mailman/listinfo/lyx-users