grantmcdermott / lecturenotes

My lecture notes Rmd template
http://grantmcdermott.com/lecturenotes/
Other
124 stars 35 forks source link

Problem with section headers being read as tex labels #2

Closed akhilrao closed 3 years ago

akhilrao commented 3 years ago

Hi Grant,

I've been running into an odd issue while trying to knit Rmd notes: every section header is being read as \label{}. So for example, if I wrote

The first section

it gets read as \label{the-first-section} in the tex file. The documents knit just fine without section headers. Possibly related, looking at the tex file shows that the document title is read as a \section{}.

Anyway, I'm not sure what might be causing this problem. Do you have any ideas?

Thanks!

EDIT: sorry, got this wrong. Looks like the section headers are showing up properly in \section{}, and even compile properly in a tex editor, just not in RStudio. I thought I had texlive in addition to texstudio, but it looks like I don't. Closing this issue since it's happening with a non-recommended setup.

grantmcdermott commented 3 years ago

Thanks @akhilrao.

I've really haven't had much feedback about non-texlive setups. So, I was hoping it would work out-of-the-box for other LaTeX distributions too. Alas.

Out of interest, do you have tinytex installed? That's a minimal texlive install that should at least work from the R (Markdown) side...

akhilrao commented 3 years ago

Interestingly, I'm getting the same error even with texlive installed from tar and texstudio uninstalled. I do have tinytex installed. With options(tinytex.verbose=TRUE), I get

! Undefined control sequence.
\\bookmark ...{pdf:out \ifBKM@DvipdfmxOutlineOpen 
                                                  [\ifBKM@open \ifnum \BKM@l...
l.123 ...\label{a-taxonomy-of-goods-and-services}}

Error: LaTeX failed to compile 1.1_goods_law.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See 1.1_goods_law.log for more info.
Execution halted

Does any of this ring any bells?

akhilrao commented 3 years ago

Just tried running the setup on a different machine with no prior tex install. Installed tinytex and the fonts, worked like a charm. I'm guessing my issues on my main machine have something to do with prior tex installs or something...

grantmcdermott commented 3 years ago

Great, thanks for testing @akhilrao. I'm glad it's working a clean setup, at least.