{nesting} is about nesting document elements. Use this tag in addition to other tags specifying what should be nested.

learn more… | top users | synonyms

43
votes
1answer
2k views

What is the meaning of double pound symbol (##1) in an argument?

I've seen sometimes that people use a double pound sign (##) when defining/using arguments. What is the difference between the normal argument, #1, and the double sign one, ##1? Are there any ...
27
votes
4answers
1k views

Why do arguments to nested \tilde or \breve commands reappear when amsmath is used?

On LaTeX-Community.org I've noticed a strange problem with nested \tilde and \breve commands, when amsmath is used. In this code the X appears also in the output of the second and the third formula: ...
24
votes
4answers
619 views

Smart parentheses?

Is there a way of smartly nesting parentheses and square brackets (in text mode), so that LaTeX detects nesting relations and typesets them accordingly? I'm thinking in something like csquotes does ...
20
votes
2answers
1k views

Footnote to a footnote

How can I make a footnote to a footnote? E.g., Playfair's axiom\footnote{so called in honor of mathematician John Playfair, etc, etc., but was actually discovered by Proclus\footnote{Greek ...
18
votes
1answer
407 views

Three quotation levels for csquotes

The recommended way of solving nested quotations in Norwegian is to use «» for the outer level and then alternating between ‘’ and “”. (Source) Is it a large undertaking to do this with csquotes?
17
votes
2answers
18k views

How to change the nested itemize bullet characters?

When creating a nested itemize environment in LaTeX as follows: \begin{itemize} \item one \dots{} \begin{itemize} \item Language Models \item Vector Space Models ...
17
votes
3answers
739 views

Is there any difference between nesting \label in \caption and putting \label outside \caption?

Is there any difference in behavior between the following coding styles? Coding style A: \caption does not enclose \label. \begin{figure} \includegraphics{cat.eps} \caption{This is a cat.} ...
16
votes
3answers
1k views

How do you end with a single quote followed by a double quote?

I have a paragraph as follows: ``This is a quote. `Here is a quote within a quote.''' But the formatting works out to be a double quote (") followed by a single quote (') instead of the other way ...
16
votes
2answers
841 views

How to align nested cases?

Please consider the code bellow: \begin{align*} function = \begin{cases} case1 &\mbox{if } n = 0 \\ \begin{cases} case2 &\mbox{if } n = 1 \\ ...
16
votes
2answers
1k views

Proper nesting of tikzpicture environments: Reset all PGF values to their defaults

Sometimes, nesting tikzpicture environments seems inevitable, e.g., if you want a node to contain a TikZ picture on its own. (Is it?) However, nesting tikzpicture environments is problematic, also ...
16
votes
2answers
3k views

tikz: a big box with fixed width containing smaller boxes

I want to render with tikz something like : The surrounding big box should behave somehow like a minipage : the width is fixed, and the height should grow if we add sufficiently small boxes inside. ...
15
votes
3answers
616 views

Redefine command when inside a specific other command possible?

How, in general, can I (re)define commands based on in which other command they are nested? A more specific example: I have a custom latex command (say, \code{}) that makes text appear bold. ...
15
votes
1answer
9k views

How can the margins around a table set to 0pt?

I need to put a table inside another table, and would like to set the outside margins of the inner table to 0pt. How can I do this (in particular for tabularx, but hopefully this would be the same for ...
15
votes
1answer
3k views

Nested enumeration numbering

I write homework assignments in LaTex and the assignments are always divided into subparts (i.e. Problem 1 is divided into 1.1, 1.2, 1.3, ...). Currently what I do is I have nested enumerations, but ...
15
votes
1answer
538 views

Footception: Footnote within a footnote within a footnote

Inspired by the question Footnote to a footnote (where it was asked if one could have a footnote reference in a footnote), I'm asking something a bit more complex. Before I ask though, let me prefence ...
12
votes
1answer
380 views

Bug? LaTeX misparses nested optional arguments

LaTeX seems to be having problems handling nested optional arguments. I've included a minimal code example that generates the error: \documentclass[12pt,oneside]{book} \begin{document} ...
12
votes
1answer
923 views

Infinite-depth list

I want to create a command set that allows me to do something like \nestedlist{ \listitem An item \sublist{ \listitem A sub item \listitem Another sub item } } and get An item 1.1 A ...
12
votes
1answer
1k views

Nesting command definitions more than two levels

How do you access macro arguments if the macros are nested by more than two levels? To explain it in more detail: Creating a new command in another command (nesting command definitions), it is ...
11
votes
2answers
826 views

Nested standalone files with standalone package

Is it possible to nest files with the standalone package? I have something like the following: In A.tex: \documentclass{article} \usepackage{standalone} \begin{document} \input{B} \end{document}​ ...
11
votes
1answer
242 views

TeX capacity exceeded, sorry [semantic nest size=500]

Reading through tex.web, I note that there is a difference between grouping levels and semantic nesting (i.e., the nesting of math, horizontal, and vertical modes). I can think of commands which ...
11
votes
1answer
293 views

New list environment: automatic enumeration with “a posteriori” format

This is a follow-up question to Nested enumerate labels with parent label appended plus a single set of enclosing parentheses First and foremost, sorry for my English, I'm learning it currently. ...
10
votes
2answers
413 views

Nested enumerate labels with parent label appended plus a single set of enclosing parentheses

I want to have a list like (1) foo (1.1) foo (1.2) foo (2) foo I am using the package enumitem and \begin{enumerate}[label=(\arabic*)] \item foo \end{enumerate} I know that i can append ...
10
votes
3answers
398 views

Adjust environments's behaviour when nested

I would like to define an environment which behaves differently when it is nested. This environment should ignore spaces at the begin and end of the environment. I have this working as I desire when ...
10
votes
2answers
2k views

How to nest a graph within a node in TikZ and draw edges between the graphs?

I'm trying to draw a graph and have a separate graph within one of the outer nodes. I seen this question, but I don't understand how the matrix nodes will help me. I would also like to draw edges ...
10
votes
2answers
1k views

Tikz fit-library vs fill (overlaying nested node colors)

I am trying to figure out the best way of nesting tikz nodes having a different background color. I would like the "inner" nodes to "win" concerning the background color. Currently the "outer" node ...
10
votes
1answer
1k views

biblatex: Enhancing \autocite in case of would-be nested footnotes

This question led to a new feature in a package: biblatex biblatex provides high-level citation commands like \autocite that allow "global switching from inline citations to citations given in ...
9
votes
2answers
357 views

A better way to do nested lists

This is how you type set a nested list in LaTeX: \begin{itemize} \item I have a house \begin{itemize} \item It has 4 walls \item a roof, \item two windows, ...
9
votes
3answers
311 views

How to check proper nesting of heading levels

How can we check that heading levels in a LaTeX file are coming in sequence, i.e., \section, \subsection, \subsubsection, \paragraph and \subparagraph. How to catch if \section is followed by ...
9
votes
2answers
827 views

Using an environ environment with \newenvironment

I want to use an environment defined with NewEnviron from environ in another environment definition: \documentclass{article} \usepackage{environ} \NewEnviron{inner}[1]{% \textbf{#1:} \BODY } ...
9
votes
1answer
144 views

Can I use \input inside an \include?

I know it is not possible to nest one \include inside another, but what about \input? Is it possible to have something like: \documentclass{article} \begin{document} \include{file1} ...
9
votes
1answer
1k views

Nesting “tikzpicture” within “tikzpicture” elements - Good or bad practice?

I often nest a tikzpicture within a tikzpicture element, such as a node, to treat subparts as unity and then place it as such relative to other parts of the picture. However, I'm wondering whether it ...
9
votes
1answer
167 views

Is there a package to differently color nested expressions in the output?

Say I have an expressions like $(\sin(x-3(z^{(x-2)^2}))+1)^2$ with many nested expressions. To better visualize this in the output (and to help finding missing delimiters when proof-reading) I'd like ...
8
votes
3answers
195 views

Nested use of \ifcsname needs protection

I have a macro \command to ensure that the names of macros in my documentation are consistently formatted. Been work great, until I had an urge to procrastinate and had this brilliant idea that I can ...
8
votes
3answers
2k views

Take 2: How do automatic overlay specifications work in Beamer (in a nested situation)

I had previous asked a question about this, but I feel that it wasn't focused enough and the answers got a little confused...so instead of editing that question, I've opted to start a new one....I ...
8
votes
2answers
1k views

Expandable Nested Boxes with TikZ

Could someone please post a minimal tikz example to draw this: I am currently doing this with nested tables, but would like to see how it can be done with tikz. The nodes would ideally have a ...
8
votes
1answer
3k views

Handling quotes inside quotes in a bibliographic field

I have an entry in my bib file of the form @conference{abc, author = "Some name", title = ""This is inside quote" and outside quote content", . . . } when I check this entry through jabref, I get ...
8
votes
1answer
136 views

How to get more than 3 levels of nesting in mdframed environments?

Before I get to many of "don't do this as it does not look good", I have two modes of my documents: Final mode: where there is ONLY one level of nested mdframed Review mode: where there are numerous ...
8
votes
1answer
150 views

nested multicols with itemised list

Is there any way to reduce the column separation in \begin{itemize}...\end{itemize} in the following MWE to be the same as \setlength{\columnsep}{1cm}. Also how can I remove the column separation rule ...
8
votes
1answer
577 views

TikZ nested rectangle split with rounded corners

Using TikZ, I want to create a nested rectangle split, with rounded corners, that looks like this: The question that most closely resembles this problem is Nested rectangles , however the proposed ...
7
votes
3answers
2k views

Passing arguments to nested newcommands

I thought that doubling hashes was sufficient to pass arguments to nested \newcommand. \newcommand{\notice}[1]{ \vspace{10px} \textbf{#1:} \begin{quotation} ##1 \end{quotation}} ...
7
votes
2answers
171 views

why aren't the \left and \right before my parentheses changing their size?

I am working on a document, and in only one case have the \left and \right before my parentheses seemed to do anything. For example, I have this equation: \begin{equation} \mathbb{E}(RS_{nd}) = ...
7
votes
3answers
493 views

Nested \loop macro

Please are there 'nestable' variants of Knuth's favourite looping macro \loop without the brace-scope introduced in the answer at nested loops. I am developing a package called loops, where I am ...
7
votes
1answer
777 views

How to adjust brace size for nested braces?

How can I adjust the size of the outer braces to make the following equation neater? \documentclass[a4paper]{scrreprt} \usepackage{amsmath} \begin{document} \[ M = \left\{ x \in X : ...
7
votes
3answers
1k views

Tikz - How to nest nodes in a matrix so they can be connected?

I want to make a matrix which has multiple nodes in a single matrix cell. These nodes should be centered to each other. I managed to make this work by using a nested tikz environment like so: ...
7
votes
2answers
1k views

Nested Environ's give “! Argument of … has an extra }” error

I tried using two Environ's in a nested fashion, but I get the ! Argument of \marray has an extra } error. Any idea why this happens? \documentclass{minimal} \usepackage{amsmath,environ} ...
7
votes
1answer
130 views

A follow-up question to: A five level deep list

The solution to A five level deep list implemented an enumerated list that extended to 9 levels of nesting. However, references to nested labels do not list the extended nesting position. I have ...
7
votes
2answers
353 views

Biblatex: nested citations with the \textcites command

I'd like to type a citation within the text and another citation inside the parenthesis for the year, something like this: The work of Author 1 (year; cited by Author 2, year) For this, I've ...
7
votes
1answer
292 views

Defining inside an \edef

The following throws an "Undefined control sequence" error: \edef\testa{\edef\testb{foobar}\testb} when it gets to expanding \testb. This problem is also mentioned in "TEX by Topic" 12.6.2. But no ...
7
votes
1answer
126 views

nested lists - typeset only top n levels

I am writing an outline and have a lot of nested enumitem lists. Is there a way to automatically suppress output for higher list levels? e.g. In the following: \begin{enumerate}[label=\Roman*.] ...
7
votes
1answer
161 views

How to allow correct environment nesting when the environment definition involves labels?

The code below shows an improved version of the code provided in this answer to Mark (highlight) a paragraph (\item{...}) with a squiggly line for later attention. The environment tikzborder uses a ...