Graphics, Figures & TablesPstricks Figure and text in two columns

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Pstricks Figure and text in two columns

Post by coachbennett1981 »

Good morning, I am working on a document that requires me to save as much space as possible. I notice that I have some (negative-open space) with some of my figures and explanations. Is there a way to have the picture on the left with the explanation on the right side in a multiple column format? So I guess I am asking is if both paragraphs can be put together in two columns.

Code: Select all

\documentclass{article}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{multicol}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{calc,through,backgrounds}
\usepackage{pstricks}
\usepackage{pst-node}
\usepackage{pst-plot}
\usepackage{pst-func}
\usepackage{pstricks-add}

\begin{document}

\paragraph{Example 8}
	What is the $y$-intercept of the line shown in Figure 14? Is the slope positive or negative?
		\vspace{.5in}
	\begin{figure}[!h]
	\centering
		\begin{pspicture}(-4,-2)(5,2)
			\psset{unit=.75cm}
\psaxes[linewidth=1.5pt]{<->}(0,0)(-4,-3)(4,4)[$x$,-90][$y$,180]
\psplot[plotstyle=curve,linewidth=1.5pt,arrows=<->]{-1}{3}{-1.5 x mul 3 add}
\end{pspicture}
\caption{}
\end{figure}


 \paragraph{Answer: 3, negative}
\noindent To find the $y$-intercept, we are looking at where the graph (line) crosses the $y$-axis (vertical axis).  We see that the $y$-intercept of this graph is 3.  Since the line slants downwards from left to right we know that the slope is negative. 

\end{document}
Thank you for you time.

Nick
Last edited by coachbennett1981 on Fri Dec 17, 2010 6:14 pm, edited 1 time in total.

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 Figure and text in two columns

Post by CrazyHorse »

Again, your document has errors .. you didn't run it by yourself!

Code: Select all

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{varwidth,caption}
\usepackage{pstricks-add}
\newcommand\SideBySide[2]{\par
 \begin{minipage}[t]{0.48\linewidth}#1\end{minipage}
\hfill
\begin{minipage}[t]{0.5\linewidth}\centering#2
\end{minipage}}

\begin{document}

\SideBySide{%
\paragraph{Example 8}
What is the $y$-intercept of the line shown in Figure~\ref{fig:foo}? Is the slope positive or negative?

\paragraph{Answer: 3, negative}
\noindent To find the $y$-intercept, we are looking at where the graph (line) crosses the $y$-axis (vertical axis).  We see that the $y$-intercept of this graph is 3.  Since the line slants downwards from left to right we know that the slope is negative.
}
{\begin{pspicture}[shift=-4](-4,-2)(5,2)
  \psset{unit=.75cm}
  \psaxes[linewidth=1.5pt]{<->}(0,0)(-4,-3)(4,4)[$x$,-90][$y$,180]
  \psplot[plotstyle=curve,linewidth=1.5pt,arrows=<->]{-1}{3}{-1.5 x mul 3 add}
\end{pspicture}
\captionof{figure}{foo}\label{figg:foo}
}

\end{document}
Herbert
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Re: Pstricks Figure and text in two columns

Post by coachbennett1981 »

Sorry, I misspelled document. I did not run it because I did cut an paste.. Again sorry.

Nick
Post Reply