Error converting pandoc tables from .md to PDF - pdf

I try to convert Markdown files to PDF with
FOR %%i IN (*.md) DO pandoc "%%~fi" -o "%%~dpni.pdf" --template=weber-export.tex --pdf-engine=xelatex
But it wont convert pandoc-tables. instead there occurs an error saying
Error producing PDF.
! Missing number, treated as zero.
<to be read again>
(
l.357 ...columnwidth - 2\tabcolsep) * \real{0.33}}
Simply Version of the tables it wont convert are :
Consumption / yield
---------------------
+--+---+--+
| | | |
| | | |
| | | |
+--+---+--+
| | | |
| | | |
| | | |
+--+---+--+
| | | |
| | | |
| | | |
+--+---+--+
and
-------------------------------------------------------------------
Type Sales unit Number
------------------------------- ------------ ----------------------
Plastic bucket 30 liters 18 buckets
-------------------------------------------------------------------
like its explained in the Pandoc User's Guid
I have installed Miktex 2.9 and pandoc 2.11.2 on Win 10
Without the tables, the conversion is doing well, even when i try out tables without the first line like
Type Sales unit Number
------------------------------- ------------ ----------------------
Plastic bucket 30 liters 18 buckets
-------------------------------------------------------------------
it works.
any suggestions? Is it a bug, or what am i doing wrong?

It seems that your custom template does not load all necessary packages.
Add
\usepackage{calc,array}
to your template to ensure the necessary commands are available.

Related

Pandoc Markdown to Latex PDF: table with alternating row colors?

