Math & ScienceIn-line Row Vector disturbs Line Spacing

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
perr0

In-line Row Vector disturbs Line Spacing

Post by perr0 »

When using a row vector with this code inside some paragraph text of my main document

Code: Select all

$ \mathbf{r} = \begin{bmatrix*} 0 & -1 & 0,5 & 0 & 0 & -\pi/18 \end{bmatrix*}^T $
the output is ugly, with the brackets much bigger then they should be.
Row vector in my main document
Row vector in my main document
Screen shot 2013-01-10 at 11.46.11 AM.PNG (17.59 KiB) Viewed 10816 times
Although when using a minimum example like this the output is ok:

Code: Select all

\documentclass[12pt,a4paper]{report}
\usepackage[latin1]{inputenc}
\usepackage{pgfplots}
\usepackage{mathtools}
\usepackage{siunitx}
\pgfplotsset{compat=newest}

\begin{document}
 Some text $ \mathbf{r} = \begin{bmatrix*} 0 & -1 & 0,5 & 0 & 0 & -\pi/18 \end{bmatrix*}^T $ then some more text.
\end{document}
Which gives
Minimum example is OK. Note the smaller brackets
Minimum example is OK. Note the smaller brackets
Screen shot 2013-01-10 at 11.49.20 AM.PNG (11.13 KiB) Viewed 10816 times
I thought that this may be due to the line spacing used in my main document. But I don't know how to change it just for the this specific row vector to see if this is the cause of the problem.

Any ideas how to improve this?

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

In-line Row Vector disturbs Line Spacing

Post by localghost »

The purpose of a proper minimal example is to reproduce the error or misbehaviour. Your example is neither minimal nor does it reproduce the described misbehaviour. Hence you should not call it a MWE in order not to irritate others (especially beginners).

Because your example does not reproduce the misbehaviour, it is not possible to give specific help. Therefore one can only guess that you are using the setspace package with an interline space that differs from the default.

Addendum: Crossposting
Postings in another forum have to be indicated with a direct link in order to prevent others from double effort. Please read what our administrator thinks about that. In the meantime the question on {TeX} SX has been closed.


Best regards and welcome to the board
Thorsten
perr0

Re: In-line Row Vector disturbs Line Spacing

Post by perr0 »

I think I may clarify what happened here.

I realized I had a problem. I thought about posting it to Tex.SX, but when I made the MWE to post to that site, I noticed that it didn't present the same issues I was experimenting with my main document.

Considering that, I thought about posting it to a forum, as I believe it allows for more diverse discussion than Tex.SX. Obviously, if the MWE does not have the problem that I see in my main document, the problem is with my document, and not with LaTeX itself. The way I see it, forums allows for more localized questions as this. Correct me if this is not the case for this forum.

After posting the question here, I did some tests and verified that the problem was with double spacing (when posting the question here it was only a hypothesis). I wasn't aware of the package setspace before so that I could use it to test the if the spacing was causing it.

Regarding the MWE, yes, mine works. It's minimal and it works. It does not show the problem, but I said explicitly that I could not reproduce the problem from my main document. The thing is, as I said before, when I posted the question here, I wasn't aware of the setspace package nor that the spacing was causing it. That's why my MWE here is different from the one on Tex.SX.

Regarding the crossposting, sorry about that, I wasn't aware of the rule.

Yes, the question has been closed on Tex.SX. The duplicate question was in a different context and that's why I didn't find it. It doesn't mean I haven't searched for a solution beforehand.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

In-line Row Vector disturbs Line Spacing

Post by localghost »

After posting the question here, I did some tests and verified that the problem was with double spacing (when posting the question here it was only a hypothesis). I wasn't aware of the package setspace before so that I could use it to test the if the spacing was causing it.
Perhaps you commited another mortal sin like redefining \baselinestrech e.g. in this way.

Code: Select all

\renewcommand*{\baselinestretch}{2}
Or perhaps you used \linespread{2} or something similar in your document.
perr0 wrote:[…] Regarding the MWE, yes, mine works. It's minimal and it works. It does not show the problem, but I said explicitly that I could not reproduce the problem from my main document. The thing is, as I said before, when I posted the question here, I wasn't aware of the setspace package nor that the spacing was causing it. That's why my MWE here is different from the one on Tex.SX. […]
No, your example is not minimal and therefore does not deserve to be called "MWE". Packages like pgfplots or siunitx are for sure not necessary to reproduce the problem.

To find out the source of the error you can build an example from scratch by copying content from your original document until the error occurs. If that is not successful, you can cut down a copy of your original document to the minimal stuff that still reproduces the error. Both procedures are described when following the corresponding link I have given in my previous reply. That would have been your homework.
perr0 wrote:[…] Regarding the crossposting, sorry about that, I wasn't aware of the rule. […]
That's one reason why the rules should be read before posting.
Post Reply