1

Consider the following code:

\RequirePackage{fix-cm}
\documentclass[10pt,conference,compsoc,letterpaper]{IEEEtran}
\usepackage{amsfonts}
\usepackage{amsmath}
\newcommand{\Foo}{\mathsf{Foo}}
\newcommand{\Blob}{\mathsf{Blob}}
\newcommand{\powerset}{\mathfrak{P}}
\begin{document}
Let \(A\) \(=\) \(\Bigl\{g\colon \bigl(\Foo\mkern-1mu\times\mkern-1mu\powerset((\Blob{\times}\Foo)^2)\bigr)\to\Foo\to\mathbb{N}_{\ge 0}\,\allowbreak\Bigm|\,\allowbreak\forall\,a{\in}\Foo,\,{\leadsto}\mkern-1mu\subseteq\mkern-1mu(\Blob{\times}\Foo)^2\colon\mkern1mu \sum_{b\in\Foo}g(a,{\leadsto})(b)=\bigl\lvert\{t{<}n\mid l_t\mkern-1mu=\mkern-1mua \land {\leadsto}\mkern-1mu=\mkern-1mu{\rightarrow_t}\}\bigr\rvert\Bigr\}\).
\end{document}

The output is: output of the above code

It is ugly in the second line: the spacing around is larger than the space after a∈Foo,. It should be the other way round: the space before ↝ should be larger than after it. Reason: the all-quantifier logically binds two variables: a and , where a ranges over Foo, and ranges over subsets of (Blob × Foo)². Moreover, the spacing around must remain larger than the spacing around × in (Blob×Foo)².

Of course, I could adjust the spacing manually via \mkern, \,, \, \hspace, \!, etc. in an ad-hoc way, but I've got tons of similar formulas. Therefore, I need a more general solution. It should also work when the column width is changed for the whole document. Ideas?

3
  • Would putting braces around \subseteq, as in {\subseteq}, be close to what you had in mind? – Steven B. Segletes Jan 17 '17 at 12:17
  • Perhaps, rather than doing all the manual adjustments, consider this question/answer, tex.stackexchange.com/questions/55512/…, in which the TeX defaults can be reset. – Steven B. Segletes Jan 17 '17 at 13:09
  • I think the question really is how to handle "double quantification" written with only one quantifier like that, and that there are lots of irrelevant details. If I'm right it would have been better to give just something like \forall a \in X, b \in Y: a < b as example. – pst Jan 18 '17 at 10:33
5

I find the comma is the least of your problems. If you want two variables being quantified, use two quantifiers.

You're trying to override the standard math spacing in all possible ways, mostly wrong. The result is something where the spaces seem placed at random: the reason is that space around relation and operation symbols is flexible, whereas the spaces after punctuation isn't. However you need such flexibility in order to have justification: an unsolvable problem.

It's even “more unsolvable” if you want a solution that work also when the typesetting is in a single column. Mathematics in two column format needs many compromises: it only works decently well with short formulas.

Moreover, your readers will not be able to interpret what you're trying to tell them. Long set descriptions should better be in words: your text, even if spaced correctly, is very difficult to parse.

I'm not sure what sort of math object is g, so I call it an extrablob.

\documentclass[10pt,conference,compsoc,letterpaper]{IEEEtran}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{mathptmx} % IEEEtran does \usepackage{times}

\usepackage{lipsum} % just for the example

\newcommand{\Foo}{\mathsf{Foo}}
\newcommand{\Blob}{\mathsf{Blob}}
\newcommand{\powerset}{\mathfrak{P}}
\newcommand{\varlto}{{\leadsto}} % \leadsto as a variable
\newcommand{\varto}{{\rightarrow}} % \rightarrow as a variable

\begin{document}

\lipsum[3]

Let \(A\) be the set of extrablobs
\[
g\colon \Foo\times\powerset((\Blob\times\Foo)^2)\to\Foo\to\mathbb{N}_{\ge 0}
\]
such that, for all \(a\in\Foo\) and all
\(\varlto\subseteq(\Blob\times\Foo)^2\),
\[
\sum_{b\in\Foo}g(a,\varlto)(b)=
\bigl\lvert\{t<n \mid l_t=a \land \varlto=\varto_t\}\bigr\rvert.
\]
\lipsum[4]

\end{document}

enter image description here

1
  • @LeonMeier You are removing spaces around binary operation symbols, then adding negative kerns around relation symbols: if you want to go against the typographic traditions, fine: but at least do it properly, by setting \medmuskip and \thickmuskip. You also have to adjust the space after \colon to suit the other changes; and some other bits. I used “extrablobs” because after g there are two arrows, so I couldn't see how these are maps. – egreg Jan 17 '17 at 15:12

Your Answer

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