Math & ScienceNeaten up an Array

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Philosophaie
Posts: 17
Joined: Sat Mar 21, 2015 8:59 pm

Neaten up an Array

Post by Philosophaie »

This array is all bunched together.
Is there any way of having the columns grouped together and many spaces between columns?
Also if possible put vertical lines on each side.

Code: Select all

\begin{align*}
        C_x = \begin{array}{c}%
                \hat{i} \hat{j} \hat{k}\\
                X1 Y1 Z1\\
                X2 Y2 Z2\\
        \end{array}\\
\end{align*}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Neaten up an Array

Post by Johannes_B »

Are you looking for a matrix?

Code: Select all

\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{align*}
	C_x = \begin{vmatrix}%
		\hat{i}& \hat{j}& \hat{k}\\
		X1&Y1&Z1\\X2&Y2&Z2\\
	\end{vmatrix}
\end{align*}
\end{document}
Please always post complete and compilable examples. Makes testing much easier.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Re: Neaten up an Array

Post by Stefan Kottwitz »

By the way, you could post a hand drawn image (Paint?) or a photo of a hand made drawing to explain the desired output, if you like. Posts can have image attachments. Sometimes a picture says more than words. Just to mention the possibility. :)

Stefan
LaTeX.org admin
Post Reply