I'm new both to LaTeX and to the forum - nice to meet you all!
I've been having a problem getting column vectors to display in a way that they don't interrupt the flow of the text. I have 3-vectors that I'd ideally like to display inline with minimal disruption to the line spacing above or below.
text text text text text text text text text text text text text text text text text text text
text $\tvect{1}{2}{3}$ text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text
That's exactly what I was looking for, thanks! Didn't know the smallmatrix environment existed.
Is is possible to centralise (or right-align) the elements in the matrix?
Also, I'm guessing that \ensuremath{...} appends $s accordingly to prevent errors? Finally (sorry for the many questions!), does the \negthinspace ensure the left bracket sits properly alongside the column?
georgefrost123 wrote:Is is possible to centralise (or right-align) the elements in the matrix?
Yes, it is possible. The environment smallmatrix, by default, centers the entries. In the following code I defined two mew environments similar to smallmatrix: lsmallmatrix (left alignment for the entries) and rsmallmatrix (right alignment for the entries).
I used those (together with smallmatrix) to define new commands for 3x1 matrices with different alignment. The example shows the new environments and commands in action:
georgefrost123 wrote:...Also, I'm guessing that \ensuremath{...} appends $s accordingly to prevent errors? Finally (sorry for the many questions!), does the \negthinspace ensure the left bracket sits properly alongside the column?..
Don't worry; you can ask as many questions as you wish.
\ensuremath is a LaTeX2e command that ensures that its argument is typeset always in math mode by enclosing it, if necessary, with $ signs.
\negthinspace, \negmedspace and \negthickspace are commands implemented by the amsmath package to produce negative horizontal spacing; their default value is 3mu, 4mu plus 2mu minus 4mu, and 5mu plus 5mu, respectively. Those commands can be used both in text and math mode.