LyXmove symbol to the left

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

move symbol to the left

Post by schroedingers_lion »

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 11520 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
mas
Posts: 226
Joined: Thu Dec 04, 2008 4:39 am

move symbol to the left

Post by mas »

This is not a direct answer about the LyX issue.

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

Code: Select all

\documentclass{article}
%
\usepackage{mathtools} 
\usepackage[arrowdel]{physics} 

\begin{document}

\[ \pqty{\pdv{g}{t}}_{\!\!\text{scatter}} \!\!\! \dd{t}  \]

\end{document}
x.png
x.png (2.71 KiB) Viewed 11512 times

OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim
schroedingers_lion
Posts: 8
Joined: Sun May 19, 2019 5:31 pm

move symbol to the left

Post by schroedingers_lion »

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: 4182
Joined: Thu Nov 01, 2012 4:08 pm

move symbol to the left

Post by Johannes_B »

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

move symbol to the left

Post by schroedingers_lion »

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 11498 times
mas
Posts: 226
Joined: Thu Dec 04, 2008 4:39 am

move symbol to the left

Post by mas »

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

move symbol to the left

Post by schroedingers_lion »

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

Code: Select all

\[ 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 11467 times
schroedingers_lion
Posts: 8
Joined: Sun May 19, 2019 5:31 pm

move symbol to the left

Post by schroedingers_lion »

I just realized I COULD have used \! in the Lyx math mode directly. Man, I'm stupid...
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

move symbol to the left

Post by Stefan Kottwitz »

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
LaTeX.org admin
Grek79
Posts: 7
Joined: Thu Jun 13, 2019 9:35 pm

move symbol to the left

Post by Grek79 »

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 11329 times
Post Reply