I have a lot of places in my dissertation where the plus sign appears surrounded by capital letters in text, e.g. NNLL+NNLO.
The problem is that by default, the + is aligned so low vertically, that among caps it looks badly aligned.
By playing around with the \raisebox
, I found that it looks quite a bit better if raised by 0.25ex
, and still looks fine with lowercase letters, even in situations like a+j.
Is there a way to change the default behavior of the plus sign to always appear raised in text?
I don't want to change what happens in the math mode.
I suppose a potential solution might be to globally substitute raw +
by \raisebox{0.25ex}{+}
(modulo the issue with space swallowing) or to make latex use a different font for rendering the +.
I just don't know if that's even possible.
Reporting on what I implemented based on the answers.
Here's the command I came up with that also accounts for bold and allows typesetting of two consecutive raised spaces with \++
.
\makeatletter % https://tex.stackexchange.com/a/31660/35990
\newcommand*{\IfbfTF}{% detect bold font
\ifx\f@series\my@test@bf
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
}
\newcommand*{\my@test@bf}{bx}
\makeatother
% https://tex.stackexchange.com/a/567256/35990
\newcommand{\textplus}[1][+]{\raisebox{% font-independent height
\dimexpr(\fontcharht\font`X-\height+\depth)/2\relax
}{\IfbfTF{$\bm{#1}$}{#1}}}
\ExplSyntaxOn
\NewDocumentCommand\+{}{
\peek_charcode_remove:NTF + {\textplus[++]}{\textplus[+]}
}
\ExplSyntaxOff
\peek_charcode_remove:NTF
requires the expl3
package.
+
and\raisebox{0.25ex}{+}
(and my suggested\+
) all have the same behaviour with respect to surrounding white space. – David Carlisle Oct 17 '20 at 22:31\newcommand\myplus{+}
and then write\myplus a
, it is rendered as '+a' without a space. I assumed the same would also happen for\newcommand\+{+}
, which seems to not be the case. Can anyone explain why? – SU3 Oct 17 '20 at 23:37\+
terminates at the+
just as\$
or\%
but you hadn't mentioned a definition, so I thought you meant using\raisebox{..}{+}
explicitly, which wouldn't drop spaces either. – David Carlisle Oct 17 '20 at 23:39\resizebox{}{}
in your editor? Yes that would work as well. – David Carlisle Oct 17 '20 at 23:45