Alignment of input in regression tables (Latex) - latex

I have created a regression table using the following commands:
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{adjustbox}{max
width={\textwidth},caption={Cumulative Average Abnormal Return},nofloat=table}
\begin{tabular}{l*{4}{c}}
\hline\hline
&\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}\\
&\multicolumn{1}{c}{Test Model 1}&\multicolumn{1}{c}{Test Model 2}&\multicolumn{1}{c}{Test Model 3}&\multicolumn{1}{c}{Test Model 4}\\
\hline
Window 1:\\
{[0]} & 0.0254\sym{***}& 0.02565\sym{***}& 0.0431\sym{***}& 0.0495\sym{***}\\
& (0.0024) & (0.0065) & (0.0098) & (0.0024) \\
Window 2:\\
{[-1,-10]} & 0.000249 & 0.000230 & 0.000276 & 0.0000194 \\
& (0.00024) & (0.00092) & (0.00032) & (0.000322) \\
{[-11,-20]} & 0.0000232 & -0.000242 & -0.000242 & -0.000232 \\
& (0.0019) & (0.0019) & (0.0019) & (0.0023) \\
Window 3:\\
{[1,10]} & -0.000124 & -0.000436 & -0.000321 & -0.000232 \\
& (0.0011) & (0.0010) & (0.0010) & (0.0010) \\
{[11,20]} & 0.000124 & 0.000124 & 0.000124 & 0.000124 \\
& (0.0014) & (0.0014) & (0.0014) & (0.0015) \\
\hline
Observations & 417 & 417 & 417 & 417 \\
\hline\hline
\multicolumn{5}{p{\textwidth}}{\footnotesize xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx}\\
\multicolumn{5}{p{\textwidth}}{\footnotesize \sym{*} \(p<0.10\), \sym{**} \(p<0.05\), \sym{***} \(p<0.01\)}\\
\end{tabular}\end{adjustbox}
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text
This results in the following output:
My question is, how can I align all the columns in the regression table and at the same the keep the table width equal to the text width. I also want to "link" the caption and the table text to the table so it does not end up on to different pages. Thank you!

It is not clear to me how you want to "align all the columns" in the table.
If you want to align the columns to the left, have them of equal width while keeping the overall width of the tabular equal to the textwidth, you can try changing
\begin{tabular}{l*{4}{c}}
to
\begin{tabular}{l*{4}{p{.2\textwidth}}}
or
\begin{tabular}{*{5}{p{.2\textwidth}}}
Please post a comment if this doesn't help!!

Related

Modify the text area in the presence of /lfoot

I'm creating my resume on overleaf with a footer using the following commands:
\lfoot{Line for Footer: Footer}
\begin{document}
.
.
.
yada yada
.
.
\beginitemize}
\item{\textbf{Place for text}: text, text text text, text text text text text text text text text text text text text text text text text text text text text text text}
\item{\textbf{Line for More text}: More text. Still More text}
\end{itemize}
\enddocument}
This is compiling as shown below:
I want the last line to be included in the 1st page itself. I used \renewcommand{\footruleskip}{-2pt} & \setlength{\skip\footins}{330pt} but they aren't producing the intended result.
Really need some guidance here, have been stuck for so long :(
As #imnothere suggested, keeping \enlargethispage{\baselineskip} before the \begin{itemize} worked!

Why long table doesn't go to the next page in latex

I need to create a long table in latex, but when the size of the table is longer than page, the table doesn't go to the next page. For example, I need the table to be gone to the next page automatically regardless the size of the table. Here is the code I need to write:
\documentclass{article}
\usepackage{overpic}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{verbatim} % multi line comment pkg
\usepackage{algpseudocode}
\usepackage{cases}
\newcolumntype{L}{>{\RaggedRight\hspace{0pt}}X}
% allow line breaking, suppress full justfication
\begin{document}
\begin{table}[]
\begin{tabular}{llll}
aa & \multicolumn{2}{l}{ewee} & \\
bb & \multicolumn{2}{l}{text text text text} & \\
ccc & \multicolumn{2}{l}{text text text text} & \\
ddd & \multicolumn{2}{l}{text text text text} & \\
eee & \multicolumn{2}{l}{text text text text} & \\
fff & \multicolumn{2}{l}{text text text text} & \\
rrr & \multicolumn{2}{l}{text text text text} & \\
fff & \multicolumn{2}{l}{text text text text} & \\
rere & \multicolumn{2}{l}{text text text text} & \\
rere & \multicolumn{2}{l}{text text text text} & \\
wqwq & \multicolumn{2}{l}{text text text text} & \\
trt & \multicolumn{2}{l}{text text text text} & \\
yyt & \multicolumn{2}{l}{text text text text} & \\
tre & \multicolumn{2}{l}{text text text text} & \\
hgh & \multicolumn{2}{l}{text text text text} & \\
wqw & \multicolumn{2}{l}{text text text text} & \\
iui & \multicolumn{2}{l}{text text text text} & \\
rer & \multicolumn{2}{l}{utjh} & \\
wqw & \multicolumn{2}{l}{text text text text} & \\
lkj & \multicolumn{2}{l}{text text text text} & \\
lkj & \multicolumn{2}{l}{text text text text} & \\
ewe & \multicolumn{2}{l}{text text text text} & \\
hng & \multicolumn{2}{l}{text text text text} & \\
fdf & \multicolumn{2}{l}{text text text text} & \\
dgf & \multicolumn{2}{l}{text text text text} & \\
gfdfd & \multicolumn{2}{l}{text text text text} & \\
dsd & \multicolumn{2}{l}{text text text text} & \\
fdf & \multicolumn{3}{l}{text text text text} \\
hghg & \multicolumn{3}{l}{text text text text} \\
fgf & \multicolumn{3}{l}{text text text text} \\
lkl & \multicolumn{3}{l}{text text text text} \\
BPSK & \multicolumn{3}{l}{text text text text} \\
LRE & \multicolumn{3}{l}{text text text text} \\
\end{tabular}
\end{table}
\end{document}
You can use the longtable package to create a table that will automatically break across pages. You need to
replace tabular with longtable
remove the table environment around it
Furthermore avoid the excessive use of \multicolumn. I know these nasty online table generators will add it everywhere, but it can interfere with the alignment of the cell contents, so only use it when appropriate.
\documentclass{article}
\usepackage{longtable}
\begin{document}
%\begin{table}[]
\begin{longtable}{llll}
aa & ewee \\
bb & text text text text \\
ccc & text text text text \\
ddd & text text text text \\
eee & text text text text \\
fff & text text text text \\
rrr & text text text text \\
fff & text text text text \\
rere & text text text text \\
rere & text text text text \\
wqwq & text text text text \\
trt & text text text text \\
yyt & text text text text \\
tre & text text text text \\
hgh & text text text text \\
wqw & text text text text \\
iui & text text text text \\
rer & utjh \\
wqw & text text text text \\
lkj & text text text text \\
lkj & text text text text \\
ewe & text text text text \\
hng & text text text text \\
fdf & text text text text \\
dgf & text text text text \\
gfdfd & text text text text \\
dsd & text text text text \\
fdf & text text text text \\
hghg & text text text text \\
fgf & text text text text \\
lkl & text text text text \\
BPSK & text text text text \\
LRE & text text text text \\
aa & ewee \\
bb & text text text text \\
ccc & text text text text \\
ddd & text text text text \\
eee & text text text text \\
fff & text text text text \\
rrr & text text text text \\
fff & text text text text \\
rere & text text text text \\
rere & text text text text \\
wqwq & text text text text \\
trt & text text text text \\
yyt & text text text text \\
tre & text text text text \\
hgh & text text text text \\
wqw & text text text text \\
iui & text text text text \\
rer & utjh \\
wqw & text text text text \\
lkj & text text text text \\
lkj & text text text text \\
ewe & text text text text \\
hng & text text text text \\
fdf & text text text text \\
dgf & text text text text \\
gfdfd & text text text text \\
dsd & text text text text \\
fdf & text text text text \\
hghg & text text text text \\
fgf & text text text text \\
lkl & text text text text \\
BPSK & text text text text \\
LRE & text text text text \\
\end{longtable}
%\end{table}
\end{document}

How to set the caption of a figure to the same indent as the title

I am trying to make a caption to a figure that looks like this:
Figure 1: Text Text Text Text Text Text Text Text Text Text Text Text
Text Text Text
or alternatively like this:
Figure 1:
Text Text Text Text Text Text Text Text Text Text Text Text Text Text
Text Text Text
but the caption has an indent, that makes it look like this:
\documentclass{scrreprt}
\begin{document}
\begin{figure}
\caption{Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text}
\end{figure}
\end{document}
The caption package offers the plain format for this:
\documentclass{scrreprt}
\usepackage[format=plain]{caption}
\begin{document}
\begin{figure}
\caption{Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text}
\end{figure}
\end{document}
To change this on a figure-to-figure basis:
\documentclass{scrreprt}
\usepackage{caption}
\begin{document}
\begin{figure}
\caption{normal caption with hanging indent Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text}
\end{figure}
\begin{figure}
\captionsetup{format=plain}
\caption{Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text}
\end{figure}
\begin{figure}
\caption{normal caption with hanging indent Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text}
\end{figure}
\end{document}

Sample letter styled Latex Template (with some specification) for word document

I want to prepare a manuscript in "Word on a letter-sized paper with no line numbering, a line spacing of 1.5, Times New Roman 11-point font size, margins top/bottom of 1”, margins left/right of 1.25.” But I am comfortable with Latex. So, Is there any possibility to prepare the manuscript in latex for the above mentioned style(format), then can convert to word file. If means guide me with Latex template for the above style settings.. Thanks in advance.
\documentclass[11pt]{article}
\linespread{1.5}
\usepackage[top=1in,bottom=1in,left=1.25in,right=1.25in]{geometry}
\begin{document}
This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.
\end{document}

How to add space following individual row in table Latex

I'm trying to add .2cm of space following an individual row in a table in LaTeX. Earlier "\[.2cm]" worked, but since updating my system, I'm no longer getting any spacing difference. Can anyone explain this? Some example code is provided below.
\begin{tabular}[t]{>{\labels[]}llll}
col 1 & col2 & col3 & col4 \\
text & text & text & text \\
text & text & text & text \\[.2cm]
text & text & text & text \\
text & text & text & text \\
\end{tabular}

Resources