<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Style definitions for Latex tables</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="https://rpkg.net/assets/examples.css" />
</head><body>

<table width="100%" summary="page for style.tex"><tr><td>style.tex</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>Style definitions for Latex tables</h2>

<h3>Description</h3>

<p>This function describes the style of Latex tables to be exported with the function <code>etable</code>.
</p>


<h3>Usage</h3>

<pre>
style.tex(
  main = "base",
  depvar.title,
  model.title,
  model.format,
  line.top,
  line.bottom,
  var.title,
  fixef.title,
  fixef.prefix,
  fixef.suffix,
  fixef.where,
  slopes.title,
  slopes.format,
  fixef_sizes.prefix,
  fixef_sizes.suffix,
  stats.title,
  notes.intro,
  notes.tpt.intro,
  tablefoot,
  tablefoot.value,
  yesNo,
  tabular = "normal",
  depvar.style,
  no_border,
  caption.after,
  rules_width,
  signif.code,
  tpt,
  arraystretch,
  adjustbox = NULL,
  fontsize,
  interaction.combine = " $\\times$ ",
  i.equal = " $=$ "
)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>main</code></td>
<td>
<p>Either &quot;base&quot;, &quot;aer&quot; or &quot;qje&quot;. Defines the basic style to start from. The styles &quot;aer&quot; and &quot;qje&quot; are almost identical and only differ on the top/bottom lines.</p>
</td></tr>
<tr valign="top"><td><code>depvar.title</code></td>
<td>
<p>A character scalar. The title of the line of the dependent variables (defaults to <code>"Dependent variable(s):"</code> if <code>main = "base"</code> (the 's' appears only if just one variable) and to <code>""</code> if <code>main = "aer"</code>).</p>
</td></tr>
<tr valign="top"><td><code>model.title</code></td>
<td>
<p>A character scalar. The title of the line of the models (defaults to <code>"Model:"</code> if <code>main = "base"</code> and to <code>""</code> if <code>main = "aer"</code>).</p>
</td></tr>
<tr valign="top"><td><code>model.format</code></td>
<td>
<p>A character scalar. The value to appear on top of each column. It defaults to <code>"(1)"</code>. Note that 1, i, I, a and A are special characters: if found, their values will be automatically incremented across columns.</p>
</td></tr>
<tr valign="top"><td><code>line.top</code></td>
<td>
<p>A character scalar equal to <code>"simple"</code>, <code>"double"</code>, or anything else. The line at the top of the table (defaults to <code>"double"</code> if <code>main = "base"</code> and to <code>"simple"</code> if <code>main = "aer"</code>). <code>"simple"</code> is equivalent to <code>"\\toprule"</code>, and <code>"double"</code> to <code>"\\tabularnewline \\midrule \\midrule"</code>.</p>
</td></tr>
<tr valign="top"><td><code>line.bottom</code></td>
<td>
<p>A character scalar equal to <code>"simple"</code>, <code>"double"</code>, or anything else. The line at the bottom of the table (defaults to <code>"double"</code> if <code>main = "base"</code> and to <code>"simple"</code> if <code>main = "aer"</code>). <code>"simple"</code> is equivalent to <code>"\\bottomrule"</code>, and <code>"double"</code> to <code>"\\midrule \\midrule &amp; \\tabularnewline"</code>.</p>
</td></tr>
<tr valign="top"><td><code>var.title</code></td>
<td>
<p>A character scalar. The title line appearing before the variables (defaults to <code>"\\midrule \\emph{Variables}"</code> if <code>main = "base"</code> and to <code>"\\midrule"</code> if <code>main = "aer"</code>). Note that the behavior of <code>var.title = " "</code> (a space) is different from <code>var.title = ""</code> (the empty string): in the first case you will get an empty row, while in the second case you get no empty row. To get a line without an empty row, use <code>"\\midrule"</code> (and not <code>"\\midrule "</code>!&ndash;the space!).</p>
</td></tr>
<tr valign="top"><td><code>fixef.title</code></td>
<td>
<p>A character scalar. The title line appearing before the fixed-effects (defaults to <code>"\\midrule \\emph{Fixed-effects}"</code> if <code>main = "base"</code> and to <code>" "</code> if <code>main = "aer"</code>). Note that the behavior of <code>fixef.title = " "</code> (a space) is different from <code>fixef.title = ""</code> (the empty string): in the first case you will get an empty row, while in the second case you get no empty row. To get a line without an empty row, use <code>"\\midrule"</code> (and not <code>"\\midrule "</code>!&ndash;the space!).</p>
</td></tr>
<tr valign="top"><td><code>fixef.prefix</code></td>
<td>
<p>A prefix to add to the fixed-effects names. Defaults to <code>""</code> (i.e. no prefix).</p>
</td></tr>
<tr valign="top"><td><code>fixef.suffix</code></td>
<td>
<p>A suffix to add to the fixed-effects names. Defaults to <code>""</code> if <code>main = "base"</code>) and to <code>"fixed-effects"</code> if <code>main = "aer"</code>).</p>
</td></tr>
<tr valign="top"><td><code>fixef.where</code></td>
<td>
<p>Either &quot;var&quot; or &quot;stats&quot;. Where to place the fixed-effects lines? Defaults to <code>"var"</code>, i.e. just after the variables, if <code>main = "base"</code>) and to <code>"stats"</code>, i.e. just after the statistics, if <code>main = "aer"</code>).</p>
</td></tr>
<tr valign="top"><td><code>slopes.title</code></td>
<td>
<p>A character scalar. The title line appearing before the variables with varying slopes (defaults to <code>"\\midrule \\emph{Varying Slopes}"</code> if <code>main = "base"</code> and to <code>""</code> if <code>main = "aer"</code>). Note that the behavior of <code>slopes.title = " "</code> (a space) is different from <code>slopes.title = ""</code> (the empty string): in the first case you will get an empty row, while in the second case you get no empty row. To get a line without an empty row, use <code>"\\midrule"</code> (and not <code>"\\midrule "</code>!&ndash;the space!).</p>
</td></tr>
<tr valign="top"><td><code>slopes.format</code></td>
<td>
<p>Character scalar representing the format of the slope variable name. There are two special characters: &quot;<strong>var</strong>&quot; and &quot;<strong>slope</strong>&quot;, placeholers for the variable and slope names. Defaults to <code>"__var__ (__slope__)"</code> if <code>main = "base"</code>) and to <code>"__var__ $\\times $ __slope__"</code> if <code>main = "aer"</code>).</p>
</td></tr>
<tr valign="top"><td><code>fixef_sizes.prefix</code></td>
<td>
<p>A prefix to add to the fixed-effects names. Defaults to <code>"# "</code>.</p>
</td></tr>
<tr valign="top"><td><code>fixef_sizes.suffix</code></td>
<td>
<p>A suffix to add to the fixed-effects names. Defaults to <code>""</code> (i.e. no suffix).</p>
</td></tr>
<tr valign="top"><td><code>stats.title</code></td>
<td>
<p>A character scalar. The title line appearing before the statistics (defaults to <code style="white-space: pre;">"\\midrule \\emph{Fit statistics"}</code> if <code>main = "base"</code> and to <code>" "</code> if <code>main = "aer"</code>). Note that the behavior of <code>stats.title = " "</code> (a space) is different from <code>stats.title = ""</code> (the empty string): in the first case you will get an empty row, while in the second case you get no empty row. To get a line without an empty row, use <code>"\\midrule"</code> (and not <code>"\\midrule "</code>!&ndash;the space!).</p>
</td></tr>
<tr valign="top"><td><code>notes.intro</code></td>
<td>
<p>A character scalar. Some tex code appearing just before the notes, defaults to <code>"\\par \\raggedright \n"</code>.</p>
</td></tr>
<tr valign="top"><td><code>notes.tpt.intro</code></td>
<td>
<p>Character scalar. Only used if <code>tpt = TRUE</code>, it is some tex code that is passed before any <code>threeparttable</code> item (can be used for, typically, the font size). Default is the empty string.</p>
</td></tr>
<tr valign="top"><td><code>tablefoot</code></td>
<td>
<p>A logical scalar. Whether or not to display a footer within the table. Defaults to <code>TRUE</code> if <code>main = "aer"</code>) and <code>FALSE</code> if <code>main = "aer"</code>).</p>
</td></tr>
<tr valign="top"><td><code>tablefoot.value</code></td>
<td>
<p>A character scalar. The notes to be displayed in the footer. Defaults to <code>"default"</code> if <code>main = "base"</code>, which leads to custom footers informing on the type of standard-error and significance codes, depending on the estimations.</p>
</td></tr>
<tr valign="top"><td><code>yesNo</code></td>
<td>
<p>A character vector of length 1 or 2. Defaults to <code>"Yes"</code> if <code>main = "base"</code> and to <code>"$\\checkmark$"</code> if <code>main = "aer"</code> (from package <code>amssymb</code>). This is the message displayed when a given fixed-effect is (or is not) included in a regression. If <code>yesNo</code> is of length 1, then the second element is the empty string.</p>
</td></tr>
<tr valign="top"><td><code>tabular</code></td>
<td>
<p>(Tex only.) Character scalar equal to &quot;normal&quot; (default), <code>"*"</code> or <code>"X"</code>. Represents the type of tabular environment to use: either <code>tabular</code>, <code style="white-space: pre;">tabular*</code> or <code>tabularx</code>.</p>
</td></tr>
<tr valign="top"><td><code>depvar.style</code></td>
<td>
<p>Character scalar equal to either <code>" "</code> (default), <code>"*"</code> (italic), <code>"**"</code> (bold), <code>"***"</code> (italic-bold). How the name of the dependent variable should be displayed.</p>
</td></tr>
<tr valign="top"><td><code>no_border</code></td>
<td>
<p>Logical, default is <code>FALSE</code>. Whether to remove any side border to the table (typically adds <code style="white-space: pre;">@\{\</code> to the sides of the tabular).</p>
</td></tr>
<tr valign="top"><td><code>caption.after</code></td>
<td>
<p>Character scalar. Tex code that will be placed right after the caption. Defaults to <code>""</code> for <code>main = "base"</code> and <code>"\\medskip"</code> for <code>main = "aer"</code>.</p>
</td></tr>
<tr valign="top"><td><code>rules_width</code></td>
<td>
<p>Character vector of length 1 or 2. This vector gives the width of the <code>booktabs</code> rules: the first element the heavy-width, the second element the light-width. NA values mean no modification. If of length 1, only the heavy rules are modified. The width are in Latex units (ex: <code>"0.1 em"</code>, etc).</p>
</td></tr>
<tr valign="top"><td><code>signif.code</code></td>
<td>
<p>Named numeric vector, used to provide the significance codes with respect to the p-value of the coefficients. Default is <code>c("***"=0.01, "**"=0.05, "*"=0.10)</code>. To suppress the significance codes, use <code>signif.code=NA</code> or <code>signif.code=NULL</code>. Can also be equal to <code>"letters"</code>, then the default becomes <code>c("a"=0.01, "b"=0.05, "c"=0.10)</code>.</p>
</td></tr>
<tr valign="top"><td><code>tpt</code></td>
<td>
<p>(Tex only.) Logical scalar, default is FALSE. Whether to use the <code>threeparttable</code> environment. If so, the <code>notes</code> will be integrated into the <code>tablenotes</code> environment.</p>
</td></tr>
<tr valign="top"><td><code>arraystretch</code></td>
<td>
<p>(Tex only.) A numeric scalar, default is <code>NULL</code>. If provided, the command <code style="white-space: pre;">\\renewcommand*{\\arraystretch{x}}</code> is inserted, replacing <code>x</code> by the value of <code>arraystretch</code>. The changes are specific to the current table and do not affect the rest of the document.</p>
</td></tr>
<tr valign="top"><td><code>adjustbox</code></td>
<td>
<p>(Tex only.) A logical, numeric or character scalar, default is <code>NULL</code>. If not <code>NULL</code>, the table is inserted within the <code>adjustbox</code> environment. By default the options are <code style="white-space: pre;">width = 1\\textwidth, center</code> (if <code>TRUE</code>). A numeric value changes the value before <code style="white-space: pre;">\\textwidth</code>. You can also add a character of the form <code>"x tw"</code> or <code>"x th"</code> with <code>x</code> a number and where tw (th) stands for text-width (text-height). Finally any other character value is passed verbatim as an <code>adjustbox</code> option.</p>
</td></tr>
<tr valign="top"><td><code>fontsize</code></td>
<td>
<p>(Tex only.) A character scalar, default is <code>NULL</code>. Can be equal to <code>tiny</code>, <code>scriptsize</code>, <code>footnotesize</code>, <code>small</code>, <code>normalsize</code>, <code>large</code>, or <code>Large</code>. The change affect the table only (and not the rest of the document).</p>
</td></tr>
<tr valign="top"><td><code>interaction.combine</code></td>
<td>
<p>Character scalar, defaults to <code>" $\\times$ "</code>. When the estimation contains interactions, then the variables names (after aliasing) are combined with this argument. For example: if <code>dict = c(x1="Wind", x2="Rain")</code> and you have the following interaction <code>x1:x2</code>, then it will be renamed (by default) <code style="white-space: pre;">Wind $\\times$ Rain</code> &ndash; using <code>interaction.combine = "*"</code> would lead to <code>Wind*Rain</code>.</p>
</td></tr>
<tr valign="top"><td><code>i.equal</code></td>
<td>
<p>Character scalar, defaults to <code>" $=$ "</code>. Only affects factor variables created with the function <code>i</code>, tells how the variable should be linked to its value. For example if you have the Species factor from the iris data set, by default the display of the variable is <code style="white-space: pre;">Species $=$ Setosa</code>, etc. If <code>i.equal = ": "</code> the display becomes <code>Species: Setosa</code>.</p>
</td></tr>
</table>


<h3>Details</h3>

<p>The <code style="white-space: pre;">\\checkmark</code> command, used in the &quot;aer&quot; style (in argument <code>yesNo</code>), is in the <code>amssymb</code> package.
</p>
<p>The commands <code style="white-space: pre;">\\toprule</code>, <code style="white-space: pre;">\\midrule</code> and <code style="white-space: pre;">\\bottomrule</code> are in the <code>booktabs</code> package. You can set the width of the top/bottom rules with <code style="white-space: pre;">\\setlength\\heavyrulewidth\{wd\}</code>, and of the midrule with <code style="white-space: pre;">\\setlength\\lightrulewidth\{wd\}</code>.
</p>
<p>Note that all titles (<code>depvar.title</code>, <code>depvar.title</code>, etc) are not escaped, so they must be valid Latex expressions.
</p>


<h3>Value</h3>

<p>Returns a list containing the style parameters.
</p>


<h3>See Also</h3>

<p><code>etable</code>
</p>


<h3>Examples</h3>

<pre>

# Multiple estimations =&gt; see details in feols
aq = airquality
est = feols(c(Ozone, Solar.R) ~
                Wind + csw(Temp, Temp^2, Temp^3) | Month + Day,
            data = aq)

# Playing a bit with the styles
etable(est, tex = TRUE)
etable(est, tex = TRUE, style.tex = style.tex("aer"))

etable(est, tex = TRUE, style.tex = style.tex("aer",
                                      var.title = "\\emph{Expl. Vars.}",
                                      model.format = "[i]",
                                      yesNo = "x",
                                      tabular = "*"))

</pre>


</body></html>
