Greetings,
I am writing a formular in Lyx' display math mode (png attached). I would like to have the 'dt' closer to the bracket, above the 'scatter'. Is there a way to do this? I suppose one can directly use Latex code for this. Can I enter Latex code inside of Lyx' math mode or how would I do this?
Best,
SL
LaTeX forum ⇒ LyX ⇒ move symbol to the left Topic is solved

 Posts: 8
 Joined: Sun May 19, 2019 5:31 pm
move symbol to the left
 Attachments

 cap1.PNG (7.27 KiB) Viewed 1907 times
This is not a direct answer about the LyX issue.
Have you tried using negative space before 'dt' to push it closer?
Have you tried using negative space before 'dt' to push it closer?
\documentclass{article} % \usepackage{mathtools} \usepackage[arrowdel]{physics} \begin{document} \[ \pqty{\pdv{g}{t}}_{\!\!\text{scatter}} \!\!\! \dd{t} \] \end{document}
OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim

 Posts: 8
 Joined: Sun May 19, 2019 5:31 pm
Thanks for the response!
No, I have not tried anything like this, beacause a) I am pretty new to Latex, which is why I started with Lyx, and b) I need to know how to enter Latex code there. I don't know where to write these /usepackage or if I even have to write it down somewhere (Lyx includes this automatically, if I select them, right?)
edit: So I found the field where one could alter the preamble, and I included your two "usepackages".
But If enter your code (in or outside of the math environment), I can't compile and get an error:
"...\backslash!\backslash dd\{t\}\backslash]}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)"
No, I have not tried anything like this, beacause a) I am pretty new to Latex, which is why I started with Lyx, and b) I need to know how to enter Latex code there. I don't know where to write these /usepackage or if I even have to write it down somewhere (Lyx includes this automatically, if I select them, right?)
edit: So I found the field where one could alter the preamble, and I included your two "usepackages".
But If enter your code (in or outside of the math environment), I can't compile and get an error:
"...\backslash!\backslash dd\{t\}\backslash]}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)"
 Johannes_B
 Site Moderator
 Posts: 4163
 Joined: Thu Nov 01, 2012 4:08 pm
The thing with LyX is, you need to learn LyX after you learned LaTeX.
You are now trying to use one tool without knowing it, needing to know the basics of another which you don't know as well.
I guess you are using LaTeX directly inside LyX, and LyX translates the backslashes ... but i don't know how to use LyX. I cannot really help here.
You are now trying to use one tool without knowing it, needing to know the basics of another which you don't know as well.
I guess you are using LaTeX directly inside LyX, and LyX translates the backslashes ... but i don't know how to use LyX. I cannot really help here.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

 Posts: 8
 Joined: Sun May 19, 2019 5:31 pm
Yeah, I now know that it would have been better to do it the other way around, but I was pushed to learn Lyx "as it is way easier". I will have to brush up on basic Latex as soon as I have the time (after my thesis, ha).
HOWEVER: It seems to work now. Lyx compiles the code given by mas, I found the preamble section.
It does not work inside the math environment though, so I have to write the entire equation myself. Can you help me with this? The equation is attached and should be centralized in my document.
I can understand mas' code except for two parts:
What do the \[ \] do? And what about the \pqty ? How do I write the fat symbols for my vectors?
HOWEVER: It seems to work now. Lyx compiles the code given by mas, I found the preamble section.
It does not work inside the math environment though, so I have to write the entire equation myself. Can you help me with this? The equation is attached and should be centralized in my document.
I can understand mas' code except for two parts:
What do the \[ \] do? And what about the \pqty ? How do I write the fat symbols for my vectors?
 Attachments

 cap2.PNG (20.34 KiB) Viewed 1885 times
schroedingers_lion wrote:What do the \[ \] do? And what about the \pqty ? How do I write the fat symbols for my vectors?
The `\[' and '\]' is the shorthand for the environment [env]equation*[/env]. The
\pqty
is for typesetting quantities within parentheses. As pointed out to you by Johannes, you should *really* read up basic LaTeX stuff before attempting to use LyX. The solutions suggested might not make sense at all.
OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim

 Posts: 8
 Joined: Sun May 19, 2019 5:31 pm
Alright, I managed to write my equation (attached):
Thanks thus far!
Now, how can I number the equation? Do I have to fix the number manually or will Lyx consider this new equation in its automatic numbering system?
Also, how can I label it? Do I have to write \label{NAME} inside the equation environment?
\[ g_n \left(\bm r, \bm{k}, t \right)=g_n \left( \bm r\bm{v}_n\left(\bm k \right)dt, \bm k\bm F \frac {dt}{\hbar}, tdt \right)+\left( \pdv{g}{t}\right)_{scatter}\!\!\!\!\!\!\!\!dt \]
Thanks thus far!
Now, how can I number the equation? Do I have to fix the number manually or will Lyx consider this new equation in its automatic numbering system?
Also, how can I label it? Do I have to write \label{NAME} inside the equation environment?
 Attachments

 cap2.PNG (10.77 KiB) Viewed 1854 times

 Posts: 8
 Joined: Sun May 19, 2019 5:31 pm
I just realized I COULD have used \! in the Lyx math mode directly. Man, I'm stupid...
 Stefan Kottwitz
 Site Admin
 Posts: 9569
 Joined: Mon Mar 10, 2008 9:44 pm
Hello SL!
Perhaps take a close look at the code by mas. A very common way is to write math operators upright, while variables are in italic. That helps to distinguish a product of 2 variables ln from the operator ln(x) and the operator d from the variable d. Also, text remarks or indices are written upright. Perhaps compare with a good book if you like, just to be sure.
Stefan
Perhaps take a close look at the code by mas. A very common way is to write math operators upright, while variables are in italic. That helps to distinguish a product of 2 variables ln from the operator ln(x) and the operator d from the variable d. Also, text remarks or indices are written upright. Perhaps compare with a good book if you like, just to be sure.
Stefan
LaTeX.org admin
You can generally get this: photo. Before you can write the formula below, I clicked Insert > Preview and pasted the code TeX (Ctrl + l) and there already wrote the code formula. Above shows that this is. I got it.
 Attachments

 Сдвиг.JPG (50.81 KiB) Viewed 1716 times
Who is online
Users browsing this forum: No registered users and 2 guests