TeX - LaTeX Asked by SOFe on January 19, 2021
I am using the Graphviz package (usepackage[pdf]{graphviz}
) for my LaTeX document.
I am unable to break lines in my nodes.
My code:
digraph{contract}{
rankdir = "LR";
computeSumParam0[label = "computeSum: n param #0"];
}
This renders the characters n
on the PDF literally.
If I instead use n
, LaTeX fails to compile because the command n
does not exist.
You can use noexpandn
, or wrap it in a macro for better clarity:
documentclass{article}
usepackage[pdf]{graphviz}
begin{document}
digraph{contract}{
rankdir = "LR";
computeSumParam0[label = "computeSum: noexpandn param #0"];
}
end{document}
or
documentclass{article}
usepackage[pdf]{graphviz}
newcommand{gvnewline}{noexpandn}
begin{document}
digraph{contract}{
rankdir = "LR";
computeSumParam0[label = "computeSum: gvnewline param #0"];
}
end{document}
Correct answer by egreg on January 19, 2021
Just create a new line in the label text!
digraph{contract}{
rankdir="LR";
computeSumParam0[label="computeSum:
param #0"];
}
Answered by gigiair on January 19, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP