GeneralMath formatting help

LaTeX specific issues not fitting into one of the other forums of this category.
ouroborus
Posts: 2
Joined: Fri Nov 21, 2008 6:38 pm

Math formatting help

Post by ouroborus »

Any idea how I can format this:

Code: Select all

\[N_{n,k}\triangleq
\left\{{\left.{\left[X_0,X_1,\cdots,X_{k-2},S+\sum_{i=0}^{k-2}X_i\right]}\right|}
{[b_0, b_1, \cdots, b_{k-1}]
\in N_k^{\prime 0}\cup N_k^{\prime 1},X_i\in X_n^{b_i},
0\leq i<k-1,S\in N_n^p,p=\sum_{i=0}^{k-1}b_i}\right\}.\]
so that it'll look something like this:

Image

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

ouroborus
Posts: 2
Joined: Fri Nov 21, 2008 6:38 pm

Math formatting help

Post by ouroborus »

Nm, I think I got it:

Code: Select all

\begin{align*}N_{n,k}\triangleq \left\{\vphantom{\sum_0^0}\right. & 
\left.{\left[X_0,X_1,\cdots,X_{k-2},S+\sum_{i=0}^{k-2}X_i\right]}\right|\\
& [b_0, b_1, \cdots, b_{k-1}]
\in N_k^{\prime 0}\cup N_k^{\prime 1},X_i\in X_n^{b_i},\\
& 0\leq i<k-1,S\in N_n^p,\left.p=\sum_{i=0}^{k-1}b_i\right\}.\end{align*}
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Math formatting help

Post by Juanjo »

A slightly different approach:

Code: Select all

\begin{align*}
   N_{n,k}\triangleq
   \Biggl\{ &\bigg[ X_0,X_1,\ldots,X_{k-2},S+\sum_{i=0}^{k-2}X_i\biggr]
   \Biggm| \Biggr. \\
   &\,[b_0, b_1,\ldots, b_{k-1}]\in N_k^{\prime 0}\cup N_k^{\prime 1},
   \ X_i\in X_n^{b_i}, \\
   \Biggl. &\, 0\leq i<k-1,\ S\in N_n^p,\ p=\sum_{i=0}^{k-1}b_i \Biggr\}.
\end{align*}
Please note that centered dots (\cdots) should mark ellipsis between binary relations or operators, not in enumerations. I've also added some spaces and removed some superfluous braces.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
daleif
Posts: 199
Joined: Wed Nov 19, 2008 12:46 am

Re: Math formatting help

Post by daleif »

you can safely remove those \Biggr. anf Biggl. as well, it is only \left and \right that comes in pairs, the rest works fine on their own.
hzmonte
Posts: 17
Joined: Sun Nov 16, 2008 8:05 am

how to display double quote inside \mathtt{}?

Post by hzmonte »

How can I get the double quotes displayed in $\mathtt{``whatever''}$ ? This generates an error.
And how to make 2 consecutive plus signs ++ smaller and closer to each other, inside \mathtt{}? I know \! means negative space = -3/18 of a quad but it does not work inside \mathtt{}.
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Math formatting help

Post by Juanjo »

Code: Select all

$0\times\texttt{``whatever C{\small ++}''}=0$
Do you really need to write those weird things in math mode? Sure?
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
hzmonte
Posts: 17
Joined: Sun Nov 16, 2008 8:05 am

Math formatting help

Post by hzmonte »

Thanks. Yes. I use it to format computer code written in the C language, e.g.

Code: Select all

i = j++;
printf("%d\n", i);
++ is an increment operator and two consecutive plus signs in normal size look ugly.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Math formatting help

Post by gmedina »

Hi,

if you want to typeset programming code, the listings package could be useful.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
gozzi84
Posts: 15
Joined: Tue Nov 25, 2008 3:25 pm

Re: Math formatting help

Post by gozzi84 »

How can I change the fonts for a math equation? I mean in a single frame I want to insert a math equation with the same font of the entire beamer document and another with a smaller font.

I tried with this but it doesn't work.

\[
\mathnormal{QA}_{j}(s,t_{j})=\frac{P_d (s,t_j)}{P_f (s,t_{j})}\rho_{j}(s,t_{j})} % standard font
\]

\[
\tiny{\widehat{S}_{f}(s,t_{j-1})=\frac{S_f (s)}{P_f (s,t_{j-1})}} %smaller font
\]

Thank you for your help
daleif
Posts: 199
Joined: Wed Nov 19, 2008 12:46 am

Re: Math formatting help

Post by daleif »

might be a better idea to open a new thread instead of highjacking a thread
Post Reply