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

allow italic and bold within column texts [skip ci] #64

Merged
merged 5 commits into from
Feb 14, 2024

Conversation

iramosgutierrez
Copy link
Collaborator

@iramosgutierrez iramosgutierrez commented Feb 13, 2024

As asked by a user, there was no possibility of including italics or bold within columns (e.g. a species name in a title).
Including LATEX directly inside column texts was not doable, as the check_latex function was correcting it.

A proposed alternative solution is to include \\startit ITALIZED TEXT \\endit NORMAL TEXT \\startbf BOLD TEXT \\endbf NORMAL TEXT AGAIN
but it has to be done by hand by the user.

Example:
labeleR::collection.table$field6[37] <- "Between the bushes of \\startit Retama and Nerium \\endit "
(of course, it can be done in the table prior to loading it to R).

Any thoughts or alternatives?

@Pakillo
Copy link
Member

Pakillo commented Feb 13, 2024

Yes, in those cases I think we'll need to include LaTeX directly within the text, as you propose (there's a similar example in

#' freetext = "organised by {\\bf Hogwarts School year 1992-1993}",
).

Any preference for \startit and \endit versus \textit? I'm fine with either, but I suspect some people might try \textit. If that will not work, please explain clearly in the documentation what's the accepted way to insert italic and bold text?

Thanks!

@iramosgutierrez
Copy link
Collaborator Author

Yes, in those cases I think we'll need to include LaTeX directly within the text, as you propose (there's a similar example in

#' freetext = "organised by {\\bf Hogwarts School year 1992-1993}",

).
Any preference for \startit and \endit versus \textit? I'm fine with either, but I suspect some people might try \textit. If that will not work, please explain clearly in the documentation what's the accepted way to insert italic and bold text?

Thanks!

You are completely right, probably keeping the same names (textit and textbf) is the best idea. Nevertheless it is going to be still needed to specify \end, as curly brackets are revised by check_latex.

@Pakillo
Copy link
Member

Pakillo commented Feb 14, 2024

As long as you explain in the documentation (ie. readme, function help) how to include italic and bold text, it should be fine! You could even create a FAQ section in the readme with this stuff (e.g. https://pakillo.github.io/grateful/#frequently-asked-questions)

@iramosgutierrez iramosgutierrez merged commit 5472957 into master Feb 14, 2024
6 checks passed
@iramosgutierrez iramosgutierrez deleted the textformat_columns branch February 14, 2024 16:37
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

Successfully merging this pull request may close these issues.

2 participants