1

I have written a document in markdown, and I am having problem referencing a fenced code block. When I write the block as

```sql
SELECT Name
FROM STUDENT 
WHERE Id = 987654321
```

and compile to pdf format with pandoc. The output looks like the image below

enter image description here

I want to be able to reference it, so reading the docs I changed the code block like this:

```{#query1, .sql}
SELECT Name
FROM STUDENT 
WHERE Id = 987654321
```

Now compiling again gives the following: (I have tried compiling with and without --listing option)

enter image description here

which does not look good and also does not help in referencing to the code block.

I am using pandoc 2.5, and vim-pandoc, vim-pandoc-syntax plugins with vim 8.2 on Focal Fossa.

tarleb
  • 19,863
  • 4
  • 51
  • 80
Imran Ali
  • 2,223
  • 2
  • 28
  • 41

1 Answers1

1

There must be no comma between the id and the class:

```{#query1 .sql}
SELECT Name
FROM STUDENT 
WHERE Id = 987654321
```
tarleb
  • 19,863
  • 4
  • 51
  • 80
  • Thanks for suggesting correct syntax, however the syntax highlighting doesn't work, and the identifier is still not working as reference, It appears in the output document same as in the source markdown like [query1] – Imran Ali Jul 01 '20 at 11:38
  • 1
    @ImranAli That's a different question. Please don't update your question to change what you are asking. – tarleb Jul 01 '20 at 13:17