# Subequations in one line (no individual references)

I use the following packages already:

\usepackage{a4wide}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[bookmarks]{hyperref}
\usepackage{braket}
\usepackage{mathrsfs}
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage[numbers]{natbib}
\usepackage{scalerel}
\usepackage{stackengine}
\usepackage{enumitem}
\usepackage{hyperref}
\usepackage{alltt}
\usepackage[multiple]{footmisc}


The relevant code so far is:

\begin{subequations}
\label{CanCommRelat}
\begin{align}
[ x_{i} ; x_{j} ] & = 0, \quad
\end{align}
\begin{align}
[ p_{i} ; p_{j} ] & = 0, \text{ and} \quad
\end{align}
\begin{align}
[ x_{i} ; p_{j} ] & = i \hbar \delta_{ij}
\end{align}
\end{subequations}


This numbers the subequations as intended, but I want them to be displayed in the same line. I realize, right now the \quad commands don't have any effect, but I would like the subequations to be separated by a bit of horizontal space each. All I could find were questions of how to put subequations in the same line WITH individual references, which I don't need. I would be nice to be able to reference the expression as a whole.

I suspect the packages I loaded already provide that possibility, but I'm just new to Latex.

• Off-topic: The a4 and a4wide packages are obsolete and haven't been updated in decades. Consider using the geometry package (likely with options a4paper and margin=2.5cm). – Mico Apr 26 at 8:08
• Can, please, edit your code why is it missing the \documentclass. Regards. – Sebastiano Apr 26 at 10:49

You wrote,

This numbers the subequations as intended, but I want [the subequations] to be displayed in the same line.

Something like this?

This solution works by placing three equation (not align) environments into three separate minipage environments.

Addendum, prompted by @Schrödinger'scat's follow-up comment: (a) For a general reference on employing minipage environments to typeset separate (sub)equations and their associated equation numbers, see this posting. (b) If there's text before and/or after this subequations environment, be sure to insert paragraph breaks (best by leaving blank lines) as well.

\documentclass{article}
%\usepackage{a4wide} % is obsolete, use 'geometry' instead
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{braket}
\usepackage{mathrsfs}
\usepackage{mathtools}
\usepackage{amssymb}
%\usepackage{amsmath} % is loaded by 'mathtools'
\usepackage[numbers]{natbib}
\usepackage{scalerel}
\usepackage{stackengine}
\usepackage{enumitem}
\usepackage{alltt}
\usepackage[multiple]{footmisc}
\usepackage[bookmarks]{hyperref}

\begin{document}

\begin{subequations}
\label{CanCommRelat}
\begin{minipage}[t]{0.28\textwidth}$$[ x_{i} ; x_{j} ] = 0,$$\end{minipage}\hfill
\begin{minipage}[t]{0.28\textwidth}$$[ p_{i} ; p_{j} ] = 0,$$\end{minipage}\hfill
\begin{minipage}[t]{0.34\textwidth}$$\text{and }[ x_{i} ; p_{j} ] = i \hbar \delta_{ij}.$$\end{minipage}
\end{subequations}

\end{document}

• I had this solution also at first before I reread the question. That's why I know that the spacing around this is not good, that is, if you add text below or above you need to correct the vertical spacing. And it would be great if you could mention this answer for the strategy. – user194703 Apr 26 at 8:56
• @Mico Off-Topic: I deleted the lines that load amsfonts and amsmath, substituted a4wide by geometry and pulled bookmarks{hyperref} down, as you said. When I try to compile now, I get the error "Latex Error: Option clash for package hyperref: The package hyperref has already been loaded with options: [] There has now been an attempt to load it with options [bookmarks] I use texmaker on Linux, btw. – Markus Gratis Apr 26 at 11:49
• got it - you edited just loading hyperref out as well – Markus Gratis Apr 26 at 11:52
• @MarkusGratis = It's definitely considered good form to load a package only once. :-) – Mico Apr 26 at 12:05