Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertical bar in an equation inside a table and Slidy format #365

Open
1 of 3 tasks
jjescario opened this issue Feb 13, 2023 · 5 comments
Open
1 of 3 tasks

Vertical bar in an equation inside a table and Slidy format #365

jjescario opened this issue Feb 13, 2023 · 5 comments

Comments

@jjescario
Copy link

jjescario commented Feb 13, 2023

Although Xaringan is great, I think these suggestions will improve it for some users:

  1. If you want to include in a column of a table a vertical bar in order to express, for example, a conditional mean like $E(y|x)$. The vertical bar is interpreted as a column separator. Would it be possible that Xaringan interpret it inside a formula as a vertical bar instead of as a column separator? I solved the problem using an inclined bar, but it would be nice to use a vertical bar.
  2. When reporting estimates in a long table, the table is cut after some rows. Would it be possible to present the table as in the slidy presentation format?
    Thank vou very much.
    José Julián Escario

By filing an issue to this repo, I promise that

  • I have fully read the issue guide at https://yihui.org/issue/.
  • I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('xaringan'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('yihui/xaringan').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

@yihui
Copy link
Owner

yihui commented Feb 13, 2023

  1. Please follow the issue guide and provide a reproducible example. I can't reproduce your problem:
---
title: "test"
output:
  xaringan::moon_reader: null
---

$E(y|x)$

image

  1. Yes, but again, it's hard to help you without an example.

@jjescario
Copy link
Author

jjescario commented Feb 14, 2023

In this table, for example, the vertical bars inside the formulas are interpreted as a column separator

---
title: "test"
output:
  xaringan::moon_reader: null
---

## Regression models: Linear Regression Model

Assumptions                       |  Linear Regression Model (LRM)                                 
-------------------------       | ------------                            
1. About the distribution    | $$Y_i|x_i \sim N(\mu_i, \sigma^2)$$                      
2. About the mean              | $E(Y_i|x_i) = \mu_i  =x'_i\beta= \eta_i$

Rendering the file Rmd separates "$$Y_i" in one column and the rest "|x_i \sim N(\mu_i, \sigma^2)$$" in another colmun.
The same happens with the next line. "$E(Y_i" appears in one colmun and "x_i) = \mu_i =x'_i\beta= \eta_i$" in the next column. Consequently, they yields 3 columns when only two columns should appear. See attached document.

José Julián

Renddering the Rmd file.pdf

@yihui
Copy link
Owner

yihui commented Feb 14, 2023

You can use \vert for |: https://tex.stackexchange.com/q/498/9128

@jjescario
Copy link
Author

Thank you so much.
What about the second theme? Do you plan in the future to add the option to enable long table scrolling like the Slidy format in RMarkdown?

@yihui
Copy link
Owner

yihui commented Apr 7, 2023

I don't have a plan, but recently I've been working on a totally different slides format, which is based on the markdown package (https://github.com/rstudio/markdown) and makes it possible to scroll over one slide if it's too long: https://cran.r-project.org/web/packages/markdown/vignettes/slides.html#lengthy-slides

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants