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

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”> "error" #1501

Closed
hbahamonde opened this issue Feb 6, 2018 · 6 comments
Milestone

Comments

@hbahamonde
Copy link

hbahamonde commented Feb 6, 2018

Hi,

For some reason I'm getting the following message when I compile a .rnw file in RStudio:

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>

I noticed that the message is contained in the next line of code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

Everything else works just fine. It's just the message.

I've updated Pandoc, knitr and r. All packages I'm using were also updated.

Not sure if this is an error, or what. I couldn't find any information online.

@yihui
Copy link
Owner

yihui commented Feb 7, 2018

The file knitr/inst/opencpu/apps/index.html is probably not relevant.

Please provide devtools::session_info(). If you have screenshots of the message in RStudio, they will also be helpful.

@hbahamonde
Copy link
Author

Thank you, Yihui.

This is what devtools::session_info() gives me after clicking Knit in Rstudio.

Session info -------------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.4.3 (2017-11-30)
 system   x86_64, darwin15.6.0        
 ui       RStudio (1.1.383)           
 language (EN)                        
 collate  en_US.UTF-8                 
 tz       America/Chicago             
 date     2018-02-07                  

Packages -----------------------------------------------------------------------------------------------------------------
 package     * version date       source        
 backports     1.1.2   2017-12-13 CRAN (R 3.4.3)
 base        * 3.4.3   2017-12-07 local         
 colorspace    1.3-2   2016-12-14 CRAN (R 3.4.0)
 compiler      3.4.3   2017-12-07 local         
 datasets    * 3.4.3   2017-12-07 local         
 devtools      1.13.4  2017-11-09 CRAN (R 3.4.2)
 digest        0.6.15  2018-01-28 CRAN (R 3.4.3)
 evaluate      0.10.1  2017-06-24 CRAN (R 3.4.1)
 geosphere     1.5-7   2017-11-05 CRAN (R 3.4.2)
 ggmap       * 2.6.1   2016-01-23 CRAN (R 3.4.0)
 ggplot2     * 2.2.1   2016-12-30 CRAN (R 3.4.0)
 graphics    * 3.4.3   2017-12-07 local         
 grDevices   * 3.4.3   2017-12-07 local         
 grid          3.4.3   2017-12-07 local         
 gtable        0.2.0   2016-02-26 CRAN (R 3.4.0)
 htmltools     0.3.6   2017-04-28 CRAN (R 3.4.0)
 jpeg          0.1-8   2014-01-23 CRAN (R 3.4.0)
 knitr         1.19    2018-01-29 CRAN (R 3.4.3)
 labeling      0.3     2014-08-23 CRAN (R 3.4.0)
 lattice       0.20-35 2017-03-25 CRAN (R 3.4.3)
 lazyeval      0.2.1   2017-10-29 CRAN (R 3.4.2)
 magrittr      1.5     2014-11-22 CRAN (R 3.4.0)
 mapproj       1.2-5   2017-06-08 CRAN (R 3.4.0)
 maps          3.2.0   2017-06-08 CRAN (R 3.4.0)
 memoise       1.1.0   2017-04-21 CRAN (R 3.4.0)
 methods     * 3.4.3   2017-12-07 local         
 munsell       0.4.3   2016-02-13 CRAN (R 3.4.0)
 pacman      * 0.4.6   2017-05-14 CRAN (R 3.4.0)
 pillar        1.1.0   2018-01-14 CRAN (R 3.4.3)
 plyr          1.8.4   2016-06-08 CRAN (R 3.4.0)
 png           0.1-7   2013-12-03 CRAN (R 3.4.0)
 proto         1.0.0   2016-10-29 CRAN (R 3.4.0)
 Rcpp          0.12.15 2018-01-20 CRAN (R 3.4.3)
 reshape2      1.4.3   2017-12-11 CRAN (R 3.4.3)
 RgoogleMaps   1.4.1   2016-09-18 CRAN (R 3.4.0)
 rjson         0.2.15  2014-11-03 CRAN (R 3.4.0)
 rlang         0.1.6   2017-12-21 CRAN (R 3.4.3)
 rmarkdown     1.8     2017-11-17 CRAN (R 3.4.2)
 rprojroot     1.3-2   2018-01-03 CRAN (R 3.4.3)
 scales        0.5.0   2017-08-24 CRAN (R 3.4.1)
 sp            1.2-7   2018-01-19 CRAN (R 3.4.3)
 stats       * 3.4.3   2017-12-07 local         
 stringi       1.1.6   2017-11-17 CRAN (R 3.4.2)
 stringr       1.2.0   2017-02-18 CRAN (R 3.4.0)
 tibble        1.4.2   2018-01-22 CRAN (R 3.4.3)
 tools         3.4.3   2017-12-07 local         
 utils       * 3.4.3   2017-12-07 local         
 withr         2.1.1   2017-12-19 CRAN (R 3.4.3)
 yaml          2.1.16  2017-12-12 CRAN (R 3.4.3)
 zipcode     * 1.0     2012-03-12 CRAN (R 3.4.0)

The problem happens either with Sweave or knitr.

Now, to make sure, the message is not an error that pops up in the console. It gets "printed" in the output, in my case an HTML file.

See below an screenshot. The message is right below "Table 1."

1

@yihui yihui added this to the v1.20 milestone Feb 7, 2018
@yihui
Copy link
Owner

yihui commented Feb 7, 2018

Okay. The screenshot is helpful. I believe the problem was not from knitr but the package/function that you used to create the table (which you didn't mention). It seems to have emitted a full HTML document, but should only emit an HTML fragment of <table></table>.

@hbahamonde
Copy link
Author

Thank you, Yihui. And sorry for not mentioning the package I used to generate the tables, which was the texreg package.

Problem solved. You were absolutely right. knitr was not the cause.

When doing tables in HTML in texreg via the htmlreg function, the argument doctype = FALSE should be added.

Don't know how <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" started popping up just now.

Thanks very much.

@yihui
Copy link
Owner

yihui commented Feb 7, 2018

Perfect. Thanks!

@yihui yihui closed this as completed Feb 7, 2018
@github-actions
Copy link

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants