0

I found this old code for a table, but I do not understand why it is not working. Could you help?

\documentclass{article} 
\setlength{\oddsidemargin}{.25in} 
\setlength{\textwidth}{5.5in} 
\setlength{\topmargin}{0.50in} 
\setlength{\textheight}{9.00in} 
\pagestyle{empty} 
\begin{document} 
\input table 
\BeginTable 

\def\C{\JustCenter} 
\def\L{\JustLeft} 
\def\R{\JustRight} 
\BeginFormat 
|   l   |  l  | cn[-0.00] | cn[-0.00] | cn[-0.00] | cn[-0.00] | cn[-0.00] | 
\EndFormat 
" \use7 \C \bf TABLE 4 " \\+02 
" \use7 \C \bf Influence of State Variables on Asset Demands " \\+11 \_3 
" {} " \C State Variables: " \C Constant " \C $AR_t$     " \C $y_t$     " \C $(d-p)_t$ " \C $spr_t$ " \\+23 \_2 
" \use3 \L 1953/Q2 - 1999/Q3, Quarterly " {} " {} " {} " {} " \\+42 
" \use3 \L $~\gamma =1, \psi = 1, \rho =0.92^{1/4}  $ " {} " {} " {} " {} " \\+34 
" ~~Stock" Total Demand " 272.77  " 292.42  " 296.33  " 303.41  " 302.79 " \\+11 
"  {} " Hedging Demand " 0.00  " 0.00  " 0.00  " 0.00  " 0.00 " \\+12 
" ~~Bond" Total Demand " 172.93  " 162.73  " 160.07  " 160.67  " 171.01 " \\+11 
"  {} " Hedging Demand " 0.00  " 0.00  " 0.00  " 0.00  " 0.00 " \\+12 
" ~~Cash" Total Demand " -345.70  " -355.15  " -356.40  " -364.08  " -373.80 " \\+11 
"  {} " Hedging Demand " 0.00  " 0.00  " 0.00  " 0.00  " 0.00 " \\+15 \_1 
" \use3 \L $~\gamma =2, \psi = 1, \rho =0.92^{1/4}  $ " {} " {} " {} " {} " \\+34 
" ~~Stock" Total Demand " 135.52  " 146.02  " 149.62  " 246.07  " 246.61 " \\+11 
"  {} " Hedging Demand " 0.00  " 0.20  " 1.95  " 94.91  " 95.77 " \\+12 
" ~~Bond" Total Demand " 82.13  " 33.53  " -7.22  " 6.25  " -8.17 " \\+11 
"  {} " Hedging Demand " 0.00  " -43.86  " -83.35  " -70.18  " -90.00 " \\+12 
" ~~Cash" Total Demand " -117.65  " -79.55  " -42.39  " -152.32  " -138.44 " \\+11 
"  {} " Hedging Demand " 0.00  " 43.66  " 81.41  " -24.73  " -5.77 " \\+15 \_1 
" \use3 \L $~\gamma =5, \psi = 1, \rho =0.92^{1/4}  $ " {} " {} " {} " {} " \\+34 
" ~~Stock" Total Demand " 53.17  " 56.52  " 57.40  " 157.64  " 160.51 " \\+11 
"  {} " Hedging Demand " 0.00  " -1.34  " -1.08  " 97.83  " 100.84 " \\+12 
" ~~Bond" Total Demand " 27.65  " -3.94  " -15.70  " -43.70  " -94.24 " \\+11 
"  {} " Hedging Demand " 0.00  " -30.13  " -41.47  " -69.59  " -122.57 " \\+12 
" ~~Cash" Total Demand " 19.18  " 47.42  " 58.30  " -13.94  " 33.73 " \\+11 
"  {} " Hedging Demand " 0.00  " 31.47  " 42.55  " -28.24  " 21.72 " \\+15 \_1 
" \use3 \L $~\gamma =20, \psi = 1, \rho =0.92^{1/4}  $ " {} " {} " {} " {} " \\+34 
" ~~Stock" Total Demand " 12.00  " 12.01  " 11.47  " 59.37  " 59.54 " \\+11 
"  {} " Hedging Demand " 0.00  " -1.88  " -2.41  " 45.23  " 45.46 " \\+12 
" ~~Bond" Total Demand " 0.41  " -11.28  " 3.61  " -19.55  " -39.95 " \\+11 
"  {} " Hedging Demand " 0.00  " -11.86  " 3.03  " -20.17  " -41.53 " \\+12 
" ~~Cash" Total Demand " 87.59  " 99.27  " 84.92  " 60.18  " 80.41 " \\+11 
"  {} " Hedging Demand " 0.00  " 13.74  " -0.62  " -25.06  " -3.94 " \\+15 \_1 
\EndTable 
\bigskip \footnotesize{\bf Note}: $AR_t$ = real returns on T-Bills, excess return on stocks, and excess return on bonds; $y_t$ = nominal yield on T-Bills; $(d-p)_t$ = log dividend-price ratio; $spr_t$ = yield spread. The bond is a 5-year nominal bond in the quarterly dataset and a 20-year in the annual dataset. \normalsize \end{document} 
  • 2
    Welcome to TeX.SE. What's in the file table.tex? How are \BeginTable, \EndTable, \BeginFormat, and \EndFormat defined? – Mico Jun 19 '18 at 20:49
  • 5
    that is TABLE syntax pctex.com/manuals/tableSelection.pdf which is almost never used with latex. I would advise using a standard latex tabular – David Carlisle Jun 19 '18 at 20:50
  • 3
    note that manual is dated 1988 so it predates latex2e by 5 years – David Carlisle Jun 19 '18 at 20:52
  • 5
    "not working" does not allow anyone to help, what error message did you get, have you installed table.tex (which is not in standard tex distributions but is available from the pctex company website) – David Carlisle Jun 19 '18 at 20:59
1

As David Carlisle mentioned its table environment defined in a different manner. If there are not much tables, you can switch back to usual tabular environment. Here I have used longtable environment so that it will not have any affect on pagebreaks. I have also used booktabs to style it.

enter image description here

Code:

\documentclass{article}
\usepackage{longtable}
\usepackage{booktabs}

\begin{document}
\begin{longtable}[c]{lllllll}
        \caption{Influence of State Variables on Asset Demands}
    \label{my-label}\\
    & \multicolumn{1}{c}{\textbf{State Variables:}} & \multicolumn{1}{c}{\textbf{Constant}} & \multicolumn{1}{c}{\textbf{$AR_t$}} & \multicolumn{1}{c}{\textbf{ $y_t$}} & \multicolumn{1}{c}{\textbf{$(d-p)_t$}} & \multicolumn{1}{c}{\textbf{$spr_t$}} \\
    \endfirsthead
    %
    \endhead
    %
    \toprule
    \multicolumn{7}{l}{\textbf{1953/Q2 - 1999/Q3, Quarterly}}                                                                                                                                                                                                                                 \\ \toprule
    \multicolumn{7}{l}{\textbf{$~\gamma =1, \psi = 1, \rho =0.92^{1/4}  $}}                                                                                                                                                                                                                   \\\toprule 
    ~~Stock                       & Total Demand                                  & 272.77                                & 292.42                              & 296.33                                & 303.41                                    & 302.79                                  \\
    & Hedging Demand                                & 0                                     & 0                                   & 0                                     & 0                                         & 0                                       \\
    ~~Bond                        & Total Demand                                  & 172.93                                & 162.73                              & 160.07                                & 160.67                                    & 171.01                                  \\
    & Hedging Demand                                & 0                                     & 0                                   & 0                                     & 0                                         & 0                                       \\
    ~~Cash                        & Total Demand                                  & -345.7                                & -355.15                             & -356.4                                & -364.08                                   & -373.8                                  \\
    & Hedging Demand                                & 0                                     & 0                                   & 0                                     & 0                                         & 0                                       \\ \toprule 
    \multicolumn{3}{l}{\textbf{$~\gamma =2, \psi = 1, \rho =0.92^{1/4}  $}}                                               & \textbf{}                           & \textbf{}                             & \textbf{}                                 & \textbf{}                               \\ \toprule 
    ~~Stock                       & Total Demand                                  & 135.52                                & 146.02                              & 149.62                                & 246.07                                    & 246.61                                  \\
    & Hedging Demand                                & 0                                     & 0.2                                 & 1.95                                  & 94.91                                     & 95.77                                   \\
    ~~Bond                        & Total Demand                                  & 82.13                                 & 33.53                               & -7.22                                 & 6.25                                      & -8.17                                   \\
    & Hedging Demand                                & 0                                     & -43.86                              & -83.35                                & -70.18                                    & -90                                     \\
    ~~Cash                        & Total Demand                                  & -117.65                               & -79.55                              & -42.39                                & -152.32                                   & -138.44                                 \\
    & Hedging Demand                                & 0                                     & 43.66                               & 81.41                                 & -24.73                                    & -5.77                                   \\ \toprule 
    \multicolumn{3}{l}{\textbf{$~\gamma =5, \psi = 1, \rho =0.92^{1/4}  $}}                                               & \textbf{}                           & \textbf{}                             & \textbf{}                                 & \textbf{}                               \\ \toprule 
    ~~Stock                       & Total Demand                                  & 53.17                                 & 56.52                               & 57.4                                  & 157.64                                    & 160.51                                  \\
    & Hedging Demand                                & 0                                     & -1.34                               & -1.08                                 & 97.83                                     & 100.84                                  \\
    ~~Bond                        & Total Demand                                  & 27.65                                 & -3.94                               & -15.7                                 & -43.7                                     & -94.24                                  \\
    & Hedging Demand                                & 0                                     & -30.13                              & -41.47                                & -69.59                                    & -122.57                                 \\
    ~~Cash                        & Total Demand                                  & 19.18                                 & 47.42                               & 58.3                                  & -13.94                                    & 33.73                                   \\
    & Hedging Demand                                & 0                                     & 31.47                               & 42.55                                 & -28.24                                    & 21.72                                   \\ \toprule 
    \multicolumn{3}{l}{\textbf{$~\gamma =20, \psi = 1, \rho =0.92^{1/4}  $}}                                              & \textbf{}                           & \textbf{}                             & \textbf{}                                 & \textbf{}                               \\ \toprule 
    ~~Stock                       & Total Demand                                  & 12                                    & 12.01                               & 11.47                                 & 59.37                                     & 59.54                                   \\
    & Hedging Demand                                & 0                                     & -1.88                               & -2.41                                 & 45.23                                     & 45.46                                   \\
    ~~Bond                        & Total Demand                                  & 0.41                                  & -11.28                              & 3.61                                  & -19.55                                    & -39.95                                  \\
    & Hedging Demand                                & 0                                     & -11.86                              & 3.03                                  & -20.17                                    & -41.53                                  \\
    ~~Cash                        & Total Demand                                  & 87.59                                 & 99.27                               & 84.92                                 & 60.18                                     & 80.41                                   \\
    & Hedging Demand                                & 0                                     & 13.74                               & -0.62                                 & -25.06                                    & -3.94                  \\ \bottomrule                 
\end{longtable}
\end{document}

I hope that you will be able to clean the empty \textbf{}s.

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.