# Tag Info

4

Please always post complete documents not fragments that have to be assembled, the you could test your example and avoid \begin{dislpmaymath} The initial error was that you were never passing #1 to your left and right macros you always passed the single token \noexpand then in the case that you did not use \left and used #1 (\big) you passed \fi rather ...

5

You don't want to use \left and \right by default. Really. You've been warned. Now, the best thing you can do is to use mathtools and type \usepackage{mathtools} \DeclarePairedDelimiter{\xnorm}{\lvert}{\rvert} so that you'll be able to use $\xnorm{v}$ % not expanding version $\xnorm[\big]{v} % slightly bigger$\xnorm[\Big]{v} % bigger ...

4

Problems with \foreach aside, I think the syntax \path (b) edge (d) (a) edge (b) edge (c) edge (d); comes much more natural. It is also much easier to change edge options on an edge-to-edge basis (or for more than one edge, too): \path (b) edge (d) {[thick] (a) edge (b) edge[green] (c) edge[red,->] (d)}; Though, a similar thing can still ...

2

The important thing is to be consistent in the way you specify elements in a list to be processed by \foreach. In the approach below, which I find more intuitive, \targets gets expanded to {b} at the first iteration of the outer loop, and to {b,c,d} at the second one. Therefore, specifying \foreach \to in \targets for the inner loop works as expected. ...

4

You need to remove the parentheses from the inner loop. Namely, instead of passing {\targets} to the \foreach loop, you should be passing \targets. \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node (a) at (0, 1) {}; \node (b) at (0, -1) {}; \node (c) at (1, 0) {}; \node (d) at (-1, 0) {}; \foreach ...

2

Here's an implementation with l3regex; the number is stored in \l_linuxss_code_int for later usage. One can extend the testing by acting on the search regular expression; this one catches the letter or the character. \documentclass{article} \usepackage{xparse,l3regex} \ExplSyntaxOn \NewDocumentCommand{\getlettercode}{m} { \linuxss_getlettercode:N #1 ...

4

\Char is not expanded because it is not an expandable token. Unlike \def\Char{a} which expands to a \let defines a token that essentially is a and like a it does not expand. The only way to get hold of this in classic TeX is to take \meaning\Char which will be the letter a split that up on spaces, and if the first two words are the letter take the ...

5

You have to compute the composition, so why trying to do it when building the clist to deliver? I use a sequence, because it's more efficient. \documentclass{article} \usepackage{expl3,xparse,permute} \ExplSyntaxOn \NewDocumentCommand \PMTCosetR { m m } { \seq_clear:N \l_tmpa_seq \clist_map_inline:nn { #2 } { \seq_put_right:Nn \l_tmpa_seq { ...

7

The answer is pretty simple: you can't. The instruction \edef works purely by expansion; no assignment can be performed during an \edef: when TeX finds an unexpandable token in \edef it passes over it and proceeds with the next token. So you can't say \newcount\baz \edef\foo{\advance\baz 1 \number\baz} and hope that \foo expands to 1. It will expand to ...

Top 50 recent answers are included