3

Hi there I'm new to StackExchange! I found the following LaTeX code on another post (Beautiful table samples) from User AK16, and tried compiling it but got "! Missing = inserted for \ifnum" and can't find the error! If someone could help I'd appreciate it.

\documentclass[10.8pt,a4]{article}
\usepackage[margin=1.1in,a4paper]{geometry}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{float}
\usepackage{titlesec}
\usepackage{capt-of}

%dashed line
\usepackage{array}
\usepackage{arydshln}
\setlength\dashlinedash{0.2pt}
\setlength\dashlinegap{1.5pt}
\setlength\arrayrulewidth{0.3pt}

%Widows & Orphans & Penalties

\widowpenalty500
\clubpenalty500
\clubpenalty=9996
\exhyphenpenalty=50 %for line-breaking at an explicit hyphen
\brokenpenalty=4991
\predisplaypenalty=10000
\postdisplaypenalty=1549
\displaywidowpenalty=1602
\floatingpenalty = 20000


\usepackage[T1]{fontenc}
\usepackage{fontspec}
\setmainfont[Scale=0.85, Ligatures={Required,Common,Contextual,TeX}]{TeX Gyre Schola} % Incredible font inside latex


\begin{document}
\begin{table*}[] \centering
%\ra{1.3}
\begin{small}
\begin{tabular}{@{}lrrrrrrrrrrrr@{}}\toprule
\textbf{Debt/Assets} & \textbf{2002} & \textbf{2003} & \textbf{2004} & \textbf{2005} & \textbf{2006} & \textbf{2007} & \textbf{2008} & \textbf{2009} & \textbf{2010} & \textbf{2011} & \textbf{2012} & \textbf{Total} \\ \midrule
\textbf{<50\%} & -\% & 10\% & 5\% & 7\% & 11\% & 2\% & -\% & -\% & -\% & -\% & 3\% & 2\%\\ \hdashline
\textbf{<50\% - 59.9\%} & 20\ & 5\ & 16\ & 7\ & 11\ & 8\ & 13\ & 11\ & 9\ & 15\ & 8\ & 11\ \\ \hdashline
\textbf{<60\% - 69.9\%} &  -\ & 10\ & 5\ & 13\ & 11\ & 10\ & 16\ & 16\ & 17\ & 11\ & 15\ & 13\ \\ \hdashline
\textbf{<70\% - 79.9\%} &  -\ & 10\ & 37\ & 13\ & 15\ & 8\ & 24\ & 29\ & 16\ & 14\ & 35\ & 22\ \\ \hdashline
\textbf{<80\% - 89.9\%} &  40\ & 10\ & 5\ & 17\ & 7\ & 24\ & 18\ & 18\ & 21\ & 6\ & 8\ & 15\ \\ \hdashline
\textbf{>90\%} &  40\ & 55\ & 32\ & 43\ & 46\ & 49\ & 29\ & 26\ & 38\ & 24\ & 35\ & 37\ \\ \midrule
\textbf{Total} &  100\% & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% \\ \midrule
\textbf{Mean} &  85\% & 80\% & 77\% & 80\% & 78\% & 85\% & 79\% & 79\% & 82\% & 77\% & 80\% & 80\% \\ \hdashline
\textbf{Median} &  85\% & 94\% & 76\% & 81\% & 80\% & 87\% & 79\% & 77\% & 82\% & 75\% & 72\% & 80\% \\ \hdashline
\textbf{No. of Projects} &  5\% & 20\% & 19\% & 30\% & 46\% & 51\% & 68\% & 38\% & 58\% & 54\% & 26\% & 415\% \\
\bottomrule
\end{tabular}
\end{small}
\caption{Initial capital structures of large projects (\$1bn.+) \emph{(Finnerty, 2013)}}
\end{table*}

\begin{table*}[] \centering
%\ra{1.3}
\begin{small}
\begin{tabular}{@{}lrrrrrrrrrr@{}}\toprule
 & \textbf{1995} & \textbf{1996} & \textbf{1997} & \textbf{1998} & \textbf{1999} & \textbf{2000} & \textbf{2001} & \textbf{2002} & \textbf{Total}\\ \midrule
