I am making a list of problems for a contest that should look like this:
Problem 1. Some text
5 points As the text continues it stays aligned
to this
|<--
|<--
Invisible line
Problem 2. More text
1 point also aligned
I want to use an enumerate-like environment, like
\newenvironment{questions}{
\begin{list}{
\bfseries\upshape\arabic{qcounter}.
}{
\renewcommand{\makelabel}[1]{%
\textbf{\refstepcounter{qcounter}\arabic{qcounter}##1.}}%
\usecounter{qcounter}
\setlength{\labelwidth}{2.5em}
\setlength{\labelsep}{0.5em}
\setlength{\leftmargin}{\labelwidth+\labelsep}
\setlength{\itemsep}{2pt}
\setlength{\listparindent}{1em}
\setlength{\parsep}{1pt}
\setlength{\topsep}{6pt}
}
}{
\end{list}
}
I have changed renewing of makelabel
to
\renewcommand{\makelabel}[1]{%
\textbf{\refstepcounter{qcounter}Problem \arabic{qcounter}##1.}\\##1 points}
but it didn't work. I also tried putting it into minipage
, but the text of the item looks strange after it.
I also want to give item
to arguments: number of points and the ending or the word points, like point##2
, because I write in russian and the ending of the word changes strongly, depending on the number.
Is there any option I can do such a list?
My code (LuaLaTeX):
\documentclass[10pt,landscape]{extarticle}
\usepackage[top=1cm, bottom=1cm, left=0.25in, right=0.25in]{geometry}
\pagestyle{empty}
\tolerance=1
\emergencystretch=\maxdimen
\hyphenpenalty=10000
\hbadness=10000
\usepackage{ragged2e}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{comment}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{wrapfig}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\usepackage{skull}
\usepackage{faktor}
\usepackage{xfrac}
\usepackage{enumitem}
\usepackage{lipsum}
%
\usepackage{multicol}
\usepackage{tabularx}
\setlength\tabcolsep{0pt}
\setlength{\columnsep}{1cm}
\setlength{\columnseprule}{0.4pt}
%
\usepackage[russian]{babel}
\usepackage{mathptmx}
\usepackage{polyglossia}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Times New Roman}
\newfontfamily\cyrillicfont{Times New Roman}
\usepackage{mathrsfs}
\setmainlanguage{russian}
\newcounter{qcounter}
\newenvironment{questions}{
\begin{list}{
\bfseries\upshape\arabic{qcounter}.
}{
\renewcommand{\makelabel}[1]{%
\textbf{\refstepcounter{qcounter}\arabic{qcounter}##1.}}%
\usecounter{qcounter}
\setlength{\labelwidth}{2.5em}
\setlength{\labelsep}{0.5em}
\setlength{\leftmargin}{\labelwidth+\labelsep}
\setlength{\itemsep}{2pt}
\setlength{\listparindent}{1em}
\setlength{\parsep}{1pt}
\setlength{\topsep}{6pt}
}
}{
\end{list}
}
\begin{document}
\begin{questions}
\item[1] \lipsum[1]
\item[2] \lipsum[2]
\end{questions}
\end{document}
\theoremindent
parameter (fromntheorem
) and use the optional argument of a theorem environment for the second line. With a list andenumitem
I don't see how to have an optional argument for\item
in a simple way.