Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Latex – undefined control sequence \sym

I cannot compile a latex document because I get the error "! Undefined control sequence. xvari & -0.0901\sym", but I do not understand what is gonig on. I suspect it should be a pretty easy fix but I have not managed to fix it / find the answer online so far. Would really appreciate if someone could take a look.

Below is my code, thank you very much!

\documentclass[oneside,a4paper,11pt]{article}
\usepackage{graphicx,url,changepage,amsmath,bm,float,subfig}
\usepackage[margin=2.5cm]{geometry}
\usepackage{parskip}
\usepackage{apacite}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{tabularx}
\usepackage{booktabs}
\setlength{\parskip}{1em}
\renewcommand{\baselinestretch}{1.5}
\newcommand{\Rom}[1]
    {\MakeUppercase{\romannumeral #1}}
\begin{document}


\begin{tabular}{cc} \hline
            &\multicolumn{1}{c}{(1)}\\
            &\multicolumn{1}{c}{Eq. 1}\\
\hline
xvari       &     -0.0824         \\
            &    (0.0601)         \\
            &\multicolumn{1}{c}{(1)}\\
            &\multicolumn{1}{c}{Eq. 2}\\
\hline
xvari       &     -0.0901\sym{**} \\
            &    (0.0370)         \\
\end{tabular}


\end{document}

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can solve the error by defining \sym. Replace the definition below with whatever you want the macro to do.

\documentclass[oneside,a4paper,11pt]{article}
\usepackage{graphicx,url,changepage,amsmath,bm,float,subfig}
\usepackage[margin=2.5cm]{geometry}
\usepackage{parskip}
\usepackage{apacite}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{tabularx}
\usepackage{booktabs}
\setlength{\parskip}{1em}
\renewcommand{\baselinestretch}{1.5}
\newcommand{\Rom}[1]
    {\MakeUppercase{\romannumeral #1}}
    
\newcommand{\sym}[1]{#1}
\begin{document}


\begin{tabular}{cc} \hline
            &\multicolumn{1}{c}{(1)}\\
            &\multicolumn{1}{c}{Eq. 1}\\
\hline
xvari       &     -0.0824         \\
            &    (0.0601)         \\
            &\multicolumn{1}{c}{(1)}\\
            &\multicolumn{1}{c}{Eq. 2}\\
\hline
xvari       &     -0.0901\sym{**} \\
            &    (0.0370)         \\
\end{tabular}


\end{document}

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading