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

Bold inside the entries #193

Open
Staklarm opened this issue Jan 16, 2022 · 4 comments
Open

Bold inside the entries #193

Staklarm opened this issue Jan 16, 2022 · 4 comments

Comments

@Staklarm
Copy link

I would like to add a bold style inside one of the entries below. For example I would like the "bold" word below to be in bold.
I have entered .protect = FALSE in the detailed_entries to prevent sanitising.

tribble(
  ~Year, ~Company, ~Position, ~Desc,
  '2017-2020', 'Github', 'CEO', 'I want to make this \textbf{bold}'
) %>% 
  detailed_entries(Company, 
                   Year,
                   Position,
                   Desc,
                   .protect = FALSE,
                   )

In the knitting of the above, I get

I want to make this extbfbold

If I use \\textbf{bold} the output becomes

I want to make this bold

but "bold" is not bolded but coloured in darker shade of grey.
image (it is barely noticeable).

@kelly-sovacool
Copy link

kelly-sovacool commented Dec 8, 2022

Similarly, attempting to use \textit{} in entries results in \textit{} getting converted to extit{} in the final PDF (i.e. the \t gets interpreted as a tab character. Escaping the backslash with another results in \textit{} getting printed literally. Here's an example with moderncv:

library(tibble)
tribble(
  ~ method, ~ result, 
  "underscore", " _C. difficile_", 
  "asterisk", " *C. difficile*", 
  "textit{}, one backslash", "\textit{C. difficile}",
  "textit{}, two backslashes", "\\textit{C. difficile}"
) %>% 
  detailed_entries(result, method)

image

Using .protect leads to an error:

library(tibble)
tribble(
  ~ method, ~ result, 
  "underscore", " _C. difficile_", 
  "asterisk", " *C. difficile*", 
  "textit{}, one backslash", "\textit{C. difficile}",
  "textit{}, two backslashes", "\\textit{C. difficile}"
) %>% 
  detailed_entries(result, method, .protect = FALSE)

Error:

! Missing $ inserted.
<inserted text> 
                $
l.105 ...nderscore}{ _C. difficile_}{}{}{}{\empty}

Try to find the following text in vitae-italics-reprex.Rmd:
  ...nderscore}{ _C. difficile_}{}{}{}{\empty} 

EDIT:

I was able to get it to work with two backslashes & .protect = FALSE.

tribble(
  ~ method, ~ result, 
  "textit{}, two backslashes", "\\textit{C. difficile}"
) %>% 
  detailed_entries(result, method, .protect = FALSE)

image

@nicole-brewer
Copy link

I have a similar problem, except I'm trying to add a \newline. There doesn't seem to be a workaround no matter what I select for .protect.

@ppaxisa
Copy link

ppaxisa commented Feb 28, 2023

I had the same problem for bold, italics, underline and as suggested by @kelly-sovacool, a \\ in the R character string did the trick for me.

@chitrabaniya
Copy link

Hi,
I had this problem

tribble(
  ~Year, ~Type, ~Desc, 
  '2022', "AAAAA", "Carbonstock and regeneration status of community managed sal \textit{Shorea robusta} forests in VVV. Defended on November 2022.", 
) %>% 
  brief_entries(
    glue::glue("{Type}"),
    Year, 
    Desc
  )
Even after I did  .protect = FALSE it did not work for me.
*, **, _ all failed to me.
I wanna Shorea robusta in italics in my vitae. I am using Hindma::vitae

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

5 participants