1

I would like to ask about this specifical spacing problem:

enter image description here

Is there a way that I can remove that unnecessary blank space? Not all of it, but at least a good proportion of it.

\documentclass{article}
\usepackage[utf8]{inputenc}

\title{How to remove the space  from above this}
\author{ABC}
\date{11 July 2018}

\begin{document}

\maketitle


    Calculate: $$\int_0^{\infty} \sqrt{x}e^{-x^2}\sin^3{(x^2)}dx$$
$$\int_0^1$$
\end{document}

As an aditional question, how can I align the integrals that they will look the same but they will be underneath the word "Calculate"?

  • 1
    You're using the wrong tool here. Look for something like a theorem environment etc. or amsmath align environment. $$...$$ is outdated syntax. – user31729 Feb 9 at 23:38
  • @ChristianHupfer Thanks, I've been told before today that, and I will try maybe in the future to change it. But for an year I have used it on MSE so I am more used to dolar signs. (I am new to LaTeX). – Zacky Feb 9 at 23:40
  • 1
    to echo the comment by @ChristianHupfer, the use of two independent display lines leaves you open to the possibility that a page break could occur between them. (although not in such a short piece as this) also, the spacing between these lines isn't optimal. please do take a look at the amsmath documentation -- texdoc amsldoc. – barbara beeton Feb 10 at 2:57
  • 1
    What do you mean with unnecessary blank space? – Edoardo Serra Feb 10 at 8:03
  • I mean, to remove abit of space. Or better said I want to make the title higher than it is right now, near the top of the page as much as possible. – Zacky Feb 10 at 10:33
4

Don't know if I understood properly what you're asking, still giving it a try ;).

Are you looking for something like this?

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\noindent
Calculate:
\begin{flalign*}
    &\int_0^{\infty} \sqrt{x}e^{-x^2}\sin^3{(x^2)}dx && \\
    &\int_0^1 &&
\end{flalign*}

\end{document}

That compiles to:

enter image description here

To shift the title upwards insert this in the preamble

\usepackage{titling}
\setlength{\droptitle}{-40ex}

and tweak the parameter -40ex to shift it upwards or downwards. With this value, it should roughly be at the top margin of the page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.