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

tex export fails to compile with negative sign #86

Open
ExarchD opened this issue Jul 28, 2017 · 8 comments
Open

tex export fails to compile with negative sign #86

ExarchD opened this issue Jul 28, 2017 · 8 comments

Comments

@ExarchD
Copy link

ExarchD commented Jul 28, 2017

It seems that negative signs are not friendly in the latex export for labelDistance and labelLocation:

\begin{feynman} 
    \gluon[label=$g$, labelDistance=-0.30, labelLocation=1.20]{2.20, 2.20}{0.20, 4.20}
    \gluon[label=$g$, labelDistance=0.60, labelLocation=-0.10]{0.20, 0.20}{2.20, 2.20}
    \gluon[color=000000, label=$g$]{2.20, 2.20}{5.20, 2.20}
    \fermion[label=$\anti{t}$, labelDistance=0.00, labelLocation=-0.14]{7.20, 4.20}{5.20, 2.20}
    \fermion[label=$t$, showArrow=true, flip=false, labelDistance=0.30, labelLocation=1.00]{5.20, 2.20}{7.20, 0.20}
\end{feynman}

Adding parentheses around the negative values fixed the problem for me.

@ExarchD
Copy link
Author

ExarchD commented Jul 28, 2017

Sorry I guess I was hasty. There are a few issues I hit with this code, and I don't think its the negative sign. Here's the error it outputs:

!FP error: UPN stack is empty!.
\FP@errmessage #1->\errmessage {FP error: #1!} 
l.15 ...abelLocation=1.20]{2.20, 2.20}{0.20, 4.20}

@AlecAivazis
Copy link
Owner

AlecAivazis commented Jul 28, 2017

hey @ExarchD - thanks for submitting the issue! If adding parentheses fixes the problem, then I think the issue is in fact with the minus sign. I can submit a fix that wraps the exported values in parentheses if so.

EDIT: After playing around with this for a bit, it seems the error is with the labelLocation greater than 1.

@AlecAivazis
Copy link
Owner

@ExarchD this problem should be fixed now, can you verify?

@shwinnn
Copy link

shwinnn commented Dec 1, 2018

Hi, I actually am still getting the same error with negative label locations. Parentheses don't solve the problem. As a minimal example:

\fermion[label=$d$, labelDistance=-0.10, labelLocation=0.35]{0.20, 10.20}{1.40, 10.20}

compiles but

\fermion[label=$d$, labelDistance=-0.10, labelLocation=-0.35]{0.20, 10.20}{1.40, 10.20}

doesn't. Parentheses don't seem to help.

@AlecAivazis
Copy link
Owner

@shwinnn i'm sorry to hear you're running into that. I just reproduced the problem but it might take me awhile to find the time to fix this. Until I do, you should be able to use a floating text element to put the label where you want

@AlecAivazis AlecAivazis reopened this Dec 2, 2018
@shwinnn
Copy link

shwinnn commented Dec 2, 2018

A label location of 0 works fine for my diagrams anyway! Thanks for the great tool.

@AlecAivazis
Copy link
Owner

AlecAivazis commented Dec 3, 2018

@shwinnn - this should be fixed now. Could you confirm?

@mvaculciak
Copy link

Hi,
first of all thanks for this lovely tool.

Unfortunately, this (error when setting negative labelLocation) is still an issue, but following the discussion https://tex.stackexchange.com/questions/460522/using-fp-package-to-compute-sum-breaks-fp-error-upn-stack-is-empty
I managed to fix it by adding "0+" to line 588 of feynman.sty.
\FPeval{labelX}{@temp@locX} --> \FPeval{labelX}{0+@temp@locX}

Hope it helps.

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

No branches or pull requests

4 participants