LaTeX forum ⇒ Graphics, Figures & TablesPsbrace isn't working

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

Psbrace isn't working

Postby Handerb » Sun Apr 20, 2014 5:30 pm

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:

  1. \documentclass[12pt,a4paper]{article}\usepackage{amsmath}
  2. \usepackage{amsthm}
  3. \usepackage{amsfonts}\usepackage{tikz}
  4. \usepackage{pst-plot}
  5. \usepackage{pstricks-add}
  6. \usepackage{graphicx}
  7. \usepackage{caption}
  8.  
  9. \begin{figure}
  10. \centering
  11. \begin{subfigure}{0.5\textwidth}
  12. \begin{pspicture}*(-1.5,-1.5)(8,8)
  13. \psaxes[labels=none,ticks=none]{->}(0,0)(0,0)(5.5,5.5)
  14. \psplot[linecolor=black,plotstyle=line]
  15. {0}{2.8}{x 1.9 add}
  16. \psplot[linecolor=black,plotstyle=line]
  17. {0}{4}{x}
  18. \psplot[linecolor=black,plotstyle=line]
  19. {0}{5}{x 2 exp -0.25 mul 1.5 x mul add 1.65 add}
  20. \rput(0,5.8){$Q(r_0)$}
  21. \rput(5.8,0){$r_0$}
  22. \rput(1,-0.5){$\widehat{r}$}
  23. \rput(1,0){$|$}
  24. \rput(1.75,-0.5){$\underline{r}$}
  25. \rput(1.75,0){$|$}
  26. \rput(3,-0.5){$r^T$}
  27. \rput(3,0){$|$}
  28. \psline[linestyle=dashed](1.75,-0.25)(1.75,5)
  29. \psline[linestyle=solid](1,-0.25)(1,5)
  30. \psbrace(3,3)(3,3.9)
  31. \end{pspicture}
  32. \caption{Text.}
  33. \end{subfigure}%
  34. ~
  35. \begin{subfigure}{0.5\textwidth}
  36. ...
  37. \end{subfigure}
  38. \caption{}\label{figure2}
  39. \end{figure}
Last edited by Stefan Kottwitz on Tue Apr 22, 2014 2:57 pm, edited 1 time in total.
Reason: code marked

User avatar
Johannes_B
Site Moderator
Posts: 4186
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Apr 21, 2014 1:18 pm

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

  1. \documentclass[12pt,a4paper]{article}
  2. \usepackage{pstricks-add}
  3.  
  4. \begin{document}
  5. \centering
  6. \begin{pspicture}*(-1.5,-1.5)(8,8)
  7. \psbrace(3,3)(3,3.9){TEXT}
  8. \end{pspicture}
  9. \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

Postby CrazyHorse » Tue Apr 22, 2014 10:22 pm

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:

  1. \documentclass[12pt,a4paper]{article}
  2. \usepackage{amsmath}
  3. \usepackage{amsthm}
  4. \usepackage{amsfonts}
  5. \usepackage{pstricks-add}
  6. \begin{document}
  7.  
  8. \begin{pspicture}*(-1.5,-1.5)(8,8)
  9. \psaxes[labels=none,ticks=none]{->}(0,0)(0,0)(5.5,5.5)[$r_0$,0][$Q(r_0)$,90]
  10. \psplot[algebraic]{0}{2.8}{x+1.9}
  11. \psplot{0}{4}{x}
  12. \psplot[algebraic]{0}{5}{-0.25*x^2+1.5*x+1.65}
  13. \psxTick(1){\mathstrut\widehat{r}}
  14. \psxTick(1.75){\mathstrut\underline{r}}
  15. \psxTick(3){\mathstrut r^T}
  16. \psline[linestyle=dashed](1.75,0)(1.75,5)
  17. \psline(1,0)(1,5)
  18. \psbrace(3,3)(3,3.9){}%% it has a text argument
  19. \end{pspicture}
  20.  
  21. \end{document}


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 5 guests