\textbf{Bank Loans} & \$23.33 & \$42.83 & \$67.43 & \$56.65 & \$72.39 & \$110.89 & \$108.48 & \$62.20 & \$557.88\\ \hdashline
\textbf{Bonds} & 3.79 & 4.79 & 7.70 & 9.79 & 19.79 & 20.81 & 25.00 & 13.80 & 109.26\\ \hdashline
\textbf{Development Agencies} & 17.59 & 18.96 & 22.05 & 20.97 & 16.62 & 17.69 & 18.75 & 18.75 & 162.63\\ \hdashline
\textbf{Total Debt} & 44.71 & 66.58 & 96.98 & 87.41 & 108.80 & 149.39 & 152.23 & 94.75 & 829.77\\ \hdashline
\textbf{Equity} & 19.16 & 28.54 & 41.56 & 37.46 & 46.70 & 64.02 & 65.24 & 40.61 & 355.68\\ \midrule
\textbf{Total} & \$63.88 & \$95.12 & \$138.54 & \$124.87 & \$155.68 & \$213.40 & \$217.47 & \$135.36 & \$1185.63\\ \midrule
\textbf{Bank Loans} & 37\% & 45\% & 49\% & 45\% & 46\% & 52\% & 50\% & 46\% & 42\% \\ \hdashline
\textbf{Bonds} & 6 & 5 & 5 & 8 & 13 & 10 & 11 & 10 & 9\\ \hdashline
\textbf{Development Agencies} & 28 & 20 & 16 & 17 & 11 & 8 & 9 & 14 & 14\\ \hdashline
\textbf{Total Debt} & 70 & 70 & 70 & 70 & 70 & 70 & 70 & 70 & 70\\ \hdashline
\textbf{Equity} & 30 & 30 & 30 & 30 & 30 & 30 & 30 & 30 & 30\\ \midrule
\textbf{Total} & 100  & 100  & 100  & 100  & 100  & 100  & 100  & 100  & 100\\
\bottomrule
\end{tabular}
\end{small}
\caption{Project funding by source (US\$ billions) \emph{(Finnerty, 2013)}}
\end{table*}

\begin{table*}[] \centering
%\ra{1.3}
\begin{small}
\begin{tabular}{@{}lllrrr@{}}\toprule
\textbf{Rank} & \textbf{Lead Arranger} & \textbf{Number of Deals} & \textbf{Dollar Amount} & \textbf{Market Share} & \textbf{Equator Principles Adoption}\\ \midrule
\textbf{1} & State Bank of India & 52 & \$21,631.6 & 10.1\% & NA\\ \hdashline
\textbf{2} & Mitsubishi UFJ Financial & 88 & 9,486.1 & 4.4 & Dec 2005\\ \hdashline
\textbf{3} & Sumitomo Mitsui & 71 & 8,188.1 & 3.8 & Jan 2006\\ \hdashline
\textbf{4} & Credit Agrocole & 60 & 6,506.4 & 3.1 & Jun 2005\\ \hdashline
\textbf{5} & Mizuho Financial & 55 & 5,797.5 & 2.7 & Oct 2003\\ \hdashline
\textbf{6} & Soci\'{e}t\'{e} Generale & 55 & 5,760.5 & 2.7 & Sep 2007\\ \hdashline
\textbf{7} & BNP Paribas & 55 & 5,390.8 & 2.5 & Oct 2008\\ \hdashline
\textbf{8} & Axis Bank & 18 & 5,216.9 & 2.4 & NA\\ \hdashline
\textbf{9} & IDBI Bank & 10 & 5,162.3 & 2.4 & NA\\ \hdashline
\textbf{10} & ING & 49 & 4,916.1 & 2.3 & Jun 2003\\ \midrule
 & Others & 102 & 135,430.4 & 63.6 & \\ \midrule
 & Total Market & 615 & \$213,486.7 & 100\% & \\
\bottomrule
\end{tabular}
\end{small}
\caption{Global project bank facility lead arrangers \emph{(Finnerty, 2013)}}
\end{table*}


