0

I get the following error using TeXstudio

Lonely \item--perhaps a missing list environment. \item{

whenever \item{$\bullet$} text is used

See example below

The document(s) that I am taking this from hundreds of these one line items with no begin statement.

Question If the begin{itemize} is required can it be declared once for the whole document ?


\documentclass{book}

\usepackage{listings}

\usepackage{enumitem}


% This begins the document:
\begin{document}


% This line effectively turns off "Underfull \vbox" and "Underfull \hbox" error messages.
\hbadness=20000
\vbadness=20000

\tolerance = 1000
\pretolerance = 10000



% Define "pseudocode" as a language recognized by the "listings" package:
\lstdefinelanguage{pseudocode}
{morekeywords={DECLARE,BEGIN,END,LOOP,ENDLOOP,SET,IF,THEN,CALL,RETURN,ELSEIF,ELSE,ENDIF,PRINT,OUTPUT,AND,OR},
 morecomment=[l]{//}
}

\lstloadlanguages{pseudocode,[ANSI]C}



% This item list works fine
\begin{itemize}

    \item Version 1.1 -- released April 16, 2017 for public use 

\end{itemize}


%This is the type of list structure that I need using TeXstudio

\item{$\bullet$} Insert bullet text here



%% The end! %%

\end{document}

\end{book}
  • 4
    your question doesn't really have a question?? the command \item is a syntax error if not used in a list. So you are showing a syntax error but not saying what output you want. – David Carlisle Mar 16 '17 at 13:47
  • 2
    why \pretolerance = 10000 ? – David Carlisle Mar 16 '17 at 13:49
  • @DavidCarlisle I'm assuming he wants an itemization, but with $\bullet$ as a fixed symbol.... something like \begin{itemize}[label=$\bullet$] \item Bullet text \item Next Bullet text \end{itemize}. – BMWurm Mar 16 '17 at 13:52
  • @BMWurm I might have guessed that, if that wasn't effectively the default for itemize already! – David Carlisle Mar 16 '17 at 13:53
  • @DavidCarlisle Yeah, that struck me as odd, too -- then I thought this all looks a bit like a pre-existing template being filled out, so maybe he is just stating what he wants without having a deeper understanding of environments and their use.... – BMWurm Mar 16 '17 at 14:01
2

Really changing latex syntax will bite you in the end, but as you may not want to edit a few hundred megabytes of tex written by someone else....

It is in fact simple to make the default \item be ignored rather than make an error.

enter image description here

\documentclass{book}

\usepackage{listings}

\usepackage{enumitem}
\renewcommand\makelabel[1]{}% silence lonely item error

% This begins the document:
\begin{document}


% This line effectively turns off "Underfull \vbox" and "Underfull \hbox" error messages.
% please don't !
%\hbadness=20000
%\vbadness=20000

%\tolerance = 1000
%\pretolerance = 10000



% Define "pseudocode" as a language recognized by the "listings" package:
\lstdefinelanguage{pseudocode}
{morekeywords={DECLARE,BEGIN,END,LOOP,ENDLOOP,SET,IF,THEN,CALL,RETURN,ELSEIF,ELSE,ENDIF,PRINT,OUTPUT,AND,OR},
 morecomment=[l]{//}
}

\lstloadlanguages{pseudocode,[ANSI]C}



% This item list works fine
\begin{itemize}

    \item Version 1.1 -- released April 16, 2017 for public use 

\end{itemize}


%This is the type of list structure that I need using TeXstudio

\item{$\bullet$} Insert bullet text here



%% The end! %%

\end{document}

\end{book}

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.