Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument Spacing When Using lw Option for \ Edge Causes Compile Error in Latexmk with Tikz-Network Package #11

Open
DiegoBneiNoah opened this issue Jul 24, 2019 · 3 comments
Assignees

Comments

@DiegoBneiNoah
Copy link

DiegoBneiNoah commented Jul 24, 2019

Writing the code with no spaces between the arguments of "\Edge[h local options i](Vertex i)(Vertex j)" normally handles processing:

\documentclass{article}
\usepackage {tikz-network}
\thispagestyle {empty}
\begin {document}
\begin {tikzpicture}
\Vertex{A} \Vertex [x = 2] {B} \Vertex [x = 2, y = -1] {C}
\Edge [lw = 3pt] (A) (B)
\Edge [lw = 5pt] (A) (C)
\end {tikzpicture}
\end {document}


But if there is spacing (whatever that is) between the arguments of "\Edge[h local options i](Vertex i)" as shown below:

\documentclass{article}
\usepackage{tikz-network}
\thispagestyle {empty}
\begin {document}
\begin {tikzpicture}
\Vertex {A} \Vertex [x = 2] {B} \Vertex [x = 2, y = -1] {C}
% Case 1: space between <[lw = 3pt]> and <(A)(B)>
\Edge [lw = 3pt] (A)(B)
% Case 2 (below): or even if there is a space between <(A)> and <(C)> as below
\Edge[lw = 5pt](A) (C)
\end {tikzpicture}
\end {document}


I get the following errors in their order as is the spacing in the code above:

Case 1 - Space between <[lw = 3pt]> and <(A)(B)> returns the following error:

Runaway argument?
(A)(B) \ end {tikzpicture} \ end {document}
! File ended while scanning use of \ @edge.
<inserted text>
\pair
<*> 17.tex
       
?

Case 2 - Space between <[lw = 5pt] (A)> and <(C)> returns the following error:

! Undefined control sequence.
\ pgfonlayer @ assert @ is @ active ... fonlayer @ isactive
                                                  {0} \ expandfter \ pgf @ asser ...

1.8 \ Edge [lw = 5pt] (A) (C)
                     
?

Note 1: Putting spacing between <\Edge> and <[h local options i](Vertex i)(Vertex j)> returns no error.
Note 2: Examples taken from Section 2.2, page 15 of https://ctan.org/pkg/tikz-network.
Note 3: Command latexmk and Zathura viewer were used.
Apparently everything is related to using the lw (\Edge line width size) option.
Note 4: As advised at https://tex.stackexchange.com/a/501300/178949 by user TeXnician there is apparently a guideline in the code script preventing the inclusion of spacing.

@hackl
Copy link
Owner

hackl commented Jul 29, 2019

Thank you for pointing that out. As TeXnician already mentioned in his answer on https://tex.stackexchange.com/a/501300/178949, this is a property of the \def command. As long as this space between (A) and (B) has not been defined, LaTeX expects the following command chain: \Edge[#1](#2)(#3) (without spaces).

To adjust the command to your preferences, you would have to change your tikz-network.sty file as follows:

Change line 585 from:

\def\@edge[#1](#2)(#3){

to

\def\@edge[#1] (#2) (#3){

It is not planned to add this feature in the near future, but I will add it to the enhancement list. If time permits, I will include it in the next version of tikz-network.

@DiegoBneiNoah
Copy link
Author

Greatfull @hackl .

@DiegoBneiNoah
Copy link
Author

I decided to reopen the issue to receive future notice of changes intended by @hackl

@hackl hackl self-assigned this Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants