vitae
vitae copied to clipboard
Bold inside the entries
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.
(it is barely noticeable).
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)
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)

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
.
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.
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