I would like to have a table, in the (xe)latex PDF output of a Markdown document via pandoc, with alternating row colors - as noted here:
https://tex.stackexchange.com/questions/518097/booktabs-but-with-enclosing-border-around-the-table
... and xcolor with the table option to add alternating row colors
So, I'm trying this test.md:
---
title: "Testing"
author: Bob Alice
date: July 13, 2010
geometry: margin=2cm
documentclass: extarticle
fontsize: 12pt
header-includes: |
\usepackage[table]{xcolor}
\rowcolors{2}{white}{gray!25}
output: pdf_document
---
Here is a test of a table:
+----------+-------------------+-----------------+
| Box name | Another parameter | The IP address |
+==========+===================+=================+
| Test 1 | random-string-01 | 10.0.0.20 |
| Test 2 | random-string-02 | 10.0.0.30 |
+----------+-------------------+-----------------+
If I convert this via pandoc:
$ pandoc --version
pandoc.exe 2.10 ...
... with:
pandoc test.md --pdf-engine=xelatex -o test.pdf
... the result is:
Error producing PDF.
! LaTeX Error: Option clash for package xcolor.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.60 \rowcolors
So, apparently xcolor gets loaded in this setup, with other options, that clash with the [table] option.
Is it possible to coax pandoc into producing all tables in a Latex/PDF document with alternating row colors - without using custom templates?
Thanks to the link by #user1759789 in comments, it seems that it is enough to pass the Latex document class option table, which then gets passed when to xcolor when is loaded; note that the code will still generate this error, if you leave the \usepackage[table]{xcolor} line. So the working Markdown is this:
---
title: "Testing"
author: Bob Alice
date: July 13, 2010
geometry: margin=2cm
classoption: table
documentclass: extarticle
urlcolor: blue
fontsize: 12pt
header-includes: |
\rowcolors{2}{gray!10}{gray!25}
output: pdf_document
---
Here is a test of a table ( [buggy](https://stackoverflow.com/questions/62835496/) ):
+----------+-------------------+-----------------+
| Box name | Another parameter | The IP address |
+==========+===================+=================+
| Test 1 | random-string-01 | 10.0.0.20 |
| Test 2 | random-string-02 | 10.0.0.30 |
+----------+-------------------+-----------------+
and another grid table:
+----------+-------------------+-----------------+
| Box name | Another parameter | The IP address |
+==========+===================+================:+
| Test 1 | random-string-01 | 10.0.0.20 |
+----------+-------------------+-----------------+
| Test 2 | random-string-02 | 10.0.0.30 |
+----------+-------------------+-----------------+
and pipe table:
| Box name | Another parameter | The IP address |
|-----------------|-------------------------|-----------------|
| Test 1 | random-string-01 | 10.0.0.20 |
| Test 2 | random-string-02 | 10.0.0.30 |
... and the output is:

Problems with using the bootstrap-datepicker in Fitnesse Tests

In my Fitnesse Tests I want to enter dates through datepicker elements. Sometimes it works. But most of the time a different date, unlike the date that was entered, appears. Here is an example:
| ensure | do | type | on | id=field_id | with | |
| ensure | do | type | on | id=field_id | with | 05.05.1997 |
| check | is | verifyValue | on | id=field_id | [28.05.1997] expected [05.05.1997] |
(To make sure that the field isn't already filled, I pass an empty String first.)
Mostly, the 'day'-statement is different from what was entered. Do you know the reason for this behavior? How can I solve this?
Thanks in advance!
This is related to how you wrote your fixture and not FitNesse, the problem is that it returns a different value and also implies that the previous line didn't work - | ensure | do | type | on | id=field_id | with | 05.05.1997 |

"Update Terminated" on /nva01 transaction

While running the SAP-SD benchmarking process on 3 tier SAP setup, a number of transactions are fired by automated users.
The following steps are executed,
6 /nva01 (Create Sales Order)
[ENTER]
7 Order Type or
Sales Organization 0001
Distribution Channel 01
Division 01
[ENTER]
8 Sold-to party sdd00000
PO Number perf500
Req.deliv.date 22.12.2009
Deliver.Plant 0001
Material Order quantity
sd000000 1
sd000001 1
sd000002 1
sd000003 1
sd000004 1
[F11] (Save)
9 [F3] (Back)
(This dialogstep is needed only to get 4 dialogsteps for VA01 as defined
for the SD benchmarks)
whenever [F11] is pressed after entering information, it saves successfully. However, when [F3] is pressed, it shows error “unable to update”
Then I manually tried to execute the same steps
6 /nva01 (Create Sales Order)
[ENTER]
7 Order Type or
Sales Organization 0001
Distribution Channel 01
Division 01
[ENTER]
8 Sold-to party sdd00000
PO Number perf500
Req.deliv.date 22.12.2009
Deliver.Plant 0001
Material Order quantity
sd000000 1
sd000001 1
sd000002 1
sd000003 1
sd000004 1
On pressing [F11] it successfully saves. But when [F3] is pressed to go back to previous screen, it gives “update was terminated” error.
[F11] (Save)
9 [F3] (Back)
Then to locate the root cause of error, SM13 transaction and it shows the following details for the error
There is a large number of same errors in logs, and the update key for all the error entries is the same “4A08B4400C022793E10000000FD5F53D” is this normal..?
On googling found out that the possible reason for this error could be
Key already exists in table and duplicate entry is disallowed.
Which table is affected by this transaction..? how to resolve..?
Document number ranges issue
Which document number range to modify..? how to resolve..?
Kindly advise how to resolve this
edit including system log--
Runtime Errors SAPSQL_ARRAY_INSERT_DUPREC Exception
CX_SY_OPEN_SQL_DB Date and Time 12.05.2009 06:59:27
---------------------------------------------------------------------------------------------------- |Short text
| | The ABAP/4 Open SQL array insert results in duplicate database
records. |
---------------------------------------------------------------------------------------------------- |What happened?
| | Error in the ABAP Application Program
| |
| | The current ABAP program "SAPLV05I" had to be terminated
because it has | | come across a statement
that unfortunately cannot be executed.
|
---------------------------------------------------------------------------------------------------- |What can you do?
| | Note down which actions and inputs caused the error.
| |
| |
| | To process the problem further, contact you SAP system
| | administrator.
| |
| | Using Transaction ST22 for ABAP Dump Analysis, you can look
| | at and manage termination messages, and you can also
| | keep them for a long time.
|
---------------------------------------------------------------------------------------------------- |Error analysis
| | An exception occurred that is explained in detail below.
| | The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB',
was not caught | | in
| | procedure "SD_PARTNER_UPDATE" "(FUNCTION)", nor was it
propagated by a RAISING | | clause.
| | Since the caller of the procedure could not have anticipated
that the | | exception would occur, the
current program is terminated. | |
The reason for the exception is:
| | If you use an ABAP/4 Open SQL array insert to insert a record
in | | the database and that record
already exists with the same key, | |
this results in a termination.
| |
| | (With an ABAP/4 Open SQL single record insert in the same error
| | situation, processing does not terminate, but SY-SUBRC is set
to 4.) |
---------------------------------------------------------------------------------------------------- |How to correct the error
| | Use an ABAP/4 Open SQL array insert only if you are sure that
none of | | the records passed already
exists in the database. | |
| | If the error occures in a non-modified SAP program, you may be
able to | | find an interim solution in an
SAP Note. | |
If you have access to SAP Notes, carry out a search with the following
| | keywords:
| |
| | "SAPSQL_ARRAY_INSERT_DUPREC" "CX_SY_OPEN_SQL_DB"
| | "SAPLV05I" or "LV05IU15"
| | "SD_PARTNER_UPDATE"
| |
| | If you cannot solve the problem yourself and want to send an
error | | notification to SAP, include
the following information: | |
| | 1. The description of the current problem (short dump)
| |
| | To save the description, choose "System->List->Save->Local
File | | (Unconverted)".
| |
| | 2. Corresponding system log
| |
| | Display the system log by calling transaction SM21.
| | Restrict the time interval to 10 minutes before and five
minutes | | after the short dump. Then
choose "System->List->Save->Local File | |
(Unconverted)".
| |
| | 3. If the problem occurs in a problem of your own or a modified
SAP | | program: The source code of the
program | |
In the editor, choose "Utilities->More
| | Utilities->Upload/Download->Download".
| |
| | 4. Details about the conditions under which the error occurred
or which | | actions and input led to the
error. | |
| | The exception must either be prevented, caught within proedure
| | "SD_PARTNER_UPDATE" "(FUNCTION)", or its possible occurrence
must be declared | | in the
| | RAISING clause of the procedure.
| | To prevent the exception, note the following:
|
---------------------------------------------------------------------------------------------------- |System environment
| | SAP-Release 701
| |
| | Application server... "hpvm-202"
| | Network address...... "15.213.245.61"
| | Operating system..... "HP-UX"
| | Release.............. "B.11.31"
| | Hardware type........ "ia64"
| | Character length.... 16 Bits
| | Pointer length....... 64 Bits
| | Work process number.. 10
| | Shortdump setting.... "full"
| |
| | Database server... "ghoul3"
| | Database type..... "ORACLE"
| | Database name..... "E64"
| | Database user ID.. "SAPSR3"
| |
| | Terminal.......... "hpvmmsa"
| |
| | Char.set.... "C"
| |
| | SAP kernel....... 701
| | created (date)... "Feb 24 2009 21:53:01"
| | create on........ "HP-UX B.11.23 U ia64"
| | Database version. "OCI_102 (10.2.0.4.0) "
| |
| | Patch level. 32
| | Patch text.. " "
| |
| | Database............. "ORACLE 9.2.0.., ORACLE 10.1.0..,
ORACLE 10.2.0.." | | SAP database version. 701
| | Operating system..... "HP-UX B.11"
| |
| | Memory consumption
| | Roll.... 2013408
| | EM...... 0
| | Heap.... 0
| | Page.... 0
| | MM Used. 1966160
| | MM Free. 24336
|
---------------------------------------------------------------------------------------------------- |User and Transaction
| |
| | Client.............. 900
| | User................ "SAP_PERF000"
| | Language key........ "E"
| | Transaction......... "VA01 "
| | Transactions ID..... "4A08B9BC0C022793E10000000FD5F53D"
| |
| | Program............. "SAPLV05I"
| | Screen.............. "RSM13000 3000"
| | Screen line......... 2
|
---------------------------------------------------------------------------------------------------- |Information on where terminated
| | Termination occurred in the ABAP program "SAPLV05I" - in
"SD_PARTNER_UPDATE". | | The main program was
"RSM13000 ".
| |
| | In the source code you have the termination point in line 480
| | of the (Include) program "LV05IU15".
| | The program "SAPLV05I" was started in the update system.
| | The termination is caused because exception "CX_SY_OPEN_SQL_DB"
occurred in | | procedure "SD_PARTNER_UPDATE"
"(FUNCTION)", but it was neither handled locally | |
nor declared
| | in the RAISING clause of its signature.
| |
| | The procedure is in program "SAPLV05I "; its source code begins
in line | | 1 of the (Include program
"LV05IU15 ". |
---------------------------------------------------------------------------------------------------- |Source Code Extract
|
---------------------------------------------------------------------------------------------------- |Line |SourceCde
|
---------------------------------------------------------------------------------------------------- | 450| POSNR = I_XVBPA-POSNR
| | 451| PARVW =
I_XVBPA-PARVW. | | 452| IF
I_YVBPA-STCD1 <> I_XVBPA-STCD1 OR
| | 453| I_YVBPA-STCD2 <> I_XVBPA-STCD2 OR
| | 454| I_YVBPA-STCD3 <> I_XVBPA-STCD3 OR
| | 455| I_YVBPA-STCD4 <> I_XVBPA-STCD4 OR
| | 456| I_YVBPA-STCDT <> I_XVBPA-STCDT OR
| | 457| I_YVBPA-STKZN <> I_XVBPA-STKZN OR
| | 458| I_YVBPA-J_1KFREPRE <> I_XVBPA-J_1KFREPRE OR
| | 459| I_YVBPA-J_1KFTBUS <> I_XVBPA-J_1KFTBUS OR
| | 460| I_YVBPA-J_1KFTIND <> I_XVBPA-J_1KFTIND.
| | 461| MOVE-CORRESPONDING I_XVBPA TO WA_XVBPA3I.
| | 462| APPEND WA_XVBPA3I TO DA_XVBPA3I.
| | 463| ENDIF.
| | 464| ENDIF.
| | 465| ENDIF.
| | 466| WHEN UPDKZ_OLD.
| | 467| IF DA_VBPA-ADRDA CA GCF_ADDR_IND_COMB_MAN_OLD OR
| | 468| DA_VBPA-ADRDA CA GCF_ADDR_IND_COMB_MAN_ADRC.
| | 469| YADR-ADRNR = DA_VBPA-ADRNR. COLLECT YADR.
| | 470| ENDIF.
| | 471| IF DA_VBPA-ADRDA CA GCF_ADDR_IND_COMB_MAN_OLD OR
| | 472| DA_VBPA-ADRDA CA GCF_ADDR_IND_COMB_MAN_ADRC.
| | 473| XADR-ADRNR = DA_VBPA-ADRNR. COLLECT XADR.
| | 474| ENDIF.
| | 475| ENDCASE.
| | 476| ENDLOOP.
| | 477| UPDATE (OBJECT) FROM TABLE DA_XVBPAU.
| | 478| UPDATE VBPA3 FROM TABLE DA_XVBPA3U.
| | 479|
| |>>>>>| INSERT (OBJECT) FROM TABLE DA_XVBPAI.
| | 481| INSERT VBPA3 FROM TABLE DA_XVBPA3I.
| | 482|
| | 483| IF SY-SUBRC > 0.
| | 484| MESSAGE A700 WITH OBJECT SY-SUBRC DA_XVBPAI(21).
| | 485| ENDIF.
| | 486|
| | 487|* Sonderfall neue VBPA (VBPA2) für Rollen AA und AW
| | 488| LOOP AT I_XVBPA2.
| | 489| DA_VBPA2 = I_XVBPA2.
| | 490| CASE DA_VBPA2-UPDKZ.
| | 491| WHEN UPDKZ_NEW.
| | 492| IF DA_VBPA2-ADRDA CA GCF_ADDR_IND_COMB_MAN_OLD OR
| | 493| DA_VBPA2-ADRDA CA GCF_ADDR_IND_COMB_MAN_ADRC.
| | 494| XADR-ADRNR = DA_VBPA2-ADRNR. COLLECT XADR.
| | 495| ENDIF.
| | 496| I_XVBPA-MANDT = SY-MANDT.
| | 497| IF I_XVBPA2-VBELN IS INITIAL.
| | 498| I_XVBPA2-VBELN = F_VBELN.
| | 499| ENDIF.
|
It is very clear that system is trying to update with some duplicate record and hence, the update termination system is popping up. Take the help of ABAP team and check the root cause of this issue. Also if there is any customization involved in sale order creation process, then in that case also, this will happen. So you have to check with ABAP team. Alternatively, if you have login credentials for Service Marketplace, then have a look at OSS note 330904.

Is there a termination character for bq in interactive mode? How do I set it?

I've just started using bigquery and I'm used to writing SQL across multiple lines. However, if I run
bq shell
to get into interactive mode, I can't put a query in that runs across multiple lines without bq reporting an error, as it evaluates the first line of the instruction and then complains there's no FROM or GROUP BY clauses.
In other database clients, I can set a termination character: eg in DB2,
db2 -t
allows me to run db2 with commands terminated with ;
Is there a way to run bq with a termination character for each statement? I've looked at https://developers.google.com/bigquery/bq-command-line-tool and although it refers to global flags, I don't see a reference to termination characters.
After delving in the source code for bq, I can confirm there's not such termination character that allows you to do multi-line queries.
It's a consequence of the cmd module on which bq shell is built upon.
As an alternative you could run queries directly from your shell with bq query YOUR QUERY as the shell allows multi-line commands when enclosed in double quotes (").
Example:
bq query "SELECT station_number, year, month, day
FROM [publicdata:samples.gsod]
LIMIT 10"
+----------------+------+-------+-----+
| station_number | year | month | day |
+----------------+------+-------+-----+
| 42420 | 2007 | 5 | 20 |
| 42080 | 2007 | 5 | 5 |
| 152990 | 1990 | 3 | 26 |
| 543110 | 1976 | 10 | 24 |
| 740430 | 1966 | 11 | 30 |
| 228540 | 1949 | 9 | 23 |
| 747809 | 2009 | 7 | 17 |
| 681120 | 1997 | 2 | 15 |
| 26070 | 2008 | 12 | 27 |
| 128430 | 1988 | 9 | 22 |
+----------------+------+-------+-----+

Reading a CSV file with SQL querys from linux shell

I would like to read a CSV file from the shell as if it was an SQL Database table.
Is this possible without having to import the CSV file content to a SQL enviroment?
Maybe there is some kind of linux based tool that can work it out...
I know it sounds like a tricky question, but I'm trying to avoid installing a SQL server and stuff. I have some limitations.
Any clue?
There is also csvsql (part of csvkit)!
It can not only run sql on given csv (converting it into sqlite behind scenes), but also convert and insert into one of many supported sql databases!
Here you have example command (also in csvsql_CDs_join.sh):
csvsql --query 'SELECT CDTitle,Location,Artist FROM CDs JOIN Artists ON CDs.ArtistID=Artists.ArtistID JOIN Locations ON CDs.LocID = Locations.LocID' "$#"
showing how to join three tables (available in csv_inputs in csv_dbs_examples).
(formatting with csvlook also part of csvkit)
Inputs
$ csvlook csv_inputs/CDs.csv
| CDTitle | ArtistID | LocID |
| -------- | -------- | ----- |
| CDTitle1 | A1 | L1 |
| CDTitle2 | A1 | L2 |
| CDTitle3 | A2 | L1 |
| CDTitle4 | A2 | L2 |
$ csvlook csv_inputs/Artists.csv
| ArtistID | Artist |
| -------- | ------- |
| A1 | Artist1 |
| A2 | Artist2 |
$ csvlook csv_inputs/Locations.csv
| LocID | Location |
| ----- | --------- |
| L1 | Location1 |
| L2 | Location2 |
csvsql
$ csvsql --query 'SELECT CDTitle,Location,Artist FROM CDs JOIN Artists ON CDs.ArtistID=Artists.ArtistID JOIN Locations ON CDs.LocID = Locations.LocID' "$#" | csvlook
Produces:
| CDTitle | Location | Artist |
| -------- | --------- | ------- |
| CDTitle1 | Location1 | Artist1 |
| CDTitle2 | Location2 | Artist1 |
| CDTitle3 | Location1 | Artist2 |
| CDTitle4 | Location2 | Artist2 |
Take a look at https://github.com/harelba/q, a Python tool for treating text as a database. By default it uses spaces to delimit fields, but the -d , parameter will allow it to process CSV files.
Alternatively you can import the CSV file into SQLite and then run SQL commands against it. This is scriptable, with a bit of effort.