{conditionals} is about macros like \if and \ifx that may execute other macros depending on whether certain conditions are true or not. Popular packages are {etoolbox} and {ifthen}.

learn more… | top users | synonyms (1)

6
votes
0answers
136 views

Display beamer headline in frames conditional on section and subsection environments

I'm trying to create a beamer presentation (in LyX) where frames conditionally display a headline containing section and subsection navigation depending on (a) whether a frame is in a section ...
4
votes
0answers
59 views

Checking environment in order to end it

I used to typeset verse with memoir package using some heavy \vspace trickery. The verse environment was too hard to control in terms of vertical space due to the immense amount of obscure glue. For ...
3
votes
0answers
54 views

Tikz: draw a circle only in selected nodes

I created a table of nodes using tikz. And now I want to draw a circle inside every even node. I started from just trying to draw a circle in the second node. But my code is not working: ...
3
votes
0answers
70 views

\if and \fi inside different \def macros

Recently I failed to solve specific task in LaTeX. I wanted to make document with several sections, each divided on several subsections. Each section I had placed to separate files, and used \input ...
3
votes
0answers
172 views

Conditional formatting, rounding and postprocessing of a column in pgfplotstable

I want to round p-values in a table to two decimals (for example 0.05), have values less than 0.05 in bold font and have values less than 0.01 to come out as '<0.01' in bold font. Like this (the ...
3
votes
0answers
59 views

how to add conditions inside itemize list?

List mentioned below is having three items. There are four variables : 1] varone 2] vartwo 3] varthree and 4] sub ; which are coming from external CSV file. Item 2 with "Value B" will be displayed if ...
3
votes
0answers
62 views

Conditional Variation of \headheight

I'm trying to use \ifthenelse from the ifthen package to vary the size of \headheight within a document. I'd like this to be larger for the first page and then smaller for each subsequent page. I ...
2
votes
0answers
72 views

LaTeX3: If next in input stream is command X or environment X, do Y else Z

Because I write my own document class (okay, I try to ...), this question bothers me for weeks as there are many situation, in which I need something like this. Is there a way to test, if the next ...
2
votes
0answers
156 views

Constraint for a decoration: how to know result after decoration

My question is kind of extending of this answer. I want to decorate a path with text only when text fit the path, but also I want to know if decoration was success. I need to know this to be able to ...
2
votes
0answers
138 views

Why can't I get a conditional command to work in a macro invoked within a tikzpicture?

I wanted to create a macro that can be invoked in the middle of a tikz path and behave differently, conditional on one of the arguments. Here is an example document: \documentclass[a4paper]{amsart} ...
1
vote
0answers
61 views

Conditional spacing based on length of chapter title

In LaTeX, (or possibly XeLaTeX), how can one achieve the following: A double spacing a 1- or 2-line chapter title, and single spacing under a 3- or more-line chapter title. A triple space ...
1
vote
0answers
30 views

Creating multiple output files, with content that depends on a variable

I'd like to write a template for a letter, which is meant to be sent to many people. Thus, the content should change slightly depending on who is the addressee. For instance, I imagine that the ...
1
vote
0answers
68 views

macro: repeat a command if new page else do nothing

QUESTION: How does one write a pair of macros that work in 1) beamer class and 2) article class, respectively, such that if it, \macroname{...}, is executed at a point in the code, that point ...
1
vote
0answers
59 views

Special conditionals (TeX)

Is there a way to compare strings rather than single tokens? Is there a way to check if a parameter in a command is a string or a single character? If there is either, how do I?
1
vote
0answers
43 views

Indicating that the adjustwidth environment should be placed around text

I've been trying to work out a solution to this question about changing margins for body text without changing header/footer placement. Using the changepage package, I was able to work out the ...
1
vote
0answers
127 views

Knitr/LaTeX: conditional execution based on external parameters

I'm using knitr to create LaTeX documents with integrated R code. Now I'd like to readout some external parameters (saved in a TXT or CSV file) and create a document based on the conditions specified ...
0
votes
0answers
51 views

How do I add multiple macro definition inside an \ifbool compound statement?

What follows is my example doofus.sty: \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{doofus}% [2014/01/01 v0.01a LaTeX doofus package]%\filedate\space\fileversion\space \typeout{Package doofus, \csname ...
0
votes
0answers
55 views

A&A template returns error \renewcommand{\Newassociation}

I got the template to make scientific papers from the Astronomy&Astrophysics official website. Since I can not compile my own document, due to an error, I tried to compile the demo that is within ...