# how to set latex options on graph to make them ultra small ? edit

I am currently playing with functions indexed by unlabeled graphs. The following method (belonging to my parent class which models linear combinations of graphs) tells my parent how to print basis element indexed by a graph m (m is in fact an integer vector modeling a graph up to isomorphism).

 def _latex_term(self, m):
r"""
"""
G = m.to_graph()
opt = G.latex_options()
opt.set_option('tkz_style', 'Simple')
opt.set_option('vertex_labels', False)
opt.set_option('scale', 0.25)
opt.set_option('vertex_size', 0.0)
return '\mathcal{M}_{' + latex(G) + '}'


I tried to set the option 'vertex_size' to zero but the size of the vertex was not affected. I realize that some combinations of options can rapidly become incoherent. Currently, I do not manage to do smaller than in the copy-pasted proposition of code.

I just want a very small (but readable) unlabeled graph.

edit retag close merge delete

I just upload an example here Precisely, I need to decrease the size of nodes. If I only decrease the scale, it produces some overlaps of the nodes.

( 2015-09-18 13:23:11 -0500 )edit

Sort by » oldest newest most voted

After checking the documentation, under vertex_size there is a note about the inner sep parameter. It seems that this parameter cannot be accessed through sage, however you may be able to tweak it in the output by adding the following line to the LaTeX output:

\tikzset{VertexStyle/.style = {inner sep  = 1pt}}


Right after the \begin{tikzpicture} would be a good place for this line. As a workaround, maybe searching and replacing the on the LaTeX string would be a way to "inject" this line to the output.

Hope this helps, otherwise please send some sample input to _latex_term for further assistance.

more
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2745857834815979, "perplexity": 1893.748033349207}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-26/segments/1498128323730.30/warc/CC-MAIN-20170628185804-20170628205804-00175.warc.gz"}