1

I am thinking this answer which returns a broken PDF document in OSX 10.10.3.

The file test_dummy.tex is here.

pandoc test_dummy.tex -f markdown -t html | grep -E '(^<|^$|^ *$)' \
| grep -v "^<p" | pandoc -f html -o tables.pdf

where pandoc 1.13.2.1 and grep grep (BSD grep) 2.5.1-FreeBSD.

1 Mistake in test_dummy.tex -file (different than you having real LaTeX)

I installed Pandoc by brew install pandoc. Something is wrong in the very beginning command

pandoc test_dummy.tex -f markdown -t html

returns a blank line, likewise pandoc test_dummy.tex -f markdown.

[fixed by the answer]

2 Connecting the full command still challenge

The command (with cabal Pandoc)

pandoc test_dummy.tex -f markdown -t html | grep -E '(^<|^$|^ *$)' | grep -v "^<p" | pandoc -f html -o tables.pdf

returns

! Package inputenc Error: Unicode char \u8:≤ not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              


l.134 ≤

[fixed the addition of this answer solves this part]

How can I troubleshoot this chain of commands?

  • 2
    I've tested this command on OSX Mavericks 10.9.5. My Pandoc is v1.13.2.1, installed via cabal-install pandoc (but usually I install the MacPorts stuff,not the HomeBrew-ed one). – Kurt Pfeifle May 26 '15 at 14:41
  • 1
    The command you listed doesn't work with just pandoc installed. You've not documented the minimum tools needed to reproduce this issue. Also, if you can specify what is broken about the pdf if you in fact don't get an empty line from the first half of the command. On 10.10 - I get everything to work except the missing pdflatex part that fails at the second invocation of pandoc – bmike May 26 '15 at 16:24
1

If you get a blank line from pandoc then something is quite amiss.

My guess is you've got several `pandoc or the tex file is encoded oddly or throwing some error that the version I downloaded from dropbox isn't the same as the one you are using.

$ pandoc test_dummy.tex -f markdown -t html | wc 
     311    1349   11676
$ pandoc test_dummy.tex -f markdown -t html | head

<p>everything - etiology, symptoms, diagnostic tests, grades of aortic valve stenosis</p>
<p>Aortic regurgitation. The murmur of aortic regurgitation occurs during diastole as the aortic valve fails to lose completely and blood regurgitates from the aorta back into the LV. Murmur - high-pitched decrescendo murmur heard best along left lower sternal border.</p>
<table>
<caption>Common causes of Aortic Stenosis Among Patients requiring Surgery. % http://emedicine.medscape.com/article/150638-overview#aw2aab6b2b4aa</caption>
<colgroup>
<col width="38%" />
<col width="38%" />
</colgroup>
<thead>
$ which pandoc
/usr/local/bin/pandoc
$ wc test_dummy.tex 
     210    1049    8801 test_dummy.tex

The troubleshooting would be to check the path to be sure you are using the tools you expect. Then break apart the chain of commands and inspect the beginnings of each output file using things like wc, head or more so you can make sure each link in the chain is working. The post you linked to is an exceptional answer by Kurt in that it explains exactly what the command line tools are doing with grep and why.

  • The command pandoc test_dummy.tex -f markdown -t html | wc gives me now the same as 311 1349 11676. Output of pandoc test_dummy.tex -f markdown -t html | head is the same now as with you. Same test_dummy.tex file too. My pandoc is now the variant of $HOME/.cabal/bin/pandoc. Do you get the correct PDF output? Please, see my edit in the question body about the error which I get when I run the full command. – Léo Léopold Hertz 준영 May 26 '15 at 16:47
  • 1
    Everything solved now! XeLaTeX must be set as a tool to compile things. – Léo Léopold Hertz 준영 May 26 '15 at 16:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .