1

Compiling the following document gives a warning "name{theorem 0.1} has been referenced but does not exist, replaced by a fixed one".

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman,english]{babel}
\usepackage{csquotes}

\usepackage{mathbbol}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]

\usepackage[english]{varioref}
\usepackage{url}
\usepackage[hidelinks]{hyperref}

\begin{document}
\begin{theorem}\label{thm}
\begin{itemize}
 \item item
\end{itemize}
\end{theorem}
In Themrem \ref{thm}
\end{document}

However, inserting a \hspace{2em} solved the problem but moves the item in a new line.

\begin{theorem}\label{thm}
\hspace{2em}
\begin{itemize}
 \item item
\end{itemize}
\end{theorem}

How can I get along well with the warning?

0

A work-around with enumitem. It uses the resume* key which allows to interrupt a list, then continue this list withe the same parameters (counters, left margin, &c.) except thos which are modified. I give an example with enumerate:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman,english]{babel}
\usepackage{csquotes}
\usepackage{showframe}
\renewcommand{\ShowFrameLinethickness}{0.2pt}

\usepackage{mathbbol}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{enumitem}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]

\usepackage[english]{varioref}
\usepackage{url}
\usepackage[hidelinks]{hyperref}

\begin{document}

\begin{theorem}\label{thm}
\begin{itemize}
 \item item
\end{itemize}Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text.
\end{theorem}
In Themrem \ref{thm2}\\

However, inserting a \texttt{\textbackslash hspace\{2em\}} solved the problem but moves the item in a new line.

\begin{theorem}\leavevmode\vspace{-\baselineskip}
\label{thm2}%\hspace{2em}
\begin{enumerate}[font=\upshape, leftmargin=9em, nosep, itemsep = 0pt]
 \item item Lalala
\end{enumerate}
\begin{enumerate}[resume*, leftmargin=*]
 \item Another item. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text.
\end{enumerate}
\end{theorem}

\end{document} 

enter image description here

Added: Here is the corresponding code for itemize:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman,english]{babel}
\usepackage{csquotes}
\usepackage{showframe}
\renewcommand{\ShowFrameLinethickness}{0.2pt}

\usepackage{mathbbol}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{enumitem}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]

\usepackage[english]{varioref}
\usepackage{url}
\usepackage[hidelinks]{hyperref}

\begin{document}

\begin{theorem}\label{thm}
\begin{itemize}
 \item item
\end{itemize}Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text.
\end{theorem}
In Themrem \ref{thm2}\\

However, inserting a \texttt{\textbackslash hspace\{2em\}} solved the problem but moves the item in a new line.

\begin{theorem}\leavevmode\vspace{-\baselineskip}
\label{thm2}%\hspace{2em}
\begin{itemize}[leftmargin=9em, nosep, itemsep = 0pt]
 \item an item 
\end{itemize}
\begin{itemize}[resume*, leftmargin=*]
 \item Another item with some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. 
\end{itemize}
\end{theorem}

\end{document} 

enter image description here

  • Sorry for the delay: In your example you are refering to Thm 0.2 not Thm 0.1. So what do I need to do in order to take itemize rather than enumerate? – user114179 Aug 28 '18 at 8:32
  • @user114179: I used enumerate in the second theorem to fully illustrate the resume functionality. I'll post another code with ` itemize` in a minute. – Bernard Aug 28 '18 at 9:48

Your Answer

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