How to control width of a long LaTeX equation in bookdown

183 views Asked by At

I have an align equation that does not fit into my bookdown, especially the tag I am using:

enter image description here

My output is bookdown::gitbook. It works in R markdown though:

---
title: "LaTeX"
output: html_document
---

# Long Equation

This is too long 

$$ \begin{align}
\text{outcome} &= f(\text{explanatory}) + \text{noise} \tag{Generic statistical model} \\
\text{outcome} &= \text{intercept} + \text{slope} \cdot \text{explanatory} + \text{noise} \tag{Generic linear model} \\
\end{align}$$

enter image description here

What is the difference between markdown and bookdown in handling LaTeX equations? And how to control the width of the aligned equations? Can I shift the entire formula block to the left?

1

There are 1 answers

0
hahahumble On

You can use a div tag with margin right property.

<div style="margin-right:400px;">
\begin{align}
\text{outcome} &= f(\text{explanatory}) + \text{noise} \tag{Generic statistical model} \\
\text{outcome} &= \text{intercept} + \text{slope} \cdot \text{explanatory} + \text{noise} \tag{Generic linear model} \\
\end{align}
</div>

Result: enter image description here