-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Horizontal rule in latex output no longer works with recent texlive #5801
Comments
Given that the LaTeX code you are generating is exactly what $ pandoc -t latex <<< "***"
\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center} Have you customized your template or included something else that would have messed with the LaTeX definition for |
Thank you alerque for this speedy reply. Unfortunately I can't tell, whether it's the update of pandoc (with homebrew) or the update of my LaTeX, which broke things; I made both updates one after the other. After these updates, I got error messages, from pandoc and pdflatex in my vim saying:
So I suppose there is something wrong with my texlive install. I will dig into it, or wait for the next update of texlive. Thank you for the Thx again |
Have you tried boiling this down to a minimum example? Get out of your problem document, leave that folder, go work in a blank space from scratch and try something simple like $ pandoc -o hr.pdf <<< "***" Does |
Wow! Did not know this command either! Here the result of it:
No PDF is produced ... |
LaTeX error messages tend to be a bit cryptic, but I'm guessing that's going to be line 51 of the standalone TeX file created by Pandoc as an intermediary to generating the PDF. Speaking of which if you can post the output of that I'll check to see if it's different than mine: $ pandoc -s -o test.tex <<< "***" Attach that file here or post it to a pastbin of some kind. If you happen to have Netcat installed you cat try this: $ pandoc -s -t latex <<< "***" | nc termbin.com 9999 That will post the generated LaTeX directly and give you a URL back you can copy here. (Note the |
I am learning a lot with this thread! I am very grateful for your input ... I just installed netcat and the resulting URL is:
Best greetings from Munich - Everybody is digesting the bear from Oktoberfest, except me! |
I just compared your dump with mine and they are bit for bit identical. This suggests that it was something that got buggered up in your LaTeX installation rather than with Pandoc. I'm curious if you can run |
I am always compiling with pdflatex. The test with xelatex and pdflatex are spitting out an empty pdf
With pdflatex I get:
You are certainly right. There is something wrong after the last update of texlive ... marek |
The problem is unlikely to be something in texlive itself, I'm guessing something is borked about the Homebrew packaging or, even more likely, your specific system. I would try a force re-install or uninstall/install of the entire texlive ball of wax — whatever it gives you the option for. I'm sorry it's been a while since I was hands on with |
Thx again alerque I can live with horizontal lines pandoc is incredibly smart and I am big fan of my combo: markdown -> Makefile (JSON) -> LaTeX -> PDF I am writing Books with it, many many pages ... Best greetings marek |
This issue occurs with the current up-to-date version of TexLive. |
Thx bogdanni Best greetings |
@jgm We should probably re-open this and look into what's coming down the pike from LaTeX. |
I have hit this too just today but I did not realize it was Pandoc's fault. See TeX, LaTeX and Friends | chat.stackexchange.com chat transcript. It previously only worked accidentally. The solution is to use |
I guess I didn't understand the issue (maybe I still don't). What has changed, exactly, in recent LaTeX? What should be changed in pandoc? |
I can reproduce the problem now, having updated texlive. |
Thanks @jgm for fixing this. I'm using horizontal rules in many RMarkdown and Jupyter notebooks, which at the moment can't be converted to PDF. Is the 2.8 release planned to be released anytime soon? |
There are still some features we're waiting on for a 2.8 release. I'd say within a month. I'd be curious to get feedback on this question from everyone: would it be better to define |
Thanks, this sounds good. I'm definitely +1 to keep it hard-coded because I prefer if things just work. Unless you can define a default value, but I guess that's not possible. |
I can reproduce the bug with pandoc 2.7.3 In my case the engine is LuaLatex 1.10.0, TeXLive 2019. My template file is the one provided by the rmarkdown package of RStudio. pandoc -o my.pdf --pdf-engine=lualatex --template=latextemplate05.tex temp.html yields
Having a look at the intermediary tex file: pandoc -o my.tex --pdf-engine=lualatex --template=latextemplate05.tex temp.html I can find this faulty line in my.tex \begin{center}\rule{0.5\linewidth}{\linethickness}\end{center} @marek-step 's workaround put me on the right track, though I could not apply it as such to my case (I am not converting md -> tex -> pdf but html -> tex -> pdf, thus inserting \HRule in the md file was not an option) Anyway, this is announced to be fixed in pandoc 2.8. For the time being, I've got an easier workaround. Add this line to the latextemplate.tex file: \renewcommand{\linethickness}{0.05em} Set the linethicknness to whatever you want. Works for me (can others confirm?). |
@jgm have you considered backporting this fix to a 2.7.x release? |
We generally don't do that. However, you can use the nightly builds... |
I hope to have 2.8 out in the next couple weeks |
… 2.1 Andrew Dunning (1): Provide @adunning's ORCID ID (#1736) Barret Schloerke (1): Return output from shiny::runApp() within rmarkdown::run() (#1760) Christophe Dervieux (1): fix #1747: correctly parse yaml front matter in html_notebook's intermediate knit files (#1758) Lanfeng Pan (1): Add the missing slash in the html <meta> tag (#1737) Yihui Xie (14): start the next version missing ) from #1736 make sure HTML dependencies can be written out even if the tempdir() has been wiped out, e.g. use a more general fix to the previous issue: change the default of tempfile(tmpdir = ) to tempdir(TRUE) make sure the first argument of tempfile() is `pattern` fix #1742: since html_vignette() uses doesn't use themes, there won't be a #header element in the output, so it doesn't make sense to center it here fix #1743: use dir.create() to create the tempdir explicitly, instead of calling tempdir(TRUE), because the latter requires R >= 3.5.0 support slide_level in slidy_presentation(): https://stackoverflow.com/q/59157211/559676 remove the hard dependency on jQuery: rstudio/rmarkdown#1732 (comment) we don't generate <section> in html_document() (because we only support html4 in R Markdown) roxygenize delete two unused functions (copied from knitr) fix horizontal rules for .tex output generated by Pandoc < 2.8 (jgm/pandoc#5801) CRAN release v2.1 atusy (1): update documentation of df_print (#1749) jooyoungseo (1): Fixed #1663: empty h2 tag for empty subtitle in ioslides_presentation (#1735) * Added a new (experimental) output format `powerpoint_presentation`. If you want to test it, you will need Pandoc >= 2.1 (#1231). ## MAJOR CHANGES * If the **tinytex** package is installed, PDF output is built through `tinytex::latexmk()`, otherwise it is generated by `rmarkdown:::latexmk()`, which has been factored out and improved in the **tinytex** package, so it is recommended that you install the **tinytex** package (#1222). ## BUG FIXES * Temporary files created in `render()` may be cleaned up prematurely, which can cause problems with Shiny R Markdown documents (#1184).
Más info: jgm/pandoc#5801. Propongo la solución aparentemente más sencilla. Funciona con pdflatex y xelatex.
Is there a change with horizontal lines? After Homebrew update my markdown file is not compiling with pandoc anymore. I have this error now related to horizontal lines:
`
Error producing PDF.
! Missing number, treated as zero.
\protect
l.153 ...nter}\rule{0.5\linewidth}{\linethickness}
make: *** [typeset] Error 43
`
And I am wondering, whether pandoc is not replacing these lines with the definition of \HRline defined in the template.
What I did so far to resolve this issue: I changed all horizontal lines in file.md
3 Hyphens 3 Underscores 3 Asterix
to:
\HRule
Surrounded by empty lines. And the definition of it in the Headers of my template.tex to:
\newcommand{\HRule}{\begin{center}\rule{0.5\linewidth}{0.2mm}\end{center}}
Working now!
My Platform: Mac Mojave,
Homebrew 2.1.12
Homebrew/homebrew-core (git revision 5b995; last commit 2019-10-05)
Homebrew/homebrew-cask (git revision a8417a; last commit 2019-10-05)
pandoc 2.7.3
Compiled with pandoc-types 1.17.5.4, texmath 0.11.2.2, skylighting 0.8.1
Default user data directory: /Users/mstep/.local/share/pandoc or /Users/mstep/.pandoc
The text was updated successfully, but these errors were encountered: