Re: [Rd] citEntry handling of encoded URLs
On Fri, 23 May 2014, Duncan Murdoch wrote: On 23/05/2014 8:35 AM, Achim Zeileis wrote: On Thu, 22 May 2014, Martin Morgan wrote: > The following citEntry includes a url with %3A and other encodings > > citEntry(entry="article", > title = "Software for Computing and Annotating Genomic Ranges", > author = personList( as.person("Michael Lawrence" )), > year = 2013, > journal = "{PLoS} Computational Biology", > volume = "9", > issue = "8", > doi = "10.1371/journal.pcbi.1003118", > url = > "http://www.ploscompbiol.org/article/info%3Adoi%2F10.1371%2Fjournal.pcbi.1003118";, > textVersion = "Lawrence M..." ) > > Evaluating this as R code doesn't parse correctly and generates a warning The citEntry (or bibentry) itself is parsed without problem. Some printing styles cause the warning, specifically when the Rd parser is used for formatting. Depending on how you want to print it, the warning doesn't occur though. Using bibentry() directly, we can do: b <- bibentry("Article", title = "Software for Computing and Annotating Genomic Ranges", author = "Michael Lawrence and others", year = "2013", journal = "PLoS Comptuational Biology", volume = "9", number = "8", doi = "10.1371/journal.pcbi.1003118", url = "http://www.ploscompbiol.org/article/info%3Adoi%2F10.1371%2Fjournal.pcbi.1003118";, textVersion = "Lawrence M et al. (2013) ..." ) Then the default print(b) issues a warning because the Rd parser thinks that the % are comments. However, print(b, style = "BibTeX") print(b, style = "citation") don't issue warnings and also produce output that one might expect. > A work-around is, apparently, to quote the %, \\%3A etc., but is this the > intention? In that case the default print(b) yields the desired output without warning but print(b, style = "BibTeX") or print(b, style = "citation") are possibly not in the desired format. I'm not sure though how the different BibTeX style files actually handle the URLs. I think some .bst files handle the "url" field verbatim (i.e., don't need escaping) while others treat it as text (i.e., need escaping). Personally, I would hence avoid the problem and only use the DOI URL here as this will be robust across BibTeX styles. Nevertheless it is not ideal that there is a discrepancy between the different printing styles. I think currently this can only be avoided if custom macros are employed. But Duncan might be able to say more about this. A similar situation occurs if you use commands that are not part of the Rd markup, e.g. I'd go further than "not ideal", I think we need to define what kind of markup is permissible in this context. If it needs to be Rd markup, then the default print method should be fixed to hide it (and \mathcal should not be allowed); if it needs to be plain text, then some escaping should be done. I would argue that any LaTeX-style markup should be permitted in the bibentry objects so that you can work with your BibTeX files in R. For the "text" and "html" print output, I would be happy if these used some approximation for unknown markup, e.g., omitting \mathcal and $ or something like that. Then only a small subset of LaTeX-style Rd markup commands would be properly processed. n01 <- bibentry("Misc", title = "The $\\mathcal{N}(0, 1)$ Distribution", author = "Foo Bar", year = "2014") print(n01) # warning print(n01, style = "BibTeX") # ok > Also, citEntry points to bibentry points to *Entry Fields*, but the > 'url' tag is not mentioned there, even though url appears in the > examples; if the list of supported tags is not easy to enumerate, > perhaps some insight can be provided at this point as to how the > supported tags are determined? This follows the BibTeX conventions. Thus, you can use any tag that you wish to use and it will depend on the style whether it is displayed or not. The only restriction is that certain bibtypes require certain fields, e.g., an "Article" has to specify: author, title, journal, year. But beyond that you can add any additional field. For example, in your bibentry above you used the "issue" field which is ignored by most BibTeX styles. My adaptation uses the "number" field instead which is processed by most standard BibTeX styles. The default print(..., style = "text") uses a bibstyle that is modeled after jss.bst, the BibTeX style employed by the Journal of Statistical Software. But you could plug in other .bibstyle arguments, e.g. one that processes the "issue" field etc. Hope that helps, Z > Thanks > > Martin Morgan > -- > Computational Biology / Fred Hutchinson Cancer Research Center > 1100 Fairview Ave. N. > PO Box 19024 Seattle, WA 98109 > > Location: Arnold Building M1 B861 > Phone: (206) 667-2793 > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > __ R-d
[Rd] iRe: Latex errors (build on windows)
Thanks so much for your beneficial advice!Accroding to your suggests, I read the tutorial about Latex.Besides,I downloaded the MiKTeX 2.9,WinEdt 8 as well as Texmaker.I try to made a PDF version.But in fact,I failed.The R version I use is 2.15.3.Best wishes! Many thanks! -- View this message in context: http://r.789695.n4.nabble.com/Latex-errors-build-on-windows-tp4691118p4691163.html Sent from the R devel mailing list archive at Nabble.com. [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Latex errors (build on windows)
Dear Prof Brian Ripley: Thanks so much for your beneficial advice!And it is my great pleasure. Accroding to your suggests, I read the tutorials about Latex.Besides,I downloaded the MiKTeX 2.9,WinEdt 8 as well as Texmaker.I try to made a PDF version.But in fact,I failed. The R version I use is 2.15.3. Actually,I was learning how to made a simply R package.At first,I uesd the function of "package skeleton" .When I run "R CMD c:\pa(which is the workspace I use)â,it told me that "NO document or directory can find".So I built R package in another way,I downloaded the "devtools/roxygen2/testthat".Eventually,I met with the problem of Latex errors.And now,these problems have confused me a lot. I am looking forword to hear from you! Best wishes! Huelei Kong Department of System Biomedical in Shanghai Jiaotong University - Department of System biomedical in Shanghaijiaotong University,China! -- View this message in context: http://r.789695.n4.nabble.com/Latex-errors-build-on-windows-tp4691118p4691164.html Sent from the R devel mailing list archive at Nabble.com. [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Latex errors (build on windows)
Dear Prof Brian Ripley: I am very sorry for that I use the unappropriate words "It's my great pleasure" when I read this mail again! I give my apology sincerely to you ,unreservedly and with my heart! You are such a warm-hearted man.And you help me to solve my problems.But owing to my poor English, I found I had made such a foolish mistake. My brain must have been stupid at that time . I hope you can forgive my carelessness and this will not affect your work. I feel ashamed of myself.And this may be brought bad influences on my university as well as my country.I hope you won't have a bad impression on my country's students. From now on,aparting from learning R language,I will strengthen my English learning.And this will be a lesson for me. Hope you could forgive me! And I hope I can continue to learn from you.I request you can give me a chance,I will never make such a mistake ! Best wishes! I am looking forword to you reply! Hualei Kong - Department of System biomedical in Shanghaijiaotong University,China! -- View this message in context: http://r.789695.n4.nabble.com/Latex-errors-build-on-windows-tp4691118p4691167.html Sent from the R devel mailing list archive at Nabble.com. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] My sincere apology
Dear Prof Brian Ripley: I am very sorry for that I use the unappropriate words "It's my great pleasure" when I read this mail again! I give my apology sincerely to you ,unreservedly and with my heart! You are such a warm-hearted man.And you help me to solve my problems.But owing to my poor English, I found I had made such a foolish mistake. My brain must have been stupid at that time . I hope you can forgive my carelessness and this will not affect your work. I feel ashamed of myself.And this may be brought bad influences on my university as well as my country.I hope you won't have a bad impression on my country's students. From now on,aparting from learning R language,I will strengthen my English learning.And this will be a lesson for me. Hope you could forgive me! And I hope I can continue to learn from you.I request you can give me a chance,I will never make such a mistake ! Best wishes! I am looking forword to you reply! Huelei Kong Department of System Biomedical in Shanghai Jiaotong University - Department of System biomedical in Shanghaijiaotong University,China! -- View this message in context: http://r.789695.n4.nabble.com/My-sincere-apology-tp4691166.html Sent from the R devel mailing list archive at Nabble.com. [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Latex errors (build on windows)
You do not need to feel so bad. No one was born an expert (even an expert may not be able to find the relevant information in a subsection of an appendix in a certain manual among numerous hyperlinks). The sky is not going to falling down, and the earth is not going to explode just because you do not know how to install a LaTeX package. I'm pretty sure you are not the only one who was puzzled by inconsolata.sty, and I believe this will continue to confuse more in the future. Unless one has LaTeX vignettes, the Rd PDF manual is normally the only place where LaTeX is required in an R Package. Personally I do not think this LaTeX dependency is worth it, comparing the relatively small gain and the great effort to learn LaTeX as well as the toolchain. It will be nice if the PDF manual can be optional for CRAN and R CMD check. Biologists, doctors, and other scientists may spend their time on more valuable things than learning LaTeX. Just my 2 cents. P.S. Just in case this should be misunderstood: 1. I do appreciate the value of LaTeX; 2. I'm grateful to the effort that R core made in the manuals; 3. There are people who are busy with test tubes and bacteria, and they also need sleep. Regards, Yihui -- Yihui Xie Web: http://yihui.name On Sat, May 24, 2014 at 7:19 AM, Hualei Kong wrote: > Dear Prof Brian Ripley: > I am very sorry for that I use the unappropriate words "It's my great > pleasure" when I read this mail again! I give my apology sincerely to you > ,unreservedly and with my heart! > You are such a warm-hearted man.And you help me to solve my > problems.But owing to my poor English, I found I had made such a foolish > mistake. My brain must have been stupid at that time . I hope you can > forgive my carelessness and this will not affect your work. > I feel ashamed of myself.And this may be brought bad influences on my > university as well as my country.I hope you won't have a bad impression on > my country's students. From now on,aparting from learning R language,I will > strengthen my English learning.And this will be a lesson for me. > Hope you could forgive me! And I hope I can continue to learn from > you.I request you can give me a chance,I will never make such a mistake ! > Best wishes! I am looking forword to you reply! > > > > Hualei Kong __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel