# "Missing # inserted in alignment preamble" - xlsx to pdf

#1

## This is my problem:

Can’t convert directly from .xlsx to .pdf (first to .md then to .pdf works, bad results). Error: “Missing # inserted in alignment preamble”. Version 0.30.1, Win7 64-bit. Pandoc version 2.2.3.2. “pdflatex --version” reports “pdfTeX 3.14159265-2.6-1.40.19 (TeX Live 2018/W32TeX)”. Conversion from .xlsx to .md works, from .md to .pdf works, but results are not acceptable.

EDIT: Identical results with .ODS file to .PDF.

## This is what I am trying to do:

I would like to be able to directly convert .xlsx to .pdf.

## My experience level is with Stencila is:

low

NOTE: When someone posts a solution which answers your question. Click the ‘solved’ button.

#2

Hi @burque50, welcome to the Stencila community!

Thanks for trying out the converter tool. The cross-document-type conversion that you’re trying e.g. spreadsheet to Markdown or PDF) is a bit of an experiment in seeing if we can use a single, internal JSON-based format for executable documents (i.e spreadsheets and notebooks like RMarkdown and Jupyter). Being experimental, this feature is still buggy.

Can you share your .xlsx file here (or some simplified version of it) so I can see if I can create a bug fix that will work for your specific case?

Nokome

#3

Thanks, @nokome, for responding. There doesn’t appear to be an option to upload document files to the forum, only images. I’ll be happy to upload the files. How might I do it?

Even a spreadsheet with only 6 cells, each containing only text, fails with the error mentioned. The json created, however, contains all the data. I posted copied console output in another message, but it came through quite badly. There appears to be no way to format code properly in the forum, at least that I’ve discovered so far. The option from the editor (</>) hammers the code, at least for me anyway, I’ve tried in both Firefox and Chrome.
EDIT:
Code problem solved with bbcode tag (trying spoiler out also). By the way, I get a useable conversion by first converting xlxs -> md and then md -> pdf, but no charts so far. Once again, I’d love to share the files if I can figure out how to upload them.

 ?  Error converting "TM.xlsx" to "TM.pdf": Error calling Pandoc:
message: Error producing PDF.
! Missing # inserted in alignment preamble.
<to be read again>
\cr
l.62 \begin{longtable}[]{@{}@{}}

args: --from json --output TM.pdf --data-dir=C:\Users\Winter\AppDa
tencila\data\pandoc
content: {
"pandoc-api-version": [
1,
17,
5
],
"meta": {
"name": {
"t": "MetaString",
"c": "Monkeys"
}
},
"blocks": [
{
"t": "Table",
"c": [
[],
[],
[],
[],
[
[
[
{
"t": "Plain",
"c": [
{
"t": "Str",
"c": "# Monkeys"
}
]
}
],
[
{
"t": "Plain",
"c": [
{
"t": "Str",
"c": "Tame?"
}
]
}
]
],
[
[
{
"t": "Plain",
"c": [
{
"t": "Str",
"c": "10"
}
]
}
],
[
{
"t": "Plain",
"c": [
{
"t": "Str",
"c": "Partly"
}
]
}
]
],
[
[
{
"t": "Plain",
"c": [
{
"t": "Str",
"c": "30"
}
]
}
],
[
{
"t": "Plain",
"c": [
{
"t": "Str",
"c": "Completely"
}
]
}
]
],
[
[
{
"t": "Plain",
"c": [
{
"t": "Str",
"c": "28"
}
]
}
],
[
{
"t": "Plain",
"c": [
{
"t": "Str",
"c": "Utterly intransigent"
}
]
}
]
]
]
]
}
]
}

That works better

Regards,
burque505

#4

Hi @burque505,

Thanks for your messages and sorry for slow reply. Can you try to upload the xlsx file now? It should be possible.
I will have a look. Though as @nokome said, the converters are still in their development-experimental phase.
Cheers,
Aleksandra

#5

I am now going through your posts in Stencila Converter - probably best to move/continue the discussion there

#6

Moving there now, thanks!