# Tag Info

3

Really this should be done with a simple shell script or other Unix tool that generates a simple wrapper document, which loads your text. But here's a more TeX-centric solution. It has the benefit that you can use just one LaTeX document, which is not generated or modified programmatically. A little-used feature of (La)TeX is that its argument can be a ...

6

Here is my solution, assuming you have access to a UNIX¹ system with a TeX installation. Inside the working directory of your project Create a main subdirectory holding the files of your document. Edit the preamble of your document, so that it includes a statement input{fontsetup}. For each font package you want to test, create a subdirectory holding a ...

1

I believe a colleague uses subversion for his LaTeX documents - which isn't aimed at LaTeX but programming itself. I think a part of the question is really "what do you want it to do"? If you only want to manage the LaTeX source files, you should be fine with any version control system aimed at source files. If you want to manage the finished documents you ...

6

I have not enough reputation for a comment, even though this is meant as one and not an answer. Probably, this question and the answers might be helpful for you: What fonts are installed on my box? Note, that one answer states, that all fonts on this page should be available on a complete LaTeX-Install. But if you want to use some system fonts, this list ...

9

This is the relevant part from etex.ch: 5247 @ The function |quotient(n,d)| computes the rounded quotient 5248 $q=\lfloor n/d+{1\over2}\rfloor$, when $n$ and $d$ are positive. 5249 5250 @<Declare subprocedures for |scan_expr|@>= 5251 function quotient(@!n,@!d:integer):integer; 5252 var negative:boolean; {should the answer be ...

1

You can use the \xintFor loop from package xinttools. One does not have to worry then about the name used for the iterated variable. \documentclass[pstricks,border=12pt]{standalone} \usepackage{xinttools} \SpecialCoor % inside a macro, the # for an \xintFor must be doubled % \def\Triangle(#1)#2{{\rput(#1)% {\xintFor* ##1 in {\xintSeq ...

2

Avoiding name clashes is achieved by using unique names for each identifier in the loop. However, in this case, passing arguments directly on to the inner \multido means they're not expanded until used, at which time they also need to be set. "Pre-expansion" (declaring macros that contain an expanded version of the arguments) helps avoid this: ...

2

\psline[linecolor=green,linewidth=5\pslinewidth]% (0,0|*-1 {\f})(*{#1 .5 gt {.5}{#1} ifelse } {\f})

4

You can use \ifdim to check for double numbers: \ifdim#1pt>.5pt \psline[linecolor=green,linewidth=5\pslinewidth](0,0|*-1 {\f})(0,0|*.5 {\f}) \else \psline[linecolor=green,linewidth=5\pslinewidth](0,0|*-1 {\f})(0,0|*#1 {\f}) \fi If you want to have it very flexible, you need to accumulate all previous function values. First I tried to save with ...

16

After getting these two answers I'd like to publish my solution also. After seeing jfbu's answer I was a bit intimidated and I went the luatex way. The code is probably not efficient, but it can produce an animated PDF – unfortunately this feature only works in Adobe Reader – or pages with the different evolution phases. Also this code only works with n×n ...

5

keyval goes to some effort not to expand macros in the argument list so \edef\z{\noexpand\includegraphics[\varone]{\vartwo}}\z not \includegraphics[\varone]{\vartwo}

19

Just for fun (but perhaps it can be useful to anyone), there is my Lua solution: Main TeX file \documentclass{article} \usepackage{pgffor} \usepackage{xcolor} \usepackage{courier} % Courier has bold series, while cm doesnt \usepackage[active,tightpage]{preview}\PreviewEnvironment{tabular} % Load lua program, and define macros for accessing its functions ...

26

I ran your code but it appeared to be very slow, I suspect from all the \pgfmathtruncatemacro. But here we can do all calculations with \numexpr easily. This code is based on the TeX primitives \ifnum, \ifcase and \csname..\endcsname. I have used \foreach loops in the first two code samples as I wanted to stay close to your original framework. In the third ...

4


6

Plain TeX, just for a change (no e-TeX). \def\PersonList{} \def\Person#1{% \expandafter\ifx\csname#1@Listed\endcsname\relax \expandafter\let\csname#1@Listed\endcsname\empty \expandafter\def\expandafter\PersonList\expandafter{\PersonList\doPerson{#1}}% \fi #1% } \def\doPerson#1{#1 was listed\par} \Person{Alan} took a shower when ...

2

From my comment based on Marco Daniel's comment, but I am not sure I understood the question correctly. \documentclass[preview,border=12pt,varwidth]{standalone} \usepackage{pgffor} \let\PersonList\empty \def\Person#1{% \ifcsname#1\endcsname \else \expandafter\expandafter\expandafter\def ...

9

You might enjoy a generic interface for defining as many commands of the same kind as you want: \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\declareprimedcommand} { m m m m } {% #1 = command to define % #2 = text for no prime % #3 = text for one prime % #4 = text for two primes \maximav_primedcommand:Nnnn #1 { #2 } ...

8

Here an approach: \documentclass{article} \makeatletter \def\@ifprime#1{\@ifnextchar'{\@firstoftwo{#1}}} \newcommand\E{\@ifprime\E@i\E@} \def\E@i{\@ifprime{B}{A}} \def\E@{E} \makeatother \begin{document} $x \E' \sin x$ $x \E'' \sin x$ $x \E \sin x$ \end{document}

Top 50 recent answers are included