0

It seems that when trying to add math or figures to a doc, all 3 get squished. It makes documents look unconsistent, and I'm wondering if there is a fix for this.

\documentclass[letterpaper,12pt]{article}

\usepackage{newfloat} \usepackage[showframe, left=1.5cm, right=1.5cm, top=1.5cm, bottom=1.5cm]{geometry} \usepackage{titling} \usepackage{indentfirst} \usepackage{fancyhdr} \usepackage{microtype} \usepackage{unicode-math} \setmainfont{Times New Roman}[Ligatures=TeX] \setmathfont{STIX Two Math}

\setlength{\droptitle}{-2cm}

\renewcommand{\maketitlehookb}{\vspace{-1cm}}

\renewcommand{\maketitlehookd}{\vspace{-.5cm}}

\renewcommand{\arraystretch}{1.5}

% }

\title{Title of Document} \author{Author Name Generic} \date{\today}

\begin{document}

\maketitle

\end{document}

Code with math for comparison

% {
\documentclass[letterpaper,12pt]{article}

\usepackage{newfloat} \usepackage[showframe, left=1.5cm, right=1.5cm, top=1.5cm, bottom=1.5cm]{geometry} \usepackage{titling} \usepackage{indentfirst} \usepackage{fancyhdr} \usepackage{microtype} \usepackage{siunitx} \usepackage{stackengine} \usepackage{cancel} \usepackage{unicode-math} \setmainfont{Times New Roman}[Ligatures=TeX] \setmathfont{STIX Two Math}

\setlength{\droptitle}{-2cm}

\renewcommand{\maketitlehookb}{\vspace{-1cm}}

\renewcommand{\maketitlehookd}{\vspace{-.5cm}}

\renewcommand{\arraystretch}{1.5}

% }

\title{Title of Document} \author{Author Name Generic} \date{\today}

\begin{document}

\maketitle

  Identities \newline

        The Sum and Difference Identities

        \begin{gather}
            \cos(\alpha - \beta) = \cos(\alpha)\cos(\beta) + \sin(\alpha)\sin(\beta)\\
            \cos(\alpha + \beta) = \cos(\alpha)\cos(\beta) - \sin(\alpha)\sin(\beta)\\
            \sin(\alpha + \beta) = \sin(\alpha)\cos(\beta) + \cos(\alpha)\sin(\beta)\\
            \sin(\alpha - \beta) = \sin(\alpha)\cos(\beta) - \cos(\alpha)\sin(\beta)
        \end{gather} 

\textbf{Example 1:} Evaluating a Trigonometric Function \newline

    A. Find the exact value of $\displaystyle \sin\left(\dfrac{\pi}{12}\right)$

    \begin{align}
        \frac{\pi}{12} &= \frac{4\pi}{12} - \frac{3\pi}{2}\\
        &= ~ \frac{\pi}{3} ~~~~~~~\frac{\pi}{4}
    \end{align}

    \begin{align}
        &\sin\left(\frac{\pi}{12}\right) = \sin\left(\frac{\pi}{3} - \frac{\pi}{4}\right)\\
        &= \sin \left(\frac{\pi}{3}\right)\cos\left(\frac{\pi}{4}\right) - \cos\left(\frac{\pi}{3}\right)\sin\left(\frac{\pi}{4}\right)\\
        &= \left(\frac{\sqrt{2}}{2}\right) \left(\frac{\sqrt{2}}{2}\right) - \left(\frac{1}{2}\right) \left(\frac{\sqrt{2}}{2}\right)\\
        &= \frac{\sqrt{6}}{4} - \frac{\sqrt{2}}{4} = \frac{\sqrt{6} - \sqrt{2}}{4}
    \end{align}

    B. Find the exact value of $\cos(\ang{75}).$   

    \begin{align}
        &\cos(\overset{\alpha}{\ang{30}} + \overset{\beta}{\ang{45}})\\
        &= \cos(\ang{30})\cos(\ang{45})-\sin(\ang{30})\sin(\ang{45})\\
        &= \left(\frac{\sqrt{3}}{2}\right) \left(\frac{\sqrt{2}}{2}\right) - \left(\frac{1}{2}\right) \left(\frac{\sqrt{2}}{2}\right)\\
        &= \frac{\sqrt{6}}{4} - \frac{\sqrt{2}}{4} = \frac{\sqrt{6} - \sqrt{2}}{4}
    \end{align}

\textbf{Example 2}: Proving a Cofunction Identity \newline

    Use a difference formula to prove the cofunction identity:

    \begin{gather}   
    \cos \left(\frac{\pi}{2} - x\right) = \sin(x) 
    \end{gather}

    \begin{align}
        \cos \left(\frac{\pi}{2} - x\right) &= \cos \overset{0}{\left(\frac{\pi}{2}\right)} \cos(x) + \sin \overset{1}{\left(\frac{\pi}{2}\right)} \sin(x)\\
        &= 0 \ast \cos(x) + 1 \ast \sin(x)\\
        &= \sin(x)
    \end{align}

\textbf{Example 3:} Solve

    \[
    \sin\overset{\alpha}{(x)}\sin\overset{\beta}{(2x)} + \cos\overset{\alpha}{(x)}\cos\overset{\beta}{(2x)} = \frac{\sqrt{3}}{2} 
    \]

            Recall: $\cos(-x) = \cos(x)$    

    \begin{align}
        \cos (x - 2x) &= \frac{\sqrt{3}}{2}\\
        &\cos (-x) = \frac{\sqrt{3}}{2}\\
        &\cos x = \frac{\sqrt{3}}{2}\\
        &x = \frac{\pi}{6} + 2 \pi k\\
        &x = \frac{11 \pi}{6} + 2 \pi k
    \end{align}

        Identities \newline

        The Product to Sum Identities

        \begin{gather}
            \sin(\alpha)\cos(\beta) = \frac{1}{2}(\sin(\alpha + \beta) + \sin(\alpha - \beta))\\
            \sin(\alpha)\cos(\beta) = \frac{1}{2}(\cos(\alpha - \beta) + \cos(\alpha + \beta))\\
            \cos(\alpha)\cos(\beta) = \frac{1}{2}(\cos(\alpha + \beta) + \cos(\alpha - \beta))
        \end{gather}

\textbf{Example 4:} Write $\sin\overset{\alpha}{(2t)}\sin\overset{\beta}{(4t)}$ as a sum or difference

        \begin{align}
            &= \frac{1}{2}(\cos(2t - 4t) - \cos(2t + 4t))\\
            &= \frac{1}{2}(\cos(-2t) - \cos (6t))\\
            &= \frac{1}{2} (\cos(2t) - \cos (6t))
        \end{align}

        Identities \newline

        The Sum to Product Identities

        \begin{align}
            \sin(u) + \sin(v) = 2\sin\left(\frac{u + v}{2}\right)\cos
            \left(\frac{u - v}{2}\right)\\
            \sin(u) - \sin(v) = 2\sin\left(\frac{u - v}{2}\right)\cos
            \left(\frac{u + v}{2}\right)\\
            \cos(u) + \cos(v) = 2\cos\left(\frac{u + v}{2}\right)\cos
            \left(\frac{u - v}{2}\right)\\
            \cos(u) - \cos(v) = 2\cos\left(\frac{u - v}{2}\right)\cos
            \left(\frac{u + v}{2}\right)
        \end{align}

\textbf{Example 5:} Evaluate $\cos\stackon{(\ang{15})}{u} - \cos\stackon{(\ang{75})}{v}$ \newline

Recall: $\sin(-30) = -\sin(30)$

        \begin{align}
            &-2 \sin \left(\frac{\ang{15} + \ang{75}}{2}\right) \sin\left(\frac{\ang{15} - \ang{75}}{2}\right)\\
            &+ 2 \sin (\ang{45}) ~ \sin (\ang{30})\\
            &= \cancel{2} \left(\frac{\sqrt{2}}{\cancel{2}}\right) \left(\frac{1}{2}\right) = \left(\frac{\sqrt{2}}{2}\right)
        \end{align}


\end{document}

enter image description here

If anyone could help with this, it would be a huge help

David Carlisle
  • 757,742
  • Can you include images of your code's output to show what you mean by "squish"? It'd help us spot the issue. I compiled your code both with and without the math, and I didn't see much of a difference between the two. – bonk Jan 05 '24 at 06:11
  • 5
    Underfull \hbox (badness 10000) in paragraph at lines 70--71 never end a paragraph with \newline or \\ !!!! also never leave a blank line in the source before a display environment such as align – David Carlisle Jan 05 '24 at 10:29
  • 5
    I added an image of your two documents, it all looks as expected although the white space is bad in the example with math as latex warns, but that does not affect the title. Please clarify your question. – David Carlisle Jan 05 '24 at 10:33
  • You could try \raggedbottom or put \maketitle inside a minipage. – John Kormylo Jan 05 '24 at 16:34
  • @DavidCarlisle what do I use instead then? \vspace{.5cm}? – Felix Maldonado Jan 05 '24 at 16:48
  • You should not need any markup at all. An end of paragraph is marked by a blank line in the source, how that formats is set globally by the document class you should never be adding space on every instance (and \newline does not add space it adds an extra blank line of text which is not dropped at a page break and will break all latex's control over bad line breaks at the ends of paragraphs) – David Carlisle Jan 05 '24 at 16:53
  • @JohnKormylo may you please show me code with those methods used in the 2nd code example? I am unfamiliar with those commands – Felix Maldonado Jan 05 '24 at 17:15
  • @bonk images are added now – Felix Maldonado Jan 05 '24 at 17:33
  • @DavidCarlisle so identities and the sum and difference identities shouldnt have a space between them? Should I utilize section and subsections? How would you do this code differently? – Felix Maldonado Jan 05 '24 at 17:38
  • never have blank lines or adjacent math displays, and use real alignement not ~ \frac{\pi}{3} ~~~~~~~\frac (also isn't a - missing on that line?) , your non-alignment between eqn 7 and 8 also looks a bit odd why is the = not aligned? – David Carlisle Jan 05 '24 at 18:26

0 Answers0