I'm writing a document which will contain something like the image I included below. I don't want to use images because if I do, the document will contain a lot of images and I want to include this text in my LaTeX document the right way.
I don't know if this is possible, but can I have a section in latex, in which I can write whitespaces and tabs the way I do in a .txt document?
You can use the verbatim environment:
\begin{verbatim}
The verbatim environment
simply reproduces every
character you input,
including all s p a c e s!
\end{verbatim}
I'm not sure if tabs will do what you want; replace them by spaces if necessary.
An alternative to verbatim environment is to use a tabular-like environment, here's a sketch:
\documentclass{article}
\begin{document}
\begin{tabular}{*{14}{c}}
0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & & & \\
e & i & n & - & t & e & s & t & e & s & t & & & \\
t & e & s & t & & & & & & & & & I=0 & j=0\\
& t & e & s & t & & & & & & & & I=1 & j=0\\
& & t & e & s & t & & & & & & & I=2 & j=0\\
& & & t & e & s & t & & & & & & I=3 & j=0\\
& & & & t & e & s & t & & & & & I=4 & j=1\\
& & & & & t & e & s & t & & & & I=5 & j=2\\
& & & & & & t & e & s & t & & & I=6 & j=3\\
& & & & & & & t & e & s & t & & I=7 & j=4\\
\multicolumn{14}{l}{Und dann wird j auf 1... }\\
& & & & & & & & t & e & s & t & I=8 & j=2\\
\end{tabular}
\end{document}
and its output.
In my opinion a tabular (or other table environment) here has the advantage that you can then configure spacing, font family and size, etc.
Related
I'm trying to draw a table, but I faced a problem with the extra column line.
\documentclass[lettersize,journal]{IEEEtran}
\usepackage{array,tabularx}
\usepackage{pifont}
\usepackage{multirow,booktabs,tabu}
\begin{table*}[!t]
\caption{A. \label{table8}}
\centering
\begin{tabu}{|c|c|c|c|c|c|c|}
\hline
\multirow{2}{*}{A} & \multicolumn{2}{c|}{\multirow{2}{*}{B}} & \multicolumn{4}{c|}{C} \\
\cline{4-7}
& & & E & F & G & H \\
\cline{1-7}
\multirow{3}{*}{D} &
\multirow{3}{*}{K} & $1.0612e-09$ & $1.0610e-09$ & $5.2760e-10$ & $3.7844e-08$ & $7.6545e-06 $\\
\cline{3-7}
& & $9.724e-10$ & $9.7239e-10$ & $4.8758e-10$ & $4.9127e-08$ & $7.7153e-06 $\\
\cline{3-7}
& & $9.132e-10$ & $9.131e-10$ & $4.1633e-10$ & $4.3932e-08$ & $8.2672e-06$\\[-1pt]
%\cline{2-7
\hline
\end{tabu}
\end{table*}
Does anyone know how to remove this extra line that shown in
Don't use the tabu package - it is more or less completely broken. The only thing which helds this package together is a lot of ducktape by the latex team.
Instead you could use tabularray package, which makes merging cells much easier and you'll also don't have to worry how long all your lines should be.
You might also want to choose another column type, like S from siunitx, to avoid the incorrect spacing around your minus signs ....
\documentclass[lettersize,journal]{IEEEtran}
\usepackage{array,tabularx}
\usepackage{pifont}
\usepackage{multirow,booktabs,tabularray}
\UseTblrLibrary{siunitx}
\begin{document}
\begin{table*}[!t]
\caption{A. \label{table8}}
\centering
\begin{tblr}{
colspec={|c|c|S[table-format=1.3e-2]|S[table-format=1.3e-2]|S[table-format=1.3e-2]|S[table-format=1.3e-2]|S[table-format=1.3e-2]|},
vlines,
hlines,
row{1-2} = {guard}
}
\SetCell[r=2]{} A & \SetCell[c=2,r=2]{} B && \SetCell[c=4]{} C &&& \\
& & & E & F & G & H \\
\SetCell[r=3]{} D &
\SetCell[r=3]{} K & 1.0612e-09 & 1.0610e-09 & 5.2760e-10 & 3.7844e-08 & 7.6545e-06\\
& & 9.724e-10 & 9.7239e-10 & 4.8758e-10 & 4.9127e-08 & 7.7153e-06\\
& & 9.132e-10 & 9.131e-10 & 4.1633e-10 & 4.3932e-08 & 8.2672e-06\\
\end{tblr}
\end{table*}
\end{document}
I have a table in latex. here is the code for it. My problem is the table is huge and and the content of it is not clear. My paper texts are shown in two columns and the table locates in one of those columns. I appreciate if anyone can help me how can I make the table content more clear for example is it good to expand it in a new page?
\begin{table}[]
\centering
\caption{Comparing accuracy of }
\label{table1}
\resizebox{\columnwidth}{!}{%
\begin{tabular}{|cccccccccccc|}
\hline
\rowcolor[HTML]{C0C0C0}
\multicolumn{12}{|c|}{\cellcolor[HTML]{C0C0C0}out\_1} \\ \hline
\rowcolor[HTML]{00D2CB}
\multicolumn{1}{|c|}{\cellcolor[HTML]{00D2CB}} & \multicolumn{1}{c|}{\cellcolor[HTML]{00D2CB}} & \multicolumn{5}{c|}{\cellcolor[HTML]{00D2CB}Accuracy result} & \multicolumn{5}{c|}{\cellcolor[HTML]{00D2CB}Precision result} \\ \hline
\rowcolor[HTML]{C0C0C0}
\multicolumn{1}{|c|}{\cellcolor[HTML]{C0C0C0}row} & \multicolumn{1}{c|}{\cellcolor[HTML]{C0C0C0}Train-Test percentage} & \multicolumn{1}{c|}{\cellcolor[HTML]{C0C0C0}TP} & \multicolumn{1}{c|}{\cellcolor[HTML]{C0C0C0}FP} & \multicolumn{1}{c|}{\cellcolor[HTML]{C0C0C0}FN} & \multicolumn{1}{c|}{\cellcolor[HTML]{C0C0C0}TN} & \multicolumn{1}{c|}{\cellcolor[HTML]{C0C0C0}Accuracy} & \multicolumn{1}{c|}{\cellcolor[HTML]{C0C0C0}TP} & \multicolumn{1}{c|}{\cellcolor[HTML]{C0C0C0}FP} & \multicolumn{1}{c|}{\cellcolor[HTML]{C0C0C0}FN} & \multicolumn{1}{c|}{\cellcolor[HTML]{C0C0C0}TN} & Accuracy \\ \hline
\multicolumn{1}{|c|}{1} & \multicolumn{1}{c|}{10-90} & \multicolumn{1}{c|}{17508} & \multicolumn{1}{c|}{5433} & \multicolumn{1}{c|}{8} & \multicolumn{1}{c|}{35961} & \multicolumn{1}{c|}{0.907638771} & \multicolumn{1}{c|}{18715} & \multicolumn{1}{c|}{4226} & \multicolumn{1}{c|}{8} & \multicolumn{1}{c|}{35961} & 0.928127652 \\ \hline
\multicolumn{1}{|c|}{2} & \multicolumn{1}{c|}{20-80} & \multicolumn{1}{c|}{17313} & \multicolumn{1}{c|}{5433} & \multicolumn{1}{c|}{8} & \multicolumn{1}{c|}{29610} & \multicolumn{1}{c|}{0.896092735} & \multicolumn{1}{c|}{18476} & \multicolumn{1}{c|}{4270} & \multicolumn{1}{c|}{8} & \multicolumn{1}{c|}{29610} & 0.918302651 \\ \hline
\multicolumn{1}{|c|}{3} & \multicolumn{1}{c|}{30-70} & \multicolumn{1}{c|}{17097} & \multicolumn{1}{c|}{5433} & \multicolumn{1}{c|}{8} & \multicolumn{1}{c|}{23281} & \multicolumn{1}{c|}{0.881250136} & \multicolumn{1}{c|}{18223} & \multicolumn{1}{c|}{4307} & \multicolumn{1}{c|}{8} & \multicolumn{1}{c|}{23281} & 0.905825094 \\ \hline
\multicolumn{1}{|c|}{4} & \multicolumn{1}{c|}{40-60} & \multicolumn{1}{c|}{16587} & \multicolumn{1}{c|}{5429} & \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{17256} & \multicolumn{1}{c|}{0.86171513} & \multicolumn{1}{c|}{17760} & \multicolumn{1}{c|}{1255} & \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{17256} & 0.891582217 \\ \hline
\multicolumn{1}{|c|}{5} & \multicolumn{1}{c|}{50-50} & \multicolumn{1}{c|}{16155} & \multicolumn{1}{c|}{5428} & \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{16942} & \multicolumn{1}{c|}{0.834056465} & \multicolumn{1}{c|}{17338} & \multicolumn{1}{c|}{4245} & \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{11142} & 0.870202884 \\ \hline
\multicolumn{1}{|c|}{6} & \multicolumn{1}{c|}{60-40} & \multicolumn{1}{c|}{15654} & \multicolumn{1}{c|}{5416} & \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{5109} & \multicolumn{1}{c|}{0.793025891} & \multicolumn{1}{c|}{16817} & \multicolumn{1}{c|}{4253} & \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{5109} & 0.837445573 \\ \hline
\multicolumn{1}{|c|}{7} & \multicolumn{1}{c|}{70-30} & \multicolumn{1}{c|}{14240} & \multicolumn{1}{c|}{8977} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0.725161685} & \multicolumn{1}{c|}{15373} & \multicolumn{1}{c|}{4264} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & 0.782858889 \\ \hline
\multicolumn{1}{|c|}{8} & \multicolumn{1}{c|}{80-20} & \multicolumn{1}{c|}{9340} & \multicolumn{1}{c|}{3752} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0.713412771} & \multicolumn{1}{c|}{9502} & \multicolumn{1}{c|}{3950} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & 0.72578676 \\ \hline
\multicolumn{1}{|c|}{9} & \multicolumn{1}{c|}{90-10} & \multicolumn{1}{c|}{4736} & \multicolumn{1}{c|}{1809} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0.723605806} & \multicolumn{1}{c|}{4766} & \multicolumn{1}{c|}{1223} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & 0.722993452 \\ \hline
\end{tabular}%
}
\end{table}
The table in the paper is shown like the following:
I edit my code according to what you have written,
\usepackage{array}
\usepackage{booktabs}
\usepackage{threeparttable}
\usepackage{siunitx}
\usepackage{float}
\usepackage[margin=1in]{geometry}
\sisetup{
table-format=1.3,
round-mode = places,
round-precision = 3,
}
\begin{table*}[ht]
\renewcommand*{\arraystretch}{1.1}
\centering
\begin{threeparttable}
\caption{Comparing accuracy}\label{tab:table}
\begin{tabular}{c #{\hspace{12pt}} *5{c} S #{\hspace{12pt}} *4{c} S #{\hspace{6pt}}}
\toprule
\multicolumn{12}{c}{out\_1} \\
\cmidrule(lr){1-12}
& & \multicolumn{5}{c}{Accuracy result}
& \multicolumn{5}{c}{Precision result} \\
\cmidrule(lr){3-7}\cmidrule(r){8-12}
& TTP\tnote{1} & TP & FP & FN & TN & {ACC\tnote{3}} & TP & FP & FN & TN & {ACC\tnote{3}} \\
\midrule
1 & 10-90 & 17508 & 5433 & 8 & 35961 & 0.907638771 & 18715 & 4226 & 8 & 35961 & 0.928127652 \\
2 & 20-80 & 17313 & 5433 & 8 & 29610 & 0.896092735 & 18476 & 4270 & 8 & 29610 & 0.918302651 \\
3 & 30-70 & 17097 & 5433 & 8 & 23281 & 0.881250136 & 18223 & 4307 & 8 & 23281 & 0.905825094 \\
4 & 40-60 & 16587 & 5428 & 3 & 17256 & 0.86171513 & 17760 & 4255 & 3 & 17256 & 0.891582217 \\
5 & 50-50 & 16155 & 5428 & 3 & 11142 & 0.834056465 & 17338 & 4245 & 3 & 11142 & 0.870202884 \\
6 & 60-40 & 15654 & 5416 & 3 & 5109 & 0.793025743 & 16817 & 4253 & 3 & 5109 & 0.837445573 \\
7 & 70-30 & 14240 & 5397 & 0 & 0 & 0.725161685 & 15373 & 4264 & 0 & 0 & 0.782858889 \\
8 & 80-20 & 9340 & 3752 & 0 & 0 & 0.713412771 & 9502 & 3590 & 0 & 0 & 0.72578674 \\
9 & 90-10 & 4736 & 1809 & 0 & 0 & 0.723605806 & 4732 & 1813 & 0 & 0 & 0.722994652 \\
\bottomrule
\end{tabular}
\par\tnote{1} Test Train Percentage
\par\tnote{2} Accuracy
\end{threeparttable}
\end{table*}
\end{document}
You just have to make sure tables aren't too wordy; "the long" column names and insane number of decimal places are mostly the culprits!
I managed to fit the table within a page of a regular two column document. However, I changed some names to acronyms and added annotation to explain what they represent. I also reduced accuracy to 3 decimal places (I don't think you need more than 2).
There are a few additional packages in the code
siunitx to round some numbers
threeparttable to split the table into three parts: a caption, the main table, footnotes (*)
booktabs for much better rules (**).
* If you insist on using colours, then you will have to get back to regular \hline due to gaps between background colours and rules defined by booktabs. I think a well designed table doesn't need colours
** The caption width will be reduced to the width of your table, which IMO has much better effect; move caption outside the threeparttable if you prefer captions to have the full page width .
Here's the result with dummy texts
and code
\documentclass[twocolumn]{article}
\usepackage{array}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{threeparttable}
\usepackage{siunitx}
\sisetup{
table-format=1.3,
round-mode = places,
round-precision = 3,
}
\usepackage{kantlipsum}
\pagestyle{empty}
\begin{document}
\section{One}
\kant[1-2]
\begin{table*}
\renewcommand*{\arraystretch}{1.1}
\centering
\begin{threeparttable}
\caption{Comparing accuracy}\label{tab:table}
\begin{tabular}{c #{\hspace{12pt}} *5{c} S #{\hspace{12pt}} *4{c} S #{\hspace{6pt}}}
\toprule
\multicolumn{12}{c}{out\_1} \\
\cmidrule(lr){1-12}
& & \multicolumn{5}{c}{Accuracy result}
& \multicolumn{5}{c}{Precision result} \\
\cmidrule(lr){3-7}\cmidrule(r){8-12}
& TTP\tnote{1} & TP & FP & FN & TN & {ACC\tnote{2}} & TP & FP & FN & TN & {ACC\tnote{2}} \\
\midrule
1 & 10-90 & 17508 & 5433 & 8 & 35961 & 0.907638771 & 18715 & 4226 & 8 & 35961 & 0.928127652 \\
2 & 20-80 & 17313 & 5433 & 8 & 29610 & 0.896092735 & 18476 & 4270 & 8 & 29610 & 0.918302651 \\
3 & 30-70 & 17097 & 5433 & 8 & 23281 & 0.881250136 & 18223 & 4307 & 8 & 23281 & 0.905825094 \\
4 & 40-60 & 16587 & 5428 & 3 & 17256 & 0.86171513 & 17760 & 4255 & 3 & 17256 & 0.891582217 \\
5 & 50-50 & 16155 & 5428 & 3 & 11142 & 0.834056465 & 17338 & 4245 & 3 & 11142 & 0.870202884 \\
6 & 60-40 & 15654 & 5416 & 3 & 5109 & 0.793025743 & 16817 & 4253 & 3 & 5109 & 0.837445573 \\
7 & 70-30 & 14240 & 5397 & 0 & 0 & 0.725161685 & 15373 & 4264 & 0 & 0 & 0.782858889 \\
8 & 80-20 & 9340 & 3752 & 0 & 0 & 0.713412771 & 9502 & 3590 & 0 & 0 & 0.72578674 \\
9 & 90-10 & 4736 & 1809 & 0 & 0 & 0.723605806 & 4732 & 1813 & 0 & 0 & 0.722994652 \\
\bottomrule
\end{tabular}
\par\tnote{1} Test Train Percentage
\par\tnote{2} Accuracy
\end{threeparttable}
\end{table*}
\kant[3-5]
\section{Two}
\kant[1-2]
\end{document}
Update
In order to achieve top alignment of a float on a single empty page, add the following to your preamble
\makeatletter
\setlength\#dblfptop{0pt}
\makeatother
I am new to Overleaf and I want to know how can I fit content of table with AutoWidth on so that it will adjust according to format of page.
% Please add the following required packages to your document preamble:
% \usepackage[table,xcdraw]{xcolor}
% If you use beamer only pass "xcolor=table" option, i.e. \documentclass[xcolor=table]{beamer}
\begin{table}[]
\begin{tabular}{|l|l|l|l|l|l|l|l|}
\hline
& Google Map & MapQuest & RouteXL & Onfleet & OptimoRoute & Workwave & Route4Me \\ \hline
\begin{tabular}[c]{#{}l#{}}Limitations\\ (Orders)\end{tabular} &
10/Person &
26/Person &
20/Person &
Total 2500 &
250/Person &
- &
- \\ \hline
Price & Free & Free & Free & \$449 & \$19/Driver & \$49/Driver & \$199 \\ \hline
Interface & - & - & - & - & - & - & - \\ \hline
Order Split & - & - & - & - & Available & Available & Extra Charge \\ \hline
Upload File & Manual & Supported CSV & Manual & & Supported CSV & & \\ \hline
App & Available & Available & - & Available & Available & Available & Available \\ \hline
ETA & Available & Available & Available & & Available & - & Available \\ \hline
API &
Available with Extra Charge &
- &
Available &
&
Available with Extra Charge &
&
Available \\ \hline
Other & Manual & - & - & & & & \\ \hline
\end{tabular}
\end{table}
You can use the tabularx package:
\documentclass{article}
\usepackage{geometry}
\usepackage[table,xcdraw]{xcolor}
\usepackage{tabularx}
\begin{document}
% Please add the following required packages to your document preamble:
% \usepackage[table,xcdraw]{xcolor}
% If you use beamer only pass "xcolor=table" option, i.e. \documentclass[xcolor=table]{beamer}
\begin{table}[]
\begin{tabularx}{\linewidth}{|X|X|X|X|X|X|X|X|}
\hline
& Google Map & MapQuest & RouteXL & Onfleet & Optimo\-Route & Workwave & Route4Me \\ \hline
Limitations (Orders) &
10/Person &
26/Person &
20/Person &
Total 2500 &
250/Person &
- &
- \\ \hline
Price & Free & Free & Free & \$449 & \$19/Driver & \$49/Driver & \$199 \\ \hline
Interface & - & - & - & - & - & - & - \\ \hline
Order Split & - & - & - & - & Available & Available & Extra Charge \\ \hline
Upload File & Manual & Supported CSV & Manual & & Supported CSV & & \\ \hline
App & Available & Available & - & Available & Available & Available & Available \\ \hline
ETA & Available & Available & Available & & Available & - & Available \\ \hline
API &
Available with Extra Charge &
- &
Available &
&
Available with Extra Charge &
&
Available \\ \hline
Other & Manual & - & - & & & & \\ \hline
\end{tabularx}
\end{table}
\end{document}
I have sideways table that is slightly too large. I want it to make it smaller that it fits on the page. I tried \small \resizebox, nothing works. Any idea how it could work? Please find below the table.
I have sideways table that is slightly too large. I want it to make it smaller that it fits on the page. I tried \small \resizebox, nothing works. Any idea how it could work? Please find below the table.
\documentclass[a4paper, 12pt]{article}
\DeclareUnicodeCharacter{FB01}{fi}
\DeclareUnicodeCharacter{FB02}{fl}
%\usepackage[space]{grffile}
\usepackage{apacite}
\usepackage{makecell}
\usepackage{afterpage}
\usepackage{dblfloatfix}
\usepackage[referable]{threeparttablex}
\usepackage[paper=portrait,pagesize]{typearea}
\usepackage{subcaption}
\usepackage{mleftright}
\usepackage{lscape}
\usepackage{a4wide}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[onehalfspacing]{setspace}
\usepackage{float, afterpage, rotating, graphicx}
\usepackage{threeparttable}
\usepackage{multirow, booktabs, makecell, caption}
\begin{document}
\begin{sidewaystable}
\small
\caption{Portfolio return and risk performance}
\label{pfperformance}
\begin{threeparttable}
\begin{tabular*}{\linewidth}{l#{\extracolsep{\fill}}*{10}{c}}
\toprule
& \multicolumn{4}{c}{Sample covariance matrix} & & \multicolumn{4}{c}{Shrinkage covariance matrix} \\
\cmidrule{2-5} \cmidrule(l{1cm}){6-10}
& HRP & IV & MV & MD & & HRP & IV & MV & MD \\
\midrule
Pandel A: Window = 250 & & & & \\
\midrule
Annualized return & 2.8913 & 2.6522 & 2.3518 & 4.5343 & & 3.4178 & 2.6522 & 2.3515 & 3.4646 \\
Annualized volatility & 0.8819 & 0.8779 & 1.4456 & 2.8673 & & 0.9805 & 0.8779 & 1.0602 & 1.5449 \\
Value-at-Risk (5\%) & 0.0098 & 0.0005 & 0.0043 & 0.0130 & & 0.0135 & 0.0005 & 0.0010 & 0.0046 \\
Conditional Value-at-Risk (5\%) & 0.0019 & 0.0011 & 0.0005 & 0.0019 & & 0.0049 & 0.0011 & 0.0004 & 0.0019 \\
Drawdown & 0.3171 & 0.3540 & 0.7069 & 0.8459 & & 0.3817 & 0.3540 & 0.5822 & 0.7181 \\
Maximum drawdown & 0.4435 & 0.4389 & 0.7755 & 0.8834 & & 0.5152 & 0.4389 & 0.6920 & 0.7917 \\
Sharpe ratio & 0.1716 & 0.1581 & 0.0852 & 0.0828 & & 0.1825 & 0.1581 & 0.1161 & 0.1174 \\
Calmar ratio & 6.5185 & 6.0423 & 3.0326 & 5.1325 & & 6.6337 & 6.0423 & 3.3983 & 4.3760 \\
Sortino ratio & 0.0072 & 0.0066 & 0.0068 & 0.0121 & & 0.0081 & 0.0066 & 0.0063 & 0.0092 \\
\midrule
Panel B: Window = 500 & & & & \\
\midrule
Annualized return & 2.9839 & 2.7675 & 2.2262 & 4.7684 & & 3.4379 & 2.7675 & 2.2100 & 3.6598 \\
Annualized volatility & 0.9310 & 0.9295 & 0.9744 & 2.6048 & & 1.0319 & 0.9295 & 0.8484 & 1.5313 \\
Value-at-Risk (5\%) & 0.0175 & 0.0182 & 0.0160 & 0.0229 & & 0.0039 & 0.0182 & 0.0269 & 0.0215\\
Conditional Value-at-Risk (5\%) & 0.0132 & 0.0116 & 0.0081 & 0.0131 & & 0.0130 & 0.0116 & 0.0099 & 0.0125\\
Drawdown & 0.3171 & 0.3539 & 0.4944 & 0.8169 & & 0.3817 & 0.3539 & 0.2857 & 0.6883\\
Maximum drawdown & 0.4435 & 0.4389 & 0.6134 & 0.8611 & & 0.5152 & 0.4389 & 0.4251 & 0.7714\\
Sharpe ratio & 0.1677 & 0.1558 & 0.1195 & 0.0958 & & 0.1744 & 0.1558 & 0.1363 & 0.1251\\
Calmar ratio & 6.7275 & 6.3050 & 3.6293 & 5.5371 & & 6.6729 & 6.3050 & 5.1982 & 4.7444\\
Sortino ratio & 0.0077 & 0.0071 & 0.0066 & 0.0130 & & 0.0084 & 0.0071 & 0.0060 & 0.0098\\
\midrule
Panel C: Window = 750 & & & & \\
\midrule
Annualized return & 2.9737 & 2.8767 & 2.2161 & 5.5427 & & 3.4330 & 2.8767 & 2.7677 & 3.9270 \\
Annualized volatility & 0.9832 & 1.0010 & 0.9142 & 2.7918 & & 1.0737 & 1.0010 & 1.2177 & 1.6674 \\
Value-at-Risk (5\%) & 0.0650 & 0.0596 & 0.0804 & 0.0793 & & 0.0546 & 0.0596 & 0.0684 & 0.0706 \\
Conditional Value-at-Risk (5\%) & 0.0077 & 0.0060 & 0.0048 & 0.0095 & & 0.0062 & 0.0060 & 0.0057 & 0.0074 \\
Drawdown & 0.3171 & 0.3539 & 0.3213 & 0.8069 & & 0.3817 & 0.3539 & 0.5395 & 0.6784 \\
Maximum drawdown & 0.4059 & 0.4389 & 0.4792 & 0.8525 & & 0.4719 & 0.4389 & 0.6651 & 0.7633 \\
Sharpe ratio & 0.1583 & 0.1504 & 0.1268 & 0.1039 & & 0.1674 & 0.1504 & 0.1190 & 0.1233 \\
Calmar ratio & 7.3246 & 6.5537 & 4.6244 & 6.5014 & & 7.2750 & 6.5537 & 4.1616 & 5.1448 \\
Sortino ratio & 0.0079 & 0.0076 & 0.0067 & 0.0153 & & 0.0087 & 0.0076 & 0.0076 & 0.0106 \\
\bottomrule
\end{tabular*}
\begin{tablenotes}[para,flushleft]
\footnotesize
\item\hspace{-2.5pt}\noindent\textit{Note:} The table presents portfolio performance and risk statistics using rolling-window sample and shrinkage covariance matrix estimates of 250, 500, and 750 days. The shrinkage covariance matrix is calculated following \cite{ledoit2004honey}, where the shrinkage target $S$ is a diagonal matrix of only variances with zeros elsewhere and the shrinkage constant is $\delta=0.3$. We use an annualization factor of 250 trading days. All series are in logarithmic first differences.
\end{tablenotes}
\end{threeparttable}
\end{sidewaystable}
\end{document}
You should use the adjustbox package which is the best and more flexible way to resize (among many other features) a box in LaTeX.
Just add
\usepackage{adjustbox}
in your pramble.
And enclose the box you want to resize with an adjustbox environment
\begin{sidewaystable}
\small
\caption{Portfolio return and risk performance}
\label{pfperformance}
\begin{adjustbox}{scale=0.95,center}
\begin{threeparttable}
....
\end{threeparttable}
\end{adjustbox}
\end{sidewaystable}
Just adapt the scale to your needs. You can also use
\begin{adjustbox}{width=\texwidth,center}
Without center, your box will be flushed left (and hence downwards in the sideway table).
I'm trying to add a caption to a table in latex, however it throws this error "! LaTeX Error: \caption outside float."
From the error I am guessing it means that it is outside the table, but I have clearly put it inside.
\begin{tabular}{|c|c|c|c|c|c|}
\caption{Table1}
Potentiometer & Resistance & \multicolumn{2}{c}{Calculated V\textsubscript{32}} & \multicolumn{2}{c|}{Measured V\textsubscript{32}}\\ \cline{3-6}
Position & R\textsubscript{34} & Amplitude & Phase & Amplitude & Phase\\ \hline \hline
1 & 303.8 & & 2.73 & 28.2 & 2.51\\
2 & 1.141k & & 1.81 & 28.2 & 1.63\\
3 & 3.453k & & 0.79 & 28.2 & 0.5\\
4 & 5.33k & & 0.53 & 28.2 & 0.38\\
5 & 7.45k & & 0.38 & 28.2 & 0.25\\
6 & 9.54k & & 0.30 & 28.2 & 0.13\\
7 & 10.84k & & 0.27 & 28.2 & 0.13\\
\hline
\end{tabular}
The tabular environment won't take a caption. You need to do something like this:
\begin{table}
\begin{tabular}{|c|c|c|c|c|c|}
Potentiometer & Resistance & \multicolumn{2}{c}{Calculated V\textsubscript{32}} & \multicolumn{2}{c|}{Measured V\textsubscript{32}}\\ \cline{3-6}
Position & R\textsubscript{34} & Amplitude & Phase & Amplitude & Phase\\ \hline \hline
1 & 303.8 & & 2.73 & 28.2 & 2.51\\
2 & 1.141k & & 1.81 & 28.2 & 1.63\\
3 & 3.453k & & 0.79 & 28.2 & 0.5\\
4 & 5.33k & & 0.53 & 28.2 & 0.38\\
5 & 7.45k & & 0.38 & 28.2 & 0.25\\
6 & 9.54k & & 0.30 & 28.2 & 0.13\\
7 & 10.84k & & 0.27 & 28.2 & 0.13\\
\hline
\end{tabular}
\caption{Table1}
\label{tab:xyz}
\end{table}
If you don't want to use a "float" (e.g. table or figure) that will "float away" from the place you define it, you can add:
\usepackage{capt-of}
in the preamble and then do something like:
\begin{center}
\captionof{table}{Caption text goes here}
\label{table1} % for use in \ref{table1} if you want to refer to the table number
\begin{tabular}{|c|c|c|c|c|c|}
% etc.
\end{tabular}
\end{center}
to add a auto-numbered caption to a non-float.