COQ-TEX(1)

πŸ“¦
version 9.3.0 Β· 2 versions
, in alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ COQ-TEX(1) ✨

okay bestie, gather round, because this one is a general commands manual classic and it's lowkey iconic πŸ’…

🌸 NAME 🌸

coq-tex β€” process Coq phrases embedded in LaTeX files

like... it's the lil filter that takes your Coq code that's chilling inside a LaTeX doc and actually does something with it. no cap.


πŸŽ€ SYNOPSIS πŸŽ€

coq-tex [ -o output-file ] [ -n line-width ] [ -image coq-image ] [ -w ]
[ -v ] [ -sl ] [ -hrule ] [ -small ] input-file ...

(and yes she takes multiple input-files, she's greedy like that, we love a multitasker 🫢)


πŸ’– DESCRIPTION πŸ’–

so the coq-tex filter does three things and she does them in order, main character behaviour fr fr:

it extracts Coq phrases that are embedded in LaTeX files, it evaluates them, and then it inserts the outcome of the evaluation after each phrase. that's the whole vibe check.

πŸ¦‹ the three LaTeX environments πŸ¦‹

to get Coq code into your input files you have three environments to choose from, each with its own energy:

  • coq_example β€” everything between \begin{coq_example} and \end{coq_example} gets evaluated and copied into the output file. and then, slay, each phrase is followed by the response of the toplevel loop. you see everything πŸ‘€
  • coq_example* β€” everything between \begin{coq_example*} and \end{coq_example*} gets evaluated and copied into the output file too, BUT the responses of the toplevel loop are discarded. it's giving "show the code, hide the receipts" πŸ™ˆ
  • coq_eval β€” everything between \begin{coq_eval} and \end{coq_eval} is silently evaluated. not copied into the output file, responses discarded. it's the ghostwriter of environments. no one sees her but she's working πŸ’€

⭐ where the output goes ⭐

the resulting LaTeX code gets stored in the file file.v.tex if the input file has a name of the form file.tex. otherwise? the name of the output file is just the name of the input file with .v.tex appended. either way you're getting a .v.tex out of this, periodt.

and the best part: the files produced by coq-tex can be directly processed by LaTeX. no middleman, no conversion era. both the Coq phrases and the toplevel output get typeset in typewriter font. aesthetic ✨


πŸ’… OPTIONS πŸ’…

  • -o output-file β€” specify the name of a file where the LaTeX output is to be stored. and a dash -? that causes the LaTeX output to be printed on standard output. pipeline girlies rise 🫢
  • -n line-width β€” set the line width. the default is 72 characters. the responses of the toplevel loop are folded if they're longer than the line width. no folding is performed on the Coq input text though, so don't come for her about your input, she leaves that alone πŸ™…
  • -image coq-image β€” cause the file coq-image to be executed to evaluate the Coq phrases. by default this is the command coqtop without specifying any path, which is used to evaluate the Coq phrases. iykyk 🌈
  • -w β€” cause lines to be folded on a space character whenever possible, avoiding word cuts in the output. by default, folding occurs at the line width, regardless of word cuts. so basically -w is the "please don't split my words mid-syllable bestie" flag 😭
  • -v β€” verbose mode. prints the Coq answers on the standard output. useful to detect errors in Coq phrases. lowkey the debugging queen πŸ‘‘
  • -sl β€” slanted mode. the Coq answers are written in a slanted font. italic era 🧚
  • -hrule β€” horizontal lines mode. the Coq parts are written between two horizontal lines. very "chapter break" of her 🌸
  • -small β€” small font mode. the Coq parts are written in a smaller font. tiny but mighty πŸ“

πŸ”₯ CAVEATS πŸ”₯

okay this is the part where we get serious because these are real and they will humble you:

the \begin... and \end... phrases must sit on a line by themselves, with no characters before the backslash or after the closing brace. no sneaky spaces, no lil comments, nothing.
each Coq phrase must be terminated by '.' at the end of a line.

blank space is accepted between '.' and the newline β€” fine, we're chill β€” but any other character will cause coq-tex to ignore the end of the phrase, and that results in an incorrect shuffling of the responses into the phrases. the responses "lag behind". and that's the messiest possible outcome, so pls respect the line break πŸ™


🌈 SEE ALSO 🌈


and that's the whole page bestie πŸ’– this one lives in the General Commands Manual as COQ-TEX(1) β€” go forth, embed your Coq, and remember: the period goes at the end of the line or the responses start lagging and nobody wants that energy. bye ily πŸŽ€βœ¨

πŸ“¦ where this page comes from