1

As some have guessed, there was indeed a \center before the title. As shown in the picture, I changed that to \begin{center} \end{center*} and the rest of the text is now aligned!

I tried to be more explicit regarding the first issue, as explained in the new picture.

enter image description here

Original Post:

My two problems are shown in the picture: I want the math expressions to appear in their "normal" size (i.e. not to fit into the line), but then when I have two expressions they don't get spaced as you can see. Another issue is that that piece of text that I marked with a * should be aligned to the left but instead appears in the center. Is there any way to resolve these issues?

In align* mode, there is no issue, since it would automatically add space between those two integrals, say. However, it is painful to write the text within \text{} and then to break the lines manually.

issues

my TeXnic Center inputs:

\documentclass{article}
\usepackage[a4paper, margin=12mm]{geometry}
\usepackage[document]{ragged2e}
\usepackage{microtype}
\usepackage[fleqn]{mathtools}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{bigints}
\usepackage{physics}
\usepackage{wrapfig}
\usepackage{amsmath, graphics, setspace}
\usepackage{bm}
\usepackage{float}
\usepackage{hyperref}

\everymath{\displaystyle} \setcounter{page}{1} \setlength{\jot}{2mm} \pagenumbering{arabic}

The community is here to help you with questions about TeX, LaTeX or related typesetting systems.  $\int_{-\infty}^\infty |P_\epsilon (t',\omega)|d\omega = |f(t')| \int_{-\infty}^\infty e^{-\omega^2 \epsilon^2} d\omega = |f(t')|\frac{\sqrt \pi}{\epsilon}$, The community is here to help you with questions about TeX.

And, $\int_{-\infty}^\infty |P_\epsilon (t',\omega)|dt' = e^{-\omega^2 \epsilon^2} \int_{-\infty}^\infty |f(t')| dt'$ The community is here to help you with questions about TeX, LaTeX or related typesetting systems.

dekees
  • 21
  • 2
    This is pretty much why inline math is sized smaller. Is there a reason you don't want to use align* and \text? That's what they're designed for. And this made up example doesn't show why you wouldn't. (Also, your made up example is missing \begin{document}.) If you could also cut down the number of packages you're using, that would be helpful in diagnosing your problem. Something is centering your text, instead of the default full-justification. – Teepeemm Jul 22 '21 at 23:55
  • 3
    Just adding \begin{document} and \end{document} and processing doesn't produce the result you show. Notice that the first and last lines are centered; that isn't the default behavior. Please update your code to produce what you show; otherwise, it's impossible to guess what is happening to the last line. (The problems with \displaystyle are pretty well covered in the other comment.) – barbara beeton Jul 23 '21 at 00:00
  • 1
    Please edit your question and clarify what you want, e.g., they don't get spaced as you can see what is the spacing you want? And read others' comments first. – AboAmmar Jul 23 '21 at 01:12
  • our screenshot strongly suggests that there's a stray \centering directive somewhere in the document that gave rise to the screenshot. Your sample code is but an excerpt from a longer document, right? – Mico Jul 23 '21 at 03:44
  • Thank you everyone. Please, take a look at my edited post if you can. By the way, I don't want the math expressions to appear small, which they would if I would let them fit into the line. I don't mind if the line spacings get varied because of large expressions such as integrals, however I don't want expressions very close to each other as exemplified in the picture. – dekees Jul 23 '21 at 11:43

1 Answers1

1

I will interpret "I want the math expressions ... not to fit into the line" to mean that they should be typeset as displayed rather than as inline equations. If this interpretation is correct, you should replace the $...$ expressions with \[...\] expressions. \[ initiates an unnumbered displayed equation, and \] terminates it.

As some of the comments have already pointed out, the wisdom of the instruction \everymath{\displaystyle} is rather questionable. Speaking for myself, the only sensible justification for its use I can think of is in beamer documents. Even then, I'd think twice before I'd use it.

enter image description here

\documentclass{article}
\usepackage[a4paper, margin=12mm]{geometry} % <-- rather narrow margins
\usepackage[document]{ragged2e}
\usepackage{microtype}
\usepackage[fleqn]{mathtools}
\DeclarePairedDelimiter\abs\lvert\rvert % <-- new
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{bigints}
\usepackage{physics}
\usepackage{wrapfig}
\usepackage{%%amsmath, % 'mathtools' automatically loads 'amsmath'
   %%graphics, % don't load both graphicx and graphics
   setspace}
\usepackage{bm}
\usepackage{float} % are you sure you need this package?
\usepackage{xurl}  % for improved handling of URL strings
\usepackage{hyperref}

%%\everymath{\displaystyle} % highly questionable, except maybe in 'beamer' documents %\setcounter{page}{1} % that's the default %\setlength{\jot}{2mm} %\pagenumbering{arabic} % that's the default

\begin{document}

The community is here to help you with questions about TeX, LaTeX or related typesetting systems.
[ \int_{-\infty}^\infty \abs{P_\epsilon (t',\omega)},d\omega = \abs{f(t')} \int_{-\infty}^\infty e^{-\omega^2 \epsilon^2} d\omega = |f(t')|\frac{\sqrt \pi}{\epsilon},. ]
The community is here to help you with questions about TeX. And, [ \int_{-\infty}^\infty \abs{P_\epsilon (t',\omega)},dt' = e^{-\omega^2 \epsilon^2} \int_{-\infty}^\infty \abs{f(t')},dt'. ] The community is here to help you with questions about TeX, LaTeX or related typesetting systems. \end{document}

Mico
  • 506,678
  • Additionally, you could use \begin{align} with an \intertext line or two to align the expressions above and below the interstitial text. – Davislor Jul 23 '21 at 02:46
  • @Davislor. Good suggestions. Let’s wait and see if the OP declares my interpretation is even valid. :-) – Mico Jul 23 '21 at 03:04
  • Thank you both. I have cleaned up my userpackages as suggested. What is the effect of "\DeclarePairedDelimiter\abs\lvert\rvert"? I have added it along with usepackage{mathtools} but haven't noticed any change with respect to the distance between the integrals that I show in the picture. Oh, and I wouldn't like to have every math expression called in a separated line as you suggest, @Mico. That is why I'm using "displaystyle". – dekees Jul 23 '21 at 11:49
  • @dekees - If you look closely at the code in my answer, you'll find a macro called \abs used several times. The \DeclarePairedDelimiter instruction in the preamble sets up the macro. – Mico Jul 23 '21 at 13:03
  • @dekees - You seem to make an equivalence where there is none: "display style math" and "displayed equation" are not the same, and one does not imply the other. The former refers to the size of the letters and especially the size of operator symbols such as \sum and \int. The latter refers to the math stuff (usually, but not necessarily an equation) being placed -- or "displayed", if you prefer -- on a line by itself. Please check for yourself: running \everymath{\displaystyle} does not convert inline equations into displayed equations. – Mico Jul 23 '21 at 13:04
  • Oh, I see. Is there any way to have the math expressions (not just integrals, by the way) shown in their "natural" size and still be properly spaced? Please, look at the new picture in my updated post. – dekees Jul 23 '21 at 13:19
  • @dekees - Certain symbolic operators -- \sum, \int, etc. -- deliberately come in two sizes: a smaller one that's suitable for inline math material, and a larger one that's suitable for displayed math material. Your term "their natural size" is thus ill-defined. – Mico Jul 23 '21 at 13:36
  • @dekees - For more information on the differences between \displaystyle and \textstyle -- it is abolutely crucial to accept the fact that both inline math and displayed math can operate with \displaystyle and \textstyle -- and the sizes of operator symbols, please see the posting Show inline math as if it were display math (and vice versa). (Shameless self-citation alert!) – Mico Jul 23 '21 at 13:37
  • What I gathered from that post is that the way to control the size of sums, integrals etc... is to use \displaystyle or \textstyle. But this doesn't adress my question, namely how to get the large symbols automatically spaced when they appear in two consecutive lines (as illustrated in my picture in the main post). It semes that I will have to space them manually, by calling \vspace{...} before and after. Right? – dekees Jul 23 '21 at 16:03
  • @dekees - The main issue with your code is not the (large) size of the integral symbols; the output would look about as bad if you omitted the ill-advised \everymath{\displaystyle} directive. Rather, the main problem is the use of inline math and hence the failure to generate displayed equations to display [pun intended] the long math expressions. Please accept the fact that running \everymath{\displaystyle} does not induce TeX to switch from inline math to display math. As I said before, "display math" is not the same as "\displaystyle". – Mico Jul 23 '21 at 16:12
  • @dekees - The fact that the long equations happen to occur on two separate lines does not -- repeat, not -- make them displayed equations, at least not in the TeX-specific sense of the term. I'd sauy that it's utter, though possibly happy, coincidence that the equations happen to fall on different lines. The very fact that the lines contain text and math material should be a dead giveaway that you're typesetting the material using inline math, not displayed math. – Mico Jul 23 '21 at 16:16
  • Oh, ok. What you recommend me then? I mean, what would be a solution? Perhaps that everytime I want to insert an integral or sum, etc... that I do it in its proper environment? I'd want them to appear in line though... :( – dekees Jul 23 '21 at 16:17
  • @dekees - What would I recommend you do? For sure, don't use \everymath{\displaystyle}. Beyond that, it really depends on (a) what you're looking to get typeset -- generally, reading long and complex equations is a chore if they're typeset inline --and (b) what you think your readers are willing to put up with in terms of idiosyncrasies and eccentricities on your part. If you're a world-famous mathematician, readers will likely put up with a lot more poor typography than if it's still a good idea for you to convince readers that it's worth their time to work through your stuff. – Mico Jul 23 '21 at 16:36
  • These are just my notes on physics. I used to write them on paper, but then changed to PDF, so it's not intended for publishing. In any case, thanks for trying to help me! – dekees Jul 24 '21 at 12:22