Skip to content
The Chat Archive
ChatGPT (model unspecified)· OpenAI ShareLM (browser-extension contributions)

create a latex \temp command that writes text in the regular place but is visually…

  1. User

    create a latex \temp command that writes text in the regular place but is visually distinct to remember to replace it later.

  2. Assistant

    A great way to make a temporary marker command in LaTeX is to define something that:

    Displays inline (so it doesn’t break your text flow).

    Looks visually distinct (e.g., bright color, bold or boxed).

    Can be easily found later (e.g., by searching for \temp{ or the color).

    Here’s a neat definition you can add to your LaTeX preamble: latexCopiar código\usepackage{xcolor}

    \newcommand{\temp}[1]{\textcolor{red!80!black}{\textbf{[TEMP: #1]}}}

    ✅ Example usage latexCopiar códigoThis is a \temp{replace this phrase later} in the text.

    Output:

    This is a [TEMP: replace this phrase later] in red bold text.

    💡 Variations

    1. More subtle version (orange italics): latexCopiar código\newcommand{\temp}[1]{\textcolor{orange!90!black}{\textit{#1}}}

    2. Boxed version (for visibility in drafts): latexCopiar código\usepackage{xcolor} \usepackage{tcolorbox} \newcommand{\temp}[1]{\tcbox[colback=yellow!20!white,colframe=red!70!black,boxrule=0.5pt]{\textbf{#1}}}

    3. If you don’t want to load tcolorbox, use a simple frame: latexCopiar código\newcommand{\temp}[1]{\fcolorbox{red!70!black}{yellow!10!white}{\textbf{#1}}}

    Would you like it to disappear automatically in the final version (e.g., when toggling a draft mode)? I can make a version that hides all \temp{} entries when you compile in final mode.