Graphics, Figures & TablesPsbrace isn't working

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Handerb
Posts: 2
Joined: Fri Mar 28, 2014 3:04 pm

Psbrace isn't working

Post by Handerb »

Hi together,

I am desperately trying to get a small brace into a pspicture, bu it just doesn't work. I have already installed the pstricks-add package, but as soon as I want to add \psbrace, nothing works anymore. Here is what I have:

Code: Select all

\documentclass[12pt,a4paper]{article}\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}\usepackage{tikz}
\usepackage{pst-plot}
\usepackage{pstricks-add}
\usepackage{graphicx}
\usepackage{caption}

\begin{figure}
        \centering
        \begin{subfigure}{0.5\textwidth}
              \begin{pspicture}*(-1.5,-1.5)(8,8)
        \psaxes[labels=none,ticks=none]{->}(0,0)(0,0)(5.5,5.5)
			\psplot[linecolor=black,plotstyle=line]
      {0}{2.8}{x 1.9 add}
			\psplot[linecolor=black,plotstyle=line]
      {0}{4}{x} 
			\psplot[linecolor=black,plotstyle=line]
      {0}{5}{x 2 exp -0.25 mul 1.5 x mul add 1.65 add} 
    \rput(0,5.8){$Q(r_0)$}
    \rput(5.8,0){$r_0$}
		\rput(1,-0.5){$\widehat{r}$}
		\rput(1,0){$|$}
		\rput(1.75,-0.5){$\underline{r}$}
		\rput(1.75,0){$|$}
						\rput(3,-0.5){$r^T$}
						\rput(3,0){$|$}
								\psline[linestyle=dashed](1.75,-0.25)(1.75,5)
								\psline[linestyle=solid](1,-0.25)(1,5)
								\psbrace(3,3)(3,3.9)
  \end{pspicture}
	\caption{Text.}
        \end{subfigure}%
        ~ 
        \begin{subfigure}{0.5\textwidth}
              ...
        \end{subfigure}
        \caption{}\label{figure2}
\end{figure}
Last edited by Stefan Kottwitz on Tue Apr 22, 2014 2:57 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.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Psbrace isn't working

Post by Johannes_B »

According to the documentation, psbrace is defined with a text label.

Code: Select all

\documentclass[12pt,a4paper]{article}
\usepackage{pstricks-add}

\begin{document}
\centering
\begin{pspicture}*(-1.5,-1.5)(8,8)
	\psbrace(3,3)(3,3.9){TEXT}
\end{pspicture}
\end{document}
Please read more about minimal working examples. They make testing much much easier.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Psbrace isn't working

Post by CrazyHorse »

Handerb wrote: I am desperately trying to get a small brace into a pspicture, bu it just doesn't work. I have already installed the pstricks-add package, but as soon as I want to add \psbrace, nothing works anymore. Here is what I have:
You can simplify a lot of the code:

Code: Select all

\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{pstricks-add}
\begin{document}

  \begin{pspicture}*(-1.5,-1.5)(8,8)
  \psaxes[labels=none,ticks=none]{->}(0,0)(0,0)(5.5,5.5)[$r_0$,0][$Q(r_0)$,90]
  \psplot[algebraic]{0}{2.8}{x+1.9}
  \psplot{0}{4}{x}
  \psplot[algebraic]{0}{5}{-0.25*x^2+1.5*x+1.65}
  \psxTick(1){\mathstrut\widehat{r}}
  \psxTick(1.75){\mathstrut\underline{r}}
  \psxTick(3){\mathstrut r^T}
  \psline[linestyle=dashed](1.75,0)(1.75,5)
  \psline(1,0)(1,5)
  \psbrace(3,3)(3,3.9){}%% it has a text argument
 \end{pspicture}
    
\end{document}
Post Reply