Skip to content

Fix generic graph LaTeX vertex styling#41785

Merged
vbraun merged 1 commit intosagemath:developfrom
ProfTR55:fix-38282-latex-vertex-style
Mar 22, 2026
Merged

Fix generic graph LaTeX vertex styling#41785
vbraun merged 1 commit intosagemath:developfrom
ProfTR55:fix-38282-latex-vertex-style

Conversation

@ProfTR55
Copy link
Copy Markdown
Contributor

@ProfTR55 ProfTR55 commented Mar 9, 2026

Fixes #38282.

The problem was that Sage encoded custom vertex appearance in \Vertex[style={...}],
but tkz-graph applies these options through VertexStyle, so options such as
vertex_shape, vertex_color, and related vertex styling settings were present in
the generated LaTeX but had no visual effect.

This patch emits the custom vertex styling via VertexStyle/.append style={...}
around each vertex, so tkz-graph applies the intended shape, color, and size
overrides.

Tests:

  • updated doctests for generated LaTeX output
  • added a regression doctest for vertex_shape='rectangle' and vertex_color='red'
  • python -m py_compile src/sage/graphs/graph_latex.py src/sage/graphs/generic_graph.py

@github-actions
Copy link
Copy Markdown

Documentation preview for this PR (built with commit 6763d16; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

Copy link
Copy Markdown
Collaborator

@dcoudert dcoudert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I checked using view(g) the result and it looks good. Thanks.

vbraun pushed a commit to vbraun/sage that referenced this pull request Mar 15, 2026
sagemathgh-41785: Fix generic graph LaTeX vertex styling
    
Fixes sagemath#38282.

The problem was that Sage encoded custom vertex appearance in
`\Vertex[style={...}]`,
but tkz-graph applies these options through `VertexStyle`, so options
such as
`vertex_shape`, `vertex_color`, and related vertex styling settings were
present in
the generated LaTeX but had no visual effect.

This patch emits the custom vertex styling via `VertexStyle/.append
style={...}`
around each vertex, so tkz-graph applies the intended shape, color, and
size
overrides.

Tests:
- updated doctests for generated LaTeX output
- added a regression doctest for `vertex_shape='rectangle'` and
`vertex_color='red'`
- `python -m py_compile src/sage/graphs/graph_latex.py
src/sage/graphs/generic_graph.py`
    
URL: sagemath#41785
Reported by: Muhammet Doğukan Bingöl
Reviewer(s): David Coudert
vbraun pushed a commit to vbraun/sage that referenced this pull request Mar 18, 2026
sagemathgh-41785: Fix generic graph LaTeX vertex styling
    
Fixes sagemath#38282.

The problem was that Sage encoded custom vertex appearance in
`\Vertex[style={...}]`,
but tkz-graph applies these options through `VertexStyle`, so options
such as
`vertex_shape`, `vertex_color`, and related vertex styling settings were
present in
the generated LaTeX but had no visual effect.

This patch emits the custom vertex styling via `VertexStyle/.append
style={...}`
around each vertex, so tkz-graph applies the intended shape, color, and
size
overrides.

Tests:
- updated doctests for generated LaTeX output
- added a regression doctest for `vertex_shape='rectangle'` and
`vertex_color='red'`
- `python -m py_compile src/sage/graphs/graph_latex.py
src/sage/graphs/generic_graph.py`
    
URL: sagemath#41785
Reported by: Muhammet Doğukan Bingöl
Reviewer(s): David Coudert
vbraun pushed a commit to vbraun/sage that referenced this pull request Mar 21, 2026
sagemathgh-41785: Fix generic graph LaTeX vertex styling
    
Fixes sagemath#38282.

The problem was that Sage encoded custom vertex appearance in
`\Vertex[style={...}]`,
but tkz-graph applies these options through `VertexStyle`, so options
such as
`vertex_shape`, `vertex_color`, and related vertex styling settings were
present in
the generated LaTeX but had no visual effect.

This patch emits the custom vertex styling via `VertexStyle/.append
style={...}`
around each vertex, so tkz-graph applies the intended shape, color, and
size
overrides.

Tests:
- updated doctests for generated LaTeX output
- added a regression doctest for `vertex_shape='rectangle'` and
`vertex_color='red'`
- `python -m py_compile src/sage/graphs/graph_latex.py
src/sage/graphs/generic_graph.py`
    
URL: sagemath#41785
Reported by: Muhammet Doğukan Bingöl
Reviewer(s): David Coudert
@vbraun vbraun merged commit a865158 into sagemath:develop Mar 22, 2026
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_latex_ method of generic graphs does not support all advertised options (vertex_color, vertex_shape, ...)

3 participants