Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
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. –  Marco Daniel Aug 18 '12 at 11:37
add comment

1 Answer

up vote 3 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.