Graphics, Figures & TablesPstricks implementation

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Mini
Posts: 73
Joined: Thu Aug 06, 2009 12:46 pm

Pstricks implementation

Post by Mini »

Hello,

I'm using the following code to implement my pstricks code but it appears that the pstricks part appears ABOVE where I put the code in the PDF. I'm NOT using pdfLatex but rather DVI PDF or PS PDF.

Here is my code. What's wrong with it?

\documentclass[12pt, fleqn, leqno]{article}

\usepackage{polynom}
\usepackage{amsmath}
\usepackage{pstricks}
\usepackage[lmargin=1cm, rmargin=1cm, tmargin=1cm, bmargin=1cm]{geometry}

\begin{document}
\textbf{Complex Numbers}

Hello

The theory of complex numbers

Like this: $\dfrac{x^2-1}{x-1}=0$

Code: Select all

\begin{equation*}
\begin{split}
n^2-n& = (k+1)^2-(k+1) \\
&=k^2+2k+1-k+1
\end{split}
\end{equation*}

\begin{tabular}{|c|l|}
  \hline
  % after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
  Hello & 2 \\
  Hi & 1 \\
  \hline
\end{tabular}

\begin{figure}
\begin{pspicture}(4,5)
\psframe(0.7,2)(3.3,3)
\rput(2,2.5){First Example}
\end{pspicture}
\end{figure}


\end{document} 
Thanks

Recommended reading 2024:

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

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

CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Pstricks implementation

Post by CrazyHorse »

Mini wrote:Hello,

I'm using the following code to implement my pstricks code but it appears that the pstricks part appears ABOVE where I put the code in the PDF. I'm NOT using pdfLatex but rather DVI PDF or PS PDF.

Here is my code. What's wrong with it?
use

Code: Select all

\begin{figure}[!htb]
This has nothing to do with PSTricks

Herbert
Mini
Posts: 73
Joined: Thu Aug 06, 2009 12:46 pm

Re: Pstricks implementation

Post by Mini »

Hi,

That kinda works. But what does !htb do?

Also,

There seems to be a large gap on the top and bottom of the pstricks figure. How would I fix this so that it's 'inline' with the text? (attached PDF)

Thanks
Attachments
TestFig.pdf
(12.68 KiB) Downloaded 293 times
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Pstricks implementation

Post by CrazyHorse »

Mini wrote: There seems to be a large gap on the top and bottom of the pstricks figure. How would I fix this so that it's 'inline' with the text? (attached PDF)
\begin{pspicture}(4,5)
\psframe(0.7,2)(3.3,3)

you saved a box of 4x5cm but used with the \psframe only a y value from 2 to 3.3

Herbert
Post Reply