latex

Square Brackets Latex

Brackets are signs, some of which are usually accustomed group statements or explain the sequence in which actions are to be performed inside an algebraic equation, like as: (simple braces), {curly brackets}, [square brackets], so on and so forth.

In mathematical formulae, parentheses and braces are particularly prevalent. This article discusses how to alter the style and size of square parentheses in LATEX. Let’s get started now with opening your command shell of the Ubuntu 20.04 Linux system. Use “Ctrl+Alt+T” to do so. After that, you need to open the Latex texmaker for editing and creating the documents. This can be achieved by the terminal shell “texmaker” command on the shell.

The texmaker tool will be opened in less than 5 seconds on your Linux screen, as shown below. Tap on the “File” menu and create a new Latex file of the “tex” extension.

On the other hand, you can use an already created file from your system file explorer. For that, tap on the “Open” option from the “File” menu and select the file. Tap on the “Open” button held at the top right corner of the dialogue screen. The file will be launched.

Example 01: Using [] Signs

The very first method to create square brackets within the Latex file is the use of [] symbols within the document code. Therefore, we will be using a simple Latex document to do so. We have started our file with the \documentclass command.

The file data will be between the \begin and \end command of the document. Within the \begin and \end command, we have added a text “Square bracket” and a mathematical expression using the [] signs.

Now, you have to tap on the “arrows” at the top of the file name one after another to execute it and open the Latex file within the DVI format view.

\documentclass{article}
\begin{document}
Square bracket: [a=bx]
\end{document}

The DVI format for this Latex file shows the text in a simple text format but not in a mathematical standard format. However, it looks like a mathematical expression with square brackets but doesn’t meet the criteria of the mathematical expression for the standard file.

Example 02: Using \left \right Commands

To display the square brackets for an expression in a standard mathematical format of documents, we need to use the \left and \right command in our Latex file code.

The \left command will use the “[“ sign after it, and the \right command will use the “]” sign after it. While the mathematical expression will be between both commands, as shown in the below code. Let’s execute this code and open the file in DVI format to see the output.

\documentclass{article}
\begin{document}
Square bracket: \left[a=bx\right]
\end{document}

This time, our output meets the standard of mathematical expression format for standard technical documents as per the below image. The appearance of the expression is quite appealing.

You can also use \left and \right commands along with the \frac command in the Latex code to create a standard format for the “p/q” form. Therefore, we have done it using the below-updated code and executed the code.

\documentclass{article}
\begin{document}
\[
 \left[ \frac{X} {\lef( \frav{Y}{Z} \right) -  (p+q) } \right]
\]
\end{document}

This code has generated an expression of “p/q” form within large square brackets.

Example 03: Using \big command

The Latex came up with another command to use the [] signs as square brackets in the latex document. That is the “\big” command for Latex. The use of a small \big command will display the output as we in the first example.

Thus, we have used these [] signs after and before the \big command in the Latex code as shown and run the file.

\documentclass{article}
\begin{document}
Square bracket: \big[a=bx\big]
\end{document}

The output DVI format shows the simple demonstration of mathematical expression within square brackets using the standard file format.

To get the square brackets in a little bigger size, we have to use the \big command with double “g” in it, i.e. \bigg. So, we have replaced the \big command with the \bigg command in our Latex code and executed it. After that, we have opened it within the DVI file format of Latex.

\documentclass{article}
\begin{document}
Square bracket: \bigg[a=bx\bigg]
\end{document}

This time, the DVI format of the Latex file shows us the square brackets in a larger size as compared to all the above examples.

To get a larger size for the square brackets in the Latex file, we need to capitalize the first character “b” of the \bigg command. Therefore, we have updated our code and replaced the \bigg command with the \Bigg command, as shown below.

\documentclass{article}
\begin{document}
Square bracket: \Bigg[a=bx\Bigg]
\end{document}

The output for this updated code shows a larger size of square brackets in the DVI format of the Latex file.

Let’s take a deeper look at the \big command. We have been using the \big command in 4 different ways to get smaller to larger square brackets in a sequence \big, \Big, \bigg, \Bigg. Executing this code for a unique expression within the brackets.

\documentclass{article}
\begin{document}
\Bigg[2x-\bigg[3+y\Big[*6\big[-4+5\big]-8\Big]+34\bigg]*3\Bigg]=0
\end{document}

Running this code Latex file in DVI format shows us the square brackets of 4 different sizes, i.e. smaller to larger.

Conclusion:

This article covers some of the very known commands of Latex to display the square brackets in Latex-supported document formats. We have tried to give our best by using most of the example codes in the Latex texmaker tool. You can display the Latex code document output in the DVI, Pdf, and other formats.

About the author

Kalsoom Bibi

Hello, I am a freelance writer and usually write for Linux and other technology related content