I have two issues with this code: I want to cross-reference an equation as Eq(1) with color I want to cross-reference the section as well
any suggestions please, here the code and my outcome :
\documentclass[a4paper, 11pt]{article}
\usepackage{natbib}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage{mathpazo}
\usepackage{eucal}
\usepackage[mathcal]{eucal}
\usepackage[mathscr]{eucal}
\usepackage{mathrsfs}
\usepackage{lmodern}
\usepackage[a4paper]{geometry}
\usepackage[showframe]{geometry}
\usepackage{textcomp}
\usepackage{mathtools, cuted}
\usepackage{cuted}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{booktabs,dcolumn,caption}
\usepackage[font=small,labelfont={bf,sf},tableposition=top]{caption}
\usepackage{booktabs,tabularx}
\usepackage[bottom]{footmisc}
\usepackage{empheq}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{multirow}
\usepackage{mathtools}
\usepackage{array}
\usepackage{booktabs}
\usepackage[justification=centering]{caption}
\usepackage{enumerate}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage[figurename=Fig.]{caption}
\usepackage{tabulary}
\usepackage{tabularx}
\usepackage{varioref}
\usepackage{multirow}
\usepackage[skip=0.5\baselineskip,font=bf]{caption}
\usepackage[rm={tabular, lining},sf={tabular, lining},tt{monowidth,tabular,lining {cfr-lm}
\usepackage[onehalfspacing]{setspace}
\usepackage{rotating}
\usepackage{siunitx}
\usepackage{booktabs, makecell, multirow, threeparttable}
\usepackage{caption}
\usepackage{xparse}
\usepackage{hyperref}
\usepackage[nameinlink,noabbrev]{cleveref}
\usepackage{xstring}
\hypersetup{colorlinks = true, allcolors = blue}
\makeatletter
\AtBeginDocument
{
\let\oldref\ref
\renewcommand{\ref}[1]{\IfBeginWith{#1}{fig:}%
{{\color{blue}Figure~\oldref{#1}}}%
{\IfBeginWith{#1}{tab:}{{\color{blue}Table~\oldref{#1}}}{Unsupported ref start}}}%
}
\makeatother
\begin{document}
\begin{empheq}[left=\empheqlbrace]{align}
Y_{t} &= c+\sum_{j=1}^{P} \beta_{j}Y_{t-j}+ \sum_{k=1}^{K}b_{k} \widetilde{h}_{t-k}+
\sigma^{*} exp\left({\frac{\widetilde{h_t}}{2}}\right) \zeta_t \label{eq:1}\\
\widetilde{h}_{t} &= \alpha_{t}+\theta \widetilde{h}_{t-1}+\sum_{j=1}^{K} \delta_{j}Y_{t-j}+ \eta_t
\end{empheq}
The above equation \Cref{eq:1},
In Section ~\ref{sec:data}, we describe the sample data.
\subsection{Data and Variables}
\label{sec:data}
\begin{table}[htp]
\caption{Descriptive statistics}
\label{tab1}
\footnotesize
\setlength{\tabcolsep}{0pt}
\begin{tabular*}{\textwidth}{
@{\extracolsep{\fill}}
l
c
S[table-format=3.4]
S[table-format=3.3]
S[table-format=4.4]
S[table-format=-1.4]
S[table-format=1.4]
S[table-format=3.4]
S[table-format=3.0]
@{}
}
\toprule
{Statistic} &
{Mean} &
{St. Dev.} &
{Min} &
{Max} &
{Skewness} &
{Kurtosis} &
{Jarque-Bera} &
{N}\\
\midrule
GNP growth (y) & 0.5531 & 0.7904 & -2.65 & 2.09 & -1.3202 & 6.1412 & 79.991
& 114 \\
GNP deflator (P) & 0.6671 & 0.7647 & -0.16 & 2.72 & 2.0248 & 7.2870 & 165.202 & 114 \\
Unemployment (U) & 6.0970 & 1.4535 & 3.90 & 10.53 & 0.9229 & 3.7673 & 18.982 & 114 \\
BAA corporate bonds (S) & 2.3745 & 0.7904 & 1.08 & 5.82 & 1.5677 & 7.2624 & 133.001 & 114 \\
House Price index (HPI) & 129.22 & 40.5193 & 75.30 & 202.53 & 0.0184 & 1.5491 & 10.004 & 114 \\
S\&P 500 index & 1173.83 & 561.4592 & 317.05 & 2732.58 & 0.4946 & 2.8919 & 4.704 & 114 \\
\bottomrule
\end{tabular*}
\end{table}
Descriptive statistics of variables are given in \Cref{tab1}
\end{document}
the outcome:
mathptmx
package and later on thelmodern
package, as the latter completely overrides the former. And, a few lines later, you load thecfr-lm
package, which supersedes almost all preceding font-related packages. What exactly do you think you're going to achieve by loading themathtools
package three times and thecaption
package a whopping six times? Finally, please confirm that\usepackage[latin1]{}
is meant to be a joke. – Mico Apr 4 '20 at 19:54