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

odd spacing with LaTeXStrings with \textrm #439

Open
lmiq opened this issue Nov 9, 2021 · 5 comments
Open

odd spacing with LaTeXStrings with \textrm #439

lmiq opened this issue Nov 9, 2021 · 5 comments

Comments

@lmiq
Copy link

lmiq commented Nov 9, 2021

example:

julia> using GR, LaTeXStrings

julia> x = rand(10)
       y = rand(10)
       plot(x[1:10], y, xlabel=L"\textrm{This is } \alpha")

image

adding tildes ~ solves the lack of spacing between words, but there is still an odd spacing between the captial T and the text that follows:

julia> x = rand(10)
       y = rand(10)
       plot(x[1:10], y, xlabel=L"\textrm{This~is~}\alpha")

image

(jl_6ruBxL) pkg> st
      Status `/tmp/jl_6ruBxL/Project.toml`
  [28b8d3ca] GR v0.62.1

@jheinen
Copy link
Owner

jheinen commented Nov 9, 2021

In the meantime, you can mix normal and math text: xlabel="This is \\alpha"):

Screenshot 2021-11-09 at 17 22 54

Is this what you want?

@lmiq
Copy link
Author

lmiq commented Nov 9, 2021

Thanks, quoted the alternative on the discourse thread: https://discourse.julialang.org/t/issue-with-plots-latex/71045/13

(it was not my specific problem now)

@tomas-budi-ors
Copy link

It is actually a problem I am facing. With normal math text, \alpha looks fine, though other characters look 'weird', compared to LaTeX, in particular the space between subindices:
image

@lmiq
Copy link
Author

lmiq commented Nov 9, 2021

It is actually a problem I am facing. With normal math text, \alpha looks fine, though other characters look 'weird', compared to LaTeX, in particular the space between subindices:

This may not be the exact same issue. Can you provide a MWE? I cannot reproduce that here.

@jheinen
Copy link
Owner

jheinen commented Nov 9, 2021

That's how it looks with up-to-date versions (GR.jl 0.62.1 and GR run-time 0.62.0):

using GR
plot(randn(10),xlabel="Bilateral Trade Costs \\tau_{rlj}")

Screen Shot 2021-11-09 at 21 13 14

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

3 participants