About an error with the command "gitbook pdf" - pdf

I met a problem.
I run the command "gitbook pdf", and it show me this Error:
EbookError: Error during ebook generation: 1% Converting input to HTML...
InputFormatPlugin: HTML Input running
on /tmp/tmp-72206AoHgIzetV6D/SUMMARY.html
Language not specified
Creator not specified
Building file list...
Normalizing filename cases
Rewriting HTML links
34% Running transforms on ebook...
Merging user specified metadata...
Detecting structure...
Detected chapter: Introduction
Detected chapter: CH1
Detected chapter: CH2
Detected chapter: Item 1
Auto generated TOC with 4 entries.
Flattening CSS and remapping font sizes...
Failed to parse CSS selector: u'h|button::-moz-focus-inner'
Failed to parse CSS selector: u'h|input::-moz-focus-inner'
Failed to parse CSS selector: u'h|input[type=search]::-webkit-search-cancel-button'
Failed to parse CSS selector: u'h|input[type=search]::-webkit-search-decoration'
Source base font size is 12.00000pt
Removing fake margins...
Cleaning up manifest...
Trimming unused files from manifest...
Creating PDF Output...
67% Running PDF Output plugin
Traceback (most recent call last):
File "/usr/bin/ebook-convert", line 20, in<br>
sys.exit(main())
File "/usr/lib/calibre/calibre/ebooks/conversion/cli.py", line 359, in main<br>
plumber.run()
File "/usr/lib/calibre/calibre/ebooks/conversion/plumber.py", line 1189, in run
self.opts, self.log)
File "/usr/lib/calibre/calibre/ebooks/conversion/plugins/pdf_output.py", line 123, in convert
must_use_qt()
File "/usr/lib/calibre/calibre/gui2/__init__.py", line 1041, in must_use_qt
raise RuntimeError('X server required. If you are running on a'
RuntimeError: X server required. If you are running on a headless machine, use xvfb
what's the error mean?

Related

How to have multi-page table row cells converted properly using rst2pdf Shpinx?

I have a table of which one-row cell has so much data that it could span multiple pages in the finally-generated PDF file. rst2pdf ungracefully fails when I feed it my file, with the following output:
[ERROR] pdfbuilder.py:161 Failed to build doc
Traceback (most recent call last):
File "/home/pwng/.local/lib/python3.9/site-packages/rst2pdf/pdfbuilder.py", line 158, in write
docwriter.write(doctree, destination)
File "/usr/lib/python3/dist-packages/docutils/writers/__init__.py", line 78, in write
self.translate()
File "/home/pwng/.local/lib/python3.9/site-packages/rst2pdf/pdfbuilder.py", line 697, in translate
createpdf.RstToPdf(
File "/home/pwng/.local/lib/python3.9/site-packages/rst2pdf/createpdf.py", line 689, in createPdf
pdfdoc.multiBuild(elements)
File "/usr/lib/python3/dist-packages/reportlab/platypus/doctemplate.py", line 1167, in multiBuild
self.build(tempStory, **buildKwds)
File "/usr/lib/python3/dist-packages/reportlab/platypus/doctemplate.py", line 1080, in build
self.handle_flowable(flowables)
File "/home/pwng/.local/lib/python3.9/site-packages/rst2pdf/createpdf.py", line 859, in handle_flowable
self.handle_frameEnd()
File "/usr/lib/python3/dist-packages/reportlab/platypus/doctemplate.py", line 726, in handle_frameEnd
self.handle_pageEnd()
File "/usr/lib/python3/dist-packages/reportlab/platypus/doctemplate.py", line 668, in handle_pageEnd
raise LayoutError(ident)
reportlab.platypus.doctemplate.LayoutError: More than 10 pages generated without content - halting layout. Likely that a flowable is too large for any frame.
FAILED
build succeeded.
and make latexpdf produce undesirable output depicted in the following screenshot.
Is there a way to remedy this problem using either latexpdf or rst2pdf? Ideally, I would like a solution that works for both spaced text (i.e. space-separated words) and consecutive, wrapped non-separated text.
This isn't the answer you want, but rst2pdf won't split the cell across pages, so if it doesn't fit onto the page, it won't be able to generate the document. The project (I'm a maintainer) is open to patches, in case you end up fixing it yourself. I'm not aware of a workaround, other than reformatting the content to be more printable.

GNU Radio OOT block: AttributeError: module 'twoTypes' has no attribute 'passthrough_cc'

What I'm trying to do:
I am trying to write an OOT block for GNU radio that accept complex or byte values and just pass through. (My final target is obviously do some processing of the incoming stream, but it had so many errors, I had to go back to the basics)
The error:
I receive this error at runtime
traceback (most recent call last):
File "/home/maisun/Desktop/asdf.py", line 193, in <module>
main()
File "/home/maisun/Desktop/asdf.py", line 171, in main
tb = top_block_cls()
File "/home/maisun/Desktop/asdf.py", line 82, in __init__
self.twoTypes_passthrough_0 = twoTypes.passthrough_cc(0)
AttributeError: module 'twoTypes' has no attribute 'passthrough_cc'
what I've tried:
I have looked into the source of GR itself and tried to correct my yaml files, my header files. To the best of my knowledge, I have defined 'passthrough_cc' in the twoTypes.h header file as,
typedef passthrough<std::uint8_t> passthrough_bb;
typedef passthrough<gr_complex> passthrough_cc;
Obviosly i'm still doing something wrong here.
my questions:
I have 2 questions.
First, how can I correct the CPP code and the python module? so that I can call passthrough_cc without errors.
second, I am more comfortable in C language. So sometimes GR codes are very confusing to me. GR wiki has some nice guides available. But does anyone know if there is any guide/blog post that kind of discusses the workflow of GR? For example, when I trace my codes, I start from main() and follow the flow. with GR I always get lost.
full code:
https://github.com/maisunmonowar/gr-twoTypes

Unable to produce pdf reports from RMarkdown (tinytex)

Until very recently, I was able to create pdf from Rmd files.
Being in trouble I have followed the advices to update tinytex and update all packages (I used to have Miktex and I changed to tinytex)
Taking this basic example:
---
title: "This is a report"
output:
pdf_document:
keep_tex: yes
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE)
options(tinytex.verbose = TRUE)
```
This is a report
I am getting the following errors:
"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS reports.utf8.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output reports.tex --lua-filter "D:\Mes Donnees\R\win-library\4.0\rmarkdown\rmarkdown\lua\pagebreak.lua" --lua-filter "D:\Mes Donnees\R\win-library\4.0\rmarkdown\rmarkdown\lua\latex-div.lua" --self-contained --highlight-style tango --pdf-engine pdflatex --variable graphics --variable "geometry:margin=1in"
output file: reports.knit.md
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/W32TeX) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
I was unable to find any missing LaTeX packages from the error log reports.log.
! I can't write on file `reports.pdf'.
(Press Enter to retry, or Control-Z to exit; default file extension is `.pdf')
Please type another file name for output
! Emergency stop.
<to be read again>
\edef
l.76 \begin{document}
! Emergency stop.
<to be read again>
\edef
l.76 \begin{document}
Error: LaTeX failed to compile reports.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See reports.log for more info.
Execution halted
Apparently, there are no missing packages, so I have no clue about what is happening?
(For info, there are no problems creating a word file or and html file; and the file reports.pdf does not exist yet in the project directory, nor is it opened by another application).
The reports.log gives the following.
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/W32TeX) (preloaded format=pdflatex 2021.3.16) 16 MAR 2021 19:28
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**reports.tex
(./reports.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18>
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/article.c
ls
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/size10.cl
o
File: size10.clo 2020/04/10 v1.4m Standard LaTeX file (size option)
)
\c#part=\count179
\c#section=\count180
\c#subsection=\count181
\c#subsubsection=\count182
\c#paragraph=\count183
\c#subparagraph=\count184
\c#figure=\count185
\c#table=\count186
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/lm/lmodern.sty
Package: lmodern 2009/10/30 v1.6 Latin Modern Fonts
LaTeX Font Info: Overwriting symbol font `operators' in version `normal'
(Font) OT1/cmr/m/n --> OT1/lmr/m/n on input line 22.
LaTeX Font Info: Overwriting symbol font `letters' in version `normal'
(Font) OML/cmm/m/it --> OML/lmm/m/it on input line 23.
LaTeX Font Info: Overwriting symbol font `symbols' in version `normal'
(Font) OMS/cmsy/m/n --> OMS/lmsy/m/n on input line 24.
LaTeX Font Info: Overwriting symbol font `largesymbols' in version `normal'
(Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 25.
LaTeX Font Info: Overwriting symbol font `operators' in version `bold'
(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 26.
LaTeX Font Info: Overwriting symbol font `letters' in version `bold'
(Font) OML/cmm/b/it --> OML/lmm/b/it on input line 27.
LaTeX Font Info: Overwriting symbol font `symbols' in version `bold'
(Font) OMS/cmsy/b/n --> OMS/lmsy/b/n on input line 28.
LaTeX Font Info: Overwriting symbol font `largesymbols' in version `bold'
(Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 29.
LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal'
(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 31.
LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal'
(Font) OT1/cmss/m/n --> OT1/lmss/m/n on input line 32.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal'
(Font) OT1/cmr/m/it --> OT1/lmr/m/it on input line 33.
LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal'
(Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 34.
LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `bold'
(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 35.
LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold'
(Font) OT1/cmss/bx/n --> OT1/lmss/bx/n on input line 36.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold'
(Font) OT1/cmr/bx/it --> OT1/lmr/bx/it on input line 37.
LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold'
(Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 38.
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsfonts/amssy
mb.sty
Package: amssymb 2013/01/14 v3.01 AMS font symbols
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsfonts/amsfo
nts.sty
Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support
\#emptytoks=\toks15
\symAMSa=\mathgroup4
\symAMSb=\mathgroup5
LaTeX Font Info: Redeclaring math symbol \hbar on input line 98.
LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version `bold'
(Font) U/euf/m/n --> U/euf/b/n on input line 106.
))
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsmath/amsmat
h.sty
Package: amsmath 2020/09/23 v2.17i AMS math features
\#mathmargin=\skip49
For additional information on amsmath, use the `?' option.
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsmath/amstex
t.sty
Package: amstext 2000/06/29 v2.01 AMS text
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsmath/amsgen
.sty
File: amsgen.sty 1999/11/30 v2.0 generic functions
\#emptytoks=\toks16
\ex#=\dimen139
))
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsmath/amsbsy
.sty
Package: amsbsy 1999/11/29 v1.2d Bold Symbols
\pmbraise#=\dimen140
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsmath/amsopn
.sty
Package: amsopn 2016/03/08 v2.02 operator names
)
\inf#bad=\count187
LaTeX Info: Redefining \frac on input line 234.
\uproot#=\count188
\leftroot#=\count189
LaTeX Info: Redefining \overline on input line 399.
\classnum#=\count190
\DOTSCASE#=\count191
LaTeX Info: Redefining \ldots on input line 496.
LaTeX Info: Redefining \dots on input line 499.
LaTeX Info: Redefining \cdots on input line 620.
\Mathstrutbox#=\box47
\strutbox#=\box48
\big#size=\dimen141
LaTeX Font Info: Redeclaring font encoding OML on input line 743.
LaTeX Font Info: Redeclaring font encoding OMS on input line 744.
\macc#depth=\count192
\c#MaxMatrixCols=\count193
\dotsspace#=\muskip16
\c#parentequation=\count194
\dspbrk#lvl=\count195
\tag#help=\toks17
\row#=\count196
\column#=\count197
\maxfields#=\count198
\andhelp#=\toks18
\eqnshift#=\dimen142
\alignsep#=\dimen143
\tagshift#=\dimen144
\tagwidth#=\dimen145
\totwidth#=\dimen146
\lineht#=\dimen147
\#envbody=\toks19
\multlinegap=\skip50
\multlinetaggap=\skip51
\mathdisplay#stack=\toks20
LaTeX Info: Redefining \[ on input line 2923.
LaTeX Info: Redefining \] on input line 2924.
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/iftex/ifxete
x.sty
Package: ifxetex 2019/10/25 v0.7 ifxetex legacy package. Use iftex instead.
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/iftex/iftex.
sty
Package: iftex 2020/03/06 v1.0d TeX engine tests
))
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/iftex/ifluat
ex.sty
Package: ifluatex 2019/10/25 v1.5 ifluatex legacy package. Use iftex instead.
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/fontenc.s
ty
Package: fontenc 2020/08/10 v2.0s Standard LaTeX package
LaTeX Font Info: Trying to load font information for T1+lmr on input line 11
2.
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/lm/t1lmr.fd
File: t1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
))
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/inputenc.
sty
Package: inputenc 2020/08/01 v1.3d Input encoding file
\inpenc#prehook=\toks21
\inpenc#posthook=\toks22
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/textcomp.
sty
Package: textcomp 2020/02/02 v2.0n Standard LaTeX package
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/xcolor/xcolor.
sty
Package: xcolor 2016/05/11 v2.12 LaTeX color extensions (UK)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics-cfg/c
olor.cfg
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package xcolor Info: Driver file: pdftex.def on input line 225.
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics-def/p
dftex.def
File: pdftex.def 2020/10/05 v1.2a Graphics/color driver for pdftex
)
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1348.
Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1352.
Package xcolor Info: Model `RGB' extended on input line 1364.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1366.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1367.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1368.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1369.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1370.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1371.
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/hyperref/hyper
ref.sty
Package: hyperref 2021-02-27 v7.00k Hypertext links for LaTeX
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/ltxcmds/ltxc
mds.sty
Package: ltxcmds 2020-05-10 v1.25 LaTeX kernel commands for general use (HO)
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pdftexcmds/p
dftexcmds.sty
Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/infwarerr/in
fwarerr.sty
Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO)
)
Package pdftexcmds Info: \pdf#primitive is available.
Package pdftexcmds Info: \pdf#ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics/keyva
l.sty
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV#toks#=\toks23
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/kvsetkeys/kv
setkeys.sty
Package: kvsetkeys 2019/12/15 v1.18 Key value parser (HO)
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/kvdefinekeys
/kvdefinekeys.sty
Package: kvdefinekeys 2019-12-19 v1.6 Define keys (HO)
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pdfescape/pd
fescape.sty
Package: pdfescape 2019/12/09 v1.15 Implements pdfTeX's escape features (HO)
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/hycolor/hycolo
r.sty
Package: hycolor 2020-01-27 v1.10 Color options for hyperref/bookmark (HO)
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/letltxmacro/le
tltxmacro.sty
Package: letltxmacro 2019/12/03 v1.6 Let assignment for LaTeX macros (HO)
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/auxhook/auxhoo
k.sty
Package: auxhook 2019-12-17 v1.6 Hooks for auxiliary files (HO)
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/kvoptions/kvop
tions.sty
Package: kvoptions 2020-10-07 v3.14 Key value format for package options (HO)
)
\#linkdim=\dimen148
\Hy#linkcounter=\count199
\Hy#pagecounter=\count266
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/hyperref/pd1en
c.def
File: pd1enc.def 2021-02-27 v7.00k Hyperref: PDFDocEncoding definition (HO)
Now handling font encoding PD1 ...
... no UTF-8 mapping file for font encoding PD1
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/hyperref/hyper
ref-langpatches.def
File: hyperref-langpatches.def 2021-02-27 v7.00k Hyperref: patches for babel la
nguages
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/intcalc/intc
alc.sty
Package: intcalc 2019/12/15 v1.3 Expandable calculations with integers (HO)
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/etexcmds/ete
xcmds.sty
Package: etexcmds 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO)
)
\Hy#SavedSpaceFactor=\count267
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/hyperref/puenc
.def
File: puenc.def 2021-02-27 v7.00k Hyperref: PDF Unicode definition (HO)
Now handling font encoding PU ...
... no UTF-8 mapping file for font encoding PU
)
Package hyperref Info: Option `unicode' set `true' on input line 4073.
Package hyperref Info: Hyper figures OFF on input line 4192.
Package hyperref Info: Link nesting OFF on input line 4197.
Package hyperref Info: Hyper index ON on input line 4200.
Package hyperref Info: Plain pages OFF on input line 4207.
Package hyperref Info: Backreferencing OFF on input line 4212.
Package hyperref Info: Implicit mode ON; LaTeX internals redefined.
Package hyperref Info: Bookmarks ON on input line 4445.
\c#Hy#tempcnt=\count268
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/url/url.sty
\Urlmuskip=\muskip17
Package: url 2013/09/16 ver 3.4 Verb mode for urls, etc.
)
LaTeX Info: Redefining \url on input line 4804.
\XeTeXLinkMargin=\dimen149
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/bitset/bitse
t.sty
Package: bitset 2019/12/09 v1.3 Handle bit-vector datatype (HO)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/bigintcalc/b
igintcalc.sty
Package: bigintcalc 2019/12/15 v1.5 Expandable calculations on big integers (HO
)
))
\Fld#menulength=\count269
\Field#Width=\dimen150
\Fld#charsize=\dimen151
Package hyperref Info: Hyper figures OFF on input line 6075.
Package hyperref Info: Link nesting OFF on input line 6080.
Package hyperref Info: Hyper index ON on input line 6083.
Package hyperref Info: backreferencing OFF on input line 6090.
Package hyperref Info: Link coloring OFF on input line 6095.
Package hyperref Info: Link coloring with OCG OFF on input line 6100.
Package hyperref Info: PDF/A mode OFF on input line 6105.
LaTeX Info: Redefining \ref on input line 6145.
LaTeX Info: Redefining \pageref on input line 6149.
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/atbegshi-
ltx.sty
Package: atbegshi-ltx 2020/08/17 v1.0a Emulation of the original atbegshi packa
ge
with kernel methods
)
\Hy#abspage=\count270
\c#Item=\count271
\c#Hfootnote=\count272
)
Package hyperref Info: Driver (autodetected): hpdftex.
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/hyperref/hpdft
ex.def
File: hpdftex.def 2021-02-27 v7.00k Hyperref driver for pdfTeX
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/atveryend
-ltx.sty
Package: atveryend-ltx 2020/08/19 v1.0a Emulation of the original atvery packag
e
with kernel methods
)
\Fld#listcount=\count273
\c#bookmark#seq#number=\count274
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/rerunfilecheck
/rerunfilecheck.sty
Package: rerunfilecheck 2019/12/05 v1.9 Rerun checks for auxiliary files (HO)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/uniquecounte
r/uniquecounter.sty
Package: uniquecounter 2019/12/15 v1.4 Provide unlimited unique counter (HO)
)
Package uniquecounter Info: New unique counter `rerunfilecheck' on input line 2
86.
)
\Hy#SectionHShift=\skip52
)
Package hyperref Info: Option `breaklinks' set `true' on input line 40.
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/geometry/geome
try.sty
Package: geometry 2020/01/02 v5.9 Page Geometry
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/iftex/ifvtex
.sty
Package: ifvtex 2019/10/25 v1.7 ifvtex legacy package. Use iftex instead.
)
\Gm#cnth=\count275
\Gm#cntv=\count276
\c#Gm#tempcnt=\count277
\Gm#bindingoffset=\dimen152
\Gm#wd#mp=\dimen153
\Gm#odd#mp=\dimen154
\Gm#even#mp=\dimen155
\Gm#layoutwidth=\dimen156
\Gm#layoutheight=\dimen157
\Gm#layouthoffset=\dimen158
\Gm#layoutvoffset=\dimen159
\Gm#dimlist=\toks24
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics/graph
icx.sty
Package: graphicx 2020/09/09 v1.2b Enhanced LaTeX Graphics (DPC,SPQR)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics/graph
ics.sty
Package: graphics 2020/08/30 v1.4c Standard LaTeX Graphics (DPC,SPQR)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics/trig.
sty
Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics-cfg/g
raphics.cfg
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
)
Package graphics Info: Driver file: pdftex.def on input line 105.
)
\Gin#req#height=\dimen160
\Gin#req#width=\dimen161
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/grffile/grffil
e.sty
Package: grffile 2019/11/11 v2.1 Extended file name support for graphics (legac
y)
Package grffile Info: This package is an empty stub for compatibility on input
line 40.
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/l3backend/l3ba
ckend-pdftex.def
File: l3backend-pdftex.def 2021-03-02 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count278
\l__pdf_internal_box=\box49
) (./reports.aux)
\openout1 = `reports.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 76.
LaTeX Font Info: ... okay on input line 76.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 76.
LaTeX Font Info: ... okay on input line 76.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 76.
LaTeX Font Info: ... okay on input line 76.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 76.
LaTeX Font Info: ... okay on input line 76.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 76.
LaTeX Font Info: ... okay on input line 76.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 76.
LaTeX Font Info: ... okay on input line 76.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 76.
LaTeX Font Info: ... okay on input line 76.
LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line 76.
LaTeX Font Info: ... okay on input line 76.
LaTeX Font Info: Checking defaults for PU/pdf/m/n on input line 76.
LaTeX Font Info: ... okay on input line 76.
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/epstopdf-pkg/e
pstopdf-base.sty
Package: epstopdf-base 2020-01-24 v2.11 Base part for package epstopdf
Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4
85.
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/latexconfig/ep
stopdf-sys.cfg
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv
e
))
Package hyperref Info: Link coloring OFF on input line 76.
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/hyperref/namer
ef.sty
Package: nameref 2021-04-02 v2.47 Cross-referencing by name of section
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/refcount/refco
unt.sty
Package: refcount 2019/12/15 v3.6 Data extraction from label references (HO)
)
(c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/gettitlestri
ng/gettitlestring.sty
Package: gettitlestring 2019/12/15 v1.6 Cleanup title references (HO)
)
\c#section#level=\count279
)
LaTeX Info: Redefining \ref on input line 76.
LaTeX Info: Redefining \pageref on input line 76.
LaTeX Info: Redefining \nameref on input line 76.
(./reports.out) (./reports.out)
\#outlinefile=\write3
\openout3 = `reports.out'.
! I can't write on file `reports.pdf'.
(Press Enter to retry, or Control-Z to exit; default file extension is `.pdf')
Please type another file name for output
! Emergency stop.
<to be read again>
\edef
l.76 \begin{document}
Here is how much of TeX's memory you used:
9719 strings out of 480970
141906 string characters out of 5905985
439920 words of memory out of 5000000
26819 multiletter control sequences out of 15000+600000
406420 words of font info for 28 fonts, out of 8000000 for 9000
14 hyphenation exceptions out of 8191
71i,1n,74p,241b,270s stack positions out of 5000i,500n,10000p,200000b,80000s
! ==> Fatal error occurred, no output PDF file produced!
The tex file being generated without problems, I used another strategy and decomposed the creation of the pdf into two steps:
xelatex --no-pdf ess.tex
The xdv file was created without any problem.
Then I tried to transformt the file into pdf using
xdvipdfmx -vv ess.xdv
Then appears the issue:
<FONTMAP:c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-var/fonts/map/pdftex/updmap/pdftex.map><FONTMAP:c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-var/fonts/map/dvipdfmx/updmap/kanjix.map><FONTMAP:c:/Users/djourdain/AppData/Roaming/TinyTeX/texmf-dist/fonts/map/dvipdfmx/ckx.map>DVI Comment: XeTeX output 2021.03.17:0716
ess.xdv -> ess.pdf
xdvipdfmx:fatal: Unable to open "ess.pdf".
No output PDF file written.
It seems the pdf file is locked somewhere. However, I haven't asked to preview the pdf file, nor any ess.pdf preexist on the directory !
Add-up
Out of despair, I tried again in a new project directory with a name without space (D:/Ess) instead of a directory with spaces (D:/Mes Donnees/Ess/), and this times it works.
I never encoutered any problem with directory names in earlier versions. Has anything changed in either Rmarkdown or tinytex that creates this new problem?
Yes, there has been changes between Rmarkdown 1.8 and Rmarkdown 1.9.
Rmarkdown 1.8 calls Pandoc to convert Markdown to PDF and in the process has an intermediate step where it temporarily changes the paths of some files, getting rid off the white spaces that caused your problem.
Since Rmarkdown 1.9 there is no Pandoc step. Hence, the intermediate step that temporarily changes the paths is not there anymore and white spaces produce the error.
The root cause of why white spaces cause this error is not really clear, though.
Issue #1285 of Rmarkdown GitHub repo and, in particular, this comment by Yihui are full of details about this and worth reading completely.
I had the same problem and nothing on StackOverflow worked for me.
Problem occurred to be that my Project was suddenly changed to the default project. (Your project should be with a light blue box in the right upper corner of your RStudio screen).
You can recognize this by checking the .log file, which is then complaining about your working directory. So changing your project is a possible answer to this problem as well!

Error Converting Jupyter Notebook to PDF after installing MikTex, pandoc and nbconvert

I have been trying to convert my Jupyter Notebook into PDF(via LaTeX).
I have installed all packages in the MikTeX console, pandoc and nbconvert.
Yet, I still see the following error.
Your advice is very much appreciated!
MikTeX packages all installed and updated
Pandoc installed
Error when i ran the code on anaconda prompt and when clicking File->Download as-> PDF via LaTeX (.pdf):
(base) C:\Users\justm>jupyter nbconvert notebook.ipynb --to pdf
[NbConvertApp] Converting notebook notebook.ipynb to pdf
[NbConvertApp] Support files will be in notebook_files\
[NbConvertApp] Making directory .\notebook_files
[NbConvertApp] Making directory .\notebook_files
[NbConvertApp] Making directory .\notebook_files
[NbConvertApp] Making directory .\notebook_files
[NbConvertApp] Making directory .\notebook_files
[NbConvertApp] Making directory .\notebook_files
[NbConvertApp] Writing 66012 bytes to .\notebook.tex
[NbConvertApp] Building PDF
[NbConvertApp] Running xelatex 3 times: ['xelatex', '.\\notebook.tex', '-quiet']
[NbConvertApp] CRITICAL | x failed: xelatex .\notebook.tex -quiet
notebook.tex:385: Unable to load picture or PDF file '
notebook.tex:404: Missing number, treated as zero
notebook.tex:404: Illegal unit of measure (
notebook.tex:404: Missing number, treated as zero
notebook.tex:404: Illegal unit of measure (
notebook.tex:490: Missing number, treated as zero
notebook.tex:490: Illegal unit of measure (
notebook.tex:490: Missing number, treated as zero
notebook.tex:490: Illegal unit of measure (
notebook.tex:600: Missing number, treated as zero
notebook.tex:600: Illegal unit of measure (
notebook.tex:600: Missing number, treated as zero
notebook.tex:600: Illegal unit of measure (
notebook.tex:896: Missing number, treated as zero
notebook.tex:896: Illegal unit of measure (
notebook.tex:896: Missing number, treated as zero
notebook.tex:896: Illegal unit of measure (
notebook.tex:1007: Unable to load picture or PDF file '
Traceback (most recent call last):
File "c:\users\justm\anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\justm\anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\justm\anaconda3\Scripts\jupyter-nbconvert.EXE\__main__.py", line 7, in <module>
File "c:\users\justm\anaconda3\lib\site-packages\jupyter_core\application.py", line 268, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "c:\users\justm\anaconda3\lib\site-packages\traitlets\config\application.py", line 664, in launch_instance
app.start()
File "c:\users\justm\anaconda3\lib\site-packages\nbconvert\nbconvertapp.py", line 340, in start
self.convert_notebooks()
File "c:\users\justm\anaconda3\lib\site-packages\nbconvert\nbconvertapp.py", line 510, in convert_notebooks
self.convert_single_notebook(notebook_filename)
File "c:\users\justm\anaconda3\lib\site-packages\nbconvert\nbconvertapp.py", line 481, in convert_single_notebook
output, resources = self.export_single_notebook(notebook_filename, resources, input_buffer=input_buffer)
File "c:\users\justm\anaconda3\lib\site-packages\nbconvert\nbconvertapp.py", line 410, in export_single_notebook
output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
File "c:\users\justm\anaconda3\lib\site-packages\nbconvert\exporters\exporter.py", line 179, in from_filename
return self.from_file(f, resources=resources, **kw)
File "c:\users\justm\anaconda3\lib\site-packages\nbconvert\exporters\exporter.py", line 197, in from_file
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
File "c:\users\justm\anaconda3\lib\site-packages\nbconvert\exporters\pdf.py", line 185, in from_notebook_node
self.run_latex(tex_file)
File "c:\users\justm\anaconda3\lib\site-packages\nbconvert\exporters\pdf.py", line 156, in run_latex
self.latex_count, log_error, raise_on_failure)
File "c:\users\justm\anaconda3\lib\site-packages\nbconvert\exporters\pdf.py", line 145, in run_command
command=command, output=out))
nbconvert.exporters.pdf.LatexFailed: PDF creating failed, captured latex output:
Failed to run "xelatex .\notebook.tex -quiet" command:
notebook.tex:385: Unable to load picture or PDF file '
notebook.tex:404: Missing number, treated as zero
notebook.tex:404: Illegal unit of measure (
notebook.tex:404: Missing number, treated as zero
notebook.tex:404: Illegal unit of measure (
notebook.tex:490: Missing number, treated as zero
notebook.tex:490: Illegal unit of measure (
notebook.tex:490: Missing number, treated as zero
notebook.tex:490: Illegal unit of measure (
notebook.tex:600: Missing number, treated as zero
notebook.tex:600: Illegal unit of measure (
notebook.tex:600: Missing number, treated as zero
notebook.tex:600: Illegal unit of measure (
notebook.tex:896: Missing number, treated as zero
notebook.tex:896: Illegal unit of measure (
notebook.tex:896: Missing number, treated as zero
notebook.tex:896: Illegal unit of measure (
notebook.tex:1007: Unable to load picture or PDF file '
Quite old question, but I just stumbled upon it as well. The problem is that something in the LaTeX code requires the calc package which, however, is not imported.
In my case the notebook contained tables which contained calculations for the column with, such as this one
\begin{longtable}[]{#{}>{\raggedright\arraybackslash}p{(\columnwidth - 10\tabcolsep) * \real{0.17}}lllll#{}}
This was introduced by pandoc 2.11.2 with this commit. However, as I used a custom template file it missed \usepackage{calc}. After adding it it worked perfectly. It is also not contained in the current nbconvert package (see #1566).
Also refer to this question and this thread in pandoc-discuss.

How to open a remote .FTS.gz file with astropy.io.fits.open()?

Summary of a problem:
I am writing some code that checks the content of a FTS file header (data saved from a telescope) using astropy.io.fits. My problem is when I try to open .FTS.gz files instead of .FTS files on a remote server. When I open() a .FTS.gz I get errors, if I gunzip the .FTS.gz file, all is good. One of the errors suggest I have an END missing card. Searching online, I used a suggestion of using the ignore_missing_end=True argument in fits.open(), but then I get the next error. This next error suggests my FITS file is empty or corrupt, however it is not the case. I can open it with SAOImage DS9 without any problems, plus I have run this handy online tool called fitsverify which reports no errors in my file. If I download the offending file .FTS.gz and run a similar code to fits.open() this file locally, I get no errors at all. An example of an offending file (used in the code below) is now uploaded here.
The Astropy documentation says:
"Working with compressed files
The open() function will seamlessly open FITS files that have been compressed with gzip, bzip2 or pkzip. Note that in this context we’re talking about a fits file that has been compressed with one of these utilities - e.g. a .fits.gz file."
How do I open a remote .FTS.gz file without downloading it? I have hundreds of thousands of files like this, so downloading is not an option and it is not just one file that gives a problem, it is all of them.
Thanks,
Aina.
Code and errors:
CODE TO OPEN A REMOTE .FTS.gz FILE:
from astropy.io import fits
import paramiko
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.load_system_host_keys()
client.connect('myhostname', username='myusername', password='mypassword')
apath = '/path/to/folder/to/search'
apattern = '"RUN0001.FTS.gz"'
rawcommand = 'find {path} -name {pattern}'
command = rawcommand.format(path=apath, pattern=apattern)
stdin, stdout, stderr = client.exec_command(command)
filelist = stdout.read().splitlines()
for i in filelist:
sftp_client = client.open_sftp()
remote_file = sftp_client.open(i)
hdulist = fits.open(remote_file)
client.close()
ERROR:
Traceback (most recent call last):
File "/Users/amusaeva/Documents/PyCharm/FITSHeaders/stackoverflow.py", line 17, in <module>
hdulist = fits.open(remote_file)
File "/Library/Python/2.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 166, in fitsopen
lazy_load_hdus, **kwargs)
File "/Library/Python/2.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 404, in fromfile
lazy_load_hdus=lazy_load_hdus, **kwargs)
File "/Library/Python/2.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 1040, in _readfrom
read_one = hdulist._read_next_hdu()
File "/Library/Python/2.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 1135, in _read_next_hdu
hdu = _BaseHDU.readfrom(fileobj, **kwargs)
File "/Library/Python/2.7/site-packages/astropy/io/fits/hdu/base.py", line 329, in readfrom
**kwargs)
File "/Library/Python/2.7/site-packages/astropy/io/fits/hdu/base.py", line 394, in _readfrom_internal
header = Header.fromfile(data, endcard=not ignore_missing_end)
File "/Library/Python/2.7/site-packages/astropy/io/fits/header.py", line 450, in fromfile
padding)[1]
File "/Library/Python/2.7/site-packages/astropy/io/fits/header.py", line 519, in _from_blocks
raise IOError('Header missing END card.')
IOError: Header missing END card.
Process finished with exit code 1
CHANGING THE CODE ABOVE FOR ONE LINE ONLY:
hdulist = fits.open(remote_file, ignore_missing_end=True)
ERROR:
WARNING: VerifyWarning: Error validating header for HDU #0 (note: Astropy uses zero-based indexing).
Header size is not multiple of 2880: 7738429
There may be extra bytes after the last HDU or the file is corrupted. [astropy.io.fits.hdu.hdulist]
Traceback (most recent call last):
File "/Users/amusaeva/Documents/PyCharm/FITSHeaders/stackoverflow.py", line 17, in <module>
hdulist = fits.open(remote_file, ignore_missing_end=True)
File "/Library/Python/2.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 166, in fitsopen
lazy_load_hdus, **kwargs)
File "/Library/Python/2.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 404, in fromfile
lazy_load_hdus=lazy_load_hdus, **kwargs)
File "/Library/Python/2.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 1044, in _readfrom
raise IOError('Empty or corrupt FITS file')
IOError: Empty or corrupt FITS file
Process finished with exit code 1
CODE TO OPEN THE OFFENDING .FTS.gz FILE LOCALLY PRODUCES NO ERRORS:
import os
from astropy.io import fits
folderTosearch = "/path/to/folder/to/search/locally";
for root, dirs, files in os.walk(folderTosearch):
for file in files:
if file.endswith("RUN0001.FTS.gz"):
hdulist = fits.open(os.path.join(root, file))
This happens because the sftp call passes some variant of a file-like object (which has a .read() method that fits.open() will use.
The file like object, however, is still a gzip file. Astropy checks whether a file is zipped only for file names, that is, when the argument to fits.open() is a string (that happens to be a path). Astropy does not appear to test for the magic bytes that identify a byte stream as a gzip file. Oddly enough, it does do this verification when path strings are passed. Arguably, this may be a slight shortcoming in the astropy.io.fits module, but perhaps there's a reason for it.
(Disclaimer: the above conclusion is from scanning quickly through the relevant source code; I may have missed something. Hopefully people will correct me if so.)
One solution is to do the unzipping yourself. I've cobbled up the following:
from cStringIO import StringIO
import zlib
<...>
for i in filelist:
sftp_client = client.open_sftp()
remote_file = sftp_client.open(i)
decompressed = StringIO(
zlib.decompress(remote_file.read(), zlib.MAX_WBITS|32))
hdulist = fits.open(decompressed)
client.close()
Above, we're reading the full contents of the remote file (remote_file.read(), then uncompressing the contents. That results in a string, so we wrap it in a StringIO instance to make it a file-like object again, that we can pass to fits.open(). (For the zlib.MAX_WBITS|32 argument: see this answer.)
Alternatively, you can sftp the file to local disk, and then read the file (with the local filename) locally. The above just keeps everything in memory.