\end{document}
  • 4
    Welcome to TeX.SX! There isn't a class option 10.8pt, you should use either 10pt, 11pt, or 12pt. a4 doesn't exist either, use a4paper. Other than that the code works for me if I compile with XeLaTeX or LuaLaTeX... – Phelype Oleinik Jun 15 '18 at 18:49
  • For me it also works with XeLaTeX (not with pdfLatex). For which line number does your error occur? – Marijn Jun 15 '18 at 18:50
  • it also works for me (with xelatex). off-topic: small is not environment but switch, so write only \small, you have one column article, therefore figure* hasn't sense (it place figure over two columns). it should be just figure – Zarko Jun 15 '18 at 19:11
4

in the following code i summarize all suggestions in comments below question and also slightly redesign table. instead of tabular i suggest to use tabular*, also use \thead command from package makecell, which enable to write column headers in two (or more lines). this is important in the third table (otherwise it is to large and not fit in text width):

\documentclass[11pt]{article}
\usepackage[margin=1.1in,a4paper]{geometry}
\usepackage{caption}
\usepackage{float}     %  not used in this mwe
\usepackage{titlesec}  %  not used in this mwe
% \usepackage{capt-of} % it is contained in caption

%dashed line
\usepackage{booktabs, makecell}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{}
\usepackage{arydshln}
\setlength\dashlinedash{0.2pt}
\setlength\dashlinegap{1.5pt}
\setlength\arrayrulewidth{0.3pt}

\usepackage[T1]{fontenc}
\usepackage{fontspec}
\setmainfont[Scale=0.85, Ligatures={Required,Common,Contextual,TeX}]{TeX Gyre Schola} % Incredible font inside latex

\begin{document}
\begin{table}[htb]
%\ra{1.3}
\small
\setlength\tabcolsep{0pt}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}>{\bfseries}l *{12}{r}}
    \toprule
Debt/Assets & \thead{2002} & \thead{2003} & \thead{2004} & \thead{2005} & \thead{2006} & \thead{2007}
            & \thead{2008} & \thead{2009} & \thead{2010} & \thead{2011} & \thead{2012} & \thead{Total} \\ \midrule
<50\%           & -\% & 10\% & 5\% & 7\% & 11\% & 2\% & -\% & -\% & -\% & -\% & 3\% & 2\%\\ \hdashline
<50\% - 59.9\%  & 20\ & 5\ & 16\ & 7\ & 11\ & 8\ & 13\ & 11\ & 9\ & 15\ & 8\ & 11\ \\ \hdashline
<60\% - 69.9\%  &  -\ & 10\ & 5\ & 13\ & 11\ & 10\ & 16\ & 16\ & 17\ & 11\ & 15\ & 13\ \\ \hdashline
<70\% - 79.9\%  &  -\ & 10\ & 37\ & 13\ & 15\ & 8\ & 24\ & 29\ & 16\ & 14\ & 35\ & 22\ \\ \hdashline
<80\% - 89.9\%  &  40\ & 10\ & 5\ & 17\ & 7\ & 24\ & 18\ & 18\ & 21\ & 6\ & 8\ & 15\ \\ \hdashline
>90\%           &  40\ & 55\ & 32\ & 43\ & 46\ & 49\ & 29\ & 26\ & 38\ & 24\ & 35\ & 37\ \\ \midrule
Total           &  100\% & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% \\ \midrule
Mean            &  85\% & 80\% & 77\% & 80\% & 78\% & 85\% & 79\% & 79\% & 82\% & 77\% & 80\% & 80\% \\ \hdashline
Median          &  85\% & 94\% & 76\% & 81\% & 80\% & 87\% & 79\% & 77\% & 82\% & 75\% & 72\% & 80\% \\ \hdashline
No. of Projects &  5\% & 20\% & 19\% & 30\% & 46\% & 51\% & 68\% & 38\% & 58\% & 54\% & 26\% & 415\% \\
\bottomrule
\end{tabular*}
\caption{Initial capital structures of large projects (\$1bn.+) \emph{(Finnerty, 2013)}}
\end{table}

\begin{table}[htb]
%\ra{1.3}
\small
\setlength\tabcolsep{0pt}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}>{\bfseries}l *{9}{r}}
    \toprule
    & \thead{1995} & \thead{1996} & \thead{1997} & \thead{1998} & \thead{1999} & \thead{2000}
    & \thead{2001} & \thead{2002} & \thead{Total}\\
    \midrule
Bank Loans  & \$23.33 & \$42.83 & \$67.43 & \$56.65 & \$72.39 & \$110.89 & \$108.48 & \$62.20 & \$557.88\\ \hdashline
Bonds       & 3.79 & 4.79 & 7.70 & 9.79 & 19.79 & 20.81 & 25.00 & 13.80 & 109.26\\ \hdashline
Development Agencies
             & 17.59 & 18.96 & 22.05 & 20.97 & 16.62 & 17.69 & 18.75 & 18.75 & 162.63\\ \hdashline
Total Debt  & 44.71 & 66.58 & 96.98 & 87.41 & 108.80 & 149.39 & 152.23 & 94.75 & 829.77\\ \hdashline
Equity      & 19.16 & 28.54 & 41.56 & 37.46 & 46.70 & 64.02 & 65.24 & 40.61 & 355.68\\ \midrule
Total       & \$63.88 & \$95.12 & \$138.54 & \$124.87 & \$155.68 & \$213.40 & \$217.47 & \$135.36 & \$1185.63\\ \midrule
Bank Lons   & 37\% & 45\% & 49\% & 45\% & 46\% & 52\% & 50\% & 46\% & 42\% \\ \hdashline
Bonds       & 6 & 5 & 5 & 8 & 13 & 10 & 11 & 10 & 9\\ \hdashline
Development Agencies
            & 28 & 20 & 16 & 17 & 11 & 8 & 9 & 14 & 14\\ \hdashline
Total Debt  & 70 & 70 & 70 & 70 & 70 & 70 & 70 & 70 & 70\\ \hdashline
Equity      & 30 & 30 & 30 & 30 & 30 & 30 & 30 & 30 & 30\\ \midrule
Total       & 100  & 100  & 100  & 100  & 100  & 100  & 100  & 100  & 100\\
    \bottomrule
\end{tabular*}
\caption{Project funding by source (US\$ billions) \emph{(Finnerty, 2013)}}
\end{table}

\begin{table}[htb]
%\ra{1.3}
\small
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}>{\bfseries}l l *{4}{r}}
    \toprule
\thead{Rank} & \thead[l]{Lead Arranger}
             & \thead{Number\\ of Deals}
             & \thead{Dollar\\ Amount}
             & \thead{Market\\ Share}
             & \thead{Equator\\ Principles Adoption}\\
    \midrule
1   & State Bank of India & 52 & \$21,631.6 & 10.1\% & NA\\ \hdashline
2   & Mitsubishi UFJ Financial & 88 & 9,486.1 & 4.4 & Dec 2005\\ \hdashline
3   & Sumitomo Mitsui & 71 & 8,188.1 & 3.8 & Jan 2006\\ \hdashline
4   & Credit Agrocole & 60 & 6,506.4 & 3.1 & Jun 2005\\ \hdashline
5   & Mizuho Financial & 55 & 5,797.5 & 2.7 & Oct 2003\\ \hdashline
6   & Soci\'{e}t\'{e} Generale & 55 & 5,760.5 & 2.7 & Sep 2007\\ \hdashline
7   & BNP Paribas & 55 & 5,390.8 & 2.5 & Oct 2008\\ \hdashline
8   & Axis Bank & 18 & 5,216.9 & 2.4 & NA\\ \hdashline
9   & IDBI Bank & 10 & 5,162.3 & 2.4 & NA\\ \hdashline
10  & ING & 49 & 4,916.1 & 2.3 & Jun 2003\\ \midrule
    & Others & 102 & 135,430.4 & 63.6 & \\ \midrule
    & Total Market & 615 & \$213,486.7 & 100\% & \\
    \bottomrule
\end{tabular*}
\caption{Global project bank facility lead arrangers \emph{(Finnerty, 2013)}}
\end{table}
\end{document}

compiling above code with xelatex doesn't gives any errors, warnings or bad boxes. image of the first table is:

enter image description here

and the third one is:

enter image description here

  • @JulianIngham, if answer solve your problem, you can accept it :-) (by clicking on check mark at the top left side of the answer). – Zarko Jul 13 '18 at 23:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.