GeneralIs this the right way.

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
metric
Posts: 61
Joined: Mon Mar 24, 2008 8:34 am

Is this the right way.

Post by metric »

Hi,

To get the ouput as in the attached file, I've used the following coding. Wants to know is there a more elegant way of getting the same output. So that I can learn the best method to get the output, I would help me whenever I have to do get a similar output.

The code for my out put is

Code: Select all

\begin{displaymath}
\begin{array}{l@{\qquad\qquad}c}
  ~\\[-1.5ex]
  S=\left[ \begin{array}{ccc} 1 & \sqrt{2} & 1 \\ 
      \sqrt{2} & 0 & -\sqrt{2} \\ 1 & -\sqrt{2} & 1 
    \end{array} \right]\\[4ex] {\quad~~~\textrm {\bfseries Eigen vector matrix for}} A_3\\[-14ex]  
  & \psfrag{zero}{$0$} \psfrag{twopi}{$\pi$} 
  \psfrag{sint}{$\sin t$} \psfrag{sintwot}{$\sin 2t$} 
  \includegraphics[width=.3\textwidth]{fig_we6_4_1.eps}
\end{array}
\end{displaymath}
The above image was drawn in corel Draw, and is converted into eps format. Any feedback/suggestion and most importantly a best way to do this is welcomed. So that I can learn the best methods that is mostly followed to get a similar output.

Thanks a lot.
Arif
Attachments
img.JPG
img.JPG (8.96 KiB) Viewed 4585 times

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Is this the right way.

Post by Stefan Kottwitz »

Hi Arif,

you could use the bmatrix environment of amsmath instead of \left\[, array, \right]:

Code: Select all

S=\begin{bmatrix} 1 & \sqrt{2} & 1 \\
      \sqrt{2} & 0 & -\sqrt{2} \\ 1 & -\sqrt{2} & 1
    \end{bmatrix}
For text inside math I recommend to use the \text macro, for instance

Code: Select all

\text{\bfseries Eigen vector matrix for }
Note the space before the end to get some space between the text and the next math symbols.

Stefan
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Is this the right way.

Post by localghost »

I suggest nearly the same modifications as Stefan does and they also rely on amsmath. The sketch might be better done with pgf/TikZ or PSTricks.

Code: Select all

\begin{displaymath}
  \begin{aligned}
    S &=
    \begin{bmatrix}
      1 & \sqrt{2} & 1 \\
      \sqrt{2} & 0 & -\sqrt{2} \\
      1 & -\sqrt{2} & 1
    \end{bmatrix}
    \\
    &\quad\textbf{Eigen vector matrix for} A_3
%  & \psfrag{zero}{$0$} \psfrag{twopi}{$\pi$}
%  \psfrag{sint}{$\sin t$} \psfrag{sintwot}{$\sin 2t$}
%  \includegraphics[width=.3\textwidth]{fig_we6_4_1.eps}
  \end{aligned}
\end{displaymath}
I will never understand why these vectors are called also "Eigen vector" in English.


Best regards
Thorsten¹
metric
Posts: 61
Joined: Mon Mar 24, 2008 8:34 am

Is this the right way.

Post by metric »

Thanks a lot for your suggestions, I'll implement them when a similary kind of output is required. (preferably when the element of matrix are to be centered align)

Sketch part can be done with pgf/TikZ or PSTricks, As far as my knowledge is concered I understand both are very vast packages, and it's diffcult to learn each of them, then to learn a single pkg.

Can you guide me which one I can go for ? (which one will be more feasible, more used).

Please correct me if any of my point is invalid.


Thank you so much for taking out your valuble time to help me.
Arif
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Is this the right way.

Post by phi »

metric wrote:Sketch part can be done with pgf/TikZ or PSTricks, As far as my knowledge is concered I understand both are very vast packages, and it's diffcult to learn each of them, then to learn a single pkg.

Can you guide me which one I can go for ? (which one will be more feasible, more used)
PSTricks is more comprehensive and widely used. TikZ is more modern and works with any backend, especially PDFLaTeX.
Here is a very small example using TikZ:

Code: Select all

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[domain=0:3.14159,smooth,samples=16,mark=*,mark repeat=4]
  \draw plot (\x, {sin(\x r)}) node[right] {$\sin t$};
  \draw plot (\x, {sin(2 * \x r)}) node[left] {$\sin 2t$};
\end{tikzpicture}
\end{document}
User avatar
T3.
Posts: 208
Joined: Fri Mar 14, 2008 12:58 pm

Is this the right way.

Post by T3. »

metric wrote:Sketch part can be done with pgf/TikZ or PSTricks, As far as my knowledge is concered I understand both are very vast packages, and it's diffcult to learn each of them, then to learn a single pkg.

Can you guide me which one I can go for ? (which one will be more feasible, more used).
I remember you asked about it a few months ago (http://www.latex-community.org/viewtopic.php?f=5&t=2038). I'm afraid there is no definitive answer to this question. Unless you have some special requirements that would exclude one of those packages, I would say, choose the one you feel more comfortable with.

I prefer TikZ but it's just that: my preference. Both packages are well established and well supported by now and they provide very similar functionality. PSTricks is older and might have more specialized packages available for it. TikZ offers tighter integration with your document (as it doesn't rely on any external processing) but at the same time it might be less potent for computationally complex tasks (e.g. 3D stuff), although those limitations should go away once LuaTeX becomes mainstream. Personally, I expect pgf/TikZ to become the graphical package of choice for TeX. Don't ask me why, it's just a gut feeling ;)

Cheers,

Tomek
metric
Posts: 61
Joined: Mon Mar 24, 2008 8:34 am

Re: Is this the right way.

Post by metric »

Thank you all of you to clear my doubts

This forum is really very helpful, my thanks goes to all those people who have maintained this forum, and are always ready to help others.

Thank you once again.

Good luck!

Regards,
Arif
curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Re: Is this the right way.

Post by curiouslearn »

I have not used pstricks, but I really like pgf/TikZ. The author has written a great manual, it is not that difficult to learn and very powerful.
Post Reply