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

LuaTeX support #2

Open
hmenke opened this issue Dec 7, 2020 · 5 comments
Open

LuaTeX support #2

hmenke opened this issue Dec 7, 2020 · 5 comments

Comments

@hmenke
Copy link
Member

hmenke commented Dec 7, 2020

Brief outline of the bug

pgf-umlcd doesn't work with LuaTeX because of

! LaTeX Error: Command \attribute already defined.
               Or name \end... illegal, see p.192 of the manual.

Minimal working example (MWE)

\documentclass{article}
\usepackage{pgf-umlcd}
\begin{document}
\end{document}
@atticus-sullivan
Copy link

As can be seen at luatex-doc(Page 24, section 2.3.2), the macro \attribute is already in use by LuaTeX (for some new ~counter implementation stuff). I think only Line 227 in the .sty would need to be changed for resolving. As this is the macro for the interface to the outside, the question is how to name it (classAttribute isn't that accurate I think).

Most important is that by simply renaming the macro there wouldn't be any backwards compatibility. I'd suggest to add the ifluatex/iftex package or some equivalent so that the new macro can be used in all versions, but prevent the redefinition of attribute in a lua(la)tex environment.

[Because of the open question regarding the naming and since I didn't dug into the doc code yet (might be subject to change as well), I didn't do a pull request. In addition I'm not sure if this is the right way of contributing to this project (or if there has to be some mailinglist action or something else)]

@TeXhackse
Copy link

@hmenke Is there any plan to fix this one?

I guess the only stable way to resolve this permanently would be changing the user Syntax (probably backwards compatible for pdfLaTeX). I could do such changes if that would help. Or are there any other ideas?

@complanar
Copy link

Seems, this is not as complicated as it seems. Quick dirty fix:

Changing Line 227 in the .sty to \newcommand{\umlAttribute}[1]{ and then redefining \attribute only inside of the classAndInterfaceCommon environment by adding \let\attribute\umlAttribute (around Line 199) does the trick.

I'm only a LaTeX user and no package author, so this is maybe dirty code and does not meet the standards, but probably someone knows a better solution.
In the meantime I kind of “fixed“ my copy of the package this way. As of now I didn't experience any side effects.

@TeXhackse
Copy link

I currently use the hook management to workaround it, so \attribute is overwritten within the internal environments of this package. But it's not a good solution to overwrite it. There might be a usecase which might make use of the luatex attribute within the environment. So it's not a good solution to overwrite it. Not even locally.

@complanar
Copy link

You’re right, that‘s why I called it a quick dirty fix. I didn’t want to recommend this solution for the package maintainer, but for me it is better than not to be able to use the package at all. Just wanted to share this workaround with others.

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

Successfully merging a pull request may close this issue.

4 participants