LaTeX forum ⇒ Comments & WishesNew "Run LaTeX here" feature breaks codebox tag

General comments, feature, category or forum wishes for this LaTeX community
User avatar
Ijon Tichy
Posts: 464
Joined: Mon Dec 24, 2018 10:12 am

New "Run LaTeX here" feature breaks codebox tag

Postby Ijon Tichy » Tue Mar 16, 2021 10:33 am

@stefan

It seems, that the new feature for LaTeX code breaks the codebox tag:
[Codebox=latex file=Untitled.tex]
\documentclass{article}
\begin{document}
\end{document}
[/Codebox]

results in:
\documentclass{article}
\begin{document}
\end{document}


So the line breaks are missing.

I've tried to use the codebox=text tag to show log-file messages, to avoid the Run LaTeX here button. Because using this button changes the shown log-file text into a LaTeX document, which is not intentionally and cannot be reverted with the Delete Output button but only by reloading the page. You can try it here:
! Undefined control sequence.
l.17 \blindtex

User avatar
Stefan Kottwitz
Site Admin
Posts: 9685
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Tue Mar 16, 2021 2:54 pm

Hi,

thank you for the feedback!

David and I are working on improving the feature.

For example, code without LaTeX-Button can be displayed with the engine none:

% !TEX none
! Undefined control sequence.l.17 \blindtex


Seeing this, would we really need to support the Codebox bbcode? Was it often used? I replaced it with the code tag to be consistent with look and feel and use, but have still an issue with the line breaks.

Did you use the Codebox to avoid the buttons? Because the no-button solution would be like above. However, I plan to automatically omit the buttons if a log file is noticed or an error message seen (parsed with an regexp if the "code" matches common error messages, or the beginning of a TeX log file). So day to day and in all old posts we won't see Compile buttons for log files or simple error messages.

Stefan
LaTeX.org admin

User avatar
Ijon Tichy
Posts: 464
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Tue Mar 16, 2021 5:19 pm

In past I've used Codebox to use examples with different names and reference the examples by the name. I've also used it to not mark code as LaTeX, if it wasn't LaTeX code.

Today I've tried to avoid the buttons. But, because of the missing linebreak, I've not used it.

IMHO a <pre>-like tag without any text formatting would be usefull, e.g., for log files. The % !TEX none is shown as line 1, so it distorts the real text. This could confuse beginners.

User avatar
Stefan Kottwitz
Site Admin
Posts: 9685
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Wed Mar 17, 2021 12:58 am

I think it's fixed plus some other improvements, thanks to David Carlisle.

Another test post is here.

Basically, Code only gets the compiler button if there's a backslash in the first line, or that starts with a % comment sign. That should match possible LaTeX code, and everything else, such as log files and error messages and shell scripts, should not get a compile button. And the codebox is fixed to work like normal code.

I'm a bit tired :-) later I can write a post with more details.

Thank you for the feedback!

Stefan
LaTeX.org admin

User avatar
Ijon Tichy
Posts: 464
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Wed Mar 17, 2021 10:14 am

Excellent job!


Return to “Comments & Wishes”

Who is online

Users browsing this forum: No registered users and 2 guests