You can have both by using the
auto-pst-pdf package and compiling with
pdflatex. Consider the following example.
Code: Select all
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[font=small,labelfont=bf,tableposition=top]{caption}
\usepackage{graphicx}
\usepackage{pstricks-add}
\usepackage{auto-pst-pdf}
\pagestyle{empty}
\begin{document}
\begin{figure}[!ht]
\centering
\begin{pspicture}[showgrid=false](-1,-1)(5,5)
\psaxes{->}(4,4)[$x_1$,0][$x_2$,90]
\psplot[algebraic,plotpoints=1000]{1.303}{3}{x-sqrt(3-x)}
\psplot[algebraic,plotpoints=1000]{0}{3}{x+sqrt(3-x)}
\psset{linecolor=blue}
\qdisk(1,2.4142){1pt}
\psline{->}(1,2.4142)(2.5,3)
\end{pspicture}
\caption{Your \textsf{PSTricks} figure}\label{fig:pstricks}
\end{figure}
\begin{figure}[!ht]
\centering
\includegraphics[height=6cm]{stairs}
\caption{The included graphics file in JPG format}\label{fig:jpg}
\end{figure}
\end{document}
To get this work, you have to call the compiler with the switch that enables shell escape.
Code: Select all
pdflatex -shell-escape jobname.tex
Adapt the settings of your LaTeX editor according to your LaTeX distribution. Concerning shell escape, there are differences between MiKTeX and TeX Live. Pay special attention to the remarks in the
pst-pdf manual (although this package is not included).
Best regards and welcome to the board
Thorsten