Tag Info

3

I'm not sure you want alignment to the equals signs. But here it is: \documentclass[10pt]{amsart} \usepackage{systeme,mathtools} \begin{document} \begin{align*} \systeme{ -3x-6y=\mathrlap{-15}, 3x+4y=\mathrlap{6} } \\ \systeme{ -3x-6y=\mathrlap{-15}, -2y=\mathrlap{-9} } \\ \systeme{ x+2y=\mathrlap{5}, y=\mathrlap{9/2} } \\ \systeme*{% no alignment on the ...

5

As far as I know, both MiKTeX and TeX Live for Windows accept paths where \ is replaced by /, so if you define your \WindowsFilename as c:/files/examples/pictures/myfile.png to begin with, you shouldn't have any problem. However, I understand that the casual user might not know this and be used to DOS style paths. If you don't plan to define the paths ...

11

\documentclass{article} \makeatletter \newcommand{\replaceBS}[2]{{\escapechar=/ \xdef#2{\expandafter\zap@space\detokenize\expandafter{#1} \@empty}}} \makeatother \begin{document} \def\WindowsFilename{c:\files\examples\pictures\myfile.png} \replaceBS{\WindowsFilename}{\TeXFilename} Current result: \texttt{\TeXFilename} Expected result: ...

5

An explicit number can be expanded without changing it and the unwanted command sequence can be redefined to vanish itself, when expanded: % Setup \makeatletter \newif\ifintheway \def\@citeb{foobar} \def\bfoobar{\inthewayfalse 17} % Extract the number from \csname b\@citeb\endcsname % and store it in the macro \mynumber \begingroup ...

5

You can not in general do this in TeX (luatex is different). If your first box ends in (say) . then adding a \space after the \unhbox will not add extra space due the the space factor stretching, it will just add a normal space. If the first box ends with a glue you can see how much glue was there with \lastskip but if it is a character node such as . it ...

1

Have you tried the ifmtarg package? It provides the macro \@ifmtarg{<arg>}{<Code for arg empty>} {<Code for arg not empty>} Use texdoc ifmtarg for the documentation.

4

The code inside siunitx (v2) uses a loop over each token in the input before comparing this to the various lists of possible 'number parts'. As that process cannot make assumptions about the nature of the tokens and as it covers a variety of input forms, it's rather complex. I'm currently re-writing it all to be more efficient and clear but the need to work ...

5

You can use a \romannumeral trick: \if\relax\detokenize\expandafter{\romannumeral-\Q#1}\relax The missing space after \Q will trigger expansion of #1 (after macro substitution, of course). Since this expansion ends at the first unexpandable token, this should be what you want. However a leading space will be ignored. \def\notempty{\relax} ...

6

\documentclass{article} \usepackage[T1]{fontenc} \def\foo#1{\par \texttt{<\detokenize{#1}>} \expandafter\if\relax\detokenize\expandafter{\romannumeral0#1}\relax \if X#1X% empty\else not empty\fi \else not empty\fi} \begin{document} \foo{} \foo{ } \foo{\empty} \foo{{}} \foo{\sqrt} \foo{\csname @gobble\endcsname{hello}} \end{document}

5

From the TeXbook, page 213: • \string⟨token⟩. TeX first reads the ⟨token⟩ without expansion. If a control sequence token appears, its \string expansion consists of the control sequence name (including \escapechar as an escape character, if the control sequence isn’t simply an active character). Otherwise the ⟨token⟩ is a character token, and its ...

5

There are a few errors in the definition of \remainder and \othermacro: a \newcount declaration mustn't go inside them, because this would waste a counter at each call. Also a space after #2 is significant and it means that TeX looks for a space after the second argument, raising an error if it doesn't find one and taking as second argument everything that ...

4

\rule has never been robust in LaTeX. You can use \protect\rule or you can use \usepackage{fixltx2e} which updates various things, including making \rule robust. Perhaps your previous document was using that package.

7

From plain.tex, lines 524–525: \def\obeyspaces{\catcode\ \active} {\obeyspaces\global\let =\space} Thus active space has a definition in Plain TeX; why is that? If a space ends up in a token list for \write when \obeyspaces is in force, it will be stored (as active character) to be expanded later, when possibly (or perhaps almost certainly), the ...

8

You have made the chars active but not provided any definitions. As such, you are relying on whatever is 'lying around'. Active space does have a definition, but active . does not so you get an error. You can \show this: \catcode\ =\active \catcode\.=\active \show % \show.

10

this version is not expandable but it doesn't need any terminator, it just gobbles up as far as the end of the number. It is restricted to integers that fit in a tex count register. \newcount\ca \newcount\cb \def\p#1{% \def\digitone{}% \ifx+#1\def\sign{#1}\else \ifx-#1\def\sign{#1}\else \def\sign{}\def\digitone{#1}\fi\fi \afterassignment\n\ca=1\digitone} ...

10

EDITED to seamlessly handle dots and/or commas as the decimal separator. REEDITED to provide error checking. The error handler works by pre-processing the string and removing "numerically valid" tokens from it (any numeral, leading + or -, and a single . or ,). If the processed string is not a null string at the end of this error-checking process, then it ...

2

The original sources for TeX (and friends) can be found on Knuth's CTAN. All the sources have very comprehensive documentation, but trying to compile them is still an epic task. TeX is written in WEB, a programming language invented by Knuth. So first we're going to need WEB. WEB is written in WEB itself, it consists of two programs: weave which produces ...

13

this just uses local settings so can (will) go wrong if the next paragraph starts in a local group as things won't get restored properly. That's fixable but this shows the basic idea... \documentclass{article} \usepackage{marginnote} \let\zzeverypar\everypar \newtoks\everypar \zzeverypar{\the\everypar} \newenvironment{myenv}{% \ifvmode ...

7

It's not really a bug and in many ways it's more consistent than the standard classes which do set it. \hsize is not a document parameter like \textwidth; it just has local values in different contexts to control the line breaking widths for TeX's linebreaker. LaTeX intentionally sets things up such that starting a paragraph that would invoke the linebreaker ...

4

You need to give \halign a bit of encouragement to put at least half the width in each column. (you should stop the doubled hrule as well, not done here) \everycr{\noalign{\hrule}}% \tabskip=0em \setbox0\hbox{\bf Quantity} \halign{% \vrule#& \enskip\hrulefill\strut#\strut& \strut#\strut\hrulefill\enskip& \vrule#% \cr ...

3

On page 245 of the TeXbook, it is explained how the widths of columns are computed when some cells in them are spanned. The explanation ends with this note: These formulas usually work fine, but sometimes they produce undesirable effects. For example, suppose that n = 3, w11 = w22 = w33 = 10, w12 = w23 = −∞, and w13 = 100; in other words, the columns by ...

3

I'm not getting “erratic” behavior. However, there's a better way for drawing the symbol so that it has the same height as a Y; I set the width to .5em in the current font and the proportion between the two parts as 1:3 \documentclass{article} \usepackage{amsmath} \usepackage{pict2e,picture} \newcommand\drawY{% \begingroup \dimen0=.5em ...

Top 50 recent answers are included