hiltpics.blogg.se

Math mode inside tabular latex
Math mode inside tabular latex






Do I gsub minus signs or expect the user to do it? (Probably latter).Do I enclose those in $$ or expect the user to do it? (Probably latter).Probably don't want to use dcolumn to enforce math mode by default because (a) it is not loaded by default when using rmarkdown/knitr, and (b) because I don't have a mechanism (yet) to wrap text in an \mbox]".Would it be safer to gsub("-", "&minus", x) when the tables goes to HTML? What's a safe analogous substitution for LaTeX? And Markdown/ASCII?.Otherwise, a ton of tables won't compile. Underscores are pretty common in variables, so I don't think we can include math mode with $$ and no escape by default. Unfortunately, stopping escaping might produce unexpected (bad) results if, for example, some variable names have underscores. This would need to be triggered automatically, I suppose. $$ works in LaTeX, of course, but one problem is that kableExtra requires escape=FALSE when there's math mode.Perhaps that's not a big deal, as long the $$ strategy is optional. The only problem might arise when wrapping in $$ and going to raw HTML with output="html".When we wrap numeric values in $$, kableExtra automatically inserts a tag with MathJax, so no problem when tables are read interactively, rendered in RStudio, etc. If someone cares enough about having a proper minus sign in HTML tables, they probably care enough to use a browser that supports MathJax.

math mode inside tabular latex math mode inside tabular latex

For example, when someone uses something else than Computer Modern for the body of their article, numbers wrapped in $$ in the tables might look inconsistent with the other faces in the paper.

math mode inside tabular latex

Not convinced that wrapping everything in $$ should be the default.Perhaps this can be triggered/disabled by a global option instead of a new argument? The easiest place to do that is probably the rounding function. It would be trivial to wrap every numeric value in $$.Just writing here so I don't forget not necessarily expecting feedback/conversation.








Math mode inside tabular latex