New answers tagged

0

Annotation 1 -- about "variables" that get initialized somewhere within the document-environment's body but are used from the beginning of the document-environment's body: Use the LaTeX2e-kernel's infrastructure for defining the \label..\ref- mechanism and define your own -- references will be resolved after the second LaTeX-run: ...


5

Keep the tests out of your document body: \documentclass[12pt]{book}% \usepackage{amsmath} \ifdefined\HCode \newenvironment{myequation} {\begin{equation}}{\end{equation}\ignorespacesafterend} \else \usepackage{breqn} \newenvironment{myequation} {\begin{dmath*}}{\end{dmath*}\ignorespacesafterend} \fi \begin{document} \begin{myequation} ...


2

Not exactly as you suggested, but \newif is a simple solution. Your A and B environments replaced by exemplary theorem-like ones. Edit: enlarged, according to suggestion from comment. The old picture left. \documentclass{article} \usepackage{amsmath} \begin{document} \def\myVariable{ whatever I want goes here } %tell Latex not to look at it Now I ...


4

To have text along a curve, use the \pstextpath command from pst-text. Here is a shorter code: \documentclass[x11names]{article} \usepackage{pst-plot,pst-slpe, pst-text} \usepackage{auto-pst-pdf} % \newcommand*\suitcase[1][]{\psset{#1}% \psframe[fillstyle=solid, fillcolor=gray!80](-0.8,0)(0.8,0.8) \psarc[linewidth=1.5\pslinewidth](0,0.8){0.25}{0}{180} } ...


7

The \newif command doesn't check whether the conditional is already existing; the assumption is that a programmer using \newif knows what she/he is doing. If you want an interface like \newcommand, load ifthen and use \newboolean; in this case \newboolean{x} would tell you ! LaTeX Error: Command \ifx already defined. Or name \end... ...


0

In case you wish to know about control sequence tokens, not about tokens whose meaning denotes them to be macros: The result of applying \string to a control sequence token is affected by the value of the integer parameter \escapechar. Have TeX apply \string with different values of \escapechar and check if the results differ. Make sure the arguments of ...


4

If you mean that control sequence is something what begins with backslash (irrelevant what meaning it has) than you can try following code. Note that this code checks all alternatives (including spaces, more tokens in the argument or {}). {\escapechar=-1\xdef\nb{\string\\}} % normal backslash \def\IsArgaCs#1{\futurelet\next\isargacsA#1\end} ...


3

Are you really sure you wish to check for control sequence tokens? Primitives like \relax are not macros but they are control sequences. Active characters (character tokens of category code 13) are not control sequence tokens but they can be defined to be macros. A control sequence token or an active character token whose meaning denotes that it is ...


1

Another approach is to create a stack that contains the nodes for a macros. Each call to a macro create en new level in the stack, and the level is deleted at the end of the macro. One can preserve the nodes one chooses by picking them, and only ones that are useful for the future. One declares some nodes (human readable names) at the beginning of the ...


0

Another answer from the perspective of "you don't need variable variables". This uses \long\def and adds a \vtop box to the material under the line. \documentclass{article} \usepackage{setspace} \long\def\sigblockB#1#2#3%`\long\def` allows for paragraphs { \singlespacing \vskip.75in\noindent\hskip#1in% \hbox ...


7

If I understand correctly, you want to use the relative positions of the saved nodes in your new picture. That is, each node should refer to a position in the new picture relative to the new origin. Here's some code that saves all the data for a list of specified nodes which can then be restored at a later time in the document. It uses LaTeX3 stuff ...


1

Testing for the fd-file is useless: It exists anyway, also it contains only font definitions, it is not the font itself. You need to test for a tfm and/or a pfb-font which is specific to the complete version. With pipes enabled you could do something like this (see Search for files first in the texmf trees): \documentclass{article} \pdfmapfile{=mtpro2.map} ...



Top 50 recent answers are included