2

When iftoggle condition is used, first letter after the condition is removed in the output. Consider below code

\documentclass{article}
\usepackage{etoolbox}
\begin{document}
\newtoggle{test}
\toggletrue{test}
First sentence.\iftoggle{test}{ Second sentence.} Last sentence.
\end{document}

If one executes above code, it renders "First sentence. Second sentence.ast sentence." removing "L"!. Can any one tell me how to correct it?

1
  • Please provide a complete mwe. However iftoggle has three arguments! The first one is the toggle name the second one your group { .. } and the third one your L. Commented Aug 18, 2012 at 11:37

1 Answer 1

4

The test iftoggle is a command with three mandatory arguments with the following syntax:

\iftoggle{ name }{ true }{ false }

Expands to true if the state of the boolean flag name is true, and to false otherwise.

In your example you have the following test:

\iftoggle{test}{ Second sentence.} Last sentence

with this setting:

name  ==> test
true  ==> Second sentence.
false ==> L

This happens because a standard mandatory argument is braced by curly brackets or it can be a single token.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .