TeX - LaTeX Asked by Randi on December 5, 2020
Is there a way of toggling the textpos
option [noshowtext]
?
I would like some textboxes to show the frame but not the text. And others to show both frame and text, but can’t seem to find a way of toggling this, the package does not specify it.
Any ideas?
textpos
sets a boolean (or IF-condition) depending on whether you provide the noshowtext
option or not. More specifically, from textpos.dtx
, it defines (comments added):
newififTP@showtext% Create a condition ifTP@showtext
TP@showtexttrue% Set condition to TRUE
DeclareOption{noshowtext}{TP@showtextfalse}% Set condition to FALSE...
% if you use usepackage[noshowtext]{textpos}
If you add
makeatletter
newcommand{NoShowText}{TP@showtextfalse}% Set condition ifTP@showtext to FALSE
newcommand{ShowText}{TP@showtexttrue}% Set condition ifTP@showtext to TRUE
makeatother
to your document preamble, it provides a user-interface to setting the condition as either being TRUE or FALSE mid-document (rather than at package-load). So, they now act as a switch:
NoShowText
to de-activate the showing of text; andShowText
to activate the showing of text again.This works because the condition is evaluated within the textpos
constructions. If the constructions were created based on whether or not you load the package with/without the option, then it would be a different story; one may have to rewrite certain macros. But this doesn't seem to be the case here.
Correct answer by Werner on December 5, 2020
Since textpos v1.8, you can do
TPoptions{showtext=false}
(or true
) to control showing and hiding the text.
Answered by Norman Gray on December 5, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP