77k views

### LaTeX conditional expression

I would like to be able to set a flag at the beginning of the main flag (say output) that tells if I want to produce a paper document or an electronic document. Then I should check this flag to ...
4k views

### How to keep up with packages and know which ones are obsolete?

I'm an on and off user of LaTeX so I'm not familiar with every package out there. Having said that, whenever I use LaTeX and need to accomplish a certain goal (i.e. generate a list of appendices), I ...
14k views

### Conditional typesetting / build

Let's say I have .tex file which is a set of problems and solutions, of which I want to make two pdf files, one which includes the solutions and one which doesn't. so I need to build the .tex file ...
2k views

### Sum of (example: 0+1+2+3 = 6 , 0+1+2+3+4+5+6+7 = 28 and so on)

Can anyone help please? I need to know how to make the sum of value S(n) = 0+1+2+3+4...+(n-1)+n (example: 0+1+2+3 = 6 , 0+1+2+3+4+5+6+7 = 28 and so on) on Latex
518 views

### Making a “For Loop”

I am trying to make a "for loop" that will iterate the variable reaches 1. However, none of the "for loops" I have found in the Internet works. These files will be distributed to other people and ...
2k views

### Does LaTeX have a built-in scripting language?

Say I want to draw a simple graph in LaTeX. I'm interested to know if you can write a for loop or something to create things like lines or squares programmatically in LaTeX.
2k views

### How to make a “condition” in a macro?

I would like to make a macro with two parameters which return a text. For instance, I want \M{1}{5} to return [1,5], and \M{2}{2} to return [2] (because the two arguments are the same). So I need to ...
2k views

### Logical String Length

How do I do a conditional 'if then else' statement, based on length of string being greater than (or less than, or equal) a specified value. For example, something Like \def\mystring{XYZ} \def\...
2k views

### Undefined control sequence \equal in section title while using packages hyperref and ifthen

I have a command that uses package ifthen. I use the command in section titles. I have to protect the command because otherwise I obtained the error Undefined control sequence \equal. So far, so ...
2k views

### Expand away empty macros within ifthenelse

I want to test whether a string, when it is finally printed, is empty. The following illustrates my problem, \documentclass{article} \usepackage{ifthen} \newcommand{\isempty}[1]% { \ifthenelse{\...
156 views

### Is “conditionals” name of package?

In some package I have seen construct like this one: \if\blank{\myMacro}% %do something \else %do something else \fi I like it and I want to use it to test if call to a macro has empty result. ...
3k views

### Using predefined constants with TikZ

I can't seem to get definitions of constants working in TikZ. I looked at this related question question and that too did not work for me. This example works, but not if the swap the \coordinate ...
1k views

### Algorithmicx — How to use latex maths delimiters

Today, I decided to migrate from using TeX [$..$] to LaTeX [$$..$$] delimiters for inline maths, and, as usual, fell off the cliff of my somewhat precarious understanding of TeXian gastroenterology, ...