0

I need to use \phantom for an argument and to deactivate it just sometimes to show only the numbers of enumerates. I spend a lot of time and I tried many things but I can't achieve it. Here is a minimal example (for xelatex) which I know it can't work but it show the quite simple idea :

\documentclass{article}
\usepackage{polyglossia}\setmainlanguage{french}
\begin{document}

\newcommand{\fantome}[1] { \begin{phantom} #1 \end{phantom} }

\let\itemold\item \renewcommand{\item}{ \end{phantom} \itemold \begin{phantom} }

Ici les questions.\ \fantome{Ici les réponses. \begin{enumerate} \item Réponse 1. \item Réponse 2. \end{enumerate} }

\end{document}

Here is the output I would like to have:

enter image description here

I tried to be concise but I can explain more if needed.

TobiBS
  • 5,240
Moïse
  • 21
  • Welcome to TeX.SE. – Mico Aug 21 '20 at 15:04
  • Is there a reason for not writing \newcommand{\fantome}[1]{\phantom{#1}} – Mico Aug 21 '20 at 15:05
  • 1
    That won't work, you can't use \phantom as environment. Check the lualatex versions here https://tex.stackexchange.com/questions/555595/multilines-multipages-phantom-analog-macro – Ulrike Fischer Aug 21 '20 at 15:06
  • I tried \newcommand{\fantome}[1]{\phantom{#1}} and other things but I am not very good in tex/latex. I understand \phantom can't be used as environment, but so how can I do ? No way to achieve my purpose (which appear quite simple I think, it's just a on/off phantom command). – Moïse Aug 22 '20 at 10:19

0 Answers0