Skip to content
Browse files

Merge pull request #240 from jnavila/fix_latex_tables

Revert "Use real Pandoc tables."
  • Loading branch information...
2 parents 893d5e1 + 3b9ef62 commit 60606ad3287fdb1dd03bcfa97d7797c45154ee29 @jnavila jnavila committed Oct 9, 2012
Showing with 22 additions and 6 deletions.
  1. +1 −1 en/02-git-basics/01-chapter2.markdown
  2. +20 −0 latex/makepdf
  3. +1 −5 latex/template.tex
View
2 en/02-git-basics/01-chapter2.markdown
@@ -541,7 +541,7 @@ Table 2-1 lists some of the more useful options that format takes.
%p Abbreviated parent hashes
%an Author name
%ae Author e-mail
- %ad Author date (format respects the date= option)
+ %ad Author date (format respects the --date= option)
%ar Author date, relative
%cn Committer name
%ce Committer email
View
20 latex/makepdf
@@ -109,6 +109,26 @@ def post_pandoc(string, config)
s /(\\verb(\W).*?\2)/, '{\footnotesize\1}'
s /(\\begin\{verbatim\}.*?\\end\{verbatim\})/m, '{\footnotesize\1}'
+ # Make Tables 2-1..2-3 actual tables
+ s /\\begin\{verbatim\}\n(([^\t\n]+\t.*?\n)+)(([^\t\n]*)\n)?\\end\{verbatim\}/ do
+ $cap = $4
+ "\\begin{table}[ht!]
+ \\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
+
# Shaded verbatim block
s /(\\begin\{verbatim\}.*?\\end\{verbatim\})/m, '\begin{shaded}\1\end{shaded}'
end
View
6 latex/template.tex
@@ -13,8 +13,6 @@
\usepackage{booktabs}
\usepackage{indentfirst}
\usepackage{framed,color}
-\usepackage{array}
-\usepackage[font=small,format=plain,labelfont=bf,up,textfont=it,up]{caption}
\definecolor{shadecolor}{gray}{0.90}
@@ -43,8 +41,6 @@
\date{\w3cdtfymd}
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
-\newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp}
-\let\PBS=\PreserveBackslash
\makeatletter
\setlength\headheight{12\p@}
\setlength\headsep {.25in}
@@ -94,7 +90,7 @@
\refstepcounter{img}
\label{img:\theimg}
\centering\includegraphics[width=\maxwidth]{figures/\theimg.png}
- \caption{#1}
+ \textbf{\caption{#1}}
\end{figure}}
\newcounter{tab}[chapter]

0 comments on commit 60606ad

Please sign in to comment.
Something went wrong with that request. Please try again.