[OS X TeX] crossings in pst node

Nitecki, Zbigniew H. Zbigniew.Nitecki at tufts.edu
Mon Jun 13 18:12:38 EDT 2016


Yes, that works very nicely (though to get a visible gap I had to use black line width 0.8 pt (I think that is the default) and white line width 4.5 pt.

A different but related question: is it possible to do arithmetic inside one of these macros?

I have set it up so that the node at integer coordinates (i,j) is called Vij.  Then I have two macros, one for an edge joining Vij to V(i+1)j, but can only do it by entering i, j, and i+1 by hand:
\stay{i}{i+1}{j}, defined by

\newcommand{\stay}[3]{\ncline{V#1#3}{V#2#3}}%
% Usage: [V13,V23]: 2=1+1, and join position 3 at level 1 to itself

 and another for two edges,one  joining Vij to V(i+1)(j+1) over one joining Vi(j+1) to V(i+1)j:
\cross{i}{i+1}{j}{j+1}(or reverse j and j+1 to get a negative crossing) defined by

\newcommand{\cross}[4]{
\ncline{V#1#4}{V#2#3}
\ncline[linewidth=4.5pt, linecolor=white]{V#1#3}{V#2#4}
\ncline[linewidth=0.8pt, linecolor=black]{V#1#3}{V#2#4}
} %Usage: [V13,V24] crosses over [V14,V23]--ie,2=1+1, and cross 3 to 4 (over)

It would be convenient to get two better levels of efficiency:

1. Redefine \stay so that only i and j need be entered, i+1 being computed from this and entered automatically;
similarly enter only i and j for cross, computing i+1 and j+1 internally;

2. Combine these to only enter i and j, and get a crossing of [Vij,V(i+1)(j+1)] over [Vi(j+1),V(i+1)j], and “stay” for all other positions between level i and level i+1.

For (1) I am not sure whether there is an option, and if so should I use the reverse Polish notation used by Metafont; and for (2) I don’t know if one can insert a kind of “if…then..” loop inside one of these commands.

Any information/suggestions gratefully accepted.  The current way of doing it is counterintuitive and prone to error.

Here is the code I have presently, and the output:


On Jun 13, 2016, at 16:18, Nitecki, Zbigniew H. <Zbigniew.Nitecki at tufts.edu<mailto:Zbigniew.Nitecki at tufts.edu>> wrote:

Nice idea—thanks.  I’ll try it.
Z
On Jun 13, 2016, at 13:43, Michael Sharpe <msharpe at ucsd.edu<mailto:msharpe at ucsd.edu>> wrote:


On Jun 13, 2016, at 7:02 AM, Nitecki, Zbigniew H. <Zbigniew.Nitecki at tufts.edu<mailto:Zbigniew.Nitecki at tufts.edu>> wrote:

In trying to create braid diagrams, I would like (in an automatic way) to create crossings which go “over” other crossings.  That is, something like the \rput* option, that is, an \ncline{A}{B} which, if it crosses an earlier \ncline{C}{D}, dominates it, in the sense that there is a slight space around \ncline{A}{B} so that \ncline{C}{D} “breaks” at the crossing point.  My first guess, \ncline* , has a totally different effect—the unstarred \ncline becomes totally invisible.

Is there such an option?  Of course a workaround is to give \ncline{C}{D} linestyle=dashed, but the standard picture is to only have a break near the crossing, otherwise it is simply a straight line.


You can achieve this effect by drawing each node connection using two passes. On the first pass, draw a white curve about 2pt wider than your standard curve width, and draw the real node connection on the second pass. This can all be put into a small macro, for efficiency.

Michael


----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://www.esm.psu.edu/~gray/tex/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
               https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex


Zbigniew Nitecki
Department of Mathematics
Tufts University
Medford, MA 02155

telephones:
Office    (617)627-3843
Dept.    (617)627-3234
Dept. fax    (617)627-3966
http://www.tufts.edu/~znitecki/




----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://www.esm.psu.edu/~gray/tex/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
               https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex


Zbigniew Nitecki
Department of Mathematics
Tufts University
Medford, MA 02155

telephones:
Office    (617)627-3843
Dept.    (617)627-3234
Dept. fax    (617)627-3966
http://www.tufts.edu/~znitecki/




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20160613/db26a6d4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BraidPictureTest.tex
Type: application/octet-stream
Size: 1789 bytes
Desc: BraidPictureTest.tex
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20160613/db26a6d4/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BraidPictureTest.pdf
Type: application/pdf
Size: 7785 bytes
Desc: BraidPictureTest.pdf
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20160613/db26a6d4/attachment.pdf>


More information about the MacOSX-TeX mailing list