New answers tagged

0

First, the body of \foreach is in a group so the effect of local commands is restricted to a single iteration. What it means for your first example is that \toggletrue/\togglefalse only have an effect within the same iteration. To fix this, as suggested in the etoolbox manual, you can prefix them with \global which extends their effect beyond groups: ...


0

Because we do not have a compiling MWE and we do not have your file nomencl.ist I can not test it, but with the following changing in the definition of your output profile for TeXnicCenter it should work. Delete the entry for the postprocessor Add -s nomencl.ist to the command line of MakeIndex My profile definition in TeXnicCenter:


3

Since the left hand column of the description is in bold letters, you have to calculate the the width based on bold letters. Trying \widthof{\textbf{Connectivity}} solves that problem. As for the insufficient indenting when multiple lines are present, they seem to be about one n space and so I gave a dummy character n or y to the argument of the second ...


7

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


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 ...


1

Special thanks to @cmhughes. The solution is to use math mode with the aligned command: \item $\begin{aligned}[t] ... \end{aligned}$


3

A variant of Christian Hupfer's solution, but fully expandable: \documentclass{article} \usepackage{enumitem} \usepackage{xparse} \ExplSyntaxOn \DeclareExpandableDocumentCommand{\basetwoenum}{m} { \basetwoenum_main:n { #1 } } \cs_new:Nn \basetwoenum_main:n { \exp_args:Nc \basetwoenum_eval:n { c@#1 } } \cs_new:Nn \basetwoenum_eval:n { \fp_eval:n ...


3

Here's a LuaLaTeX-based solution, which works with the enumitem package. It defines an enumerated environment called powertwoenum, in which consecutive items are numbered as 1, 2, 4, 8, 32, etc. Items in a powertwoenum list may be cross-referenced via the usual \label-\ref mechanism. % !TEX TS-program = lualatex \documentclass{article} ...


2

An 'awful' mix with enumitem and expl3 features, defining a new counter formater named baseenum -- I've to test with deeper level nesting however. \documentclass{article} \usepackage{enumitem} \usepackage{xparse} \makeatletter \def\basetwoenum#1{\expandafter\@basetwoenum\csname c@#1\endcsname} \ExplSyntaxOn \def\@basetwoenum#1{% \int_set:Nn ...


3

\documentclass{article} \usepackage{tikz} \renewcommand*{\labelenumi}{\pgfmathparse{int(2^(\theenumi-1))} \pgfmathresult} \begin{document} \begin{enumerate} \item One \item Two \item Three \item more \item more \item more \item more \item more \item more \item more ...


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 ...


3

\documentclass{article} \usepackage{listings} \begin{document} \begin{lstlisting}[caption={\textsc{Newton(1,2,5)}}] > 0.0001 > 0.0011 > 0.0111 > 0.1111 > 0.1111 \end{lstlisting} \begin{lstlisting}[caption={\textsc{reciprocal(2,2,5)}}] > 0.0001 > 0.0011 > 0.0111 > 0.1111 > 0.1111 \end{lstlisting} \end{document} An update ...


4

Another option is to add \usepackage[export]{adjustbox}, and then add valign=t to the options of \includegraphics. \documentclass{book} \usepackage[demo]{graphicx} \usepackage[shortlabels]{enumitem} \usepackage[export]{adjustbox} \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, ...


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 ...


0

I realize this answer doesn't satisfy the requirement of not using itemize, but I am adding it for completeness. Since the 5-level depth constraint also applies to itemize environments, here is an example (using the same method proposed in Peter's answer) that increases the depth for the default itemize environment: \usepackage{enumitem} \setlistdepth{20} ...


3

Your minipages should be like \begin{minipage}[b]{\linewidth} Material\par\xdef\tpd{\theprevdepth} \end{minipage} Then the regex match code could be \NewDocumentCommand{\tarassinput}{om} { \tl_set_from_file:Nnn \l_tarass_input_tl { } { #2 } \regex_match:nVTF { \A \c{begin} \cB. minipage \cE. } \l_tarass_input_tl {% true branch: input the minipage ...


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

Put the item in the minipage solves the problem. \documentclass[10pt,a4paper,french]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[french]{babel} \usepackage{tikz,xparse,calc} % Redefinir les etiquettes des listes \usepackage[flushleft,alwaysadjust]{paralist} %[flushleft,alwaysadjust] les options annulent le décalage ...


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 ...


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} ...


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)}% ...


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 ...


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 ...


0

So I go this proposal at another forum and it works great. \documentclass{article} \usepackage{enumitem} \usepackage[svgnames]{xcolor} \newcommand{\checkbox}[1]{\protect\fbox{% \hbox to1em{\footnotesize\color{LightGray}\sffamily\hfil#1\hfil}}} \begin{document} Answer the following by marking the Yes or No box: \begin{enumerate} ...


1

A work around using tabularx package \documentclass{article} \usepackage{tabularx} \newcounter{row} \renewcommand\therow{\alph{row}} \newenvironment{rowenum}[1] {\setcounter{row}{0} \par\noindent\tabularx{\linewidth}[t] {*{#1}{>{\stepcounter{row}\makebox[1.8em][l]{\therow)\hfill}}X}}% } {\endtabularx} \begin{document} ...


0

A basic solution/ workaround: \documentclass[]{article} \usepackage{amsmath} \begin{document} \begin{equation*} \begin{array}{ccc} (a) \lim\limits_{x \rightarrow 0} h(x) & (b) \lim\limits_{x \rightarrow 0} h(x) & (c)\lim\limits_{x \rightarrow 0} h(x) \\ (d)\lim\limits_{x \rightarrow 0} h(x) & (e)\lim\limits_{x \rightarrow 0} h(x) ...


1

Here is a possible solution. I defined a margindescription clone of description, with specific parameters, and a \mitem command which does all you want, I think: \documentclass[11pt, twosided]{article} \usepackage[utf8]{inputenc} \usepackage{enumitem} \usepackage[showframe, twoside, marginpar=3cm, outer = 36mm]{geometry} \usepackage[fulladjust]{marginnote} ...


-1

use the package ragged2e \begin{itemize} \justifying \item... \item... \end{itemize}


3

Use the wide option of enumitem. This way the lavbels will be left-aligned along the left margin of text (which is different of left margin of the list): \documentclass{article} \usepackage{enumitem} \usepackage[margin=1.20in,showframe=true]{geometry} \begin{document} \noindent\textbf{\large Problem 1} \begin{enumerate}[wide = 0pt, ...


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

I am unsure if this is meant, but the box is before the label: \documentclass[11pt]{article} \usepackage{amssymb} \usepackage{enumitem} \newlist{checklist}{enumerate}{2} \setlist[checklist]{label={$\square$\quad\arabic*.}} \newcommand{\YesNo}{Yes $\square$ \quad No $\square$} \begin{document} Put a check in the box if the statement is mostly true ...


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*)}} ...


0

Inline lists are boxes, and so your definition is lost. Either use mode=unboxed or move the \@currentlabel definition so that it is nearer at the label: \documentclass{article} \usepackage[inline]{enumitem} \makeatletter \newcommand{\myitem}[1][]{% \item[#1]\protected@edef\@currentlabel{#1}\ignorespaces% } \makeatother \begin{document} ...



Top 50 recent answers are included