eddelbuettel / pinp Goto Github PK
View Code? Open in Web Editor NEWPinp Is Not PNAS -- Two-Column PDF Template
Pinp Is Not PNAS -- Two-Column PDF Template
I'm getting the exact same error as shown here (Last updated on 2019-08-29 02:49:05 CEST):
http://cran.utstat.utoronto.ca/web/checks/check_results_Rcpp.html
I tried reinstalling my TeXLive distribution on Ubuntu using tinytex
but that didn't work. I'm not really sure how to provide a reproducible example with a reproducible environment for this issue.
Kurt H writes what follows below. Need to change the reference vignette, and the Rcpp* packages using this scheme.
Dirk,
As already mentioned: pls see
https://cran.r-project.org/web/checks/check_results_RcppCNPy.html
Yihui wrote:
The problem is that it seems Pandoc no longer recognizes arbitrary
LaTeX commands in variables set in the YAML metadata. Specifically,
in RcppCNPy-intro.Rmd:
include-after: |
\begin{thebibliography}{4}
This will be escaped to \textbackslash{}begin{thebibliography}{4}
in the .tex output, failing the bibliography. I suggest that the
authors move the values of header-includes and include-after to
separate .tex files, and use the "includes" option of the R Markdown
output format, e.g.,
output:
pinp::pinp:
includes:
in_header: header.tex
after_body: bibliography.tex
Can you pls fix accordingly?
Packages
RcppClassic RcppGSL RcppZiggurat pinp
apparently all have exactly the same problem as RcppCNPy: pls fix those
too.
Best
-k
I'm trying to use the template where I do not include any abstract and keyword information, and without any text here, there are still 2-3 lines of empty space before the first lines of text in the body of the document starts in column 1. I've been trying to figure out how to get ride of this space so the text in both columns start evenly and so that this space disappears. I'm sure this is an easy fix, but I'm pretty new to working with tex, and I'm stumped. Haven't found anything online in the usual places, I'm hoping someone here might have ideas. Thanks!
For example:
We probably should tag the releases on GitHub.
v0.0.1 - v0.0.3 will need to be done via CLI
git tag -a <tag> <commit-hash>
git push origin --tags
(FYI: releases are MIA on tint
and linl
)
I am a little non-plus'ed that adding pinp as the vignette driver leads to two extra files.
I already figured out how to get rid of one---we can just include the content of the Bibtex-rendered .blg file directly in the source Rmd, which frees us from adding a foo.bib
file. Down one. (Of course, you want it while you still edit the document. Once done, and included as a more static vignette you do not and the extra file is line noise.)
And I realized that we have a code hook to just copy in pinp.cls
from the pinp skeleton directory if it is not present in the current working directory---and tada we also get rid of pinp.cls
.
Good idea? Methinks it is.
KH writes in private email. Has not bitten me yet on Ubuntu...
Pls see
https://cran.r-project.org/web/checks/check_results_pinp.html:
apparently pinp.cls no longer works with current texlive.For me problems started with the recent Debian testing upgrade to
texlive 2019.20190830-1; for Brian a few days sooner.My check logs show tlmgr fail because there is no initialized user
tree. If I run tlmgr init-usertree, my logs look like Brian's, modulo
mine using TEXMFHOME (as tlmgr on Debian will not use other locations).The same problems occur with packages
ChemoSpec ChemoSpec2D RProtoBuf Rcpp RcppArmadillo RcppCNPy
RcppClassic RcppGSL RcppZiggurat mistr pinp readJDXwhich are exactly the packages using pinp::pinp to produce a pinp
document.Of course, tikzlibrarytopaths.code.tex is installed on the check
systems. Nevertheless, knitr asks tinytex to try to install pgf, which
does not help, as compilation still fails with a missing
\begin{document} error in pinp.cls. I suspect what is going on is that
recent texlive changes have invalidated pinp.cls presumably with an
error in tikzlibrarytopaths.code.tex, knitr incorrectly infers that this
is missing and asks tlmgr to install, and then fails again.Hard to find out more on my end: can you please have a look?
This is a small nasty thing that mage me kill several hours twice (with a gap of maybe half a year). Once the package is updated, a fresh cope of pinp.bst
is required, and the directory with previously knitted document hold an outdated copy. Maybe there is a way to give an informative message in such a case?
I tried to install pinp
on a computer using Windows 10 in Portuguese and every time I try to compile the package example, I get the following error in my log file:
! pdfTeX error (font expansion): auto expansion is only possible with scalable
fonts.
\AtBegShi@Output ...ipout \box \AtBeginShipoutBox
\fi \fi
l.234 T
o allow an equation to span both columns, options are to use the
Here is how much of TeX's memory you used:
38326 strings out of 494585
721011 string characters out of 6176316
852398 words of memory out of 5000000
41278 multiletter control sequences out of 15000+600000
593034 words of font info for 132 fonts, out of 8000000 for 9000
14 hyphenation exceptions out of 8191
64i,15n,77p,451b,894s stack positions out of 5000i,500n,10000p,200000b,80000s
! ==> Fatal error occurred, no output PDF file produced!
I tried both CRAN and github versions on Windows, but they give me the same error. I looked for help on internet (like this post on StackOverflow), but I couldn't find what is wrong with my computer.
My LaTeX engine is TinyTex, based on TexLive. I know it is correctly installed, because the vanilla pdf example from rmarkdown
is compiled in my computer.
I don't get what is happening, because I installed pinp
on macOS and Ubuntu 18.10 and it works on both systems.
Here is my sessionInfo()
if you need to check it.
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252
[3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Brazil.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] Rcpp_1.0.0 rstudioapi_0.8 knitr_1.21 magrittr_1.5
[5] usethis_1.4.0 devtools_2.0.1 pkgload_1.0.2 R6_2.3.0
[9] rlang_0.3.0.1 tools_3.5.1 pkgbuild_1.0.2 xfun_0.4
[13] sessioninfo_1.1.1 tinytex_0.9.3 cli_1.0.1 withr_2.1.2
[17] remotes_2.0.2 htmltools_0.3.6 yaml_2.2.0 assertthat_0.2.0
[21] digest_0.6.18 rprojroot_1.3-2 crayon_1.3.4 processx_3.2.1
[25] pinp_0.0.6 callr_3.1.0 fs_1.2.6 ps_1.2.1
[29] curl_3.2 glue_1.3.0 memoise_1.1.0 evaluate_0.12
[33] rmarkdown_1.11.2 compiler_3.5.1 backports_1.1.2 desc_1.2.0
[37] prettyunits_1.0.2
Create a unit test based off of what exists in RStudio's rticles package.
c.f.
Various:
skeleton.Rmd
(such as a two-column figures)The code segements come in lightgrey shaded and framed boxen.
We could do the same for output.
Hi,
The include-after is missing a \input{} from the template.tex. The code
$for(include-after)$
$include-after$
$endfor$
is correctly placed after the bibliography but if we want to include a .tex file, it needs to have a \input{include-after}
. Otherwise if we put include-after: somefile.tex
in the yaml, then just the words "somefile.tex" will apprear in the .tex.
Putting \input{somefile.tex}
in the yaml allows for a workaround. but it's nicer to just put the .tex in the yaml header
A few places in NEWS.Rd incorrectly refer to tint
rather than pinp
.
Has the bib.tex file been intentionally omitted from the pinp
package?
From YAML:
# Produce a pinp document
output:
pinp::pinp:
includes:
after_body: bib.tex
Using the current Rcpp vignettes, I am seeing some misbehaved latex runs on eg Rcpp-package.
I am not yet sure what causes this.
Edit: The \pnasbreak
appears to be involved.
Edit 2: Two of the vignettes need a manual \pnasbreak
at end with pinp 0.0.3.
The objective of this issue ticket is to clean up the PNAS file by removing features.
This has been split off of issue #1
The current setup is too restrictive and near-broken. If you remove the affiliations section, only the last of several authors is shown.
It would be nice if you could put a few "if set, then..." layers around it to also allow a minimal use case of just one line of Author:
with a single entry (or YAML array).
Just how the Rcpp vignettes do it.
Turns out this is easy enough to do with mframed.cls
which the PNAS style already loaded.
I am having trouble finding where I can adjust the abstract font size. Is this possible?
Hi,
In the package rticles, there is an option called pnas_type : pnasinvited which produces a slightly different output than the default pnasresearcharticle.
Would it please be possible to add this option?
Thank you
Best regards
Is there possible to include the abstract of the citations in the references section of pinp?
A quick examples with code typeset pandoc-style (ie three backtick r) looks different from knitr-typeset and eval'ed R. Can we make both look the same?
tl;dr -- maybe default bibliography to APA?
I am specifying a custom .csl using the option (apa.csl is in the parent directory)
# citation style
biblio-style: apa
The resulting reference list looks fine. The only issue -- it omits DOI link at the very end. I think it's useful to have a direct link to the papers from the PDF.
The blog post describes some of the reasons why we needed to rush 0.0.8 out -- in essence, pinp was breaking CRAN check because something was afoul with the newest texlive.
I think we have a handle on this, but in upgrading we may have trampled on earlier pull requests and extensions. I am fairly certain that
papersize
settings and non US support (@saghirb) may be gone (Edit: They are fine.)date_subtitle
(@ikashnitsky) too (Edit: This is too.)In better news we no longer need the skip_final_break
stuff @coatless and I did earlier.
For that I apologize. It is my fault as I should have kept the diffs more cleanly in order to reapply them on upgrades -- such as this one. I am fairly confident we can get this back and I will try harder to have a better process. I already added a copy of the current PNAS files so going forward we can diff changes between them.
In hindsight I think #7 got the defaults wrong.
If nothing is set, we should do 9pt, two-columns, two-sides.
If someone set one-colum: true
, they get it. Ditto for one-sided: true
,
The goal of this ticket is to enable support for a 1-column version.
rticles::pnas_article()
.This issue has been split off of #1.
File pinp.cls
originally defined the settings for letter paper size but part of these were moved as part of [issue #24] to template.tex
to support a4 paper size. [Pull request #55] moved the remaining settings to template.tex
to accommodate other paper sizes. This changed the hard-coded PNAS settings for letter paper size to relative ones (not particularly desirable).
The current version of pinp
package supports letter and a4 paper sizes. Is this enough? Should we support other paper sizes? If so, should we keep letter paper settings as per PNAS and make the rest relative where the preference would be to try to get it working in pinp.cls
?
Using the widetext*
environment gives the following error:
! LaTeX Error: Environment widetext* undefined.
However if I use widetext
then the error goes away (as it is defined in pinp.cls
). It is also defined as widetext
in rticles::pnas_article
. For consistency I would change from \begin{widetext*} ... \end{widetext*}
to \begin{widetext} ... \end{widetext}
in the pinp
vignette.
Any thoughts/comments?
Note: Originally from pull request #55.
I was trying to get a one column document, and while there are no errors reported, the pdf produced is empty (though the .tex is produced and can be processed separately, I don't understand enough to know why the result is empty).
I'm attaching a MWE that demonstrates this if you set one_column: true
(attachment is .txt to satisfy Github; rename to .Rmd).
I have pandoc 2.1.3 and other session info is below. I process via:
library("rmarkdown")
render("MWE.Rmd")
Thanks for this very nice package by the way, and any assistance.
> sessionInfo()
R version 3.4.4 (2018-03-15)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.4
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] MASS_7.3-49 rmarkdown_1.9
loaded via a namespace (and not attached):
[1] compiler_3.4.4 backports_1.1.2 magrittr_1.5 rprojroot_1.3-2
[5] tools_3.4.4 htmltools_0.3.6 yaml_2.1.18 tinytex_0.4
[9] Rcpp_0.12.16 pinp_0.0.4 stringi_1.1.7 knitr_1.20
[13] stringr_1.3.0 digest_0.6.15 evaluate_0.10.1
What should I change to create a document in a language other than English?
Thank you.
This doesn't currently work from Markdown.
It still works at the latex layer.
Goals of this ticket:
rticles::pnas_article
figure*
environmentknitr::kable()
, c.f. yihui/knitr#1221. Unfortunately, pandoc is hardcoded to use longtable
. Only way to get around this is to use a python filter. (We weren't fans of this approach...)This has been broken off from issue #1 and elaborated upon.
This version https://www.pnas.org/sites/default/files/advanced-pages/pnas-new.cls is a little newer; we seem to have started off a 2015 variant whereas this one is from 2017.
A careful diff and carryover may improve ours too. Volunteers gladly accepted :)
Condition these final three lines:
c.f.
pinp/inst/rmarkdown/templates/pdf/resources/template.tex
Lines 74 to 76 in b6bf4c9
The hope here is these will address the fragile state of the floats...
Compiling a pinp document I see
3: LaTeX Warning: You have requested document class `pinp',
but the document class provides `widetext'.
LaTeX Warning: You have requested document class `pinp',
but the document class provides `pnasresearcharticle'.
and indeed
edd@rob:~/git/pinp(master)$ grep Provides inst/rmarkdown/templates/pdf/skeleton/pinp.cls
\ProvidesClass{pinp}[2017-Sep-12, based on pnas-new 28/02/2015, v1.2]
\ProvidesPackage{widetext}
\ProvidesPackage{pnasresearcharticle}[2016/02/28 v1.2 PNAS two column research article style]
edd@rob:~/git/pinp(master)$
The second and third need to be commented out.
Hi, thanks for a great package!
I was wondering if you have any plans for supporting internationalisation, either by allowing to set this through babel or another comment? It would be great if dates could be formatted according to different languages and contexts.
When I do a figure using a
> ```{r, fig.pos='H', fig.cap="Text"}
> some ggplot image
> ```
the figure text font is too large when compared to the regular text (fontsize 9). In regular markdown, I can control that in the yaml header, ex:
output:
pdf_document:
fig_height: 5
fig_width: 6
But pinp does not offer that option. When I set the options:
knitr::opts_chunk$set(fig.width = 6, fig.height = 5)
it just increases the size of the figure and goes out of the column.
Is there a way to set fig_height and fig_width of the document?
thanks
PNAS being the Academy of the US, the layout assumes 8.5in by 11in paper. Which is not the standard in the rest of the world.
The code uses the very powerful LaTeX package geometry
so there is no reason why a switch could not be added to support, say, a4
paper size. But someone with access to a printer with a4 needs to drive this.
This issue ticket will be resolved when:
template.tex
file so they can be set with yml
:
true
or false
(default)This has been split off from issue #1
Customize the template by school colors (cough orange and blue cough)
This issue ticket will be resolved after:
PNAS
and rticles
(see #11)rticles
copyleft licenseThis has been broken off from issue #1.
I think the following should be moved inside the template.tex
file:
<!-- Leave these lines as they are at the end of your .Rmd file to ensure placement of methods & acknowledgements sections before the references-->
\showmatmethods
\showacknow
\pnasbreak
Hi,
thank you for this excellent template!
Is there a way I can make it inherit from bookdown instead of the classic Rmarkdown pdf? Rmarkdown cannot reference sections in the documents using @ref, but bookdown does this correctly
thanks
Formatting before sending out for review?
Formatting of the final version for posting the version that the journal does not own?
Using output: pinp::pinp
, the quotes in the code chunks are converted to fancy quotes.
I quickly constructed a minimal example as follows
---
title: "Test pinp quotes"
output: pinp::pinp
---
Pinp's quotes in regular text: "dquoted", 'squoted', \`bquoted\`.
Pinp's quotes in inline verbatim text: `"dquoted"`, `'squoted'`.
```r
"dquoted"
'squoted'
`bquoted`
#' Xyz's "dquoted" 'squoted' `bquoted`
(I did not find a nice way to render the closing ``` of the code chunk)
Not sure if this is a desired behavior (I noticed it for the Rcpp vignettes), but in case I tried a quick fix by using LaTeX package upquote. In particular, adding
\RequirePackage{upquote} % For keeping actual quotes in verbatim
to the class definition pinp.cls seemed to indeed help:
My LaTeX skills are a bit rusty, so maybe there are more convenient / appropriate ways to achieve the same.
Is it possible to give a custom range of page numbers to a document?
[I have a semi crazy idea to layout PhD thesis as a journal issue using pinp
]
It would be very useful to have an option to set the date of the document (running in the footer throughout the document) rather than hard-coded default of \today
. It seems that {pinp} ingnores date: "..."
in YAML.
Also, it seems very nice to use custom text for the line "This version was compiled on ...". One use case that I see super attractive is to give full bibliographic info for the published post-prints.
Any ideas?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.