Label text after text in table caption

I need to move label text to the end of table caption, but there is newline at the end of text...

\documentclass[pdf, unicode, 12pt, a4paper, oneside, fleqn]{article}

\usepackage[utf8]{inputenc}
\usepackage[T2B]{fontenc}
\usepackage[english,russian]{babel}
\usepackage{caption}
\usepackage{longtable}

\DeclareCaptionFormat{reverse}{#3#2#1}
\DeclareCaptionLabelFormat{fullparens}{\bothIfFirst{#1}{ }#2}
\DeclareCaptionLabelSeparator{fill}{\hfill}
\captionsetup[longtable]{format=reverse,labelformat=fullparens,
labelsep=fill}

\begin{document}

\begin{longtable}{|p{4.5cm}|p{11cm}|}
\caption[Caption text]{Caption text} \label{table_1} \\
\hline
\hline
Title 1 & Title 2 \\
\hline
\hline
\multicolumn{2}{c}{\textit{Продолжение на следующей странице}}
\endfoot
\hline
\endlastfoot
1 & 2 \\
\end{longtable}

\end{document}


And here is result: Hot to remove new line? The result should be like this : "Text. Таблица 2".

• Please extend your code snipped to complete small document, which we can copy and compile on our computers. – Zarko May 15 '17 at 1:34
• Zarko, i extended my code. – toshunster May 15 '17 at 1:52
• There are only two ways to put everything in one line: Put it all inside the \caption, or use \caption{} and put it all outside the caption. – John Kormylo May 15 '17 at 3:03

try the following caption formatting:

\DeclareCaptionFormat{reverse}{#3#2#1}
\DeclareCaptionLabelFormat{fullparens}{(\bothIfFirst{#1}{ }#2)\hfill}
\captionsetup{format=reverse,
labelformat=fullparens,
labelsep=fill, labelfont=bf}


or

Complete MWE producing the second caption is:

\documentclass[12pt]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
%\usepackage[english,russian]{babel}
\usepackage{caption}
\usepackage{longtable}

\DeclareCaptionFormat{reverse}{#3#2#1}
\DeclareCaptionLabelFormat{fullparens}{(\bothIfFirst{#1}{ }#2)\hfill}
\captionsetup{format=reverse,
labelformat=fullparens,
labelsep=fill, labelfont=bf}

\begin{document}

\begin{longtable}{|p{4.5cm}|p{11cm}|}
\caption[Caption text]{Very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, long caption text.} \label{table_1} \\
\hline
\hline
Title 1 & Title 2 \\
\hline
\hline
\multicolumn{2}{c}{\textit{xxxxxxxxx xxxxxxxxxxxxx}}
\endfoot
\hline
\endlastfoot
1 & 2 \\
\end{longtable}
\end{document}


If you like to have table label aligned with right border of table, than change definition for label separator to

\DeclareCaptionLabelSeparator{fill}{\vspace{-\baselineskip}\hfill}


in you will obtain:

• You can also use \captionsetup[longtable]... But I still see two lines. – John Kormylo May 15 '17 at 2:59
• @JohnKormylo, I believe that caption setup is independent from longtable. I suggest dirty hack, since I don't know, how to remove par which is somewhere hidden in caption definition on the end of caption main text. – Zarko May 15 '17 at 3:08
• @Zarko - One can setup figure, table and any other declared \@captype to use different formats. Then again, you don't have to. – John Kormylo May 15 '17 at 12:43