5

enter image description here

As you can see in the picture, I have an undesired blank space between Fig. and 3. This occurs some time through the document. How can I prevent it? I also have another problem that I am not managing. The bottom of the columns is not align because I have one-column figure or section title. What do you suggest to do?

\documentclass[reprint]{revtex4-2}
\begin{document}
To do that, the tilt angle $\theta$ is estimated
using the macrospin approximation as $\theta =
\arccos{\left|R_\mathrm{H}^\mathrm{1\omega}\big/R_\mathrm{AHE}\right|}$.
$R$\textsubscript{PHE} is reported in Table
\ref{tab:table} along with the other relevant magnetic
properties. \\ $R_\mathrm{H}^\mathrm{1\omega}$
and $R_\mathrm{H}^\mathrm{2\omega}$ are shown in
Fig. \ref{fig:methods} as function of the in plane
field $H$\textsubscript{x} ($H$\textsubscript{y})
in Pt/[Co/Tb/Co]/Tb\textsubscript{1.5} and
Pt/Tb\textsubscript{1}/[Co/Tb/Co].
\end{document}
  • 1
    Something seems to have gone wrong with the uploading of picture(s). Please re-do. – Mico Dec 14 '19 at 15:49
  • 1
    The edit seems to have succeeded! also post the body of the document that gives rise to the problem output. At present, your code listing cuts off at \begin{document}. – Mico Dec 14 '19 at 15:53
  • 5
    Try Fig.~\ref{} – Dr. Manuel Kuehner Dec 14 '19 at 15:56
  • 1
    I am not aware of another solution. Maybe use search and replace throughout your document using a text editor of your choice. – Dr. Manuel Kuehner Dec 14 '19 at 15:59
  • 4
    It isn't the \ref{} which matters here. It's the tilde, ~, which you need following the . marking the abbreviation. Otherwise, TeX thinks it is the end of a sentence. You could alternatively use Figure \ref{} and then you won't need the tilde (though arguably you should use it anyway to stop the number being detached, but you wouldn't need it for spacing). – cfr Dec 14 '19 at 16:09
11

The main problem with your input is the lack of ~ in front of \ref, which has a dual function:

  • it inhibits line breaks at the space it produces;
  • it disallows enlarged space after the period.

The enlarged space after the period is inserted because TeX considers a period following a lowercase letter as the end of a sentence. With ~, the extra space is not added.1

You might declare \frenchspacing in the document preamble, but this would only cure the second disease, not the first one.

There are other quirks in your code:

  1. R_\mathrm{H}^\mathrm{1\omega} should be R_{\mathrm{H}}^{1\omega} (and similarly for the other instances); note the braces;

  2. $R$\textsubscript{PHE} should be $R_{\mathrm{PHE}}$

  3. there should be no brace after \arccos

  4. \left|, \big/ and \right| make the formula too high and not more legible; use \lvert and \rvert instead;

  5. \\ should never be used to end paragraphs; the indent is good in order to tell the reader a new paragraph has started; in this particular case, perhaps a paragraph break is not needed;

  6. $H$\textsubscript{x} should be $H_{x}$ with an italic x.

Generally, don't use \textsubscript for math material. I left it in the final parts, but be careful: if you use \textsubscript in italic context, also the subscript will be in italic; this would affect the code in point 2 above.

\documentclass[reprint,amsmath]{revtex4-2}

\usepackage{lipsum} % fillin text

\begin{document}

To do that, the tilt angle $\theta$ is estimated
using the macrospin approximation as $\theta =
\arccos\lvert R_{\mathrm{H}}^{1\omega}/R_\mathrm{AHE}\rvert$.
$R_{\mathrm{PHE}}$ is reported in Table~\ref{tab:table} along 
with the other relevant magnetic properties.

$R_{\mathrm{H}}^{1\omega}$
and $R_{\mathrm{H}}^{2\omega}$ are shown in
Fig.~\ref{fig:methods} as function of the in plane
field $H_{x}$ ($H_{y}$)
in Pt/[Co/Tb/Co]/Tb\textsubscript{1.5} and
Pt/Tb\textsubscript{1}/[Co/Tb/Co].

%%% from here on it's irrelevant for the example
%%% added just to avoid revtex splitting the
%%% text above across columns
\bigskip
\begingroup\linepenalty=1000
\lipsum\par
\endgroup

%% just to get the numbers as in the example
\refstepcounter{table}\label{tab:table}
\setcounter{figure}{2}
\refstepcounter{figure}\label{fig:methods}

\end{document}

As said in the code, the last part has only been added in order to avoid revtex split the important example text across columns (it balances columns in the final page).

enter image description here

Footnote

1In a tough case when no other solution such as rewording allows to avoid a line break between Fig. and the number, a last resort might be removing the extra space by typing Fig.\@ \ref{...}. But this should really be a last resort.

  • 4
    You might mention that the reason there's a wider space after "Fig." is that TeX thinks this is the end of a sentence. While both \frenchspacing and ~ will get rid of it, there is sometimes a situation where the two elements joined by ~ won't fit neatly on a line. In that case, I recommend using "\ " (a slash-space), as discussed here: What is the proper use of \@ (i.e., backslash-at)? – barbara beeton Dec 14 '19 at 23:40
9

Your example was extremely non-minimal, including lots of superfluous code that didn't really contribute to the problem you were having. Consider reading through I've just been asked to write a minimal example, what is that? or https://www.dickimaw-books.com/latex/minexample/html/ (the Dickimaw example is truly wonderful) to prepare better MWEs.

In any case, your problem is quite simple. In accordance with a very long tradition of Anglo-American typography (contrary to common Internet lore, and the otherwise usually excellent Bringhurst, the tradition long predates typewriters), TeX sets extra space after periods which end sentences. Unfortunately, it has no way of telling when a period doesn't end a sentence, so you need to inform it. You can do this in three ways:

  1. Use a non-breaking space (~), which will use a simple interword space (not an intersentence space) and refuse to break it across lines. This is probably the right choice for your situation, so using Fig.~3 as suggested by @bishopcranmer is advisable. You wouldn't want Fig. and 3 to be split across lines.

  2. Tell TeX that you want an interword, rather than intersentence, space by following the period with a \ (that's a backslash-space). This space might be used to break the line; however, it will be a normal interword space on that line.

  3. Set \frenchspacing, which turns off extra space after periods entirely. As its name implies, this is the tradition for French typesetting.

Hope that helps.

1

Two suggestions come to mind.

1: Sometimes using two-column means that the spacing becomes awkward. Use the \sloppy setting for that paragraph, perhaps?

2: Already suggested above: Use the unbreakable space (~) ...

3: Ah yes, and I find the package microtype very helpful.

  • 5
    1 is a poor suggestion typographically. 2 was already suggested by Dr. Manuel Kuehner. – cfr Dec 14 '19 at 16:20
  • You are right about #1, except that the present outcome looks worse that with the sloppy setting being used. – bishopcranmer Dec 14 '19 at 23:24
  • At least suggest \sloppypar instead. – cfr Dec 15 '19 at 19:51
  • You are right, it's a better call to use the \begin{sloppypar} - \end{sloppypar} environment. Good catch!! – bishopcranmer Dec 16 '19 at 14:23

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.