Tag Info

Hot answers tagged

12

I am not sure whether this is, what you want to achieve, but you can explicitly set the label of an item. \documentclass[a4paper,10pt]{article} \usepackage[]{enumitem} \begin{document} Foobar \begin{enumerate}[label={(\arabic*)}] \item baz \item[\refstepcounter{enumi}(*\number\value{enumi})] xyzzy \item quux \end{enumerate} ...


12

well I didn't say any primitives, but those in particular (\leftskip and \rightskip) are bad ones to touch.. LaTeX list environments (which is almost all latex display environments, so not just enumerate but center, verbatim, quote etc) all need to know how much space is available on the line after current indentation levels are taken into account. LaTeX ...


7

As was mentioned in the comments, you can also use the tcolorbox package for creating the box. In my example code, I took over the enumitem package suggestion of A.Ellett. The code uses your example three times: without box, with box, and finally with a box broken from one page to the following. Color, line width, arcs etc. of the box can be adapted. ...


7

Put the asterisk in the specification of the label: \documentclass[a4paper,10pt]{article} \usepackage{enumitem} \newcommand{\staritem}{\global\asterisktrue\item} \newcommand{\perhapsasterisk}{% \ifasterisk*\global\asteriskfalse\fi } \newif\ifasterisk \begin{document} Foobar \begin{enumerate}[label={(\protect\perhapsasterisk\arabic*)}] \item baz ...


7

Explicitly embed the enumerate environment inside a minipage environment. \documentclass[11pt,a4paper]{article} \usepackage{longtable} \begin{document} \begin{longtable}{c|p{10cm}}\hline \textbf{test} & \textbf{test} \\\hline\hline test & \begin{minipage}[t]{10cm} \begin{enumerate} \item test \item test ...


5

