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

show for certain symbols (e and f) has extra space #1206

Closed
mattsignorelli opened this issue Aug 6, 2024 · 2 comments · Fixed by #1207
Closed

show for certain symbols (e and f) has extra space #1206

mattsignorelli opened this issue Aug 6, 2024 · 2 comments · Fixed by #1207

Comments

@mattsignorelli
Copy link

Minor issue but for some reason there is an extra space for only the symbols e and f:

julia> @variables a b c d e f g h i
9-element Vector{Num}:
 a
 b
 c
 d
  e
  f
 g
 h
 i

julia> [a b c; d e f; g h i]
3×3 Matrix{Num}:
 a  b   c
 d   e   f
 g  h   i
@mattsignorelli
Copy link
Author

The issue also gives very strange output for expressions:

julia> @variables a b c d e f g h i j
10-element Vector{Num}:
 a
 b
 c
 d
  e
  f
 g
 h
 i
 j

julia> [a b c d;
        b e f g;
        c f h i;
        d g i j]*[1,2,3,4]
4-element Vector{Num}:
 a + 2b + 3c + 4d
            b + 2e + 3f + 4g
            c + 2f + 3h + 4i
 d + 2g + 3i + 4j

The vector components containing any e or f are all misaligned with many spaces preceded

@bowenszhu
Copy link
Member

I found that in Julia base they match e and f in https://github.com/JuliaLang/julia/blob/48d4fd48430af58502699fdf3504b90589df3852/base/show.jl#L3027
and if e or f is matched, extra space is padded on the left https://github.com/JuliaLang/julia/blob/48d4fd48430af58502699fdf3504b90589df3852/base/arrayshow.jl#L118

@bowenszhu bowenszhu linked a pull request Aug 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants