The mysterious LyX program. Part 1

Copied from my blog in order to create another Russian-language source of information on this topic.







What will I talk about?



This series of articles will be written by a person who is not very computer savvy for the same people. I am fond of mathematics and in order to facilitate this lesson, there, for a decent record of my decisions, evidence, to facilitate calculations, etc. I had to study several special programs. At first I used Word to write down my opus in math. At the same time, I clearly felt the inappropriateness of this program for these purposes. For this reason, I began to look for alternative ways to resolve this issue. So I came across  TeX . At first, I did not think to spend any significant time studying it, considering it according to its capabilities somewhere near the Mathtype add-in in Word. However, looking at  TeX 'more closely, I came to the conclusion that, although, of course, many would not agree with this, but nothing is better  TeX 'a for writing text with a mathematical, in general, with a scientific bias, no. Yes, partly then I was prompted by the absence in Office of the ability to include formulas typed on  TeX (I know that in Office 16 there was such an opportunity, I don’t know about earlier versions, but in Office 2003 there is no such possibility). Despite the fact that at that time I did not know what TeX was, if such an opportunity existed then, I would know about it and, who knows, maybe I would not discover the magical world  TeX 'but.







But even after including support in Office  TeX And, Office can not even be seen as a competitor  TeX 'but. Word, on the other hand, has one advantage over  TeX - the ability to instantly edit the text, in particular, formulas (again with repeated use of the mouse - again minus), but this advantage turns into nothing against the background of countless macros  TeX 'but. However, this is my personal opinion. Personally, I use, albeit already obsolete, but fully functional implementation  TeX 'a - MiKTEX 2.9. True, I have not updated it, nor the repository since 2015, but have not yet found any really unsolvable problem when using the MiKTEX 2.9 + repository, downloaded then. At least for now, I will not write about setting up the MiKTEX program, sending readers of these notes to read about this matter on an Internet-aware site. I, because I do not know computer lotions, terms, I will explain on the fingers, if necessary, inserting graphics. So, for user interaction with this very  TeX There are a huge number of programs: TeXworks, TeXmaker, etc., delivered in MiKTEX’s bundle, and so on. And among these programs is LyX. However, for some reason, Russian-speaking users  TeX 'a they consider this program second-rate, limiting the possibilities that open to the user, compared with the possibilities that open when using the "real LaTeX editor." And therefore, there is no information on this program in RuNet. But in vain. I reacted to this point of view with great distrust and spent a decent amount of time studying this program. What, in my inexperienced opinion, is this program better than other shells for  TeX ? Firstly, with proper configuration, you do not need to switch the keyboard to English to enter formulas and back to enter text. Yes, for English users  TeX 'a this problem does not exist, but for other users it is quite noticeable. Further, the user does not need to bother with closing the parentheses that were open before. At first glance, there seems to be some limitation in the set of formulas (incorrect interpretation of the symbols & and \ entered in the mathematical mode, the inability to insert, for example, rrr @ {\,} r | r into the array preamble), however, the use of the Command Buffer and Preview functions solves these problems. Further, if a person has problems writing with a pen on paper, then this program is simply irreplaceable for him, even when studying a school course in algebra, geometry, not to mention studying a university course in exact, natural sciences, of course, if this person has the necessary equipment to use this program, but this is a topic for another not very fun conversation. So, well, what other criteria are there to compare? Adding new layout tools, say, as in  TeX works? Yes it is possible. I just finished tinkering with studying how to add tools to get all the LyX files that arise during the processing of a file directly in the same folder with the file being processed (it is intended that they appear in a special folder specified in Tools> Settings> Paths The temporary directory was busy for the sake of interest) and for processing LyX files in which asymptote graphics codes are also in the same folder as the file being processed (and this is already a pretty useful tool).







