diff options
author | Karl Berry <karl@freefriends.org> | 2009-12-31 01:44:07 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-12-31 01:44:07 +0000 |
commit | 35a5ddb9c4a7ab6239bc84741df4cbd8cf8e2ac9 (patch) | |
tree | a3f908782043bf1e8a2cd3e385c695589756573e /Master/texmf-dist/tex | |
parent | f84374dfd46b282099b639296e3b952f4d52746f (diff) |
dcpic update (27dec09)
git-svn-id: svn://tug.org/texlive/trunk@16547 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/dcpic/dcpic.sty (renamed from Master/texmf-dist/tex/latex/dcpic/dcpic.sty) | 779 |
1 files changed, 455 insertions, 324 deletions
diff --git a/Master/texmf-dist/tex/latex/dcpic/dcpic.sty b/Master/texmf-dist/tex/generic/dcpic/dcpic.sty index 9a613845837..4c1ef123710 100644 --- a/Master/texmf-dist/tex/latex/dcpic/dcpic.sty +++ b/Master/texmf-dist/tex/generic/dcpic/dcpic.sty @@ -1,6 +1,5 @@ -% $Id: dcpic.sty,v 1.31 2007/12/13 17:34:57 pedro Exp pedro $ %% DC-PiCTeX -%% Copyright (c) 1990-2007 Pedro Quaresma de Almeida, Coimbra +%% Copyright (c) 1990-2009 Pedro Quaresma, Coimbra, Portugal %% 11/1990 (version 1.0); %% 10/1991 (version 1.1); %% 9/1993 (version 1.2); @@ -12,34 +11,38 @@ %% 5/2002 (version 4.0); %% 3/2003 (version 4.1); %% 12/2004 (version 4.1.1) -%% 3/2007 (version 4.1.2) +%% 3/2007 (version 4.2) +%% 5/2008 (version 4.2.1) +%% 8/2008 (version 4.3) +%% 12/2008 (version 4.3.1) +%% 12/2009 (version 4.3.2) -\immediate\write10{Package DCpic 2007/03/01 v4.1.2} +\immediate\write10{Package DCpic 2009/12/22 v4.3.2} -\ProvidesPackage{dcpic}[2007/03/01 v4.1.2] +\ProvidesPackage{dcpic}[2009/12/22 v4.3.2] %% Version X.Y.Z %% X - major versions %% Y - minor versions %% Z - bug corrections %% -%% Copyright (c) 1990-2007 Pedro Quaresma <pedro@mat.uc.pt> -%% The DCpic package is free software; you can redistribute it and/or -%% modify it under the terms of the GNU General Public License as -%% published by the Free Software Foundation; either version 2 of the -%% License, or (at your option) any later version. -%% -%% The DCpic package is distributed in the hope that it will be -%% useful, but WITHOUT ANY WARRANTY; without even the implied warranty -%% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -%% General Public License for more details. -%% -%% You should have received a copy of the GNU General Public License -%% along with this package; if not, write to the Free Software -%% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -%% -%% -%% Coimbra, 13 de Dezembro de 2007 +%% Copyright (c) 1990-2009 Pedro Quaresma <pedro@mat.uc.pt> +%% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Pedro Quaresma (pedro@mat.uc.pt). +% +% This work consists of the files dcpic.sty. +%% +%% Coimbra, 22 de Dezembro de 2009 (2009/12/22) %% Pedro Quaresma de Almeida %% %% DCpic is a package of \TeX\ macros for graph modelling in a @@ -138,24 +141,28 @@ %% #1 and #2 - coordinates (beginning) %% #3 and #4 - coordinates (ending) %%(optional)#5,#6 - correction factors (defaul values, 10 and 10) -%% #5 - actual beginning of the edge -%% #6 - actual ending of the edge +%% #5 - actual beginning of the edge +%% #6 - actual ending of the edge %% #7 - text (morphism label) %%(optional)#8,#9 %% #8 - label placement -%% 1 = \atright, at right, default value -%% -1 = \atleft, at left +%% 1 = "\atright", at right, default value +%% -1 = "\atleft", at left %% #9 - edge type %% 0 = "\solidarrow", default edge -%% 1 = "\dasharrow" +%% 1 = "\dashArrow" %% 2 = "\solidline" %% 3 = "\dashline" %% 4 = "\dotline" %% 5 = "\injectionarrow" --- old value 3 %% 6 = "\aplicationarrow" --- old value 4 %% 7 = "\surjectivearrow" --- old value 5 +%% 8 = "\equalline" (thanks to Ruben Debeerst), +%% 9 = "\doublearrow" +%% 10 = "\doubleopposite" +%% 11 = "nullarrow" (to allow adding labels to existing arrows) %% -%% Note: insert a space after the command. +%% Notes: the equalline "arrow" does not provide a second label. %% %% Curved Morphisms (quadratic edges): %% \cmor(#1) #2(#3,#4){#5}[#6] @@ -169,7 +176,7 @@ %% #5 - morphism label %%(optional)#6 - edge type %% 0 ="\solidarrow", default value -%% 1 = "\dasharrow" +%% 1 = "\dashArrow" %% 2 = "\solidline" %% %% Notes: insert a space after the command. @@ -220,7 +227,7 @@ %%\mor{Gr}{SigmaG}{$\lambda^G$} %%\mor{Grstar}{Gr}{$i_5$}[\atleft,\aplicationarrow] %%\mor{Grstar}{H}{$r^*$}[\atright,\solidarrow] -%%\mor{H}{SigmaH}{$\lambda^H$}[\atright,\dasharrow] +%%\mor{H}{SigmaH}{$\lambda^H$}[\atright,\dashArrow] %%\mor{SigmaG}{SigmaH}{$\varphi^{r^*}$}[\atright,\solidarrow] %%\mor{Lm}{Gr}{$m$}[\atright,\solidarrow] %%\mor{Lm}{L}{$i_2$}[\atleft,\aplicationarrow] @@ -241,31 +248,28 @@ %% %%\end{document} %%-----------------//------------- -%% Modifica{\c c}{\~o}es (9/1993) -%% argumento "dist{\^a}ncia entre as extremidades da seta e os -%% objectos" passou a ser opcional; uma nova op{\c c}{\~a}o para as -%% "setas" (op{\c c}{\~a}o 3). -%% -%% 2/3/1995 (vers{\~a}o 1.3) -%% foi acrescentado o tipo de seta de aplica{\c c}{\~a}o -%% (op{\c c}{\~a}o 4) a dist{\^a}ncia da etiqueta {\`a} seta respectiva -%% passou a ser fixa (10 unidades de medida). -%% 15/7/1996 (vers{\~a}o 2.1) -%% O comando "\mor" passou a ter uma sintaxe distinta. Os -%% par{\^a}metros 5 e 6 passaram a ser a dist{\^a}ncia entre os -%% objectos e os extremos da seta o par{\^a}metro 7 {\'e} o nome do -%% morfismo e os par{\^a}metros 8 e 9, coloca{\c c}{\~a}o do morfismo -%% e tipo de morfismo passaram a ser opcionais. -%% -%% 5/2001 (vers{\~a}o 3.0) -%% Implementa{\c c}{\~a}o do comando "\cmor" baseado no comando -%% de desenho de curvas quadr{\'a}ticas pelo PiCTeX -%% -%% 11/2001 (vers{\~a}o 3.1) -%% Modifica{\c c}{\~a}o das pontas das setas de forma a estas ficarem -%% semelhantes {\`a}s setas (s{\'\i}mbolos) dos TeX. -%% -%% 1/2002 (vers{\~a}o 3.2) +%% Modifications (9/1993) +%% argument "distance" between de tip of the arrow and the objects +%% became optional; a new option for the "arrows" (option 3) +%% +%% 2/3/1995 (version 1.3) +%% adds "the aplication arrow" (option 4); the distance between +%% the label and the "arrow" is now a fixed value (10 units). +%% 15/7/1996 (version 2.1) +%% The comand "\mor" has a new sintax. The 5th and 6th +%% parameters are now the distance between the two objects and +%% the arrow tips. The 7th parameter is the label. The 8th e 9th +%% parameters (label position and type of arrow) are now optional +%% +%% 5/2001 (version 3.0) +%% Implementation of the comand "\cmor" based on the quadratic +%% curver comand of PiCTeX +%% +%% 11/2001 (version 3.1) +%% Changes on the tips of the arrow to became more LaTeX style +%% (after a conversation on EuroTeX 2001). +%% +%% 1/2002 (version 3.2) %% Modifica{\c c}{\~a}o dos comandos "obj" e "mor" de forma a introduzir %% a especifica{\c c}{\~a}o l{\'o}gica dos morfismos, isto {\'e}, passa-se a %% dizer qual {\'e} o objecto de partida e/ou o objecto de chegada @@ -274,70 +278,95 @@ %% Por outro lado o tamanho das setas passa a ser ajustado %% automaticamente em rela{\c c}{\~a}o ao tamanho dos objectos. %% -%% 5/2002 (versão 4.0) -%% Modificação dos comandos "begindc" e "obj" -%% !!! Modificação da sintaxe destes comandos !!! -%% O comando "begindc" passou a ter um argumento (obrigatório) +%% 5/2002 (version 4.0) +%% Modificação dos comandos "begindc" e "obj" +%% !!! Modificação da sintaxe destes comandos !!! +%% O comando "begindc" passou a ter um argumento (obrigatório) %% que nos permite especificar o tipo de grafo que estamos a %% querer especificar: %% "commdiag" (0), para diagramas comutativos %% "digraph" (1), para grafos orientados -%% "undigraph" (2), para grafos não orientados -%% O comando "obj" modificou a sua sintaxe passou a ter um (após -%% a especificação das coordenadas, um argumento opcional, um -%% argumento obrigatório, e um argumento opcional. O primeiro -%% argumento opcional dá-nos a etiqueta que serve como -%% referência para a especificação dos morfismos, na sua -%% ausência usa-se o argumento obrigatório para esse efeito, o -%% argumento obrigatório dá-nos o "conteúdo" do objecto, nos -%% diagramas comutativos é centrado no ponto dado pelas +%% "undigraph" (2), para grafos não orientados +%% O comando "obj" modificou a sua sintaxe passou a ter um (após +%% a especificação das coordenadas, um argumento opcional, um +%% argumento obrigatório, e um argumento opcional. O primeiro +%% argumento opcional dá-nos a etiqueta que serve como +%% referência para a especificação dos morfismos, na sua +%% ausência usa-se o argumento obrigatório para esse efeito, o +%% argumento obrigatório dá-nos o "conteúdo" do objecto, nos +%% diagramas comutativos é centrado no ponto dado pelas %% coordenadas sendo o argumento seguinte simplesmente ignorado, -%% nos grafos o "conteúdo" é colocado numa posição a norte, a -%% noroeste, a este, ..., sendo que a posição concreta é -%% especificada pelo último dos argumentos deste comando, o -%% valor por omissão é o "norte". -%% -%% 3/2003 (versão 4.1) -%% A pedido de Jon Barker <jeb1@soton.ac.uk> criei um novo tipo -%% de seta, a seta de sobrejecção. -%% Para já a dupla seta só fica bem nas setas horizontais ou -%% verticais. -%% 12/2004 (versão 4.1.1) -%% Nova versão das setas de sobrejecção que corrigue -%% completamente os problemas da solução anterior. -%% 3/2007 (versão 4.1.2) -%% Acrescenta linhas a tracejado e a ponteado +%% nos grafos o "conteúdo" é colocado numa posição a norte, a +%% noroeste, a este, ..., sendo que a posição concreta é +%% especificada pelo último dos argumentos deste comando, o +%% valor por omissão é o "norte". +%% +%% 3/2003 (version 4.1) +%% Responding to a request of Jon Barker <jeb1@soton.ac.uk> I +%% create a new type of arrow, the surjective arrow. +%% For now only horizontal and vertical versions, other angles +%% are poorly rendered. +%% 12/2004 (version 4.1.1) +%% New version for the surjective arrows, solve the problems +%% with the first implementation of this option. +%% 3/2007 (version 4.2) +%% Adds the "providespackage" directive that was missing. +%% Adds dashed lines, and dotted lines. +%% 5/2008 (version 4.2.1) +%% Deleting some counters, trying to avoid the problem "running +%% out of counters", that occurs because of the use of PiCTeX +%% and DCpic (only two...) +%% 8/2008 (version 4.3) +%% Thanks to Ruben Debeerst (debeerst@mathematik.uni-kassel.de), +%% he added a new arrow "equalline". After that I +%% decided to add: the doublearrow; the doublearrow with +%% opposite directions; the null arrow. This last can be used as +%% a simple form of adding new labels. +%%12/2008 (version 4.3.1) +%% The comand \id is internalised (\!id), it should be that way +%% from the begining because it is not to be used from the +%% outside. +%% The comand \dasharrow was changed to \dashArrow to avoid a +%% clash with the AMS command with the same name. +%%12/2009 (version 4.3.2) +%% There is a conflict between dcpic.sty and hyperref in current +%% texlive-2009 due to the one letter macro \d (thanks Thorsten +%% S <thorsten.schwander@gmail.com>). +%% The \d changed to \deuc (Euclidian Distance). The \x and \y +%% changed to \xO \yO %%-----------------//------------- -\catcode`!=11 % ***** THIS MUST NEVER BE OMITTED (Ver PiCTeX) +\catcode`!=11 % ***** THIS MUST NEVER BE OMITTED (See PiCTeX) \newcount\aux% \newcount\auxa% \newcount\auxb% -\newcount\m% -\newcount\n% -\newcount\x% -\newcount\y% +\newcount\xO% +\newcount\yO% \newcount\xl% \newcount\yl% -\newcount\d% +\newcount\deuc% \newcount\dnm% \newcount\xa% \newcount\xb% \newcount\xmed% \newcount\xc% \newcount\xd% +\newcount\xe +\newcount\xf \newcount\ya% \newcount\yb% \newcount\ymed% \newcount\yc% \newcount\yd -%% "variáveis globais" +\newcount\ye +\newcount\yf +%% "global variables" \newcount\expansao% -\newcount\tipografo% versão 4.0 -\newcount\distanciaobjmor% versão 4.0 -\newcount\tipoarco% versão 4.0 -%\newif\ifarredondada% versão 4.0 (valor inicial "false") +\newcount\tipografo% version 4.0 +\newcount\distanciaobjmor% version 4.0 +\newcount\tipoarco% version 4.0 +%\newif\ifarredondada% version 4.0 (initial value "false") \newif\ifpara% %% version 3.2 \newbox\caixa% @@ -352,7 +381,7 @@ \newcount\alt% \newcount\larg% \newcount\prof% -%% para os ajustes +%% for the triming \newcount\auxqx \newcount\auxqy \newif\ifajusta% @@ -389,7 +418,7 @@ %% %% the empty stack is not taken care %% the element is "kept" ("guardado") -\def\!guarda(#1)(#2,#3)(#4,#5,#6){\def\id{#1}% +\def\!guarda(#1)(#2,#3)(#4,#5,#6){\def\!id{#1}% \xaux=#2% \yaux=#3% \alt=#4% @@ -417,31 +446,36 @@ \def\!compara#1#2{\!comparaaux{#1}{#2}} -%%Comando Interno -%% Valor absoluto (absolute value) +%% Private Macro +%% Absolute Value) %% \absoluto{n}{absn} -%% entrada -%% n - natural -%% sa{\'\i}da -%% absn - o valor absoluto de n -\def\!absoluto#1#2{\n=#1% - \ifnum \n > 0 - #2=\n +%% input +%% n - integer +%% output +%% absn - |n| +\def\!absoluto#1#2{\aux=#1% + \ifnum \aux > 0 + #2=\aux \else - \multiply \n by -1 - #2=\n + \multiply \aux by -1 + #2=\aux \fi} %% Name definitions for edge types and directions \def\solidarrow{0} -\def\dasharrow{1} +\def\dashArrow{1} \def\solidline{2} \def\dashline{3} \def\dotline{4} \def\injectionarrow{5} \def\aplicationarrow{6} \def\surjectivearrow{7} +\def\equalline{8} +\def\doublearrow{9} +\def\doubleopposite{10} +\def\nullarrow{11} + %% Name definitions for edge label placement \def\atright{-1} \def\atleft{1} @@ -456,7 +490,7 @@ \def\undigraph{2} \def\cdigraph{3} \def\cundigraph{4} -%% Posicionamento da etiquetas nos grafos +%% Positioning of labels in graphs \def\pcent{0} \def\north{1} \def\northeast{2} @@ -499,29 +533,29 @@ \let\auxobj=#6% \ifcase \tipografo % diagramas comutativos \ifnum\number\aux=10 - \ajustadisttrue % se o valor é o valor por omissão ajusta + \ajustadisttrue % se o valor é o valor por omissão ajusta \else - \ajustadistfalse % caso contrário não ajusta + \ajustadistfalse % caso contrário não ajusta \fi - \else % grafos (dirigidos, não dirigidos, com molduras) + \else % grafos (dirigidos, não dirigidos, com molduras) \ajustadistfalse -% \or % grafos não dirigidos +% \or % grafos não dirigidos % \ajustadistfalse % \else % grafos dirigidos com molduras circulares nos objectos % \ifnum\number\aux=8 -% \ajustadisttrue % se o valor é o valor por omissão ajusta +% \ajustadisttrue % se o valor é o valor por omissão ajusta % \else -% \ajustadistfalse % caso contrário não ajusta +% \ajustadistfalse % caso contrário não ajusta % \fi \fi \ifajustadist -% \tiny Vou ajustar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \tiny Vou ajustar %%% % \ifnum\number\aux=10% verificar se s{\~a}o os valores por omiss{\~a}o \let\pilhaaux=\pilha% \loop% \!topo{\pilha}% \!retira{\pilha}% - \!compara{\id}{\auxobj}% + \!compara{\!id}{\auxobj}% \ifcompara\nvaziafalse \else\!pilhanvazia\pilha \fi% \ifnvazia% \repeat% @@ -542,7 +576,7 @@ \divide\larg by 131072 \divide\prof by 65536 \divide\alt by 65536 - \ifnum\number\y=\number\yl + \ifnum\number\yO=\number\yl %% Caso 1 -- seta horizontal %% %% divide-se por 131072 para se obter metade da largura da caixa em @@ -553,8 +587,8 @@ #5=\larg \fi \else - \ifnum\number\x=\number\xl - \ifnum\number\yl>\number\y + \ifnum\number\xO=\number\xl + \ifnum\number\yl>\number\yO %% Caso 2.1 -- seta vertical de cima para baixa %% \ifnum\number\alt>\aux @@ -574,10 +608,10 @@ %% Caso 3 -- seta obl{\'\i}qua %% Caso 3.1 de 315o a 45o; |x-xl|>|y-yl| e %% Caso 3.3 de 135o a 225o; |x-xl|>|y-yl|; Largura - \auxqx=\x + \auxqx=\xO \advance\auxqx by -\xl \!absoluto{\auxqx}{\auxqx}% - \auxqy=\y + \auxqy=\yO \advance\auxqy by -\yl \!absoluto{\auxqy}{\auxqy}% \ifnum\auxqx>\auxqy @@ -588,7 +622,7 @@ #5=\larg \else %% Caso 3.2 de 45o a 135o; |x-xl|<|y-yl| e y>0; Largura - \ifnum\yl>\y + \ifnum\yl>\yO \ifnum\larg<10 \larg=10 \fi @@ -613,35 +647,33 @@ %% sa{\'\i}da %% n - natural %% m - maior natural contido na raiz quadrada de n -\def\!raiz#1#2{\n=#1% - \m=1% +\def\!raiz#1#2{\auxa=#1% + \auxb=1% \loop - \aux=\m% + \aux=\auxb% \advance \aux by 1% \multiply \aux by \aux% - \ifnum \aux < \n% - \advance \m by 1% + \ifnum \aux < \auxa% + \advance \auxb by 1% \paratrue% - \else\ifnum \aux=\n% - \advance \m by 1% + \else\ifnum \aux=\auxa% + \advance \auxb by 1% \paratrue% \else\parafalse% \fi \fi \ifpara% \repeat -#2=\m} +#2=\auxb} -%%Comando Interno -%% Calcula os pontos de -%% come{\c c}o da "seta" -%% fim da "seta" -%% coloca{\c c}{\~a}o do s{\'\i}mbolo +%%Private Macro +%% Find the starting and ending points of the "arrow" and also the +%% label position (one coordinate at a time) %% %% ucoord{x1}{x2}{x3}{x4}{x5}{x6}{+|- 1} -%% entrada +%% Input %% x1,x2,x3,x4,x5 -%% sa{\'\i}da +%% Output %% x6 %% %% x2 - x1 @@ -655,13 +687,14 @@ \advance \aux by #3% #6=\aux} -%%Comando Interno -%% C{\'a}lculo do Quadrado da Dist{\^a}ncia Euclidiana entre dois pontos +%%Private Macro +%% Euclidean distance between two points +%% %% quadrado{n}{m}{l} -%% entrada -%% n - natural -%% m - natural -%% sa{\'\i}da +%% Input +%% n - natural number +%% m - natural number +%% Output %% l = (n-m)*(n-m) \def\!quadrado#1#2#3{\aux=#1% \advance \aux by -#2% @@ -725,42 +758,48 @@ \expansao=#2 \ifcase #1 \distanciaobjmor=10 - \tipoarco=0 % seta - \tipografo=0 % diagrama comutativo + \tipoarco=0 % arrow + \tipografo=0 % commutative diagram \or \distanciaobjmor=2 - \tipoarco=0 % seta - \tipografo=1 % grafo orientado + \tipoarco=0 % arrow + \tipografo=1 % directed graph \or \distanciaobjmor=1 - \tipoarco=2 % linha - \tipografo=2 % grafo não orientado + \tipoarco=2 % line + \tipografo=2 % undirected graph \or \distanciaobjmor=8 - \tipoarco=0 % seta - \tipografo=3 % grafo orientado + \tipoarco=0 % arrow + \tipografo=3 % directed graph % \arredondadotrue % objectos com molduras circulares \or \distanciaobjmor=8 - \tipoarco=2 % linha - \tipografo=4 % grafo não orientado + \tipoarco=2 % line + \tipografo=4 % undirected graph % \arredondadotrue % objectos com molduras circulares \fi} \def\enddc{\endpicture} +%% Public macro: "mor" %% -%% Comando para construir a "seta" entre dois objectos %% -%% Os pontos definidores da seta e da etiqueta respectiva s{\~a}o: +%% Funtion to built the "arrow" between two points +%% +%% The points that are uses to built all the elements of the "arrows" +%% are: %% -%% (xd,yd) +%% (xc,yc) %% o %% | %% o------o---------o---------o------o %%(x,y) (xa,ya) (xm,ym) (xb,yb)(xl,yl) %% +%% auxa - distance between (x,y) and (xa,ya), 10pt by default +%% auxb - distance between (xl,yl) and (xb,yb), 10pt by default +%% \def\mor{% \!ifnextchar({\!morxy}{\!morObjA}} \def\!morxy(#1,#2){% @@ -773,15 +812,14 @@ \loop% \!topo\pilha% \!retira\pilha% - \!compara{\id}{\objPartida}% + \!compara{\!id}{\objPartida}% \ifcompara \nvaziafalse \else \!pilhanvazia\pilha \fi% \ifnvazia% \repeat% \ifvazia% \ifdiferentes% %% -%% Mensagem de erro e atribui{\c c}{\~a}o de valores fict{\'\i}cios aos -%% argumentos dos comandos que se seguem. +%% error message and ficticious parameters %% Error: Incorrect label specification% \xaux=1% @@ -791,54 +829,53 @@ \let\pilha=\pilhaaux% \!ifnextchar({\!morxyl{\number\xaux}{\number\yaux}}{\!morObjB{\number\xaux}{\number\yaux}}} \def\!morObjB#1#2#3{% - \x=#1 - \y=#2 + \xO=#1 + \yO=#2 \def\objChegada{#3}% \let\pilhaaux=\pilha% \loop \!topo\pilha % \!retira\pilha% - \!compara{\id}{\objChegada}% + \!compara{\!id}{\objChegada}% \ifcompara \nvaziafalse \else \!pilhanvazia\pilha \fi \ifnvazia \repeat \ifvazia \ifdiferentes% %% -%% Mensagem de erro e atribui{\c c}{\~a}o de valores fict{\'\i}cios aos -%% argumentos dos comandos que se seguem. +%% error message and ficticious parameters %% Error: Incorrect label specification - \xaux=\x% - \advance\xaux by \x% - \yaux=\y% - \advance\yaux by \y% + \xaux=\xO% + \advance\xaux by \xO% + \yaux=\yO% + \advance\yaux by \yO% \fi \fi \let\pilha=\pilhaaux - \!ifnextchar[{\!mora{\number\x}{\number\y}{\number\xaux}{\number\yaux}}{\!mora{\number\x}{\number\y}{\number\xaux}{\number\yaux}[\number\distanciaobjmor,\number\distanciaobjmor]}} + \!ifnextchar[{\!mora{\number\xO}{\number\yO}{\number\xaux}{\number\yaux}}{\!mora{\number\xO}{\number\yO}{\number\xaux}{\number\yaux}[\number\distanciaobjmor,\number\distanciaobjmor]}} \def\!mora#1#2#3#4[#5,#6]#7{% \!ifnextchar[{\!morb{#1}{#2}{#3}{#4}{#5}{#6}{#7}}{\!morb{#1}{#2}{#3}{#4}{#5}{#6}{#7}[1,\number\tipoarco] }} -\def\!morb#1#2#3#4#5#6#7[#8,#9]{\x=#1% - \y=#2% +\def\!morb#1#2#3#4#5#6#7[#8,#9]{\xO=#1% + \yO=#2% \xl=#3% \yl=#4% - \multiply \x by \expansao% - \multiply \y by \expansao% + \multiply \xO by \expansao% + \multiply \yO by \expansao% \multiply \xl by \expansao% \multiply \yl by \expansao% %% -%% calcular a dist{\^a}ncia Euclidiana entre dois pontos +%% Euclidean distance between two points %% d = \sqrt((x-xl)^2+(y-yl)^2) %% - \!quadrado{\number\x}{\number\xl}{\auxa}% - \!quadrado{\number\y}{\number\yl}{\auxb}% - \d=\auxa% - \advance \d by \auxb% - \!raiz{\d}{\d}% + \!quadrado{\number\xO}{\number\xl}{\auxa}% + \!quadrado{\number\yO}{\number\yl}{\auxb}% + \deuc=\auxa% + \advance \deuc by \auxb% + \!raiz{\deuc}{\deuc}% %% -%% o ponto (xa,ya) est{\'a} {\`a} dist{\^a}ncia #5 (valor por omiss{\~a}o 10) do ponto -%% (x,y) +%% the point (xa,ya) is at a distance #5 (default value 10) from the +%% point (x,y) %% %% como existem dois pontos em considera{\c c}{\~a}o, o ponto de partida e o %% ponto de chegada, vai sei necess{\'a}rio recuperar de novo os seus @@ -846,7 +883,7 @@ \auxa=#5 \!compara{\objNulo}{\objPartida}% \ifdiferentes% S{\'o} vai fazer o ajuste quando {\'e} necess{\'a}rio - \!ajusta{\x}{\xl}{\y}{\yl}{\auxa}{\objPartida}% + \!ajusta{\xO}{\xl}{\yO}{\yl}{\auxa}{\objPartida}% \ajustatrue \def\objPartida{}% re-inicializar o valor do Objecto de Partida \fi @@ -854,25 +891,25 @@ %% dos morfismos de injec{\c c}{\~a}o. \guardaauxa=\auxa %% - \!ucoord{\number\x}{\number\xl}{\number\x}{\auxa}{\number\d}{\xa}{1}% - \!ucoord{\number\y}{\number\yl}{\number\y}{\auxa}{\number\d}{\ya}{1}% + \!ucoord{\number\xO}{\number\xl}{\number\xO}{\auxa}{\number\deuc}{\xa}{1}% + \!ucoord{\number\yO}{\number\yl}{\number\yO}{\auxa}{\number\deuc}{\ya}{1}% %% auxa vai ter o valor da dist{\^a}ncia entre os objectos menos a %% dist{\^a}ncia da seta ao objecto (10 por omiss{\~a}o) - \auxa=\d% + \auxa=\deuc% %% -%% o ponto (xb,yb) est{\'a} {\`a} dist{\^a}ncia #6 (valor por omiss{\~a}o 10) do ponto -%% (xl,yl) +%% the point (xb,yb) is at a distance #6 (default value 10) from the +%% point (xl,yl) %% \auxb=#6 \!compara{\objNulo}{\objChegada}% \ifdiferentes% S{\'o} vai fazer o ajuste quando {\'e} necess{\'a}rio % Vou ajustar - \!ajusta{\x}{\xl}{\y}{\yl}{\auxb}{\objChegada}% + \!ajusta{\xO}{\xl}{\yO}{\yl}{\auxb}{\objChegada}% \def\objChegada{}% re-inicializar o valor do Objecto de Chegada \fi \advance \auxa by -\auxb% - \!ucoord{\number\x}{\number\xl}{\number\x}{\number\auxa}{\number\d}{\xb}{1}% - \!ucoord{\number\y}{\number\yl}{\number\y}{\number\auxa}{\number\d}{\yb}{1}% + \!ucoord{\number\xO}{\number\xl}{\number\xO}{\number\auxa}{\number\deuc}{\xb}{1}% + \!ucoord{\number\yO}{\number\yl}{\number\yO}{\number\auxa}{\number\deuc}{\yb}{1}% \xmed=\xa% \advance \xmed by \xb% \divide \xmed by 2 @@ -880,81 +917,175 @@ \advance \ymed by \yb% \divide \ymed by 2 %% +%% find the coordinates of the label position: (xc,yc) +%% +%% after this the values of xmed and ymed are no longer important +%% + \!distnomemor{\number\xO}{\number\yO}{\number\xl}{\number\yl}{#7}{\dnm}% + \!ucoord{\number\yO}{\number\yl}{\number\xmed}{\number\dnm}{\number\deuc}{\xc}{-#8}% + \!ucoord{\number\xO}{\number\xl}{\number\ymed}{\number\dnm}{\number\deuc}{\yc}{#8}% %% - \!distnomemor{\number\x}{\number\y}{\number\xl}{\number\yl}{#7}{\dnm}% - \!ucoord{\number\y}{\number\yl}{\number\xmed}{\number\dnm}{\number\d}{\xc}{-#8}% - \!ucoord{\number\x}{\number\xl}{\number\ymed}{\number\dnm}{\number\d}{\yc}{#8}% -\ifcase #9 % Seta S{\'o}lida +%% draw the "arrow" +%% +\ifcase #9 % 0=solid arrow \arrow <4pt> [.2,1.1] from {\xa} {\ya} to {\xb} {\yb} -\or % Seta a Tracejado +\or % 1=dashed arrow \setdashes \arrow <4pt> [.2,1.1] from {\xa} {\ya} to {\xb} {\yb} \setsolid -\or % Linha S{\'o}lida +\or % 2=solid line \setlinear \plot {\xa} {\ya} {\xb} {\yb} / -\or % Linha Tracejado +\or % 3=dashed line \setdashes \setlinear \plot {\xa} {\ya} {\xb} {\yb} / \setsolid -\or % Linha a Ponteado +\or % 4=dotted line \setdots \setlinear \plot {\xa} {\ya} {\xb} {\yb} / \setsolid -\or % Seta de Injec{\c c}{\~a}o +\or % 5=injective arrow %% C{\'a}lculos auxiliares %% -%% 3 valor para o raio do "rabo" da "seta" +%% 3 units, the radius for the tail of the arrow %% %% repor o valor de auxa \auxa=\guardaauxa %% dar a compensa{\c c}{\~a}o para o "rabo" \advance \auxa by 3% %% -%% IMPORTANTE os valores de xa e ya v{\~a}o ser alterados +%% Note: the values of (xa,ya) will be modified, they will be +%% "pushed" further away from (x,y) in order to acomodate the tail +%% of the "arrow" +%% +%% find the point (xd,yd), the center of a 3pt circle %% - \!ucoord{\number\x}{\number\xl}{\number\x}{\number\auxa}{\number\d}{\xa}{1}% - \!ucoord{\number\y}{\number\yl}{\number\y}{\number\auxa}{\number\d}{\ya}{1}% - \!ucoord{\number\y}{\number\yl}{\number\xa}{3}{\number\d}{\xd}{-1}% - \!ucoord{\number\x}{\number\xl}{\number\ya}{3}{\number\d}{\yd}{1}% -%% Constru{\c c}{\~a}o da "seta" + \!ucoord{\number\xO}{\number\xl}{\number\xO}{\number\auxa}{\number\deuc}{\xa}{1}% + \!ucoord{\number\yO}{\number\yl}{\number\yO}{\number\auxa}{\number\deuc}{\ya}{1}% + \!ucoord{\number\yO}{\number\yl}{\number\xa}{3}{\number\deuc}{\xd}{-1}% + \!ucoord{\number\xO}{\number\xl}{\number\ya}{3}{\number\deuc}{\yd}{1}% +%% building the "arrow" \arrow <4pt> [.2,1.1] from {\xa} {\ya} to {\xb} {\yb} -%% e do seu "rabo" +%% and its "tail" \circulararc -180 degrees from {\xa} {\ya} center at {\xd} {\yd} -\or % Seta de Aplica{\c c}{\~a}o ("|-->") - \auxa=3% valor para o meio-segmento do "rabo" da "seta" -%% c{\'a}lculo dos pontos (xmed,ymed) e (xd,yd) para o segmento de recta que -%% define o "rabo" da seta - \!ucoord{\number\y}{\number\yl}{\number\xa}{\number\auxa}{\number\d}{\xmed}{-1}% - \!ucoord{\number\x}{\number\xl}{\number\ya}{\number\auxa}{\number\d}{\ymed}{1}% - \!ucoord{\number\y}{\number\yl}{\number\xa}{\number\auxa}{\number\d}{\xd}{1}% - \!ucoord{\number\x}{\number\xl}{\number\ya}{\number\auxa}{\number\d}{\yd}{-1}% -%% Constru{\c c}{\~a}o da "seta" +\or % 6=maps "arrow" ("|-->") + \auxa=3 +%% +%% Note: the values of xmed and ymed will be modified +%% +%% find the two points that defines the tail of the arrow (segment +%% (xmed,ymed)(xd,yd)) + \!ucoord{\number\yO}{\number\yl}{\number\xa}{\number\auxa}{\number\deuc}{\xmed}{-1}% + \!ucoord{\number\xO}{\number\xl}{\number\ya}{\number\auxa}{\number\deuc}{\ymed}{1}% + \!ucoord{\number\yO}{\number\yl}{\number\xa}{\number\auxa}{\number\deuc}{\xd}{1}% + \!ucoord{\number\xO}{\number\xl}{\number\ya}{\number\auxa}{\number\deuc}{\yd}{-1}% +%% building the "arrow" \arrow <4pt> [.2,1.1] from {\xa} {\ya} to {\xb} {\yb} -%% e do seu "rabo" +%% and its "tail" \setlinear \plot {\xmed} {\ymed} {\xd} {\yd} / -\or % Seta de Sobrejec{\c c}{\~a}o ("-->>") +\or % 7=surjective arrow ("-->>") +%% building arrow with the first tip \arrow <4pt> [.2,1.1] from {\xa} {\ya} to {\xb} {\yb} -%% e da segunda "seta" +%% and the second tip \setlinear \arrow <6pt> [0,.72] from {\xa} {\ya} to {\xb} {\yb} +\or % 8=equalline +%% by Ruben Debeerst: equal-line +%% +%% sets the separation (distance) between the two parallel lines, if +%% horizontal or vertical 1pt is enough, if not 2pt +\auxa=2 +\ifnum\number\yO=\number\yl +\auxa=1 +\fi +\ifnum\number\xO=\number\xl +\auxa=1 +\fi +%% the two parallel lines will be given by (xmed,ymed)(xd,yd), and +%% (xe,ye)(xf,yf) + \!ucoord{\number\yO}{\number\yl}{\number\xa}{\number\auxa}{\number\deuc}{\xmed}{-1}% + \!ucoord{\number\xO}{\number\xl}{\number\ya}{\number\auxa}{\number\deuc}{\ymed}{1}% + \!ucoord{\number\yO}{\number\yl}{\number\xa}{\number\auxa}{\number\deuc}{\xd}{1}% + \!ucoord{\number\xO}{\number\xl}{\number\ya}{\number\auxa}{\number\deuc}{\yd}{-1}% + + \!ucoord{\number\yO}{\number\yl}{\number\xb}{\number\auxa}{\number\deuc}{\xe}{-1}% + \!ucoord{\number\xO}{\number\xl}{\number\yb}{\number\auxa}{\number\deuc}{\ye}{1}% + \!ucoord{\number\yO}{\number\yl}{\number\xb}{\number\auxa}{\number\deuc}{\xf}{1}% + \!ucoord{\number\xO}{\number\xl}{\number\yb}{\number\auxa}{\number\deuc}{\yf}{-1}% + \setlinear + \plot {\xmed} {\ymed} {\xe} {\ye} / + \plot {\xd} {\yd} {\xf} {\yf} / +\or % 9=double arrow +%% +%% sets the separation (distance) between the two parallel lines, if +%% horizontal or vertical 2pt is enough, if not 3pt. The extra space +%% is needed because of the arrow tip. +\auxa=3 +\ifnum\number\yO=\number\yl +\auxa=2 +\fi +\ifnum\number\xO=\number\xl +\auxa=2 +\fi +%% the two parallel lines will be given by (xmed,ymed)(xd,yd), and +%% (xe,ye)(xf,yf) + \!ucoord{\number\yO}{\number\yl}{\number\xa}{\number\auxa}{\number\deuc}{\xmed}{-1}% + \!ucoord{\number\xO}{\number\xl}{\number\ya}{\number\auxa}{\number\deuc}{\ymed}{1}% + \!ucoord{\number\yO}{\number\yl}{\number\xa}{\number\auxa}{\number\deuc}{\xd}{1}% + \!ucoord{\number\xO}{\number\xl}{\number\ya}{\number\auxa}{\number\deuc}{\yd}{-1}% + + \!ucoord{\number\yO}{\number\yl}{\number\xb}{\number\auxa}{\number\deuc}{\xe}{-1}% + \!ucoord{\number\xO}{\number\xl}{\number\yb}{\number\auxa}{\number\deuc}{\ye}{1}% + \!ucoord{\number\yO}{\number\yl}{\number\xb}{\number\auxa}{\number\deuc}{\xf}{1}% + \!ucoord{\number\xO}{\number\xl}{\number\yb}{\number\auxa}{\number\deuc}{\yf}{-1}% + \arrow <4pt> [.2,1.1] from {\xmed} {\ymed} to {\xe} {\ye} + \arrow <4pt> [.2,1.1] from {\xd} {\yd} to {\xf} {\yf} +\or % 10=double arrow, opposite directions +%% +%% sets the separation (distance) between the two parallel lines, if +%% horizontal or vertical 2pt is enough, if not 3pt. The extra space +%% is needed because of the arrow tip. +\auxa=3 +\ifnum\number\yO=\number\yl +\auxa=2 +\fi +\ifnum\number\xO=\number\xl +\auxa=2 +\fi +%% the two parallel lines will be given by (xmed,ymed)(xd,yd), and +%% (xe,ye)(xf,yf) + \!ucoord{\number\yO}{\number\yl}{\number\xa}{\number\auxa}{\number\deuc}{\xmed}{-1}% + \!ucoord{\number\xO}{\number\xl}{\number\ya}{\number\auxa}{\number\deuc}{\ymed}{1}% + \!ucoord{\number\yO}{\number\yl}{\number\xa}{\number\auxa}{\number\deuc}{\xd}{1}% + \!ucoord{\number\xO}{\number\xl}{\number\ya}{\number\auxa}{\number\deuc}{\yd}{-1}% + + \!ucoord{\number\yO}{\number\yl}{\number\xb}{\number\auxa}{\number\deuc}{\xe}{-1}% + \!ucoord{\number\xO}{\number\xl}{\number\yb}{\number\auxa}{\number\deuc}{\ye}{1}% + \!ucoord{\number\yO}{\number\yl}{\number\xb}{\number\auxa}{\number\deuc}{\xf}{1}% + \!ucoord{\number\xO}{\number\xl}{\number\yb}{\number\auxa}{\number\deuc}{\yf}{-1}% + \arrow <4pt> [.2,1.1] from {\xmed} {\ymed} to {\xe} {\ye} + \arrow <4pt> [.2,1.1] from {\xf} {\yf} to {\xd} {\yd} +\or % 11=null arrow (no arrow, only a label) +%% +%% does not draw the arrow, it allows to put two labels in one "arrow" +%% \fi -%% Coloca{\c c}{\~a}o do nome do morfismo. +%% The label positioning. %% Se os morfismos s{\~a}o horizontais ou verticais constro{\'\i} uma caixa %% centrada no ponto pr{\'e}viamente calculado. Se as setas s{\~a}o %% obl{\'\i}quas coloca a caixa de forma a n{\~a}o colidir com o morfismo %% tendo em aten{\c c}{\~a}o o quadrante assim como a posi{\c c}{\~a}o %% relativa do morfismo e do respectivo nome. \auxa=\xl -\advance \auxa by -\x% +\advance \auxa by -\xO% \ifnum \auxa=0 \put {#7} at {\xc} {\yc} \else \auxb=\yl - \advance \auxb by -\y% + \advance \auxb by -\yO% \ifnum \auxb=0 \put {#7} at {\xc} {\yc} \else \ifnum \auxa > 0 @@ -1000,21 +1131,21 @@ %% sintaxe dos restantes comandos %% \def\modifplot(#1{\!modifqcurve #1} -\def\!modifqcurve(#1,#2){\x=#1% - \y=#2% - \multiply \x by \expansao% - \multiply \y by \expansao% - \!start (\x,\y) +\def\!modifqcurve(#1,#2){\xO=#1% + \yO=#2% + \multiply \xO by \expansao% + \multiply \yO by \expansao% + \!start (\xO,\yO) \!modifQjoin} -\def\!modifQjoin(#1,#2)(#3,#4){\x=#1% - \y=#2% +\def\!modifQjoin(#1,#2)(#3,#4){\xO=#1% + \yO=#2% \xl=#3% \yl=#4% - \multiply \x by \expansao% - \multiply \y by \expansao% + \multiply \xO by \expansao% + \multiply \yO by \expansao% \multiply \xl by \expansao% \multiply \yl by \expansao% - \!qjoin (\x,\y) (\xl,\yl) % \!qjoin is defined in QUADRATIC + \!qjoin (\xO,\yO) (\xl,\yl) % \!qjoin is defined in QUADRATIC \!ifnextchar){\!fim}{\!modifQjoin}} \def\!fim){\ignorespaces} @@ -1029,19 +1160,19 @@ \!maispontosxy} \def\!maispontosxy(#1,#2)(#3,#4){% \!ifnextchar){\!fimxy#3,#4}{\!maispontosxy}} -\def\!fimxy#1,#2){\x=#1% - \y=#2 - \multiply \x by \expansao - \multiply \y by \expansao - \xl=\x% - \yl=\y% +\def\!fimxy#1,#2){\xO=#1% + \yO=#2 + \multiply \xO by \expansao + \multiply \yO by \expansao + \xl=\xO% + \yl=\yO% \aux=1% \multiply \aux by \auxa% \advance\xl by \aux% \aux=1% \multiply \aux by \auxb% \advance\yl by \aux% - \arrow <4pt> [.2,1.1] from {\x} {\y} to {\xl} {\yl}} + \arrow <4pt> [.2,1.1] from {\xO} {\yO} to {\xl} {\yl}} %% @@ -1076,11 +1207,11 @@ \modifplot#1% Desenhar o arco \fi % seta de injec{\c c}{\~a}o %% coloca{\c c}{\~a}o da etiqueta do morfismo - \x=#3% - \y=#4% - \multiply \x by \expansao% - \multiply \y by \expansao% - \put {#5} at {\x} {\y}} + \xO=#3% + \yO=#4% + \multiply \xO by \expansao% + \multiply \yO by \expansao% + \put {#5} at {\xO} {\yO}} %% %% Comando para construir os Objectos @@ -1091,15 +1222,15 @@ \def\!obja#1#2[#3]#4{% \!ifnextchar[{\!objb{#1}{#2}{#3}{#4}}{\!objb{#1}{#2}{#3}{#4}[1]}} \def\!objb#1#2#3#4[#5]{% - \x=#1% - \y=#2% + \xO=#1% + \yO=#2% \def\!pinta{\normalsize$\bullet$}% para definir o tamanho normal das pintas \def\!nulo{Nulo}% \def\!arg{#3}% \!compara{\!arg}{\!nulo}% \ifcompara\def\!arg{#4}\fi% - \multiply \x by \expansao% - \multiply \y by \expansao% + \multiply \xO by \expansao% + \multiply \yO by \expansao% \setbox\caixa=\hbox{#4}% \!coloca{(\!arg)(#1,#2)(\number\ht\caixa,\number\wd\caixa,\number\dp\caixa)}{\pilha}% \auxa=\wd\caixa \divide \auxa by 131072 @@ -1115,116 +1246,116 @@ % \auxb=\dp\caixa \divide \auxb by 131072 % \advance \auxb by 8 \ifcase \tipografo % diagramas comutativos - \put{#4} at {\x} {\y} + \put{#4} at {\xO} {\yO} \or % grafos dirigidos \ifcase #5 % c=0 - \put{#4} at {\x} {\y} + \put{#4} at {\xO} {\yO} \or % n=1 - \put{\!pinta} at {\x} {\y} - \advance \y by \number\auxb % height+depth+5 - \put{#4} at {\x} {\y} + \put{\!pinta} at {\xO} {\yO} + \advance \yO by \number\auxb % height+depth+5 + \put{#4} at {\xO} {\yO} \or % ne=2 - \put{\!pinta} at {\x} {\y} + \put{\!pinta} at {\xO} {\yO} \advance \auxa by -2 % para fazer o ajuste (imperfeito) - \advance \auxb by -2 % ao raio da circunferência de centro (x,y) - \advance \x by \number\auxa % width+5 - \advance \y by \number\auxb % height+depth+5 - \put{#4} at {\x} {\y} + \advance \auxb by -2 % ao raio da circunferencia de centro (x,y) + \advance \xO by \number\auxa % width+5 + \advance \yO by \number\auxb % height+depth+5 + \put{#4} at {\xO} {\yO} \or % e=3 - \put{\!pinta} at {\x} {\y} - \advance \x by \number\auxa % width+5 - \put{#4} at {\x} {\y} + \put{\!pinta} at {\xO} {\yO} + \advance \xO by \number\auxa % width+5 + \put{#4} at {\xO} {\yO} \or % se=4 - \put{\!pinta} at {\x} {\y} + \put{\!pinta} at {\xO} {\yO} \advance \auxa by -2 % para fazer o ajuste (imperfeito) - \advance \auxb by -2 % ao raio da circunferência de centro (x,y) - \advance \x by \number\auxa % width+5 - \advance \y by -\number\auxb % height+depth+5 - \put{#4} at {\x} {\y} + \advance \auxb by -2 % ao raio da circunferencia de centro (x,y) + \advance \xO by \number\auxa % width+5 + \advance \yO by -\number\auxb % height+depth+5 + \put{#4} at {\xO} {\yO} \or % s=5 - \put{\!pinta} at {\x} {\y} - \advance \y by -\number\auxb % height+depth+5 - \put{#4} at {\x} {\y} + \put{\!pinta} at {\xO} {\yO} + \advance \yO by -\number\auxb % height+depth+5 + \put{#4} at {\xO} {\yO} \or % sw=6 - \put{\!pinta} at {\x} {\y} + \put{\!pinta} at {\xO} {\yO} \advance \auxa by -2 % para fazer o ajuste (imperfeito) - \advance \auxb by -2 % ao raio da circunferência de centro (x,y) - \advance \x by -\number\auxa % width+5 - \advance \y by -\number\auxb % height+depth+5 - \put{#4} at {\x} {\y} + \advance \auxb by -2 % ao raio da circunferencia de centro (x,y) + \advance \xO by -\number\auxa % width+5 + \advance \yO by -\number\auxb % height+depth+5 + \put{#4} at {\xO} {\yO} \or % w=7 - \put{\!pinta} at {\x} {\y} - \advance \x by -\number\auxa % width+5 - \put{#4} at {\x} {\y} + \put{\!pinta} at {\xO} {\yO} + \advance \xO by -\number\auxa % width+5 + \put{#4} at {\xO} {\yO} \or % nw=8 - \put{\!pinta} at {\x} {\y} + \put{\!pinta} at {\xO} {\yO} \advance \auxa by -2 % para fazer o ajuste (imperfeito) - \advance \auxb by -2 % ao raio da circunferência de centro (x,y) - \advance \x by -\number\auxa % width+5 - \advance \y by \number\auxb % height+depth+5 - \put{#4} at {\x} {\y} + \advance \auxb by -2 % ao raio da circunferencia de centro (x,y) + \advance \xO by -\number\auxa % width+5 + \advance \yO by \number\auxb % height+depth+5 + \put{#4} at {\xO} {\yO} \fi - \or % grafos não dirigidos + \or % grafos nao dirigidos \ifcase #5 % c=0 - \put{#4} at {\x} {\y} + \put{#4} at {\xO} {\yO} \or % n=1 - \put{\!pinta} at {\x} {\y} - \advance \y by \number\auxb % height+depth+5 - \put{#4} at {\x} {\y} + \put{\!pinta} at {\xO} {\yO} + \advance \yO by \number\auxb % height+depth+5 + \put{#4} at {\xO} {\yO} \or % ne=2 - \put{\!pinta} at {\x} {\y} + \put{\!pinta} at {\xO} {\yO} \advance \auxa by -2 % para fazer o ajuste (imperfeito) - \advance \auxb by -2 % ao raio da circunferência de centro (x,y) - \advance \x by \number\auxa % width+5 - \advance \y by \number\auxb % height+depth+5 - \put{#4} at {\x} {\y} + \advance \auxb by -2 % ao raio da circunferencia de centro (x,y) + \advance \xO by \number\auxa % width+5 + \advance \yO by \number\auxb % height+depth+5 + \put{#4} at {\xO} {\yO} \or % e=3 - \put{\!pinta} at {\x} {\y} - \advance \x by \number\auxa % width+5 - \put{#4} at {\x} {\y} + \put{\!pinta} at {\xO} {\yO} + \advance \xO by \number\auxa % width+5 + \put{#4} at {\xO} {\yO} \or % se=4 - \put{\!pinta} at {\x} {\y} + \put{\!pinta} at {\xO} {\yO} \advance \auxa by -2 % ver acima \advance \auxb by -2 - \advance \x by \number\auxa % width+5 - \advance \y by -\number\auxb % height+depth+5 - \put{#4} at {\x} {\y} + \advance \xO by \number\auxa % width+5 + \advance \yO by -\number\auxb % height+depth+5 + \put{#4} at {\xO} {\yO} \or % s=5 - \put{\!pinta} at {\x} {\y} - \advance \y by -\number\auxb % height+depth+5 - \put{#4} at {\x} {\y} + \put{\!pinta} at {\xO} {\yO} + \advance \yO by -\number\auxb % height+depth+5 + \put{#4} at {\xO} {\yO} \or % sw=6 - \put{\!pinta} at {\x} {\y} + \put{\!pinta} at {\xO} {\yO} \advance \auxa by -2 % ver acima \advance \auxb by -2 - \advance \x by -\number\auxa % width+5 - \advance \y by -\number\auxb % height+depth+5 - \put{#4} at {\x} {\y} + \advance \xO by -\number\auxa % width+5 + \advance \yO by -\number\auxb % height+depth+5 + \put{#4} at {\xO} {\yO} \or % w=7 - \put{\!pinta} at {\x} {\y} - \advance \x by -\number\auxa % width+5 - \put{#4} at {\x} {\y} + \put{\!pinta} at {\xO} {\yO} + \advance \xO by -\number\auxa % width+5 + \put{#4} at {\xO} {\yO} \or % nw=8 - \put{\!pinta} at {\x} {\y} + \put{\!pinta} at {\xO} {\yO} \advance \auxa by -2 % ver acima \advance \auxb by -2 - \advance \x by -\number\auxa % width+5 - \advance \y by \number\auxb % height+depth+5 - \put{#4} at {\x} {\y} + \advance \xO by -\number\auxa % width+5 + \advance \yO by \number\auxb % height+depth+5 + \put{#4} at {\xO} {\yO} \fi % \or % grafos dirigidos com molduras circulares nos objectos % \advance \auxa by 4 -% \put{\circle{\auxa}} [Bl] at {\x} {\y} -% \put{#4} at {\x} {\y} -% \or % grafos não dirigidos com molduras circulares nos objectos +% \put{\circle{\auxa}} [Bl] at {\xO} {\yO} +% \put{#4} at {\xO} {\yO} +% \or % grafos não dirigidos com molduras circulares nos objectos \else % grafos com molduras circulares nos objectos - \ifnum\auxa<\auxb % determina a maior das dimensões + \ifnum\auxa<\auxb % determina a maior das dimensões \aux=\auxb \else \aux=\auxa \fi -% se a largura da caixa é menor do que 1em então o tamanho -% tamanho é ajustado para esse valor mínimo +% se a largura da caixa é menor do que 1em então o tamanho +% tamanho é ajustado para esse valor mÃnimo \ifdim\wd\caixa<1em \dimen99 = 1em \aux=\dimen99 \divide \aux by 131072 @@ -1233,15 +1364,15 @@ \advance\aux by -2 %folga entre o objecto e a moldura \multiply\aux by 2 % \ifnum\aux<30 - \put{\circle{\aux}} [Bl] at {\x} {\y} + \put{\circle{\aux}} [Bl] at {\xO} {\yO} \else \multiply\auxa by 2 \multiply\auxb by 2 - \put{\oval(\auxa,\auxb)} [Bl] at {\x} {\y} + \put{\oval(\auxa,\auxb)} [Bl] at {\xO} {\yO} \fi - \put{#4} at {\x} {\y} + \put{#4} at {\xO} {\yO} \fi } -\catcode`!=12 % ***** THIS MUST NEVER BE OMITTED (Ver PiCTeX) +\catcode`!=12 % ***** THIS MUST NEVER BE OMITTED (see PiCTeX) |