# Tag Info

20

I took a different approach, not using a list of primes but, rather, using pgfmath to find the primes instead. This was fun. \documentclass{article} \usepackage{pgfmath} \usepackage{enumitem} \newcounter{primecnt} \newcommand{\nextprime}{%\ \loop \stepcounter{primecnt}% \pgfmathsetmacro{\primeTF}{isprime(\theprimecnt)}% ...

19

Here's an enumitem version with a special \AddEnumerateCounter output named \primeenum which can be used label={\primeenum*.} style. Basically, it just applies \ifcase... \or...\fi and lists some prime numbers up to 59, but this can be extended of course. \documentclass{article} \usepackage{enumitem} \makeatletter ...

15

This answer takes Christian's excellent answer (and who deserves the credit for developing the basic structure) and tweaks it to make the input of new primes more streamlined. It uses the \getargsC macro of the readarray package to take a space-separated list and plunk the list into the macros \argi, \argii, \argiii, etc. in romannumeral fashion. This ...

14

Here's a enumitem way and a patch that starts $$after item and ends$$ before \item or at the end of the environment, checking with \ifmmode whether we are in math mode or not. Note: \item[...] is not catched here! -- Since the patch is inside the environment group, all other \item definitions in other environments are not changed. It's possible to jump ...

9

If the engine is Unicode aware and a font is used, which contains the glyph for the private Unicode code point: ^^^^e25f See: The ^^ notation in various engines. This is TeX's method to encode non-ASCII characters with ASCII and can also be used inside command tokens. There are also commands to select a character by slot in the current font: LaTeX ...

8

Just for fun, a version that asks Pari-GP to increase the list of primes, using the function nextprime. The final list is written out in the .aux file, so it can be recycled at initialization time. Note that shell escape is needed if the list has to be made larger. Of course, a working Pari-GP installation is needed. \documentclass{article} ...

7

\begin{enumerate}[label=\arabic*.,ref=\arabic*] ... Or add it to the definition of your custom list or whatever.

7

Here's a LuaLaTeX-based solution, which works with both enumerate and itemize environments. It does not actually modify the enumerate and itemize environments, it doesn't modify the \item macro, and it doesn't require the use of a new macro called, say, \mathitem. How does the solution work, then? It takes a preprocessor approach: It sets up a Lua function ...

7

You can create a command like \mathitem that you would use in place of \item when you want that the current item contains only math: \newcommand\mathitem[1]{\item $#1$} Your lists will look like this: \begin{itemize} \mathitem{1+1=2} \mathitem{e^{i\pi}+1=0} \end{itemize}

4

Your problem comes from the fact that graphics are laid on the base line. A solution uses \raisebox: \documentclass{book} \usepackage[demo]{graphicx} \usepackage[shortlabels]{enumitem} \begin{document} \begin{enumerate}[(a)] \item $3,6,9,12, \dots$ \item $3,5,7,9,11, \dots$ \item $2,3,5,7,11,13, \dots$ \item ...

4


2

The \alph* enumeration labels set a width that's enough for accommodating “m”, the widest letter. You can solve simply the issue by adding align=left: \documentclass{article} \usepackage{enumitem} \usepackage[margin=1.20in,showframe=true]{geometry} \begin{document} \noindent\textbf{\large Problem 1} ...

2

There are a number of things I would do differently, but here is a possible work around for your last environment: \begin{ListExos} \item %\hspace{-20pt}% \begin{minipage}[t]{\linewidth-4cm} %\hspace{20pt}% \raggedright% ne pas commencer par une liste directement \begin{compactenum}%% \item bla ...

2

Instead of an enumerate or itemize environment, consider using a plain array environment. (The horizontal bar in the following screenshot is added only to illustrate the width of the textblock.) \documentclass{article} \begin{document} \hrule\smallskip % just to illustrate width of textblock \noindent \begin{minipage}{0.5\textwidth} \centering ...

2

Too long for a comment: The problem is not related to latex 3 or the input method. It can be shown with a MWE like the following. As one can see the minipage disturbs the spacing. And while one can find with careful analyzing of the code suitable values to correct the spacing, I would avoid such a structure at all costs. It looks unnatural and wrong. ...

1

This is mostly a hack, but it does work well. You could do it with just an environment {questionlist} and then incrementing a counter for the “depth”, that might be easier. \documentclass{scrartcl} \usepackage{etoolbox} \usepackage[shortlabels]{enumitem} \newlist{questionlistA}{enumerate}{1} \setlist[questionlistA]{label=\textup{\arabic*)}} ...

Only top voted, non community-wiki answers of a minimum length are eligible