The last one in TeXworks I couldn’t do at all (I have some experience writing and using .bat files, so I don’t know how to transfer the batch file assigned to me as the engine that I created in TeXworks to the Makeup Tool the name of that currently open in TeXworks .tex file, which I want to process with this very tool). I will tell about all this in due time. I want to say that I was not able to find anything that I could do in, I repeat, "this editor  LaTeX "and couldn’t do it in LyX. However, maybe this is a question of the scarcity of my imagination, I don’t know, but I will start writing here about the finds I made during this study. And then we'll see what else to write about. So, without spending extra time, let's start.







LyX: Spell Checker Settings



In general, looking at my humble experience, I got the impression that when you start using the computer more widely than watching movies on it or using Word, using even a small amount of programming, it is usually convenient that the file extensions are displayed after file name. How to do this is described, for example, here . I will not 1001 times describe what hundreds of links are devoted to on the Internet. So, back to the stated topic of the story. The LyX program uses .aff and .dic files for spell checking. To be honest, the other day I tried to make these files manually, as for the first time, namely: I copied the first files that came to my eyes with the extension .aff and .dic in the C:\Program Files\LyX 2.0\Resources\dicts



folder, inserted them into the same folder, opened them, deleted all the lines in them, renamed these files to ru_Ru. Here I clicked on ru_Ru.aff, highlighted the lines there







 1 SET KOI8-R ....................... 1632 SFX A 0 Á ÉÎ
      
      





And I began to select, being with the mouse not on the line with number 1, but, being on the same line as the mouse







 blame
      
      





to the right of this word. (the ellipsis here indicates missed lines), copied, pasted into the Word window, highlighted again (the selection looked like this:







image







, moreover, it was necessary to start the selection, being in the same column with SET KOI8-R, to the left of this set of letters, and to finish the selection, it was necessary to be in the same column as SFX A 0 Á ÉÎ, to the right of this set of letters), again copied (I used Word to remove line numbers) and only then inserted into the empty ru_Ru.aff file I had previously made and closed it with preservation. In the same way, I made the ru_Ru.dic file (I took the code from here ). but for some reason nothing happened. Therefore, I will post the necessary files that I made in the 15th year as described above, the first time I mentioned, from my computer. Here they are . So, download this archive, unpack it, put the ru_Ru.aff and ru_Ru.dic files located there in the folder mentioned above. In Document> Settings> Language , where the word Language: is located , click on the triangle, select Russian with the left mouse button. (as a rule, leave the value of the Encoding switch. By default, for the language:







image







, but sometimes it still turns out to be useful to choose the encoding manually. To do this, switch the Encoding switch from Default for the language to Other (just left-click in the circle next to this word) and select the Cyrillic encoding (CP 1251) , or Unicode (utf8) , or which other (after all, do not forget to click the Save or Apply button if we do not want the Settings dialog box to close)). That's it, LyX is ready for spell checking. Further, there are 2 options for using this whole charm. Or Tools> Spell Checker, and the "Spell Checker" dialog box pops up with the question: "We reached the end of ...", in which you need to click Yes , otherwise the Spell Checker closes. At the same time, the cursor jumps to the end of the first word with an error, this word is highlighted in blue, an area with buttons "Spelling Check" appears in the main LyX window, further verification is carried out manually, using the buttons of this area. Well, I do not really like this method. Or in Tools> Settings> Language settings> Spellcheck, check the boxes next to Spellcheck continously and Spellcheck notes and comments , click Save or Apply . Honestly, the check begins after checking the box opposite Spellcheck continously . In the drop-down list of the Spellchecker engine, Hunspell should be selected. Well, Hunspell is on this list initially, after installation. We don’t touch anything else. When using this method of settings, words with errors begin to be underlined immediately after inserting a space after them, without turning on Tools> Spellcheck .







Only here is such a moment. At initial settings, this underline is barely noticeable:







image







To change this, in Tools> Settings> Screen Fonts, in the Scale counter, put a number larger than there, click OK . If you want the visible size of the LyX entered in the window to not change, you can proportionally change the size of all fonts. With my settings:







image







The error underline looks like this:







image







IMHO, it looks quite real. Probably written messy, excuse me for this, but then, I hope, intelligibly.







LyX: Thesaurus



Well, everything is simple here. Thesaurus provides synonyms for the highlighted word. Its configuration in LyX is as follows. Download the archive from here , copy its contents to the folder C:\Program Files\LyX 2.0\Resources\thes



. If LyX is open, restart it. That's all, in the LyX window we select the word (this is done this way: the cursor is brought to the beginning (end) of the word of interest, the left mouse button is pressed, and, without releasing the button, we move the mouse to the end (beginning) of the word, after the last (first) the letter of the word is highlighted, release the left mouse button, or you can do it like this: the cursor moves to the beginning (end) of the word of interest and 2 Ctrl and Shift keys are pressed and held immediately, and then the left arrow (right arrow)), click Tools> Thesaurus or after highlighting the word of interest, click and refrain Shift, and then F7. A window appears, in the lower part of which and at the same time a little higher than the Cancel button, there are synonyms for the highlighted word, associated terms with the highlighted word:







image







(the picture was taken after left-clicking on the word reputation ). If in this situation I click the Replace button, the word Popularity in the LyX window will be replaced by the word reputation . After finishing work with the thesaurus, close the "Lyx: Thesaurus" dialog box or click the Cancel button in this dialog box. If we use the Cancel button, our previous replacement of the word selected in the LyX window with the Thesaurus DOES NOT CANCEL! So, well, sort of, that's all I wanted to report on this.







LyX: Keyboard Shortcuts



That's when you write a text with theorems, lemmas, their proofs, enumerations, etc. in LyX, you need to switch the environment using this switch:







image







also to execute, for example, some command located on some toolbar, even if activated, accessible in the main program window (to activate any toolbar, go to View> Toolbars . put a halo in front of the you need a toolbar), you have to use the mouse. When you write something that interests you or something complicated, distracting with such a mouse switch is not always desirable. It would be better if all this could be done with clave. And the creators of LyX provided the opportunity for each LyX user to resolve this issue on their own. Consider, for example, how to define a keyboard shortcut to insert an environment. Theorem . Click on the triangle from the above photo. In the drop-down list, left-click on the item Theorem . In this case, the status bar, at the bottom of the window, where the Font is usually written : By default , for a short time it will take the following form:







image







And here the phrase layout Theorem is what we need. Next, go to Tools> Settings> Editing> Hotkeys . There we click the New button. The following dialog box appears:







image







In the Function text box, enter the previously known phrase layout theorem . We left-click in the rectangle located to the right of the inscription Hotkey and enter the combination of keys we have invented for this command. I, for example, since most keyboard shortcuts starting with Ctrl are already taken, so as not to bother with which keyboard shortcuts with the same beginning exist, which ones do not, I start my keyboard shortcuts with Ctrl + 0 from the numeric keypad, and then a set of letters, individual for each team. In order not to get confused, I assign this individual set, based on the record of the Russian name of the environment to which I create the keyboard shortcut, in Latin letters. For example, the keyboard shortcut Ctrl + 0 + t + e is assigned to the Theorem environment, the combination Ctrl + 0 + d + o is assigned to the Proof environment (pluses in the rectangle located to the right of the inscription Hotkey is not necessary to enter, just as it is not necessary press them when using the keyboard shortcuts created in this way). That's all, I click the Save or Apply buttons (after clicking the OK button with the photo). I will also assign a keyboard shortcut to a command, for example, Insert> Note> Comment . I left-click this command, the status bar at the same time takes the following form: ( note-insert Comment ). All other actions are similar to the actions described above.







Mustache, for the first time, I think that's enough. As they say in Russian that bi continued.







About latin

"Oh, and where does this Latin rush come from? ...")))








All Articles