LaTeX forum ⇒ LyXmove symbol to the left Topic is solved

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
schroedingers_lion
Posts: 8
Joined: Sun May 19, 2019 5:31 pm

move symbol to the left

Postby schroedingers_lion » Tue May 21, 2019 11:02 pm

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
Attachments
cap1.PNG
cap1.PNG (7.27 KiB) Viewed 509 times

mas
Posts: 219
Joined: Thu Dec 04, 2008 4:39 am

Postby mas » Wed May 22, 2019 3:51 am

This is not a direct answer about the LyX issue.

Have you tried using negative space before 'dt' to push it closer?

  1. \documentclass{article}
  2. %
  3. \usepackage{mathtools}
  4. \usepackage[arrowdel]{physics}
  5.  
  6. \begin{document}
  7.  
  8. \[ \pqty{\pdv{g}{t}}_{\!\!\text{scatter}} \!\!\! \dd{t} \]
  9.  
  10. \end{document}


x.png
x.png (2.71 KiB) Viewed 501 times

OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim

schroedingers_lion
Posts: 8
Joined: Sun May 19, 2019 5:31 pm

Postby schroedingers_lion » Wed May 22, 2019 11:25 am

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.)"

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Wed May 22, 2019 11:46 am

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.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

schroedingers_lion
Posts: 8
Joined: Sun May 19, 2019 5:31 pm

Postby schroedingers_lion » Wed May 22, 2019 12:00 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?
Attachments
cap2.PNG
cap2.PNG (20.34 KiB) Viewed 487 times

mas
Posts: 219
Joined: Thu Dec 04, 2008 4:39 am

Postby mas » Wed May 22, 2019 3:21 pm

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

schroedingers_lion
Posts: 8
Joined: Sun May 19, 2019 5:31 pm

Postby schroedingers_lion » Wed May 22, 2019 11:59 pm

Alright, I managed to write my equation (attached):

  1. \[ 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}, t-dt \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
cap2.PNG (10.77 KiB) Viewed 456 times

schroedingers_lion
Posts: 8
Joined: Sun May 19, 2019 5:31 pm

Postby schroedingers_lion » Thu May 23, 2019 12:13 am

I just realized I COULD have used \! in the Lyx math mode directly. Man, I'm stupid...

User avatar
Stefan Kottwitz
Site Admin
Posts: 9419
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Thu May 23, 2019 3:26 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
Site admin

Grek79
Posts: 5
Joined: Thu Jun 13, 2019 9:35 pm

Postby Grek79 » Fri Jun 14, 2019 10:50 pm

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
Сдвиг.JPG (50.81 KiB) Viewed 318 times


Return to “LyX”

Who is online

Users browsing this forum: No registered users and 2 guests