A solution with small bullets, and your code simplified, using the nccmath , relsize and braket packages. I patched the definition of the \Set command thanks to David Carlisle to improve the spacing of the braces. Note that "discr" is actually a math operator, and I declare it as such, in order to have better horizontal spacings. \documentclass[11pt, ...


5

\documentclass{article} \newcommand\putItem[1]{\refstepcounter{enumi}\makebox[.3\textwidth][l]{\theenumi. #1}\hfill\ignorespaces} \begin{document} \begin{flushleft} \putItem{xyzxyz} \putItem{sadsdasd} \putItem{dfasdfas} \putItem{23ea3ad} \putItem{898sd} \putItem{xyzxyz} \putItem{sadsdasd} \putItem{dfasdfas} \putItem{23ea3ad} \putItem{898sd} ...


5

EDIT Sorry for misunderstanding... To obtain what you want, you just have the use the option: leftmargin=* The following MWE (I've replaced your custom commands with known ones): \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{enumitem} \begin{document} \noindent x\hrulefill x \begin{enumerate}[leftmargin=*,label=Caso \arabic*)] ...


5

For this type of material you can just save your text etc. in a macro \documentclass{article} \begin{document} \newcommand{\mytext}{This is a sentence \begin{itemize} \item I am a list \end{itemize}} \mytext Something else. \mytext \end{document}


4

Adding \leavevmode also has the desired effect and looks reasonably clean. \documentclass{article} \begin{document} \begin{description} \item[Animals:]\leavevmode \begin{itemize} \item Dog \item Cat \item Fish \end{itemize} \item[Colors:]\leavevmode \begin{itemize} \item Red \item Green \item Blue \end{itemize} \end{description} ...


4

I wouldn't do this, since there is no consistency with other chapter titles, but if you really want to do this, here is what you can do. You have two commands to control the spacing before and after the chapter titles, \chapterheadstartvskip and \chapterheadendvskip, respectively. You can modify them locally to change only the appearance of the List of ...


3

\documentclass[12pt]{article} \usepackage{adjustbox} \begin{document} \begin{enumerate} \item \begin{enumerate} \item \adjustbox{valign=t}{\rule{1cm}{2cm}} \end{enumerate} \end{enumerate} \end{document}


3

\documentclass{article} \newcommand\z{,\linebreak[0]} \begin{document} \begin{raggedright} $\{7, 2, 6, 5\}\z \{7, 2, 6, 6\}\z \{7, 3, 1, 1\}\z \{7, 3, 1, 3\}\z \{7, 3, 1, 6\}\z \{7, 3, 2, 2\}\z \{7, 3, 2, 3\}\z \{7, 3, 2, 4\}\z \{7, 3, 3, 1\}\z \{7, 3, 3, 2\}\z \{7, 3, 3, 3\}\z \{7, 3, 3, 4\}\z \{7, 3, 3, 5\}\z \{7, 3, 3, 6\}\z \{7, 3, 4, 2\}\z \{7, 3, 4, ...


3

You can simplify the input syntax and also get centering (but the list can't be split across pages): \documentclass{article} \usepackage{xparse,lipsum,varwidth} \ExplSyntaxOn \NewDocumentCommand{\printbiglist}{m} { \[ \begin{varwidth}{.8\textwidth}\raggedright $\makebox[0pt][r]{$\lbrace$} % the opening brace hanging left \dan_print_biglist:n { #1 ...


3

You're better adding the annotation to the chapter making command; with memoir there's the hook \mempostaddchaptertotochook for this purpose. The following code is adapted to an answer of mine in the GuIT forum; as you see, the annotation is printed only if in a chapter some tables (or figures) are found. \documentclass[twoside,a4paper]{memoir} ...


3

enumitem is your friend: \documentclass{article} \usepackage[pass,showframe]{geometry} % show a frame around the page \usepackage{enumitem} \newenvironment{spreadenum}[1][] {\begin{enumerate}[itemsep=.6ex plus 1fill,#1]} {\end{enumerate}\par\vfill} \begin{document} \begin{spreadenum} \item a \item b \item c \item d \end{spreadenum} \end{document}


3

The insertion of an empty item seems to give a better vertical spacing. One can define a myitemize environment that includes this empty item; that will prevent typing it for each description item: \documentclass{article} \usepackage{enumitem} \newenvironment{myitemize}% {\begin{itemize}\item[]} {\end{itemize}} \begin{document} \begin{description}[style ...


3

This is one possible solution, where the second \tikzmark{br} is moved inside the enumerate environment to prevent extra white space. Also the relative distance is adjusted to 5em to cover the whole text. Code \documentclass{article} \usepackage{tikz} \usepackage{amsmath} \usetikzlibrary{calc,shapes} \newcommand{\tikzmark}[1]{\tikz[overlay,remember ...


3

I would make a number of changes: I would use the enumitem package to facilitate formatting the labels for your enumerate environments. I would use a \label/\ref pair to refer to a previous label Here's a solution for you box using tikz and a \vadjust \documentclass{article} \usepackage{tikz} \usepackage{enumitem}%%[inline] \usepackage{amsmath} ...


3

There are four predefined styles for the itemize items or enumerate items templates controlling the aspect for the labels in an itemize, respectively enumerate, environment: these are default, square, circle and ball; the following simple example shows these four styles for an itemize: \documentclass{beamer} \begin{document} \begin{frame} ...


2

You can adjust the way the item label is set. The macro responsible for this is \listitemsymbol, and it needs to be done before setting the moderncv theme: \documentclass{moderncv} \renewcommand*{\listitemsymbol}{\hspace{2em}\labelitemi~} \moderncvtheme[green]{classic} \firstname{Joe} \familyname{Blow} \begin{document} \maketitle \section{Profile} ...


2

Here I make the . active inside \tab and restore it when I am done. Inside \tab, the . can become \item if the next token is a not a nested \tab and it becomes \relax if the next token is a nested \tab. I keep track of the nesting level with a simple counter, and only restore the catcode 12 definition of . when the nesting level reaches back to zero. I ...


2

With just xparse it's too complicated. Using \@ifnextchar is possible, but a jump to expl3 is perhaps better: \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\tab}{m} { % start an itemize (that also provides grouping for nested calls) \begin{itemize} \azpillaga_tab:n { #1 } % finish off \end{itemize} } \seq_new:N ...


2

Based on my answer at How can I add lists and similar in a savebox?, I placed the question in a temporary vbox, and then embraced it in an \fbox, making the appropriate allowances for indentation. I here define the process as a macro, \boxitem{}: \def\boxitem#1{\setbox0=\vbox{#1}{\centering\makebox[0pt]{% ...


2

While Andrew's solution works great in many, many situations, it will fail in some, for example, if you try to place \mytext in an \fbox. To get around that problem, you really have to define \mytext to place the contents in a box. \documentclass{article} \parindent 0in \begin{document} \newcommand{\mytext}{\setbox0=\vbox{% This is a sentence ...


2

Use correctly the parameters of enumitem. \documentclass{article} \usepackage[pass,showframe]{geometry} % just to show the page frame \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[italian]{babel} \usepackage{enumitem} \usepackage{calc} \newcommand{\pint}[1]{\mathring{#1}} \newcommand{\eps}{\varepsilon} \begin{document} ...


2

I'd avoid lengthy set descriptions; just provide two definitions for p different from 2 and for 2: \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amssymb} \DeclareMathOperator{\disc}{disc} \begin{document} We say that $\disc(F)$ is \emph{quozzy} if $\disc{F}\equiv1\pmod{4}$ or $\disc(F)\equiv8\pmod{16}$ ...


2

Here is a slight improvement over David Carlisle's solution in that a simple comma separated list can be spcified: Notes: Use a custom counter in case which allows for use within other enumerated environments. Counter is rest for each invocation of \ListTable. Code: \documentclass{article} \usepackage{pgffor} \usepackage{xstring} ...


2

The entering and exiting of environment abc is accompanied by the execution of macros \abc and \endabc. Often, one can invoke those macros as part of your own environment definition as I did here. There are some cases where it will not work (verbatim and align environments are two examples). But, when unsure, I inevitably try it and find out if it works. ...


2

The spacing of top level lists at normalsize in the default 10pt option in the standard classes is set by \makeatletter \def\@listi{\leftmargin\leftmargini \parsep 4\p@ \@plus2\p@ \@minus\p@ \topsep 8\p@ \@plus2\p@ \@minus4\p@ \itemsep4\p@ \@plus2\p@ \@minus\p@} \let\@listI\@listi \makeatother (in size10.clo) so the ...



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