Git Product home page Git Product logo

Comments (5)

caseywdunn avatar caseywdunn commented on July 22, 2024

I am using tinytex latex distribution. Didn't see anything at https://yihui.org/tinytex/r/#debugging

from phylogenetic_biology.

caseywdunn avatar caseywdunn commented on July 22, 2024

After creating docker environment, now get the following error when attempting to create pdf:

bookdown::render_book("index.Rmd", "bookdown::pdf_book")
...
output file: phylogenetic_biology.knit.md

Error: Functions that produce HTML output found in document targeting latex output.
Please change the output type of this document to HTML. Alternatively, you can allow
HTML output in non-HTML formats by adding this option to the YAML front-matter of
your rmarkdown file:

  always_allow_html: true

Note however that the HTML output will not be visible in non-HTML formats.

In addition: Warning message:
Removed 3 rows containing missing values (geom_label). 

Attempting to use Build Book button still results in same error as above.

from phylogenetic_biology.

brevans avatar brevans commented on July 22, 2024

working through each chapter by swapping out each chapter

_bookdown.yml :

rmd_files: [
  "index.rmd", 
  "intro.rmd",
  CHAPTER
  "references.rmd"
  ]

Error/warning hints for the chapters that fail

simulation.rmd

! Missing $ inserted.
<inserted text> 
                $
l.985 

You may need to add $ $ around a certain inline R expression `r ` in phylogenetic_biology.Rmd. See https://github.com/rstudio/rmarkdown/issues/385 for more info.
Error: LaTeX failed to compile phylogenetic_biology.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See phylogenetic_biology.log for more info.

inference.rmd

Missing character: There is no 𝛱 in font [lmroman10-bold]:mapping=tex-text;!
! LaTeX Error: Unknown float option `H'.

Error: LaTeX failed to compile phylogenetic_biology.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See phylogenetic_biology.log for more info.
In addition: Warning message:
Removed 3 rows containing missing values (geom_label). 

evaluation.rmd

Error: Failed to build the bibliography via bibtex
In addition: Warning message:
bibtex seems to have failed:

This is BibTeX, Version 0.99d (TeX Live 2020)
Capacity: max_strings=200000, hash_size=200000, hash_prime=170003
The top-level auxiliary file: phylogenetic_biology.aux
The style file: apalike.bst
Database file #1: book.bib
Database file #2: packages.bib
Name 3 in "Swofford, DL and Olsen, GJ and Waddell, PJ, and Hillis, DM" has a comma at the end for entry swofford1996molecular
while executing---line 1023 of file apalike.bst
Warning--empty publisher in darwin1859
Name 3 in "Swofford, DL and Olsen, GJ and Waddell, PJ, and Hillis, DM" has a comma at the end for entry swofford1996molecular
while executing---line 1098 of file apalike.bst
Warning--can't use both author and editor fields in swofford1996molecular
You've used 17 entries,
            1935 wiz_defined-function locations,
            588 strings with 7069 characters,
and the built_in function-call counts, 6864 in all, are:
= -- 648
> -- 313
< -- 11
+ -- 112
- -- 108
* -- 614
:= -- 1217
add.period$ -- 5 [... truncated] 
Warning message:
Package natbib Warning: Citation `bookdown2016' on page 5 undefined on input li
ne 109.
Package natbib Warning: Citation `darwin1859' on page 9 undefined on input line
 237.
Package natbib Warning: Citation `haeckel1897' on page 9 undefined on input lin
e 237.
Package natbib Warning: Citation `hennig1966' on page 9 undefined on input line
 237.
Package natbib Warning: Citation `Felsenstein:1981vk' on page 9 undefined on in
put line 237.
LaTeX Warning: Reference `fig:intro-concepts' on page 10 undefined on input lin
e 252.
Package natbib Warning: Citation `Hohna2014' on page 11 undefined on input line
 282.
LaTeX Warning: Reference `fig:intro-concepts' on page 13 undefined on input lin
e 304.
Package natbib Warning: Citation `hadfield2018nextstrain' on page 14 undefined 
on input line 333.
Package natbib Warning: Citation `chang2015genomic' on page 14 undefined on inp
ut line 335.
Package natbib Warning: Citation `dunn2018pairwise' on page 14 undefined on inp
ut line 337.
Package natbib [... truncated]

bayes.rmd

Warning message:
LaTeX Warning: Reference `stats-bayes' on page 18 undefined on input line 367.
LaTeX Warning: There were undefined references

time.rmd

Warning message:
LaTeX Warning: Reference `trees-edge-lengths' on page 17 undefined on input lin
e 356.
LaTeX Warning: Reference `fig:time-cladogram' on page 18 undefined on input lin
e 364.
LaTeX Warning: Reference `tree-properties' on page 20 undefined on input line 4
25.
LaTeX Warning: There were undefined references.

from phylogenetic_biology.

brevans avatar brevans commented on July 22, 2024

Fixed bibliography, syntax and floating errors in recent commits, so now you at least get a pdf to look at.

Tail of R's console output:

/usr/lib/rstudio-server/bin/pandoc/pandoc +RTS -K512m -RTS phylogenetic_biology.utf8.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output phylogenetic_biology.tex --lua-filter /usr/local/lib/R/site-library/bookdown/rmarkdown/lua/custom-environment.lua --lua-filter /usr/local/lib/R/site-library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /usr/local/lib/R/site-library/rmarkdown/rmarkdown/lua/latex-div.lua --metadata-file /tmp/RtmpokERPa/filefb59387b46 --self-contained --table-of-contents --toc-depth 2 --number-sections --highlight-style tango --pdf-engine xelatex --natbib --include-in-header preamble.tex --variable graphics --wrap preserve --variable tables=yes --standalone -Mhas-frontmatter=false 

Output created: docs/phylogenetic_biology.pdf
[1] "/phylogenetic_biology/docs/phylogenetic_biology.pdf"
Warning messages:
1: Removed 3 rows containing missing values (geom_label). 
2: LaTeX Warning: Reference `fig:sim-tree' on page 61 undefined on input line 1189
.
LaTeX Warning: Reference `fig:sim-tree' on page 62 undefined on input line 1194
.
LaTeX Warning: Reference `fig:sim-tree' on page 62 undefined on input line 1194
.
LaTeX Warning: Float too large for page by 69.74217pt on input line 1751.
LaTeX Warning: Float too large for page by 119.59538pt on input line 1848.
LaTeX Warning: Reference `fig:time-cladogram' on page 108 undefined on input li
ne 2055.
LaTeX Warning: There were undefined references. 

Some issues remain, outlined below.

Pi in simulation.rmd, inference.rmd

Capital Greek letter Pi (Π) seems to be getting stuck pointing to the non-math fonts that don't have the right glyph and just gets dropped. Might be good to also read through simulation.rmd and make sure upper and lowecase pi are used consistently.

mathrm is the normal upright Roman font

$\mathrm{\Pi}$

mathnormal is the normal math italic font

$\mathnormal{\Pi}$

Just dollar signs

$\Pi$

mathcal is the special calligraphic font for uppercase letters only

$\mathcal{\Pi}$

mathbf gives upright Roman boldface letters

$\mathbf{\Pi}$

mathsf gives upright sans serif letters

$\mathsf{\Pi}$

mathit gives text italic letters

$\mathit{\Pi}$

mathtt gives upright letters from the typewriter type font

$\mathtt{\Pi}$

mathbb for "blackboard bold" uppercase letters

$\mathbb{\Pi}$

renders

image

With errors like this:

Missing character: There is no 𝛱 in font [lmroman10-bold]:mapping=tex-text;!

A simple rendering of the same .tex with my rudimentary skills or in overleaf doesn't have these issues.

Figure reference in simulation.rmd

An R code block is being rendered to pdf but its metadata don't make it into the .tex file.

```{r sim-tree, fig.cap="Simulation of states for a single DNA site on a simple tree according to our toy mammal model. Node numbers are in red. Character states are in boxes at nodes. Branch lengths for this phylogram are in units of expected change."}
tree_text ="((Species_A:2,Species_B:2):0.5,(Species_C:0.5,Species_D:0.5):2);"
phy = read.tree( text = tree_text )
# Not very robust, but for now assume consistent parsing
# phy$tip.label
# [1] "A" "B" "C" "D"
# MRCA AB - 6
# MRCA CD - 7
# root - 5
state = rep( NA, max(phy$edge) )
state[5] = sample(rownames(Pi), size=1, prob=diag(Pi), replace = TRUE)
state[6] = sim_site( state[5], phy$edge.length[ which(phy$edge[,2]==6) ], Q )
state[7] = sim_site( state[5], phy$edge.length[ which(phy$edge[,2]==7) ], Q )
state[1] = sim_site( state[6], phy$edge.length[ which(phy$edge[,2]==1) ], Q )
state[2] = sim_site( state[6], phy$edge.length[ which(phy$edge[,2]==2) ], Q )
state[3] = sim_site( state[7], phy$edge.length[ which(phy$edge[,2]==3) ], Q )
state[4] = sim_site( state[7], phy$edge.length[ which(phy$edge[,2]==4) ], Q )
ggtree(phy) +
geom_tiplab(offset=0.5) +
geom_label(aes(label=state)) +
geom_text2(aes(label=node), col="red", nudge_x=0.2 ) +
xlim(0,5)
```

becomes just

\includegraphics{phylogenetic_biology_files/figure-latex/sim-tree-1.pdf}

Whereas

```{r sim-tree-cnid, fig.cap="A published phylogeny [@zapata2015] with a scale bar indicating branch length in terms of the expected amount of evolutionary change, rather than absolute time."}
knitr::include_graphics("figures/Fig_cnidaria.png")
```

becomes

\begin{figure}
\centering
\includegraphics{figures/Fig_cnidaria.png}
\caption{\label{fig:sim-tree-cnid}A published phylogeny \citep{zapata2015} with a scale bar indicating branch length in terms of the expected amount of evolutionary change, rather than absolute time.}
\end{figure}

Because there isn't a label added to the .tex file you get warnings like

LaTeX Warning: Reference `fig:sim-tree' on page 62 undefined

and ?? references in the pdf.

Figures too big?

Finally, a couple Float too large for page warnings for

```{r evaluation-models-nested, echo=FALSE, fig.cap="A hierarchical view of DNA substitution models. The number of degrees of freedom is determined by the number of independent stochastic parameters (boxes with rounded corners). All other parameters are either constant (set to a specific value ahead of the analysis; boxes with straight lines) or deterministic (their value depends on the value of other parameters according to specified relationships; boxes with dashed lines). Here $\\mu=1$, such that the edge lengths in the phylogeny are the expected amount of evolutionary change. The models are listed from top to bottom by increasing nestedness. Rates are ordered so that transitions and transversions are adjacent. Any model could be realized as a subset of the possible parameter space of the models above it. The visual nomenclature is inspired by Hohna et al. (2014). See the [iqtree DNA model documentation](http://www.iqtree.org/doc/Substitution-Models#dna-models) for a longer list of models."}
knitr::include_graphics("figures/models_dna.png")
```

and

```{r eval-splits, echo=FALSE, fig.cap="Four phylogenies in a sample, one focal phylogeny, and a table of splits found in all of these topologies. A split is an edge, with the identification of the edge based on which taxa are split from each other by the edge. The splits table shows the binary encoding of each split, where taxa on the same side of the split have the same binary number (0 or 1). The assignment of 1 or 0 to a particular side of the split is arbitrary. Identical splits are labeled consistently in red throughout the figure. The frequency of the split is based on the proportion of sample phylogenies that contain the splits. The frequencies of the sample splits are shown as percentages on the edges in the focal topology."}
knitr::include_graphics("figures/splits.png")
```

from phylogenetic_biology.

caseywdunn avatar caseywdunn commented on July 22, 2024

knitting to pdf without problems now...

from phylogenetic_biology.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.