Difference between revisions of "Command/doif..."
< Command
Jump to navigation
Jump to search
m (moved /References/en/doif... to Reference/en/doif...: wrong page) |
(Add doifdocumentargument) |
||
(16 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{Reference|name=doif...|attributes=}} | {{Reference|name=doif...|attributes=}} | ||
− | + | * <tt>\doifnextcharelse</tt> | |
+ | * <tt>\doifundefined</tt>, <tt>\doifdefined</tt>, etc. | ||
+ | * <tt>\doif</tt>, <tt>\doifnot</tt>, <tt>\doifelse</tt> | ||
+ | * <tt>\doifempty</tt>, <tt>\doifnotempty</tt>, <tt>\doifemptyelse</tt> | ||
+ | * <tt>\doifinset</tt>, <tt>\doifnotinset</tt>, <tt>\doifnotinsetelse</tt> | ||
+ | * <tt>\doifcommon</tt>, <tt>\doifnotcommon</tt>, <tt>\doifcommonelse</tt> | ||
+ | * <tt>\doifsamestringselse</tt>,<tt>\doifsamestring</tt>,<tt>\doifnotsamestring</tt> | ||
+ | * <tt>\doifinstringelse</tt>,<tt>\doifincsnameelse</tt> | ||
+ | * <tt>\doifnumberelse</tt> | ||
+ | * <tt>\doifassignmentelse</tt> | ||
+ | * <tt>\doifrightpageelse</tt> (precede by {{cmd|signalrightpage}}) | ||
+ | * {{cmd|doifdocumentargument}} | ||
− | + | == Example == | |
+ | We can also write tests using Lua. (Example by WS, 3/2011.) | ||
− | < | + | <context mode="mkiv" source="yes"> |
\starttext | \starttext | ||
\ctxlua{test = true} | \ctxlua{test = true} | ||
− | + | Test is \ctxlua{commands.doifelse(test)}{True}{False}. | |
\ctxlua{test = false} | \ctxlua{test = false} | ||
− | Test is \ctxlua{commands. | + | Test is \ctxlua{commands.doifelse(test)}{True}{False}. |
\stoptext | \stoptext | ||
− | </ | + | </context> |
− | [[Category: | + | == See also == |
+ | |||
+ | [[System Macros/Branches and Decisions|Branches and Decisions]] | ||
+ | |||
+ | == Help from ConTeXt-Mailinglist/Forum == | ||
+ | All issues with: | ||
+ | {{Forum|{{SUBPAGENAME}}}} | ||
+ | |||
+ | [[Category:Command/Internals|doif...]] |
Revision as of 15:29, 10 September 2012
\doif...
- \doifnextcharelse
- \doifundefined, \doifdefined, etc.
- \doif, \doifnot, \doifelse
- \doifempty, \doifnotempty, \doifemptyelse
- \doifinset, \doifnotinset, \doifnotinsetelse
- \doifcommon, \doifnotcommon, \doifcommonelse
- \doifsamestringselse,\doifsamestring,\doifnotsamestring
- \doifinstringelse,\doifincsnameelse
- \doifnumberelse
- \doifassignmentelse
- \doifrightpageelse (precede by \signalrightpage)
- \doifdocumentargument
Example
We can also write tests using Lua. (Example by WS, 3/2011.)
\starttext \ctxlua{test = true} Test is \ctxlua{commands.doifelse(test)}{True}{False}. \ctxlua{test = false} Test is \ctxlua{commands.doifelse(test)}{True}{False}. \stoptext
See also
Help from ConTeXt-Mailinglist/Forum
All issues with: