Skip to content

Commit

Permalink
Fix a bug of LaTeX display.
Browse files Browse the repository at this point in the history
  • Loading branch information
waltergu committed Sep 23, 2022
1 parent b31bbd4 commit 70a7026
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/QuantumOperators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ LaTeX string representation of an operator unit.
"""
@inline function latexstring(u::OperatorUnit)
l = latexformat(typeof(u))
return @sprintf "%s^{%s}_{%s}" script(Val(:BD), u, l) join(script(Val(:SP), u, l), l.spdelimiter) join(script(Val(:SB), u, l), l.sbdelimiter)
return @sprintf "%s^{%s}_{%s}" script(Val(:BD), u, l) join([str for str in script(Val(:SP), u, l) if length(str)>0], l.spdelimiter) join([str for str in script(Val(:SB), u, l) if length(str)>0], l.sbdelimiter)
end

"""
Expand Down
2 changes: 1 addition & 1 deletion test/DegreesOfFreedom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ end
@inline shape(iidspace::IIDSpace{DID{Symbol}, DFock}) = (1:iidspace.internal.nnambu,)
@inline shape(iidspace::IIDSpace{DID{Int}, DFock}) = (iidspace.iid.nambu:iidspace.iid.nambu,)

@inline script(::Val{:nambu}, did::DID; kwargs...) = did.nambu==2 ? "\\dagger" : did.nambu==1 ? "" : did.nambu
@inline script(::Val{:nambu}, did::DID; kwargs...) = did.nambu==2 ? "\\dagger" : did.nambu==1 ? "" : string(did.nambu)

@inline latexname(::Type{<:CompositeIndex{<:Index{<:Union{Int, Colon}, <:DID}}}) = Symbol("CompositeIndex{Index{Union{Int, Colon}, DID}}")
@inline latexname(::Type{<:Index{<:Union{Int, Colon}, <:DID}}) = Symbol("Index{Union{Int, Colon}, DID}")
Expand Down

0 comments on commit 70a7026

Please sign in to comment.