3

i'm struggling with the labels of some biforcate dynkin-diagram

my code is the following

\usepackage{dynkin-diagrams}
\begin{document

\begin{center}
 \begin{dynkinDiagram}
  \dynkin[labels={m \cosh \theta, 1,2,3,,n-2,n-1,n,n+1}, scale=1.8, extended]D{*ooo...oooo}
 \end{dynkinDiagram}
\end{center}

\end{document}

but my output looks like this. unlabel

enter image description here

I would really appreciate some help, I have tried different combinations but nothing seems to work.

2 Answers 2

2

Here is another way that might work. We can create a Dynkin diagram environment, put in place the labels that seem to work ok, and then for the difficult label, use TikZ directly inside the environment. Maybe that is more stable than using the labels from my package. (It gives the same picture as above.)

\documentclass{article}
\usepackage{dynkin-diagrams}
\begin{document}
\begin{center}
\begin{dynkinDiagram}[labels={,1,2,3,,n-2,n-1,n,n+1},
         label directions={,,left,,,,right,,},
         scale=1.8,
         extended] D{*ooo...oooo}    
\node[left] at (root 0) {\(m\,\cosh\theta\)};
\end{dynkinDiagram}
\end{center}
\end{document}
2

There are two issues: first you can't use \dynkin inside of a dynkinDiagram environment, you have to choose one or the other. Second for some reason the label list parser does not like \cosh, so you can replace that with \text{cosh}. To add a bit of space around the operator I added \, in the code below.

To position the labels I added label directions={} in the example below.

Note that I don't know anything about Dynkin diagrams, so probably the end result is not fully correct - but it does have labels.

MWE:

\documentclass{article}
\usepackage{dynkin-diagrams}
\begin{document}
\begin{center}
 \dynkin[labels={m\,\text{cosh}\,\theta,1,2,3,,n-2,n-1,n,n+1},
         label directions={,,left,,,,right,,},
         scale=1.8,
         extended] D{*ooo...oooo}
\end{center}
\end{document}

Result:

enter image description here


Following the comment from egreg below, you can also robustify \cosh with etoolbox to make the command survive processing by dynkin-diagrams. This allows to use the original command instead of a poorly spaced \text{cosh}. Note that if you want to use other non-robust commands then you need to robustify those separately.

\documentclass{article}
\usepackage{etoolbox}
\usepackage{dynkin-diagrams}
\robustify{\cosh}
\begin{document}
\begin{center}
 \dynkin[labels={m\cosh\theta,1,2,3,,n-2,n-1,n,n+1},
         label directions={,,left,,,,right,,},
         scale=1.8,
         extended] D{*ooo...oooo}
\end{center}
\end{document}
14
  • There should be a bit of space around "cosh". Instead of using \text, you can use \operatorname{cosh}. (This may require amsmath.) Commented Mar 8, 2021 at 17:18
  • @barbarabeeton I agree that the original spacing was not good. \operatorname resulted in the same error as \cosh itself (! Argument of \XC@definec@lor has an extra }.) which probably has to do with some parsing either by TikZ or by dynkin-diagrams itself. I used \, as an alternative, I guess the spacing is more acceptable now.
    – Marijn
    Commented Mar 8, 2021 at 17:36
  • Thanks but sadly I cant get this to work yet. I get the following compilation error: '! Pacakge pgfkeys Error: I do not know the key '/tikz/ on background layer' and I am going to ignore it. Perhaps you misspelled it.' Commented Mar 9, 2021 at 17:12
  • 2
    @Marijn The problem with \cosh is that dynking-diagrams abuses xstring and so in many instances it tries full expansion which dramatically fails if the list contains tokens that don't survive \edef. Among them there is \cosh. Better solution: load etoolbox and do \robustify{\cosh} in the preamble.
    – egreg
    Commented Mar 30, 2021 at 21:53
  • 1
    @Marijn: Of course your code should work without robustify, so I have a bug. I just submitted an update to the dynkin-diagrams package to get rid of many expansions. Once the update gets through, I think it will work as it should with your code. Commented Mar 31, 2021 at 15:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .