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

Fix \mess not being able to accept some commands #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ElectronicRU
Copy link

The newline between \node and node text in \messanother prevented TikZ parsing tricks that suspend command evalutation from working.

In my use case, \ref inside \mess broke horribly,while working fine in messcall and call.

The newline between \node and node text in \messanother prevented TikZ parsing tricks that suspend command evalutation from working.

In my use case, \ref inside \mess broke horribly,while working fine in messcall and call.
@hmenke
Copy link
Member

hmenke commented Dec 22, 2020

Can you provide a minimal example for the failure because as far as I can see you have not made a semantic change.

@ElectronicRU
Copy link
Author

Ah sure - I was using \lstinline (from lstlisting) in the \messanother and it kept breaking horribly until I made this change. Calls didn't break, that's how I divined what the difference is.

@hmenke
Copy link
Member

hmenke commented Jun 4, 2021

You cannot use any verbatim material in \mess and your patch doesn't fix that.

@ElectronicRU
Copy link
Author

Well, I was able to... and in \call's the verbatim material works fine as well. You're welcome to go ahead and try.
TikZ does have some delayed-evaluation thing that makes it work, but it only works if there's no newline there.

@hmenke
Copy link
Member

hmenke commented Jun 4, 2021

You're welcome to go ahead and try.

Sure thing, here you go! This doesn't work, neither with nor without your patch.

\documentclass{article}
\usepackage{pgf-umlsd}
\usepackage{listings}
\begin{document}
\begin{sequencediagram}
  \newthread{a}{:Thread A}
  \newthread[gray]{b}{:Thread B}
  \mess[1]{a}{\lstinline|{|}{b}
  \mess[1]{b}{\lstinline|#|}{a}
\end{sequencediagram}
\end{document}

TikZ does have some delayed-evaluation thing that makes it work

There is no such thing.

@ElectronicRU
Copy link
Author

Oh you're right, my memory is hazy. The patch indeed didn't fix \lstinline, but it did fix \ref and \autoref usage in messages.
I apologize, it's been half a year and I mixed things up.

(And I even written it in the MR message and still got it wrong!)

@hmenke
Copy link
Member

hmenke commented Jun 7, 2021

No, \ref and \autoref are not fully expandable so it will still blow up when used as the node name.

\node (#3 from) at (mess from) {};
\node (#3 to) at (mess to) {};

This library just has to be rewritten (like I already did for pgf-pie).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants