1

I have a group defined in algebra as such in my MWE. The problem is that it is too long to fit in one line. How can I make it look better?

\documentclass[11pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsfonts}
\usepackage[left=3.50cm, right=3.0cm, top=3.0cm, bottom=3.0cm]{geometry}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\begin{document}
$$G = \langle a, b, x, y, z \;|\; a^4 = 1_G =1, b^2 =1, ab=ba, x^3=y^3=z^3=1, xy=yx, x^a = xy, x^b =x, y^a =xy^2, y^b =y, z^a =xyz, z^b = y^2z^2[y,z], [x, y, x]=1 \rangle$$
\end{document}
R Maharaj
  • 405

3 Answers3

1

You could put the thing in a multi-lined aligned environment.

\documentclass[11pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsfonts}
\usepackage[left=3.50cm, right=3.0cm, top=3.0cm, bottom=3.0cm]{geometry}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\begin{document}
\[
\begin{aligned}
G ={}& \langle a, b, x, y, z \;|\; a^4 = 1_G =1, b^2 =1, ab=ba, x^3=y^3=z^3=1,\\
&xy=yx, x^a = xy, x^b =x, y^a =xy^2, y^b =y, z^a =xyz, z^b = y^2z^2[y,z],\\
& [x, y, x]=1 \rangle
\end{aligned}
\]
\end{document}

enter image description here

1

I propose a code adapted from the code for the set-builder notation described in the documentation of mathtools, nested in a medsize environment from nccmath; in order to make it fit in two lines.

I define a \GenRels command, with one argument in two parts: the generators and the relations, separated by a \st command. The size of the delimiters and the vertical rule adapts automatically to the size of the content if you use the star version of the command, which add implicit \left \middle \right at the relevant places. Alternatively, you can fine-tune the size of the delimiters using as an optional argument one of \big, \Big, \bigg, \Bigg:

\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts}
\usepackage[left=3.5cm, right=3cm, vmargin=3cm, showframe]{geometry}
\usepackage{graphicx}
\usepackage{mathtools, nccmath}
\usepackage{amsthm}
\usepackage{amssymb}

\providecommand\st{}
\newcommand\RelSymbol[1][]{%
\nonscript\:#1\vert
\allowbreak
\nonscript\:
\mathopen{}}
\DeclarePairedDelimiterX\GenRels[1]\langle\rangle{%
\renewcommand\st{\RelSymbol[\delimsize]}
#1}

\begin{document}
\mbox{}

\[ \GenRels*{ a, b, x, y, z \st
\begin{medsize}
\begin{aligned} & a^4 = 1_G =1,\enspace b^2 =1, \enspace ab=ba, \enspace x^3=y^3=z^3=1, \enspace xy=yx,\enspace x^a = xy, \\[-0.5ex] %
 & x^b =x, \enspace y^a =xy^2,\enspace y^b =y,\enspace z^a =xyz,\enspace z^b = y^2z^2[y,z],\enspace [x, y, x]=1%
\end{aligned}
\end{medsize}
} \]

\end{document} 

enter image description here

Bernard
  • 271,350
1

You can use an internal aligned:

\documentclass[11pt,a4paper]{article}
\usepackage{amsmath}

\begin{document}

\begin{equation*}
G = \langle a, b, x, y, z \mid
  \begin{aligned}[t]
  & a^4 = 1_G =1, b^2 =1, ab=ba,\\
  & x^3=y^3=z^3=1, xy=yx, \\
  & x^a = xy, x^b =x, \\
  & y^a =xy^2, y^b =y, \\
  & z^a =xyz, z^b = y^2z^2[y,z], \\
  & [x, y, x]=1 \rangle
  \end{aligned}
\end{equation*}

\end{document}

I grouped the identities “by kind”.

An important note: never use $$ in LaTeX, see Why is \[ ... \] preferable to $$ ... $$?

enter image description here

egreg
  • 1,121,712