Tag Info

New answers tagged

3

enumitem provides separate label and ref components to its lists. So, you could have a different representation of your reference to an item than the label that is set for that item. Here's an example: \documentclass{article} \usepackage{enumitem}% http://ctan.org/pkg/enumitem \begin{document} \begin{enumerate}[label=\arabic*] \item Foo ...


6

Please always post complete documents not just fragments. You can redefine the prefix used at each level of list to be empty. \documentclass{article} \makeatletter \renewcommand\p@enumi{} \renewcommand\p@enumii{} \renewcommand\p@enumiii{} \renewcommand\p@enumiv{} \makeatother \begin{document} \begin{enumerate} \item Foo \begin{enumerate} \item ...


16

Here is an approach which is somewhat more modular than alexurba's approach, which accomodates indefinite levels of nesting. \makeatletter \def\@enparen#1{\bgroup\let\enparen\@@enparen(#1)\egroup} \def\@@enparen#1{\bgroup\let\enparen\@@@enparen[#1]\egroup} \def\@@@enparen#1{\bgroup\let\enparen\@enparen\{#1\}\egroup} \let\enparen\@enparen ...


19

For comparison I am posting a ConTeXt solution. Such a macro already exists, albeit for quotes. One of the good things about ConTeXt is that a feature is never defined in a one-off basis. For example, instead of defining a macro for quotations that changes the quote symbol depending on the level of nesting, ConTeXt defines a generic delimitedtext mechanism ...


13

Maybe nested definitions: \documentclass{article} \newcommand{\enparent}[1]{{% \def\enparent##1{{\def\enparent####1{\{####1\}}[##1]}}(#1)% }} \begin{document} \noindent \enparent{My outer layer \enparent{my inner lever \enparent{my innermost level}}}\\ \enparent{My outer layer \enparent{my inner lever \enparent{my innermost level}}} \end{document}


21

A package? The following simple macro does it: \documentclass{article} \newcount\smcount \def\smart#1{\ifcase\smcount(\or[\or\{\else TOO DEEP!\fi% \advance\smcount by1 #1\ifcase\smcount\or)\or]\or\}\else TOO DEEP!\fi% \advance\smcount by-1 } \begin{document} \smart{Ala \smart{ma \smart {kota}}} \end{document} (Or, if you wish, not \smart but ...


1

You seem to use the subfigure package, were numbering works a little bit different than in the linked question. \documentclass{article} \usepackage[demo]{graphicx} \usepackage{subfigure} \usepackage[colorlinks]{hyperref} \begin{document} \begin{figure}[ht] \centering \subfigure[ ]{ \includegraphics[width=110px,height=85px] {images/case1} ...



Top 50 recent answers are included