What is the solution for taller parentheses in a matrix using xy-pic in LaTeX?

  • LaTeX
  • Thread starter Aikon
  • Start date
  • Tags
    Latex
In summary, The conversation is about a problem with the height of parentheses in a matrix when using the xy-pic package. The solution is to use \vcenter to fix the baseline of the matrix. An example of this solution is provided and a similar approach is mentioned on LaTeX-Community.org.
  • #1
Aikon
21
0
Hi,

I am trying to show the reader what is the main diagonal of a matrix, so i wrote the code using the xy-pic package, this is the code:
Code:
\begin{displaymath}
\left(
\xymatrix @=0.5pc
{
a \ar@{-}[dr] & b\\
c & d\\
}
\right)
\end{displaymath}
In the compiled file the parenthesis are taller than the matrix, and i couldn't found a solution, so i am asking help!
:smile:
Thanks,
 
Physics news on Phys.org
  • #2
Hi Aikon,

the problem here is the baseline of the matrix, which is not at the center. You can fix that by \vcenter:

Code:
\begin{displaymath}
\left(\vcenter{
\xymatrix @=0.5pc
{
a \ar@{-}[dr] & b\\
c & d\\
}}
\right)
\end{displaymath}

xymatrix.png


On LaTeX-Community.org, it has been made similarly here: Parentheses around a sigma sum with huge subscript. There just an additional \hbox has been used within \vcenter, which an be a good idea in some cases.

Stefan
 

FAQ: What is the solution for taller parentheses in a matrix using xy-pic in LaTeX?

1. What is the xy-pic package in LaTeX?

The xy-pic package is a specialized package in LaTeX that allows users to create diagrams, graphs, and other visual elements in their documents. It uses a specialized syntax for specifying coordinates and connecting elements, making it particularly useful for scientific and mathematical documents.

2. Why am I having trouble with xy-pic in my document?

There could be several reasons for difficulties with xy-pic in your document. One common issue is incorrect syntax or formatting, which can lead to errors or unexpected results. Another possibility is that the package may not be installed or loaded correctly in your LaTeX environment.

3. How can I troubleshoot problems with xy-pic in my document?

If you are having trouble with xy-pic in your document, start by checking your syntax and formatting to ensure it is correct. If the package is not loading correctly, make sure it is installed and loaded in your LaTeX environment. You can also consult the package documentation for further troubleshooting tips.

4. Are there any alternative packages to xy-pic for creating diagrams and graphs in LaTeX?

Yes, there are several alternative packages to xy-pic for creating diagrams and graphs in LaTeX. Some popular options include TikZ, PSTricks, and pgfplots. Each of these packages has its own syntax and features, so it may be helpful to explore them to find the best fit for your needs.

5. Can I use xy-pic in conjunction with other packages in LaTeX?

Yes, you can use xy-pic in conjunction with other packages in LaTeX. However, some packages may not be compatible with xy-pic or may require additional configuration. It is always a good idea to consult the documentation for both packages before using them together to ensure compatibility.

Similar threads

Back
Top