Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

customize solution environment

Tags:

r

bookdown

quarto

I'm trying to automate the insertion of horizontal rules at the end of solution environments in Quarto; for example:

---
title: "Untitled"
---

:::{#exr-oneplusone}
What is 1+1?

::::{.solution}
$$1+1 = 2$$

******

::::



:::

I'm trying to insert

******

at the end of every .solution environment, or maybe the exercise environment.

From https://bookdown.org/yihui/bookdown/markdown-extensions-by-bookdown.html#theorems, it seems like there's a way to customize the solution environment using CSS. I'm just not sure what the syntax is for the CSS file. Thanks for any guidance!

like image 361
Doug Ezra Morrison Avatar asked Dec 15 '25 06:12

Doug Ezra Morrison


1 Answers

Here a way: The CSS margin properties are used to create space below and the border mirrors a horizontal line,

---
title: "Untitled"
---

<style>
.solution{
    margin: 3px 0px; 
    border-bottom: 0.9px solid black;
}
</style>

:::{#exr-oneplusone}
What is 1+1?

::::{.solution}
$$1+1 = 2$$

::::
:::

enter image description here

like image 168
Julian Avatar answered Dec 16 '25 20:12

Julian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!