How to use/define a customized parameter?

I´m generating any grpahs... and I´m playing with any linewidhts values so I would like to type on the beginning of the .TEX a line similar to

width1=0.1cm width2=0.15cm width2=0.20cm 

to avoid chaging all the values of linewidth trough all the lines in the graphs. So, I would change only, and I view all the lines with that width.

   width1=0.32cm  

How can I do this?

I suposse this is easy, but I can´t find the answer.

-- That´s my doubt --- and in the next lines I type my .tex file, where I can´t reach a good way to do an amount as a parameter

\documentclass[12pt,a4paper]{article} \usepackage[top=2.5cm, left=3.5cm, bottom=2.5cm, right=2.5cm]{geometry}  % Margenes de la normativa TFG  \usepackage{setspace} % para que no afecte el interlineado a las notas de pié de página \setstretch{1.5}  \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[spanish]{babel} \usepackage{amsmath,amsfonts,amssymb,latexsym} \usepackage{eurosym} \usepackage{graphicx} \usepackage{verbatim}  \usepackage{hyperref} \hypersetup{colorlinks=true, urlcolor=blue}  \usepackage{xcolor} \usepackage{mathpazo}       % Fuente MathPazo \usepackage{datetime}       % paquete para configurar formato de fecha y hora \settimeformat{ampmtime} \renewcommand*{\noon}{\pmname} \spanishdecimal{.} % ----------------------  PSTRICKS --------------- \usepackage{pstricks} \usepackage{pst-plot,pst-3dplot,pst-node,pst-tree,pst-grad,pst-coil,pst-text,pst-3d,pst-eps,pst-fill,pstricks-add,multido} % -------- Paquetes de pst-all \usepackage{pst-all}   paquete pstricks para las figuras en postcript \usepackage{pst-node} \usepackage{pst-eps} \usepackage{pstricks-add} % ---- Fin Paquetes de pst-all  w1=0.085cm          (HERE I WANT TO DEFINE A PARAMETER) w2=0.1cm                (HERE I WANT TO DEFINE A PARAMETER) w3=0.15cm             (HERE I WANT TO DEFINE A PARAMETER) w4=0.30cm            (HERE I WANT TO DEFINE A PARAMETER)   \begin{document} \psset{xunit=1cm,yunit=1cm}   \begin{pspicture}(-0,-0)(7.28,4.5) %\malla  \psframe[fillcolor=lightgray,fillstyle=solid,linestyle=none](-.0,0)(7.28,4.5)   \rput(1,1){\circlenode{1}{\textcolor{black}{1}}}  \rput(1,3){\circlenode{2}{\textcolor{black}{2}}}  \rput(3,2){\circlenode{3}{\textcolor{black}{3}}}  \rput(3,4){\circlenode{4}{\textcolor{black}{4}}}  \rput(5,1){\circlenode{5}{\textcolor{black}{5}}}  \rput(5,3){\circlenode{6}{\textcolor{black}{6}}}  \rput(7,2){\circlenode{7}{\textcolor{black}{7}}}   \ncline[linewidth=w1]{-}{1}{2}\naput{\scriptsize $2$} (IN THIS LINE I WANT TO USE A PARAMETER)  \ncline{-}{1}{3}\naput{\scriptsize $6$}  \ncline{-}{1}{4}\naput{\scriptsize $4$}  \ncline{-}{1}{5}\naput{\scriptsize $6$}  \ncline{-}{2}{4}\naput{\scriptsize $7$}  \ncline[linewidth=w2]{-}{2}{3}\naput{\scriptsize $3$} (IN THIS LINE I WANT TO USE A PARAMETER)  \ncline[linewidth=w3]{-}{3}{4}\naput{\scriptsize $5$} (IN THIS LINE I WANT TO USE A PARAMETER)  \ncline{-}{3}{5}\naput{\scriptsize $4$}  \ncline{-}{3}{6}\naput{\scriptsize $9$}  \ncline{-}{3}{7}\naput{\scriptsize $3$}  \ncline{-}{4}{6}\naput{\scriptsize $3$}  \ncline[linewidth=0.12cm]{-}{4}{5}\naput{\scriptsize $4$}  \ncline[linewidth=0.12cm]{-}{5}{6}\naput{\scriptsize $6$}  \ncline{-}{5}{7}\naput{\scriptsize $8$}  \ncline[linewidth=0.12cm]{-}{6}{7}\naput{\scriptsize $4$}   \nccurve[angleA=335,angleB=255,linewidth=0.12cm]{-}{1}{7}\naput{\scriptsize $4$}   \end{pspicture} \end{document} 

Replay

With PSTricks you can use \pslinewidth, which is the current linewidth. If you use that through the document, you can later scale the linewidth of all lines.

\documentclass[pstricks]{standalone}

\begin{document}
\begin{pspicture}(5,5)
  \psset{linewidth=3pt}
  \psline(0,1)(5,1)
  \psline(0,2)(5,2)
  \psline[linewidth=2\pslinewidth](0,3)(5,3)
  \psline[linewidth=3\pslinewidth](0,4)(5,4)
\end{pspicture}
\end{document}

If you want to change the line properties of only a few lines, you can use e.g. \newpsstyle to define some line styles at one, centralized point in your document:

\documentclass[pstricks]{standalone}

\begin{document}
\newpsstyle{LineA}{linewidth=2\pslinewidth, linecolor=green}
\newpsstyle{LineB}{linewidth=3\pslinewidth, linecolor=red}
\begin{pspicture}(5,5)
  \psset{linewidth=3pt}
  \psline(0,1)(5,1)
  \psline(0,2)(5,2)
  \psline[style=LineA](0,3)(5,3)
  \psline[style=LineB](0,4)(5,4)
\end{pspicture}
\end{document}

How to use/define a customized parameter?

Just to mention a few possibilities.

\documentclass{article}
\usepackage{pstricks}
\newpsobject{pslineA}{psline}{linewidth=6\pslinewidth, linecolor=green}
\newpsobject{pslineB}{psline}{linewidth=10\pslinewidth, linecolor=red}

\begin{document}
\begin{pspicture}(5,5)
  \psline(0,1)(5,1)
  \psline[linewidth=1mm](0,2)(5,2)
  \pslineA(0,3)(5,3)
  \pslineB(0,4)(5,4)
\end{pspicture}
\end{document}

How to use/define a customized parameter?

Category: pstricks Time: 2014-04-15 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.176 (s). 12 q(s)