0

How can I define a new environment such that the following tex code would produce the following output?

\begin{customproblemsenv}
   \item content1
   \item content2
\end{customproblemsenv}

Problem 1. content1
Problem 2. content2


  • 2
    A MWE would be very nice. On top, the problem can easily be solved by using more ways (e.g., enumerate- or newenvironment-like solution). – Marian G. Sep 11 '18 at 6:14
  • As far as I'm aware, I can only make enumerate make items with numbers (1,2,3...) and characters ((a),(b),(c)...) . I'm more interested how it'd be done with environments though – Συλχαν Sep 11 '18 at 6:18
3

You can use enumitem to design lists with addition label formatting:

enter image description here

\documentclass{article}

\usepackage{enumitem,lipsum}

\newlist{customproblemsenv}{enumerate}{1}
\setlist[customproblemsenv]{
  label = \textbf{Problem \arabic*.}, 
  wide
}

\begin{document}

\lipsum[1]

\begin{customproblemsenv}
  \item content1
  \item content2
  \item \lipsum[3]
\end{customproblemsenv}

\lipsum[2]

\end{document}
2

Continuing the above answer, the simpler code would be: (Check the documentation)

  \documentclass[letterpaper,12pt]{article}
  \usepackage{enumitem}
  \begin{document}

  \begin{enumerate}[label = Problem \arabic*]
     \item content1
     \item content2
  \end{enumerate}

  \end{document}

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.