You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在LaTeX输出中隐藏行内部分内容?附Agda示例场景

Yes, this is absolutely feasible! You can hide inline portions of your Agda type signature in the LaTeX output by either manually adjusting the generated LaTeX code or using built-in commands from the Agda LaTeX package. Here are two straightforward approaches:

1. Manual LaTeX Editing (Best for One-Off Adjustments)

If you only need to modify this specific signature, the simplest way is to tweak the generated LaTeX code directly:

First, the standard agda.sty package includes an \AgdaHide command that lets you hide parts of code. Locate the line with your signature in the generated .tex file and wrap the sections you want to omit with \AgdaHide{...}:

\begin{code}
sub-⊢*⊇ : ∀ \AgdaHide{{Γ Δ Θ t}} \AgdaHide{(σ : Γ ⊢* Δ)} σ \AgdaHide{(Δ⊇Θ : Δ ⊇ Θ)} Δ⊇Θ \AgdaHide{(e : Tm Θ t)} e → sub (σ ⊢*⊇ Δ⊇Θ) e ≡ sub σ (ren Δ⊇Θ e)
\end{code}

This will render exactly the output you requested:
sub-⊢*⊇ : ∀ σ Δ⊇Θ e → sub (σ ⊢*⊇ Δ⊇Θ) e ≡ sub σ (ren Δ⊇Θ e)

If \AgdaHide isn’t available for some reason, define a simple replacement command in your LaTeX preamble:

\newcommand{\hide}[1]{}

Then use \hide{...} instead of \AgdaHide{...} in the code line.

2. Automated Control via Agda Pragmas (For Global or Repeated Cases)

If you want to hide implicit arguments across multiple definitions, use an Agda pragma to disable their display globally. Add this line at the top of your Agda file:

{-# OPTIONS --hide-implicit #-}

This will omit all implicit arguments (the ones in curly braces {...}) from the LaTeX output. However, this won’t automatically remove type annotations for explicit parameters (σ : Γ ⊢* Δ, etc.). For those, you’ll still need to use the manual \AgdaHide method above, or adjust your Agda source to omit type annotations where possible (though this might affect readability in the original code).

Whichever method you choose, you can achieve the exact output you’re looking for without altering the structure of your original Agda code.

内容的提问来源于stack exchange,提问作者Cactus

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 04:31:18