# Tag Info

0

Here's my attempt at an elegant solution to your custom notation. This solution does not require any packages whatsoever (amsmath is only included in the example for the \bar{} command in your example equations). \documentclass{article} \usepackage{amsmath} \newcommand\slantstack[2]{% \raisebox{1.25ex}{$#1$}% \raisebox{-1.25ex}{$#2$}} ...

0


0

These are trivial to set up with stackengine macros (original answer) and even easier still with the tabstackengine package (revised answer). However, I don't feel I have enough info to set up macro shortcuts, since I don't know the full extent of the desired syntax. Since many of your data items were in upright (non-math) font, I made the default settings ...

0

In order: This can be done using the solution in this answer. You would need to make line white. You could use matrices here or set a \newcommand (I'm working on it). This can be done with a foreach, only two lines of code (I don't know those letters with the above line but you get it): \documentclass[margin=10pt]{standalone} \usepackage{tikz} ...

6

In LaTeX the \par command gets redefined several times during a run over a document. For example, inside a tabular it does nothing: an input such as \begin{tabular}{l} \ttfamily\meaning\par \end{tabular} would print macro:->. (after the colon the parameter text is shown; after -> up to the period the replacement text is shown). This way, users ...

1

The easiest way to find what a command does is to create a minimal and run: \makeatletter\ttfamily \meaning\par \\ \meaning\@@par \\ \meaning\p@ As you go along studying the LaTeX2e kernel you can grow this minimal with notes etc. The best study source for coding LaTeX2e style packages and macros is the source itself, as well as packages. All these ...

3

You have too deep expansion in two places: add \expandonce. First: \newenviron{solution}{}{\xappto{\temp@solnlist}{\expandonce{\solutionbody} {\@@par}}} % Second: \listxadd{\qaks@solutionlist}{% %noexpand so that I want it to expand later when typesetting the whole %solution list. But note that \temp@solnlist is expanded right here. ...

2

It is quite straight-forward to split the code for a single .sty over multiple sources: after all, the .dtx format was created to support the work of the LaTeX team where there is a significant need for this type of thing. The \generate macro takes two arguments where the second can have multiple source files \input docstrip \generate{mypackage.sty}{% ...

4

Don't rule out the .dtx method just yet :) With a nice makefile crafted for the occasion, your .sty is only a few keystrokes (and a few seconds) away. I use such a makefile for all of my LaTeX packages; see an example here. I favour the .dtx approach because it gives you colocation of documentation and code. I can't remember where I read/heard it, but ...

0

To answer my own question, using only expandable macros and avoiding the use of \prg_new_conditional:Npnn the following example just works fine and is flexible in the way that all used tests can be adapted to specific problems and do not rely on predefined code like \__int_to_roman:w suggested by egreg. \documentclass{article} \usepackage{expl3} ...

1

The old trick for checking if a token list <tl> consists only of digits is to use \romannumeral-<tl>, which will return nothing in that case. As far as I know there's no public interface for the trick in expl3, only \__int_to_roman:w: \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \prg_new_conditional:Npnn \is_integer:n #1 { p, T, ...

5

In order to work, a predicate such as \foo_p: that you'd like to use must expand to either \prg_return_true: or \prg_return_false:, leaving nothing else in the input stream after macro expansion. In the code for the replacement text you are free to use any of the conditionals marked with a (filled) * in the interface3 manual and, in their true or false ...

2

\usepackage is a wrapper around \input so \input@path applies to that just as well, but it is better not to set \input@path and just set TEXINPUTS appropriately

1

This is based on egreg's answer but is adapted to what I actually wanted to do. I'm afraid that my original question did not sufficiently explain the context and was therefore unclear. As such, I think egreg's answer a perfectly good one. However, in case it is useful to anybody else, I'm also posting the code which I came up with by adapting that answer. ...

1

If I understand well your requirement, standard methods suffice: \documentclass{article} \usepackage{graphicx,lipsum,color} \newcommand\rotbox[3][\dimexpr\height+\depth\relax]{% % #1 is the final height, #2 is the angle, #3 the contents \raisebox{\depth}[#1][0pt]{% \makebox[0pt]{% \rotatebox{#2}{\color{red}#3}% }% }% } \begin{document} ...

2

I don't think this is the full solution, but it's too long for a comment (and I've not figured out what could go wrong in here) Looking into documenation of geometry: reset sets back the layout dimensions and switches to the settings before geometry is loaded. Options given in geometry.cfg are also cleared. Note that this cannot reset pass and mag ...

1

When I first got in contact with LaTeX, I bought Lamport’s LaTeX: A Document Preparation System, but, alas, I found it too superficial and didn’t understand many (even basic) things. So, as I later took notice that all started with Knuth’s TeX, I felt that it might be the logical way to begin with looking at TeX. In consequence I bought Knuth’s The TeXbook, ...

Top 50 recent answers are included