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

Mitre/miter line join spelling #178

Closed
jcaldera314 opened this issue Mar 28, 2018 · 5 comments
Closed

Mitre/miter line join spelling #178

jcaldera314 opened this issue Mar 28, 2018 · 5 comments

Comments

@jcaldera314
Copy link

@jcaldera314 jcaldera314 commented Mar 28, 2018

In R base graphics, one can specify the linejoin="mitre" option. In tikz, however, this option is spelled "miter." Currently tikzDevice preserves the R spelling when it builds the tikz code. This will generate an error when trying to compile in LaTeX unless one corrects the spelling.

@bellackn
Copy link

@bellackn bellackn commented Aug 10, 2018

Hi @jcaldera314, could you please provide an example of code which does not work as expected?

I did the following without getting errors:

tikzDevice::tikz(file = "mitre.tex", width = 6, height = 3,
                 standAlone = TRUE)

plot(c(0, 0, 4, 0, 0), c(0, 1, 1.5, 2, 3), type="l", lwd=5, axes=FALSE,
     xlab=NA, ylab=NA, ljoin ="mitre")

dev.off()

I could compile the resulting mitre.tex file without errors (PDFLatex):

mitre

Loading

@jcaldera314
Copy link
Author

@jcaldera314 jcaldera314 commented Aug 29, 2018

Hi @bellackn, thank you for looking into this. To replicate the error, you apparently have to use the "lmitre=n" option. Modifying your example in the following way should elicit the problem:

tikzDevice::tikz(file = "mitre.tex", width = 6, height = 3,
                 standAlone = TRUE)

plot(c(0, 0, 4, 0, 0), c(0, 1, 1.5, 2, 3), type="l", lwd=5, axes=FALSE,
     xlab=NA, ylab=NA, ljoin ="mitre", lmitre=25)

dev.off()

Interestingly, it looks like your original example didn't generate the error because without the lmitre option it didn't even attempt to implement mitre joins in the first place.

Loading

@bellackn
Copy link

@bellackn bellackn commented Sep 21, 2018

Hi @jcaldera314 , sorry for the late reply. You were right, setting lmitre elicited the error. This will be fixed in the next development release, thanks for reporting this!
Until then, you can just correct the spelling in the resulting *.tex file, as you already mentioned in your initial posting.

Loading

@bellackn bellackn closed this Sep 27, 2018
bellackn pushed a commit that referenced this issue Sep 27, 2018
tikzDevice correctly translates the `lmitre = n` parameter of the `plot()`
function now (#178)
rstub added a commit that referenced this issue Sep 28, 2018
tikzDevice correctly translates the `lmitre = n` parameter of the `plot()`
function now (#178)
@bellackn
Copy link

@bellackn bellackn commented Sep 28, 2018

The fix for this was just merged into the master branch, @jcaldera314. Thanks again for reporting!

Loading

@jcaldera314
Copy link
Author

@jcaldera314 jcaldera314 commented Sep 28, 2018

Thank you, @bellackn! Happy to help!

Loading

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

Successfully merging a pull request may close this issue.

None yet
2 participants