Skip to content

Loading…

Revert "Use real Pandoc tables." #240

Merged
merged 2 commits into from

1 participant

@jnavila
Pro Git Book member

This reverts commit 83d725e.

This commit introduced pandoc tables in the text, which broke web
generation. This was partially reverted in

8d9c368

where the text was taken back to the original shape, but not the
pdf processing. This is the object of the present revert.

jnavila added some commits
@jnavila jnavila Revert "Use real Pandoc tables."
This reverts commit 83d725e.

This commit introduced pandoc tables in the text, which broke web
generation. This was partially reverted in

8d9c368

were the text was taken back to the original shape, but not the
pdf processing. This is the object of the present revert.
23b6496
@jnavila jnavila Change latex float specifier to ht! for table 3b9ef62
@jnavila jnavila merged commit 60606ad into progit:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 4, 2012
  1. @jnavila

    Revert "Use real Pandoc tables."

    jnavila committed
    This reverts commit 83d725e.
    
    This commit introduced pandoc tables in the text, which broke web
    generation. This was partially reverted in
    
    8d9c368
    
    were the text was taken back to the original shape, but not the
    pdf processing. This is the object of the present revert.
Commits on Oct 9, 2012
  1. @jnavila
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
@@ -106,6 +106,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]
Something went wrong with that request. Please try again.