ancase
ancase

Reputation: 57

rmd greek letters and accents not knitting properly

I am working on adding "hats" to my Greek letters in RMarkdown to symbolize parameters. It seems that the preview/hover over mode in RMarkdown shows exactly what I want. However, when I knit the markdown file to an HTML it seems like the hat has moved and now covers the whole term rather than just my one letter. What's confusing me is clearly my code is doing what I want since that's what I can see in R, but it isn't knitting the same as this preview. Here's an example of the code:

 $\hat{\beta}_{0}$

which in R preview nicely as:

what I want

but in my HTML it knits into this:

not what I want

Thanks in advance!

Upvotes: 1

Views: 1081

Answers (1)

manro
manro

Reputation: 3677

Try rendering this file, how does your output look?

---
title: "Test symbols"
date: '2021-10-23'
header-includes: \usepackage{amsmath} \usepackage{amssymb} 

output:
  pdf_document:
    latex_engine: xelatex
  html_document:
    df_print: paged
---

How does it look: $\hat{B} + \hat{\beta}_{3} + \hat{\Delta}_{2}$ ?

The hat of the capital Beta has a little offset as shown in this image.

The offset in the hat of the capital Beta

Upvotes: 1

Related Questions