Hello,
I have three questions:
1) How would I draw a 6x6 matrix with dots as entries and a line that indicates the main diagonal?
2) In my current latex document, large matrices appear stretched vertically. Is there a way to make them more square (I'm using {amssymb}, [fleqn]{amsmath}, {tikz} and pmatrix to draw matrices)
3) http://tiny.cc/2smxs How do I draw the G symbol located just after the highlated text?
Thanks in advance,
Michael
Math & Science ⇒ Help with matrices
NEW: TikZ book now 40% off at Amazon.com for a short time.

Help with matrices
Hi,
for 3):
for 1) and 2) please post a minimal working example allowing us to see how exactly are you building your matrices.
for 3):
Code: Select all
\documentclass{article}
\usepackage{amssymb}
\begin{document}
$\mathcal{G}$
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Help with matrices
Thank you!
For 1) I'd like a matrix like this (less vertically stretched) with a line that goes through the leading diagonal.
Code: Select all
\documentclass[12pt,a4paper]{article}
\usepackage{amssymb}
\usepackage[fleqn]{amsmath}
\usepackage{tikz}
\linespread{1.5}
\numberwithin{equation}{subsection}
\tolerance = 10000
\setlength{\oddsidemargin}{8mm}
\setlength{\evensidemargin}{8mm}
\setlength{\topmargin}{-5mm}
\setlength{\textwidth}{145mm}
\setlength{\textheight}{220mm}
\begin{document}
$\begin{pmatrix}.&.&.&.&.&.\\.&.&.&.&.&.\\.&.&.&.&.&.\\.&.&.&.&.&.\\.&.&.&.&.&.\\.&.&.&.&.&.\end{pmatrix}$
\end{document}
Help with matrices
For your matrix with a diagonal line, you could use something like this:
For the vertical stretching issue you can use the optional argument of \\:
Code: Select all
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}\small
\matrix (magic) [matrix of math nodes, left delimiter = (, right delimiter = )]
{%
\cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
\cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
\cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
\cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
\cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
\cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
};
\draw[thin,help lines] (magic-1-1.north west) -- (magic-6-6.south east);
\end{tikzpicture}
\end{document}
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\begin{pmatrix}
\cdot &\cdot &\cdot &\cdot &\cdot & \cdot \\[-1.5ex]
\cdot &\cdot &\cdot &\cdot &\cdot & \cdot \\[-1.5ex]
\cdot &\cdot &\cdot &\cdot &\cdot & \cdot \\[-1.5ex]
\cdot &\cdot &\cdot &\cdot &\cdot & \cdot \\[-1.5ex]
\cdot &\cdot &\cdot &\cdot &\cdot & \cdot \\[-1.5ex]
\cdot &\cdot &\cdot &\cdot &\cdot & \cdot
\end{pmatrix}
\]
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Help with matrices
Thank you!gmedina wrote:For your matrix with a diagonal line, you could use something like this:
For the vertical stretching issue you can use the optional argument of \\:Code: Select all
\documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \begin{document} \begin{tikzpicture}\small \matrix (magic) [matrix of math nodes, left delimiter = (, right delimiter = )] {% \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\ \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\ \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\ \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\ \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\ \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\ }; \draw[thin,help lines] (magic-1-1.north west) -- (magic-6-6.south east); \end{tikzpicture} \end{document}
Code: Select all
\documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{pmatrix} \cdot &\cdot &\cdot &\cdot &\cdot & \cdot \\[-1.5ex] \cdot &\cdot &\cdot &\cdot &\cdot & \cdot \\[-1.5ex] \cdot &\cdot &\cdot &\cdot &\cdot & \cdot \\[-1.5ex] \cdot &\cdot &\cdot &\cdot &\cdot & \cdot \\[-1.5ex] \cdot &\cdot &\cdot &\cdot &\cdot & \cdot \\[-1.5ex] \cdot &\cdot &\cdot &\cdot &\cdot & \cdot \end{pmatrix} \] \end{document}