title: Confusion about setting column width in huxtable
body: <p>I am a little bit confused about how setting column widths works for tables in the R package <code>huxtable</code>. The documentation says that in the call to <code>set_col_width</code> the argument <code>value</code>, if numeric, specifies column widths as proportions of the overall width (which is set by <code>set_width</code>). But, when I write a table to Word, a numeric vector for <code>value</code> seems to instead specify absolute column width (which I actually like), apparently in inches, regardless of the value set in <code>set_width</code>. For pdf output, column width specifications don't seem to have any effect at all. </p>
  
  <p>Consider the following example. </p>
  
  <pre><code>library(dplyr)
  library(huxtable)
  
  test=data.frame(var1=1918:1925,var2=c(9009,1000:1006),var3 = 1100:1107)
  HUX &lt;- hux(test)
  
  # add caption, borders, and colnames
  HUX &lt;- set_caption(HUX,"Example table") %&gt;%
  set_caption_pos("topleft") %&gt;%
  set_top_border(1,,1) %&gt;%
  set_bottom_border(final(1), , 1)    %&gt;%
  set_align(,,"left") %&gt;%
  add_colnames()
  number_format(HUX)[,2:3] &lt;- list(function(x) prettyNum(x, big.mark=","))
  </code></pre>
  
  <p>If I set column widths, they are reflected in the Word output, but not the pdf output, but apparently as absolute, not proportional widths. </p>
  
  <pre><code>HUX &lt;- set_width(HUX,1) %&gt;%
      set_col_width(1:3, c(2,1,1))
  quick_docx(HUX)  
  quick_pdf(HUX)                                
  
  file.remove(c("huxtable-output.pdf","huxtable-output.docx"))
  HUX &lt;- set_width(HUX,1) %&gt;%
      set_col_width(1:3, c(2,3,1))
  quick_docx(HUX)  
  quick_pdf(HUX)                                
  </code></pre>
  
  <p>The above code changes the column widths (and the overall table widths, even though the width set in <code>set_width</code> is unchanged), but only in Word, not for the pdf output. Changing the argument in <code>set_with</code> has no effect in Word, but does shift the table in the pdf (although the appearance of the table itself is unchanged), presumably because the "table plotting area" is smaller, and the edge is thus shifted, and the position of the table is left-justified in this "area".</p>
  
  <pre><code>file.remove(c("huxtable-output.pdf","huxtable-output.docx"))
  HUX &lt;- set_width(HUX,0.5) %&gt;%
      set_col_width(1:3, c(2,3,1))
  quick_docx(HUX)  
  quick_pdf(HUX)                                
  </code></pre>
  
  <p>Now, when I try to specify column width using valid (I think) LaTex lengths, it makes no difference for the pdf, and neither does it actually set column widths for the Word output. </p>
  
  <pre><code>file.remove(c("huxtable-output.pdf","huxtable-output.docx"))
  HUX &lt;- set_width(HUX,1) %&gt;%
      set_col_width(1:3, paste0(c(2,3,1),"in"))
  quick_docx(HUX)  
  quick_pdf(HUX)                                
  </code></pre>
  
  <p>Moreover, now, having tried LaTex length specifications, the previous code (above) that <em>did</em> successfully set column widths for the Word output, no longer does so. </p>
  
  <pre><code>file.remove(c("huxtable-output.pdf","huxtable-output.docx"))
  HUX &lt;- set_width(HUX,1) %&gt;%
      set_col_width(1:3, c(2,3,1))
  quick_docx(HUX)  
  quick_pdf(HUX)                                
  </code></pre>
  
  <p>I apologize if I'm missing something obvious here, but I just can't seem to get this column width specification working the way I expected. Many thanks to anyone who can clear this up for me.</p>
  
  <p>The bottom line is that I'd like to be able to explicitly set column widths, regardless of the cell contents of a table (i.e., column widths are not shrunk to the width of the cell contents), especially for writing out or knitting to pdf. </p>
  
  <p>Having it work for Word would be nice too, but as an aside, writing to Word seems to not preserve the table caption (but I could always add a caption later in Word).</p>
  
  <p>I'm using <code>huxtable</code> 4.5.0.</p>