1
\documentclass[a4paper, 12pt,twoside=on, listof=totoc, bibliography=totoc,]{scrreprt}

\usepackage{stackengine}
\usepackage{braket}
\usepackage{mathrsfs}
\usepackage{mathtools}

\begin{document}
Intro
\newline
\begin{subequations}
\label{DualCorrespondenceKetBra}
\begin{minipage}[t]{0.25\textwidth}
    \begin{equation}
    \label{DualCorrespHilbSpaces}
        \tilde{\mathscr{H}} \stackon{ $ \iff $ }{ \emph{DC} } \mathscr{H},
    \end{equation}
\end{minipage}\hfill
\begin{minipage}[t]{0.25\textwidth}
    \begin{equation}
    \label{BraKetCorrPsi}
        \bra{\psi} \stackon{ $ \iff $ }{ \emph{DC} } \ket{\psi},
    \end{equation}
\end{minipage}\hfill
\begin{minipage}[t]{0.25\textwidth}
    \begin{equation}
    \label{EigenBraKetCorr}
        \text{and } \bra{a'},\bra{a''},... \stackon{ $ \iff $ }{\emph{DC}} \ket{a'}, \ket{a''},... \quad ,
    \end{equation}
\end{minipage}
\end{subequations}
\newline
\newline
\newline
Outro
\end{document}

I am new to latex and have used this environment for side to side subequations in my text on a number of occasions now. Usually, by tweaking the \textwidth setting, I was able to make it look ok, but now the equations are either not displayed in the same line (too small value of textwidth, it seems to me) or the line goes way beyond the page layout (too large value of textwidth). If not so much space was left in between the subequations, I think it should fit into a single line just fine. Basically the question is, how do I make this look good? :)

5
  • How or where are \bra and \ket defined? How or where is \mathscr defined? How wide is the textblock?
    – Mico
    May 14, 2020 at 10:52
  • 1
    if we run the example posted get multiple errors, please post an error free document so that we can see the issue that you are asking about May 14, 2020 at 10:58
  • Incidentally, what's with the \newline directives?
    – Mico
    May 14, 2020 at 11:15
  • @Mico The \bra and \ket are from the physics package I think, adding this and \usepackage[scr,scaled=1.1]{rsfso} I can get it to compile.
    – oliversm
    May 14, 2020 at 11:31
  • Thank you, oliversm. yep. Sorry for that. Now the document works. The \newline s are somehow needed when using this \minipage construction. May 14, 2020 at 11:34

3 Answers 3

1

The reason this looks ugly is because you are trying to fit more into one line than can comfortably fit. Adding the following two lines to the pramble

\usepackage{physics}
\usepackage[scr,scaled=1.1]{rsfso}

and some enclosing this within a \begin{document} and \end{document}, this seems to compile to (putting some \fbox commands around the minipages to show how big these are):

enter image description here

Basically the question is, how do I make this look good?

I would abandon trying to fit this all into one line as it will all just be too cramped, and so I would write:

\documentclass[a4paper, 12pt,twoside=on, listof=totoc, bibliography=totoc]{scrreprt}
\usepackage{amsmath}
\usepackage{stackengine}
\usepackage{physics}
\usepackage{mathtools}
\usepackage[scr,scaled=1.1]{rsfso} 
\begin{document}
\begin{subequations}
\begin{gather}
\label{DualCorrespHilbSpaces}
\tilde{\mathscr{H}} \stackon{ $ \iff $ }{ \emph{DC} } \mathscr{H},
\\
\label{BraKetCorrPsi}
\bra{\psi} \stackon{ $ \iff $ }{ \emph{DC} } \ket{\psi},
\\
\shortintertext{and}
\label{EigenBraKetCorr}
\bra{a'},\bra{a''},... \stackon{ $ \iff $ }{\emph{DC}} \ket{a'}, \ket{a''},...
\end{gather}
\end{subequations}
\end{document}

which gives

enter image description here

1

You can make all three subequations fit on a line if you (a) replace all three instances of \stackon{ $ \iff $ }{ \emph{DC} } with \overset{DC}{\iff}, (b) drop the extra commas and the "and" conjunction, and (c) increase the width of the third minipage from 0.25\textwidth to 0.47\textwidth.

enter image description here

\documentclass[a4paper, 12pt]{scrreprt}
\usepackage{braket,mathrsfs,mathtools}
\usepackage[margin=2.5cm]{geometry} % set page size parameters suitably

\begin{document}
\setcounter{chapter}{3} % just for this example

\begin{subequations}\label{DualCorrespondenceKetBra}
\begin{minipage}[t]{0.25\textwidth}
    \begin{equation}\label{DualCorrespHilbSpaces}
    \tilde{\mathscr{H}} \overset{DC}{\iff} \mathscr{H}
    \end{equation}
\end{minipage}\hfill%
\begin{minipage}[t]{0.25\textwidth}
    \begin{equation}\label{BraKetCorrPsi}
    \bra{\psi} \overset{DC}{\iff} \ket{\psi}
    \end{equation}
\end{minipage}\hfill%
\begin{minipage}[t]{0.47\textwidth}
    \begin{equation}\label{EigenBraKetCorr}
    \bra{a'},\bra{a''},\dotsc \overset{DC}{\iff} 
        \ket{a'}, \ket{a''},\dotsc 
    \end{equation}
\end{minipage}
\end{subequations}
\end{document}
0

If you are determined to have these all on the same line then you can adapt this solutionto Labelled in-line equation to give something like:

\documentclass[a4paper, 12pt,twoside=on, listof=totoc, bibliography=totoc]{scrreprt}
\usepackage{amsmath}
\usepackage{stackengine}
\usepackage{physics}
\usepackage{mathtools}
\usepackage[scr,scaled=1.1]{rsfso} 


\makeatletter
\newcommand*{\inlineequation}[2][]{%
\begingroup
% Put \refstepcounter at the beginning, because
% package `hyperref' sets the anchor here.
\refstepcounter{equation}%
\ifx\\#1\\%
\else
\label{#1}%
\fi
% prevent line breaks inside equation
\relpenalty=10000 %
\binoppenalty=10000 %
\ensuremath{%
% \displaystyle % larger fractions, ...
#2%
}%
~\@eqnnum
\endgroup
}
\makeatother

\begin{document}
\inlineequation[DualCorrespHilbSpaces]{
\tilde{\mathscr{H}} \stackon{ $ \iff $ }{ \emph{DC} } \mathscr{H}}, \hfill
\inlineequation[BraKetCorrPsi]{
\bra{\psi} \stackon{ $ \iff $ }{ \emph{DC} } \ket{\psi}}, and \hfill 
\inlineequation[EigenBraKetCorr]{
\bra{a'},\bra{a''},... \stackon{ $ \iff $ }{\emph{DC}} \ket{a'}, \ket{a''},...}

\eqref{DualCorrespHilbSpaces}, \eqref{BraKetCorrPsi}, and \eqref{EigenBraKetCorr} are interesting.
\end{document}

where you can then add \hfill as much or as little as you want without specifying the width, which is okay for these types of inline equations.

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .