Math & ScienceMath Font Size

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
woltan
Posts: 19
Joined: Mon Mar 09, 2009 2:08 pm

Math Font Size

Post by woltan »

Heyas,
I have a matrix I would like to display in an multline environment. However that matrix is so huge, that the even the first "line" in the multline environment is too big to fit on my page. If I put a \footnotesize in front of the multline the matrix fits perfectly, however now my equation number is in footnotesize.
Is there a way of changing the font size inside the math environment without having that effect on the equation number?
The only way I found so far is to but a \scriptstyle in front of every elemtent of my matrix, which makes the source even uglyer than it already is!
Thx for any hint, link or solution ;)

Cherio Woltan

Recommended reading 2024:

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

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

fatra2
Posts: 126
Joined: Fri May 01, 2009 1:43 pm

Math Font Size

Post by fatra2 »

Hi there,

You have a partial solution to your problem. To change the display size in math mode, you will need to use the \...style, like \scriptstyle.

To ensure that the whole math environment is in the same style, you need to put brackets around it, like this:

Code: Select all

\begin{eqnarray}
{\scriptstyle your matris goes here.}
\end{eqnarray}
You can also use \scriptscriptstyle to make it even smaller.

Cheers
woltan
Posts: 19
Joined: Mon Mar 09, 2009 2:08 pm

Math Font Size

Post by woltan »

Hey fatra,
thx for your posting. However I didn't get it working with your approach. I think this is because of the array envirnment inside my multline math envirnment.

Code: Select all

\begin{multline}
{\scriptstyle\M{\Psi} = \left(\begin{array}{cccccccc}
f_{11}(u_1(1)) & f_{12}(u_2(1)) & \hdots & f_{1p}(u_p(1)) & f_{21}(u_1(1)) & f_{22}(u_2(1)) & \hdots & f_{2p}(u_p(1))\\
f_{11}(u_1(2)) & f_{12}(u_2(2)) & \hdots & f_{1p}(u_p(2)) & f_{21}(u_1(2)) & f_{22}(u_2(2)) & \hdots & f_{2p}(u_p(2))\\
\vdots & \vdots & \ddots & \vdots & \vdots & \vdots & \ddots & \vdots\\
f_{11}(u_1(N)) & f_{12}(u_2(N)) & \hdots & f_{1p}(u_p(N)) & f_{21}(u_1(N)) & f_{22}(u_2(N)) & \hdots & f_{2p}(u_p(N))
\end{array}\right.}\\
{\scriptstyle\left.\begin{array}{ccccc}
\hdots & f_{N_j1}(u_1(1)) & f_{N_j2}(u_2(1)) & \hdots & f_{N_jp}(u_p(1))\\
\hdots & f_{N_j1}(u_1(2)) & f_{N_j2}(u_2(2)) & \hdots & f_{N_jp}(u_p(2))\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
\hdots & f_{N_j1}(u_1(N)) & f_{N_j2}(u_2(N)) & \hdots & f_{N_jp}(u_p(N))
\end{array}\right)}
\end{multline}
the \M is a making bold command.
What did I do wrong?

Cherio Woltan
fatra2
Posts: 126
Joined: Fri May 01, 2009 1:43 pm

Re: Math Font Size

Post by fatra2 »

Some stupid question, but have you tried leaving a space between the \scriptstyle command and the \M???
woltan
Posts: 19
Joined: Mon Mar 09, 2009 2:08 pm

Re: Math Font Size

Post by woltan »

Yes I did, the result is that only my first greek letter is getting scriptstyled, and the rest is not, which might be due to the array commencing afterwards.

There is also an issue due to the multline envirnment, since the braces { } that encapsolates the scriptstyle would have to be carried over the linebreak \\ which the compiler does not like.

So still having a ton of scriptstyles in my equation^^
cherio Woltan
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Math Font Size

Post by localghost »

Load the array package additionally and try the following.

Code: Select all

\documentclass[english]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage{amsmath}
\usepackage{array}

\begin{document}
  \begin{multline}
    \scriptstyle
    \boldsymbol{\Psi}=
    \left(
    \begin{array}{*{8}{>{\scriptstyle}c}}
      f_{11}(u_1(1)) & f_{12}(u_2(1)) & \hdots & f_{1p}(u_p(1)) & f_{21}(u_1(1)) & f_{22}(u_2(1)) & \hdots & f_{2p}(u_p(1))\\
      f_{11}(u_1(2)) & f_{12}(u_2(2)) & \hdots & f_{1p}(u_p(2)) & f_{21}(u_1(2)) & f_{22}(u_2(2)) & \hdots & f_{2p}(u_p(2))\\
      \vdots & \vdots & \ddots & \vdots & \vdots & \vdots & \ddots & \vdots\\
      f_{11}(u_1(N)) & f_{12}(u_2(N)) & \hdots & f_{1p}(u_p(N)) & f_{21}(u_1(N)) & f_{22}(u_2(N)) & \hdots & f_{2p}(u_p(N))
    \end{array}
    \right.\\
    \left.
    \begin{array}{*{5}{>{\scriptstyle}c}}
      \hdots & f_{N_j1}(u_1(1)) & f_{N_j2}(u_2(1)) & \hdots & f_{N_jp}(u_p(1))\\
      \hdots & f_{N_j1}(u_1(2)) & f_{N_j2}(u_2(2)) & \hdots & f_{N_jp}(u_p(2))\\
      \vdots & \vdots & \vdots & \ddots & \vdots\\
      \hdots & f_{N_j1}(u_1(N)) & f_{N_j2}(u_2(N)) & \hdots & f_{N_jp}(u_p(N))
    \end{array}
    \right)
  \end{multline}
\end{document}

Best regards
Thorsten
woltan
Posts: 19
Joined: Mon Mar 09, 2009 2:08 pm

Re: Math Font Size

Post by woltan »

Heyas Thorsten,
that solved my problem. Its amazing what latex can do, and sometimes how hard it is to find out. But thx to this community one gets smarter after every posting^^

thx for your posts!
cherio Woltan
Post Reply