verso icon indicating copy to clipboard operation
verso copied to clipboard

fix: generate placeholder text for missing `toTex` implementations

Open kpadmasola opened this issue 6 months ago • 3 comments

Generate placeholder text for missing toTex implementations instead failing.

kpadmasola avatar Aug 26 '25 17:08 kpadmasola

@david-christiansen With this change, the main.tex gets generated. However, running lualatex main.tex fails with errors. I have categorized the errors below along with the fixes to enable successful conversion to main.pdf.

  • FIX: Need to add the following for showing error text in red color \usepackage{xcolor} \colorlet{RED}{black}
  • FIX: Replace \Verb with \verb
  • ERROR: Cannot have verbatim text inside section titles
    • LaTeX Error: \verb illegal in argument.
    • e.g., \subsubsection{The \verb|ToFormat| Class}
    • FIX: We may need something like https://tex.stackexchange.com/questions/152229/strange-error-related-to-verb-in-section-titles
    • Or https://tex.stackexchange.com/questions/24574/how-to-put-verb-command-inside-of-textbf-block
    • Or https://tex.stackexchange.com/questions/2790/when-should-one-use-verb-and-when-texttt
  • ERROR: LaTeX Error: \verb ended by end of line — happens in hyperlink args
    • e.g., in \hyperlink{"https://lean-lang.org/doc/reference/4.23.0-rc2/find/?domain=Verso.Genre.Manual.section&name=do-notation"}{\verb|do| -notation}.Because the resulting value is treated as a side-effect-free term, the compiler may re-order,`
    • FIX: use \texttt instead
  • ERROR: LaTeX Error: Command \item invalid in math mode.
    • e.g., .\item The syntax \verb|have (eq := h) pat := e| is equivalent to \verb|match h : e with | pat => _|
    • FIX: In the second line there is a | inside \verb
    • So we should use some other delimiter character, such as !
    • Or use \begin{verbatim}
    • Also \item should probably begin on a new line, perhaps?
  • ERROR: LaTeX Error: Lonely \item--perhaps a missing list environment.
    • Issue due to \hyperlink second arg having underscore
    • FIX: escape underscore
  • ERROR: ! Text line contains an invalid character.
    • e.g., l.32508 ... or. Usually accessed via the \verb|^^^
    • FIX: Try \verb|\^\^\^|
  • ERROR: LaTeX Error: \verb illegal in argument.
    • FIX: Replace with \texttt instead

kpadmasola avatar Aug 27 '25 08:08 kpadmasola

Thanks for the big list of things that need fixing! That'll be really helpful to check off as it goes.

david-christiansen avatar Aug 27 '25 09:08 david-christiansen

I'm away from the computer for a few days but will look again as soon as I'm back. Thanks again!

david-christiansen avatar Aug 29 '25 06:08 david-christiansen