0

How to remove extra spaces between \ref{...} and text? This is the example:

\begin{table}
\begin{center}
\caption{Some text\label{tab1}}
\begin{tabular*}{500pt}{@{\extracolsep\fill}lccD{.}{.}{3}c@{\extracolsep\fill}}
Table information
\end{tabular*}
\end{center}
\end{table}
(see Table \ref{tab3}, O9)

Example text result

EDIT

Thats the preambla of my prject:


\usepackage{unicode-math}
\usepackage{float}
\renewcommand{\thempfootnote}{\arabic{mpfootnote}}
\usepackage{placeins}
\usepackage{longtable}
\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=cyan,
    filecolor=magenta,      
    urlcolor=cyan,
}
\usepackage{ltablex}
\usepackage{graphicx}
\usepackage{amsmath}
\articletype{Article Type}%
\usepackage{newunicodechar}
\usepackage{caption}

4
  • 5
    Please give a complete example, starting with \documentclass and ending with \end{document}. Normally, what you describe does not happen. So some additional code in your preamble or some package introduce this space. – gernot Dec 27 '20 at 16:12
  • 1
    Unrelated, but don't use center inside of table, this gives improper spacing. Instead use \centering. – Skillmon Dec 27 '20 at 16:21
  • the fragment you show should not produce a space after \ref. Do not post disconnected fragments, post a single small complete example that produces the output shown. – David Carlisle Dec 27 '20 at 17:11
  • 2
    \articletype is used in several publishers' classes. Without knowing which one you're using it becomes pure guessing. – egreg Dec 27 '20 at 17:23
2
  • Your preamble code fragment is not complete. In it are missed
    • document class (assumable article)
    • package dcolumn for used D columns in table
    • contain undefined command \articletype{Article Type}
  • Package hyperref had to ve load tha last in preamble (with rare exceptions which are not present in your code snippets)
  • Table is slightly unusual (two @{\extracolsep\fill} instructions)

With completing and correction your preamble and table:

\documentclass{article}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\usepackage{unicode-math}
\usepackage{newunicodechar}
\usepackage{amsmath}

\usepackage{float}
\renewcommand{\thempfootnote}{\arabic{mpfootnote}}
\usepackage{placeins}
\usepackage{dcolumn, longtable, ltablex}
\usepackage{graphicx}
\usepackage{caption}

\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=cyan,
    filecolor=magenta,
    urlcolor=cyan,
}

\begin{document}
    \begin{table}
    \centering
\caption{Some text}
\label{tab1}
\begin{tabular*}{\linewidth}{@{\extracolsep\fill}lccD{.}{.}{3}c@{\extracolsep\fill}}
    \hline
Table information & text    & text  & 123.456   \\
    \hline
\end{tabular*}
    \end{table}
(see Table \ref{tab1}, O9)
\end{document}

I can't reproduce your problem:

enter image description here

(red lines indicate page layout)

Please, next time at question provide MWE (Minimal Working Example), a small but complete document, which reproduce your problem. Merging your code fragments, adding missed packages, document class may remove a cause of your problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.