Math & Sciencepstricks along side align equations

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
jaybz
Posts: 90
Joined: Sun Jul 11, 2010 6:02 pm

pstricks along side align equations

Post by jaybz »

How can I place a pstricks graph along side a align equation ? This one's not too bad but I have other graphs which a much taller and I don't want to take up most of the page just for the graph.

Code: Select all

\documentclass[10pt]{article}
\usepackage[top=.5in, bottom=.5in,left=0.5in,right=0.5in]{geometry}
\usepackage{amsmath}
\usepackage{pstricks-add}
\begin{document}
The region is rotated around the x-axis, find the volume bounded by: $\displaystyle \quad y=(\,x+1\,)^{2}, \quad y{\,=\,}0, \quad x=1, \quad x=2 $\\\\\\

\begin{center}
\newrgbcolor{zzttqq}{0.6 0.2 0}
\psset{xunit=1.0cm,yunit=1.0cm,algebraic=true,dotstyle=o,dotsize=3pt 0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}
\begin{pspicture*}(-0.5,-0.5)(2.5,9.3)
\psaxes[labelFontSize=\scriptstyle,xAxis=true,yAxis=true,Dx=1,Dy=1,ticksize=-2pt 0,subticks=2]{->}(0,0)(-0.5,-0.5)(2.5,9.3)[x,140] [y,-40]
\pscustom[linecolor=zzttqq,fillcolor=zzttqq,fillstyle=solid,opacity=0.1]{\psplot{1}{2}{(x+1)^2}\lineto(2,0)\lineto(1,0)\closepath}
\psplot[plotpoints=200]{-0.5}{2.5}{(x+1)^2}
\psline(1,-0.5)(1,4)
\rput[tl](0.1,8.1){$y=(x+1)^{2}$}
\psline(2,-0.5)(2,10)
\end{pspicture*}
\newline
\end{center}

\begin{align*}
\text{Area} &= \int_a^{b} \Bigg[\, \pi\,(\text{\,radius\,})^{2}\; \Bigg] \,dx \\\\
~ &= \int_0^{1} \Bigg[\, \pi\,(\,x^{2}\,)^{2}\; \Bigg] \,dx \\\\
~ &= \int_0^{1} \Bigg[\, \pi\,x^{4}\; \Bigg] \,dx \\\\
~ &= \Bigg[\, \pi\,\frac{\,x^{5}}{5} \;  \Bigg]_0^{1} \\\\
~ &= \Bigg[\, \pi\,\frac{\,1^{5}}{5} \; - \pi\,\frac{0^{5}}{4} \,  \Bigg] \\\\
~ &= \,\frac{\pi}{5} \, - \, 0 \\\\
~ &= \frac{\pi}{5}
\end{align*}
\end{document}
Last edited by jaybz on Sun Nov 14, 2010 7:52 am, edited 2 times in total.

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

pstricks along side align equations

Post by localghost »

You could use packages like wrapfig to wrap text around the figure. Another possible solution would be two minipage environments.


Thorsten
jaybz
Posts: 90
Joined: Sun Jul 11, 2010 6:02 pm

Re: pstricks along side align equations

Post by jaybz »

I've tried without success using minipage. Could you give an example please. Sorry for the code tag omission.
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

pstricks along side align equations

Post by CrazyHorse »

jaybz wrote:How can I place a pstricks graph along side a align equation ? This one's not too bad but I have other graphs which a much taller and I don't want to take up most of the page just for the graph.

Code: Select all

\documentclass[10pt]{article}
\usepackage[top=.5in, bottom=.5in,left=0.5in,right=0.5in]{geometry}
\usepackage{amsmath}
\usepackage{pstricks-add}
\begin{document}
The region is rotated around the x-axis, find the volume bounded by: $\displaystyle \quad y=(\,x+1\,)^{2}, \quad y{\,=\,}0, \quad x=1, \quad x=2 $\\\\\\

\begin{center}
\begin{minipage}{0.3\linewidth}
\definecolor{zzttqq}{rgb}{0.6 0.2 0}
\psset{algebraic=true,dotstyle=o,dotsize=3pt 0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}
\begin{pspicture*}(-0.5,-0.5)(2.5,9.3)
\psaxes[labelFontSize=\scriptstyle,xAxis=true,yAxis=true,Dx=1,Dy=1,ticksize=-2pt 0,subticks=2]{->}(0,0)(-0.5,-0.5)(2.5,9.3)[x,140] [y,-40]
\pscustom[linecolor=zzttqq,fillcolor=zzttqq,fillstyle=solid,opacity=0.1]{\psplot{1}{2}{(x+1)^2}\lineto(2,0)\lineto(1,0)\closepath}
\psplot[plotpoints=200]{-0.5}{2.5}{(x+1)^2}
\psline(1,-0.5)(1,4)
\rput[tl](0.1,8.1){$y=(x+1)^{2}$}
\psline(2,-0.5)(2,10)
\end{pspicture*}
\end{minipage}
%\hfill% 
\begin{minipage}{0.4\linewidth}
\begin{align*}
\text{Area} &= \int_a^{b} \Bigg[\, \pi\,(\text{\,radius\,})^{2}\; \Bigg] \,dx \\\\
~ &= \int_0^{1} \Bigg[\, \pi\,(\,x^{2}\,)^{2}\; \Bigg] \,dx \\\\
~ &= \int_0^{1} \Bigg[\, \pi\,x^{4}\; \Bigg] \,dx \\\\
~ &= \Bigg[\, \pi\,\frac{\,x^{5}}{5} \;  \Bigg]_0^{1} \\\\
~ &= \Bigg[\, \pi\,\frac{\,1^{5}}{5} \; - \pi\,\frac{0^{5}}{4} \,  \Bigg] \\\\
~ &= \,\frac{\pi}{5} \, - \, 0 \\\\
~ &= \frac{\pi}{5}
\end{align*}
\end{minipage}
\end{center}

\end{document}
Herbert
jaybz
Posts: 90
Joined: Sun Jul 11, 2010 6:02 pm

Re: pstricks along side align equations

Post by jaybz »

Perfect! Thank you very much Crazyhorse.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

pstricks along side align equations

Post by localghost »

Now that the problem is solved, please be so kind and mark the topic (not the last post) accordingly as clearly written in Section 3 of the Board Rules (to be read before posting) and as you have already been directed in my last reply. Please keep that in mind for the future so that further reminders will not be necessary.
Post Reply