Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Use pandoc tables for pdf generation #405

Merged
merged 2 commits into from Apr 13, 2013

Conversation

Projects
None yet
2 participants
Member

jnavila commented Apr 8, 2013

Instead of transforming the tabulated data in real tables in the post pandoc procedure, do it in the prepandoc. This allows to use markdown in the text of the second column.

Contributor

GArik commented Apr 10, 2013

This allows to use markdown in the text of the second column.

Tested-by: /me :)

There is one bad thing with these changes -- tables lost their labels. Can you fix that?

@GArik GArik commented on an outdated diff Apr 10, 2013

latex/makepdf
- \\refstepcounter{tab}
- \\centering
- \\label{tab:\\thetab}
- \\begin{tabular}{p{2.75cm}p{8.25cm}}
- \\toprule\n" <<
- verbatim_sanitize($1).
- gsub(/^([^\n\t]+)\t/, '{\footnotesize\texttt{\1}} & ').
- gsub(/(\n)/, '\\\\\\\\\1').
- sub(/\{\\footnotesize\\texttt(.*?)\n/, '{\1\midrule ').
- concat("
- \\bottomrule
- \\end{tabular}
- \\textbf{\\caption{#{$cap}}}
- \\end{table}")
- end
+ # Style ctables
@GArik

GArik Apr 10, 2013

Contributor

spaces instead of tabs

Member

jnavila commented Apr 10, 2013

spaces instead of tabs: fixed

missing caption: partly fixed. Normally we would have some text after the figure number, but there is nothing in the original source text.

Contributor

GArik commented Apr 10, 2013

Normally we would have some text after the figure number, but there is nothing in the original source text.

Then it's not a regression, I suppose.

There is one more tiny issue with the changeset -- table captions are drawn in normal font, while figures have bold captions.

Member

jnavila commented Apr 11, 2013

Hum, this own is a little harder. I have to figure out how to change this style.

Contributor

GArik commented Apr 12, 2013

+\usepackage{caption}
+\captionsetup[table]{font=bf,position=below}

This stuff indeed makes table captions bold, but figure captions became normal, lol. I suppose, changing the second line to something like \captionsetup[table,figure]{font=bf,position=below} will do the trick. Maybe \captionsetup{font=bf,position=below} would be even better, dunno.

jnavila added some commits Apr 7, 2013

Translate the table declarations to use pandoc table management
This change allows to get rid of the hack made on the generated latex.
Moreover, writers and translators can now use markdown typesetting inside
the table and it is be correctly converted.

One downside is that to be processed correctly, the table must be in form of
a block made of lines starting with a tab and with tab as a column separator
ie matching the regex /^\t[^t^n]+\t[^\t\n]+$/. Otherwise it is not transformed
to table.
Add a reminder comment for table formatting
The formatting of the tables in the book follow the rule of column seperations
by tab characters. Remind the translators to follow this rule where it is applied
in the original text.
Member

jnavila commented Apr 12, 2013

I realized my mistake right after pushing, but it was already late. i postpone to today.

You are right \captionsetup{font=bf,position=below} made the trick.

Contributor

GArik commented Apr 13, 2013

The last version looks good to me.

Member

jnavila commented Apr 13, 2013

Just for my record, what is your OS configuration.

jnavila added a commit that referenced this pull request Apr 13, 2013

Merge pull request #405 from progit/use_pandoc_tables
Use pandoc tables for pdf generation

@jnavila jnavila merged commit fa55279 into master Apr 13, 2013

Contributor

GArik commented Apr 16, 2013

what is your OS configuration.

Why you want to know this? )

Member

jnavila commented Apr 17, 2013

Just to have an idea of how different your cross-checking is from mine (Debian and Ubuntu).

Contributor

GArik commented Apr 18, 2013

I use Slackware with texlive-20120701.

Member

jnavila commented Apr 18, 2013

I was half expecting this... So no full cross platform check (Mac or Windows).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment