LyX ⇒ Where/How to enter latex code into lyx
-
- Posts: 128
- Joined: Wed Jul 04, 2012 5:34 pm
Where/How to enter latex code into lyx
Where/how does one enter latex code to modify the lyx document they are working on?
As a beginner, I suspect there are at least a couple different places to enter code, probably depending on whether you want to change something just once, or if you want that something to always be changed.???
Some examples:
1) You want to change only one paragraph so that the first line is indented.
2) You want every paragraph to be indented throughout the whole document.
If this question has already been answered, please post some links.
Thanks
As a beginner, I suspect there are at least a couple different places to enter code, probably depending on whether you want to change something just once, or if you want that something to always be changed.???
Some examples:
1) You want to change only one paragraph so that the first line is indented.
2) You want every paragraph to be indented throughout the whole document.
If this question has already been answered, please post some links.
Thanks
Last edited by insipidtoast on Fri Jul 06, 2012 5:20 pm, edited 1 time in total.
FYI:
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Where/How to enter latex code into lyx
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 128
- Joined: Wed Jul 04, 2012 5:34 pm
Where/How to enter latex code into lyx
Where does the lyx wiki say?
FYI:
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
- Stefan Kottwitz
- Site Admin
- Posts: 10347
- Joined: Mon Mar 10, 2008 9:44 pm
Where/How to enter latex code into lyx
The best way is using LaTeX in the document preamble, making global definitions. In the menu, choose Documents, then Settings, there you can find the document preamble. There you can insert
If you repeat LaTeX commands within the text, there's a good chance that you could do the same by a global setting, in the preamble.
In case you would like to use LaTeX just locally and once, you could insert TeX code in the document: click the TeX toolbar button, or select Insert and TeX. This is also known as ERT.
Stefan
\usepackage
commands for loading packages with settings and making further definitions.If you repeat LaTeX commands within the text, there's a good chance that you could do the same by a global setting, in the preamble.
In case you would like to use LaTeX just locally and once, you could insert TeX code in the document: click the TeX toolbar button, or select Insert and TeX. This is also known as ERT.
Stefan
LaTeX.org admin
-
- Posts: 128
- Joined: Wed Jul 04, 2012 5:34 pm
Where/How to enter latex code into lyx
In my version of Lyx what you are calling "document preamble" is called "LaTeX Preamble."
Thanks
I'm currently reading the Not So Short Introduction to Latex2e. Please let me know if you think there's a better tutorial that's more geared towards my desire of customizing a few thing here and there within lyx, and making a couple "global definitions."
So that's the area to make changes that apply to the whole lyx document?Stefan_K wrote:The best way is using LaTeX in the document preamble, making global definitions. In the menu, choose Documents, then Settings, there you can find the document preamble. There you can insert\usepackage
commands for loading packages with settings and making further definitions.
And that's how you make a one-time-only change?Stefan_K wrote:In case you would like to use LaTeX just locally and once, you could insert TeX code in the document: click the TeX toolbar button, or select Insert and TeX. This is also known as ERT.
Thanks
I'm currently reading the Not So Short Introduction to Latex2e. Please let me know if you think there's a better tutorial that's more geared towards my desire of customizing a few thing here and there within lyx, and making a couple "global definitions."
FYI:
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
- Stefan Kottwitz
- Site Admin
- Posts: 10347
- Joined: Mon Mar 10, 2008 9:44 pm
Where/How to enter latex code into lyx
I don't have LyX installed on the computer where I'm currently working. So take the advice as a guide, not as "click exactly there".insipidtoast wrote:In my version of Lyx what you are calling "document preamble" is called "LaTeX Preamble."
Yes.insipidtoast wrote:So that's the area to make changes that apply to the whole lyx document?
Regaredig ERT within the document:
Yes. But a change, such as a "declaration", has effect from the place where it has been made onwards, until the current scope has ended. Scopes can be limited by curly braces, and also LaTeX environments are limiting a scope. For example:insipidtoast wrote:And that's how you make a one-time-only change?
- If you place a command within a table, it ends when the table ends.
- If you would like to have an effect in a small specific region, you could use braces, such as
{\bfseries bold text here} normal text continues
- A simply inserted command can have effect until the document ended - if you don't insert a command which cancels it. (such as
\normalfont
after font changes).
Stefan
LaTeX.org admin
-
- Posts: 128
- Joined: Wed Jul 04, 2012 5:34 pm
Where/How to enter latex code into lyx
l2short document?Stefan_K wrote:For knowing such things it's good to read the l2short document.
Where is that? I didn't see it in your resources for beginners post.
FYI:
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
- Stefan Kottwitz
- Site Admin
- Posts: 10347
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Where/How to enter latex code into lyx
lshort is the correct name, it's a common shortcut for the document which you already mentioned, The Not So Short Introduction to Latex2e, and its filename.
Stefan
Stefan
LaTeX.org admin
-
- Posts: 128
- Joined: Wed Jul 04, 2012 5:34 pm
Re: Where/How to enter latex code into lyx
Great!
Thank you sir.
Thank you sir.
FYI:
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class