I don't really get the question so I hope this is what you wanted. If you include a full document (such that we copy paste and see the problem on our systems) things are much more easier.
Here, you can change the default setting within a scope but your block
style had a node distance
which was resetting every time it is issued. I've made it 2mm such that we can see the difference easier.
\documentclass[tikz]{standalone}
\usetikzlibrary{arrows,shapes.geometric,positioning}
\begin{document}
\begin{tikzpicture}[decision/.style={diamond, draw, text width=4.5em, text badly centered, node distance=3.5cm, inner sep=0pt},
block/.style ={rectangle, draw, text width=6em, text centered, rounded corners, minimum height=4em, minimum height=2em},
cloud/.style ={draw, ellipse, minimum height=2em},
line/.style ={draw,-latex'},
node distance = 1cm,
auto]
\node [block] (1st) {1st};
\node [block, right= of 1st] (2nd1) {2nd1};
\begin{scope}[node distance=2mm and 10mm]%Here we change it for everything inside this scope
\node [block, above= of 2nd1] (2nd2) {2nd2};
\node [block, below= of 2nd1] (2nd3) {2nd3};
\node [block, right= of 2nd1] (3rd1) {3rd1};
\node [block, above= of 3rd1] (3rd2) {3rd2};
\node [block, above= of 3rd2] (3rd3) {3rd3};
\end{scope}
\node [block, below= of 3rd1] (3rd4) {3rd4};
\node [block, below= of 3rd4] (3rd5) {3rd5};
\path [line] (1st) -- (2nd1);
\path [line] (2nd1) -- (2nd2);
\path [line] (2nd1) -- (2nd3);
\path [line] (2nd2) -- (3rd3);
\path [line] (2nd1) -- (3rd1);
\path [line] (1st) -- (2nd1);
\end{tikzpicture}
\end{document}
The reason linegoal
changes its results is twofold: One is that it requires two compilations, after which it should stabilize; the second for the slight changes might be because it isn't returning a position but rather one relative to the remaining \linewidth
, which may be changing for reasons of kerning decisions or something.
For absolute position you can use the zref
subpackage zref-savepos
(which linegoal
uses) (And in either case you can only use pdfTex or XeTex -- no LuaTeX or DVI outputs). Then you use the following command combo:
\zsaveposx{<yourlabel>) % tells pdfTeX to save the current position (x-coord) once generated; returns nothing; can be used inline; expands variables in argument
\zposx{<yourlabel>) % returns the saved x-coord once generated, or 0? if not yet generated (not cycled thru compilation yet); also usable inline
The resulting coordinates are in sp I think, but at least an answer on column detection gives us a page midpoint (19000000) and what to test ("stop" and "start2") for comparing where you are. I used the following functions for my recent twocolumn tweaks:
\def\islcol#1{\ifnum 0#1<19000000 1\else 0\fi\relax}
\newcommand\isleftcol[1][blahlabel]{\zsaveposx{pos-#1} \islcol{\zposx{#1}}}
Best Answer
You can wrap it into a tikz node.