LyX ⇒ Equation formatting
-
- Posts: 3
- Joined: Sat Dec 03, 2016 10:36 pm
Equation formatting
I've been having trouble for a while making the attached equation look normal.
I've read about different align environments but couldn't get any of them to work well (since a bunch need actual code which i'm not familiar with)
The main problems with what I've done is that awkward minus sign and not enough spacing between the lines.
Anyway, i'd be grateful for any help on how to do once and for all.
Thanks!
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Equation formatting
Hard to say with just a screenshot. Could you post the pdfLaTeX export, so we can see source code?
Stefan
-
- Site Moderator
- Posts: 542
- Joined: Sat Sep 01, 2012 6:38 am
Equation formatting
-
- Posts: 3
- Joined: Sat Dec 03, 2016 10:36 pm
Equation formatting
I attached the Lyx file, pdf output and source code.
I also tried to have a single right bracket span two lines which produces an error.
So the pdf is without it and the lyx has what I tried to make that happen.
I don't really know any Latex code either.
Thanks!
- Attachments
-
- equationFormat.tex
- (4.11 KiB) Downloaded 273 times
-
- equationFormat.lyx
- (5.94 KiB) Downloaded 240 times
-
- equationFormat.pdf
- (94.77 KiB) Downloaded 148 times
-
- Site Moderator
- Posts: 542
- Joined: Sat Sep 01, 2012 6:38 am
Equation formatting
-
- Posts: 3
- Joined: Sat Dec 03, 2016 10:36 pm
Equation formatting
I anyway added the tex without preamble, ERT and the other lyx file. The other lyx file had macros I used so that might explain unknown symbols in
the code.
Thanks!
- Attachments
-
- equationFormat.tex
- (3.91 KiB) Downloaded 237 times
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Equation formatting
Your first try was quite good, but you need to cheat a little bit using invisible place holders.
For the second thing (which should be in another thread), you can use
rcases
from package mathtools.
Code: Select all
%% LyX 2.2.2 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}
\usepackage{enumitem}
\usepackage{mathtools}% improves amsmath
\usepackage{showframe}% Shows the available typeblock
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\newlength{\lyxlabelwidth} % auxiliary length
\makeatother
\usepackage{babel}
\begin{document}
\begin{enumerate}
\item This is the ``raw'' equation I need to set up
\begin{align*}
F_{X}\left(s\right)-F_{X}\left(s-1\right) & =\P\left\{ \omega\in\Omega:X\left(\omega\right)\leq s\right\} -\P\left\{ \omega\in\Omega:X\left(\omega\right)\leq s-1\right\} \underset{_{\text{like previsously}}}{=}\P{\left\{ \omega\in\Omega:X\left(\omega\right)=1\right\} \cup\left\{ \omega\in\Omega:X\left(\omega\right)=2\right\} \cup\dots\cup\left\{ \omega\in\Omega:X\left(\omega\right)=s\right\} }-\\
& \P{\left\{ \omega\in\Omega:X\left(\omega\right)=1\right\} \cup\left\{ \omega\in\Omega:X\left(\omega\right)=2\right\} \cup\dots\cup\left\{ \omega\in\Omega:X\left(\omega\right)=s-1\right\} }=\P\left\{ \omega\in\Omega:X\left(\omega\right)=1\right\} +\P\left\{ \omega\in\Omega:X\left(\omega\right)=2\right\} +\dots+\P\left\{ \omega\in\Omega:X\left(\omega\right)=s\right\} -\\
& \P\left\{ \omega\in\Omega:X\left(\omega\right)=1\right\} +\P\left\{ \omega\in\Omega:X\left(\omega\right)=2\right\} +\dots+\P\left\{ \omega\in\Omega:X\left(\omega\right)=s-1\right\} =\P\left\{ \omega\in\Omega:X\left(\omega\right)=s\right\} =f_{X}\left(s\right)
\end{align*}
\begin{align*}
F\left(s\right)-F_{X}\left(s-1\right)
&=\P{\left\{ \omega\in\Omega:X\left(\omega\right)=1\right\} \cup\left\{ \omega\in\Omega:X\left(\omega\right)=2\right\} \cup\dots\cup\left\{ \omega\in\Omega:X\left(\omega\right)=s\right\} }-\\
&\phantom{=~}-(\P{\left\{ \omega\in\Omega:X\left(\omega\right)=1\right\} \cup\left\{ \omega\in\Omega:X\left(\omega\right)=2\right\} \cup\dots\cup\left\{ \omega\in\Omega:X\left(\omega\right)=s-1\right\} })=\} \\
&=\P\left\{ \omega\in\Omega:X\left(\omega\right)=1\right\} +\P\left\{ \omega\in\Omega:X\left(\omega\right)=2\right\} +\dots+\P\left\{ \omega\in\Omega:X\left(\omega\right)=s\right\} - \\
&\phantom{=~}-(\P\left\{ \omega\in\Omega:X\left(\omega\right)=1\right\} +\P\left\{ \omega\in\Omega:X\left(\omega\right)=2\right\} +\dots+\P\left\{ \omega\in\Omega:X\left(\omega\right)=s-1\right\} )= \\
&=\P\left\{ \omega\in\Omega:X\left(\omega\right)=s\right\} =f_{X}\left(s\right)
\end{align*}
\item Here I'm trying to make a curly bracket span two lines with no success.
The attached pdf is without this since it doesn't compiles
\[
\begin{rcases} \frac{3}{234} & \text{if } x=0\\
\mathit{something} & \text{if some other thing}
\end{rcases}
\]
\end{enumerate}
\end{document}
-
- Site Moderator
- Posts: 542
- Joined: Sat Sep 01, 2012 6:38 am