Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
216 views
in Technique[技术] by (71.8m points)

r - Layout of a formula in a bookdown file

In my *.Rmd file I'm writing something like this

$ext{Dia}_i = max_{x, y in C_i} d(x,y)$

And I was expecting this

namelimits

but when doing bookdown::render_book(...) and controlling the results in my browser firefox I got

nonamelimits

I found that this has something to do with the namelimits (first picture) and nonamelimits (second picture) but unfortunately I have no clue how to change the outcome.

Question: What kind of code chunk I have to add that I can switch between the two notations?

Thanks a lot in advance!

Edit_1

enter image description here

Can I mix these two types?! The goal is to have an inline formula with the desired apperance.

Edit_2

This is my Code - the three dots (...) are the magic/unknown code

enter image description here

And this is my desired output

enter image description here

But sadly I get this

enter image description here

My wish summerized

enter image description here

question from:https://stackoverflow.com/questions/65860307/layout-of-a-formula-in-a-bookdown-file

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This should work, following https://stackoverflow.com/a/61979164/13249862:

Add this to your YAML header:

header-includes:
    - 
ewcommand{argmax}{mathop{mathrm{max}}limits}

Then, you can write both equations:

This $ext{Dia}_i = argmax_{x, y in C_i} d(x,y)$, or this $ext{Dia}_i = max_{x, y in C_i} d(x,y)$.

Result: enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...