latex

How to Write and Use a Subset Symbol in LaTeX

When a set contains those elements, which are the members of another set, it is called a subset. In mathematics, the ⊂ shows “proper subset of” and ⊆ symbol represents “subset of.” It means the subset symbol has an essential role in mathematics.

That’s why document processors like LaTeX provide simple means to write a subset symbol in a document. In this tutorial, we will explain various ways to write and use the subset symbol in LaTeX.

How to Write and Use a Subset Symbol in LaTeX?

We’ll start with the basic subset symbol, i.e., a proper subset, and you can write it using \subset code in LaTeX. Here is a simple source code example:

\documentclass{article}
\begin{document}
   $X \subset Y$
\end{document}

Output

Similarly, you can write a subset using the following source code:

\documentclass{article}
\begin{document}
   $X \subseteq Y$
\end{document}

Output

You can also create the not subset symbol using the source code given below, but it will require the amssymb \usepackage:

\documentclass{article}
\usepackage{amssymb}
\begin{document}
   $X \nsubseteq Y$
\end{document}

Output

You can also create the proper subset through the following source code:

\documentclass{article}
\usepackage{amssymb}
\begin{document}
   $X \not\subset Y$
\end{document}

Output

There are some situations when you require the “subset not equal” symbol, but luckily LaTeX also contains the source code to write this symbol:

\documentclass{article}
\usepackage{amssymb}
\begin{document}
$X \subsetneqq Y$ ;
$A \subsetneq  B$
\end{document}

Output

Now let’s take an example that includes a subset symbol in a mathematical expression:

\documentclass{article}
\usepackage{amssymb}
\begin{document}
Set X =$\{$1,3,5$\}$ so the subsets of X are;\\

$\{$$\}$, $\{$1$\}$, $\{$2$\}$, $\{$5$\}$, $\{$1,3$\}$, $\{$3,5$\}$, $\{$1,5$\}$ and $\{$1,3,5$\}$.\\

Where, $\{$$\}$, $\{$1$\}$, $\{$3$\}$, $\{$5$\}$, $\{$1,3$\}$, $\{$3,5$\}$, $\{$1,5$\}$ $\textrm{are the proper subsets}$ ($\subset$) and $\{$1,3,5$\}$ $\textrm{is the not the proper subset. Hence, we can write}$ $\{$1,3,5$\}$ $\subseteq$ X.

\end{document}

Output

Conclusion

That was a quick rundown of the source code you can use to create and use a subset symbol in LaTeX. We have used different examples by which you can understand everything easily. A subset is an important symbol that you can try to explain the relationship between the quantities.

About the author

Prateek Jangid

A passionate Linux user for personal and professional reasons, always exploring what is new in the world of Linux and sharing with my readers.