0
\documentclass[aps,prd,reprint,groupeaddress,showpacs,preprintnumbers,nofootinbib,nobibnotes,amsmath,amssymb,floatfix,superscriptaddress]{revtex4-1}

\usepackage{booktabs}
\usepackage{siunitx}

\begin{document}


\begin{table}[ht]
\centering
\caption{Coupling constants at saturation density n_0}
\begin{tabular}[t]{cccccc} 
\toprule
Model &$g_\sigma N$ &$g_\omega N$ &$g_\rho N$ &$g_2 (fm^{-1})$ &$g_3$\\
\midrule
GMT &9.9400 &12.2981 &9.2756 &10.5745 &-24.1907\\
NL3 &10.2170 &12.8780 &8.9480 &10.4310 &-28.8850\\
\bottomrule
\end{tabular}
\end{table}

\end{document}

This code leads to a table as shown below. Why is there no toprule, midrule or bottomrule appearing? I have used \usepackage{booktabs} .

enter image description here

D.K.
  • 1
  • they are not defined by default did you get an error message saying they were undefined. (Never ignore error messages) – David Carlisle Feb 08 '22 at 15:46
  • 1
    please always show a complete small document that shows the problem, we can not test your fragment without guessing where the error is in code you have not shown – David Carlisle Feb 08 '22 at 15:47
  • I cannot replicate the issue you say you are experiencing if I make your code snippet minimally compilable by prefixing it with \documentclass{article} \usepackage{booktabs} \begin{document} and affixing \end{document} to it. (For good measure, I also changed n_0 to $n_0$.) Hence, do please post code that (a) people can compile without having to apply a lot of guesswork and (b) generates the problem behavior you wish to fix. – Mico Feb 08 '22 at 15:58
  • @DavidCarlisle I have edited the question to include the entire code. I hope that makes it easier to identify the mistake. The image is the entire output. – D.K. Feb 08 '22 at 16:01
  • 1
    @Mico I have edited the question to include a entire code including documentclass. I hope that makes it better to identify the error. – D.K. Feb 08 '22 at 16:02
  • your posted document produces ! Missing $ inserted. from l.11 ...pling constants at saturation density n_0} you have no $ around n_0 ` – David Carlisle Feb 08 '22 at 16:15
  • Note that the line with the error is the \caption which was not mentioned or shown in the original version of the question. – David Carlisle Feb 08 '22 at 16:16
  • 1
    if you fix tehcaption you get no rules with the obsolete revtex4-1 class but if you change that to revtex4-2 then they appear – David Carlisle Feb 08 '22 at 16:18
  • @Mico actually the_other_ answer to that post is better now as that bug is fixed in revtex4-2 – David Carlisle Feb 08 '22 at 16:21
  • @DavidCarlisle - I have no idea is the OP is free to use revtex4-2 instead of revtex4-1. FWIW, the OP's code does not compile successfully when I switch to revtex4-2. (Some impenetrable error mesage is issued, \document@inithook \true@sw {}\UseOneTimeHook {begindo....) – Mico Feb 08 '22 at 16:26
  • @DavidCarlisle If I replace revtex4-1 with revtex4-2 will my document change in any way. Will formatting changes or anything else? I am only editing a document here which has been writen initially by someone else. I don't to make any changes that might affect anything significantly. – D.K. Feb 08 '22 at 16:27
  • well if you submit it to a revtex-using journal they will use revtex4-2 anyway. and yes clearly some things change, eg the booktabs rules appear, like anything else after any update most changes are intended and good, but buyer beware. – David Carlisle Feb 08 '22 at 16:31
  • @Mico The code I posted here did compile when I changes revtex4-1 to revtext4-2 but the table moved from left side to right side of the page. – D.K. Feb 08 '22 at 16:32
  • @Mico I think you need 4.2e or some such the first couple of revtex4.2 had issues with the latex hook system that we added, – David Carlisle Feb 08 '22 at 16:33

0 Answers0