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

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

New "Run LaTeX here" feature breaks codebox tag

Post by Ijon Tichy »

@stefan

It seems, that the new feature for LaTeX code breaks the codebox tag:

Code: Select all

[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
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics
User avatar
Stefan Kottwitz
Site Admin
Posts: 10270
Joined: Mon Mar 10, 2008 9:44 pm

New "Run LaTeX here" feature breaks codebox tag

Post by Stefan Kottwitz »

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:

Code: Select all

% !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: 640
Joined: Mon Dec 24, 2018 10:12 am

New "Run LaTeX here" feature breaks codebox tag

Post by Ijon Tichy »

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.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
User avatar
Stefan Kottwitz
Site Admin
Posts: 10270
Joined: Mon Mar 10, 2008 9:44 pm

New "Run LaTeX here" feature breaks codebox tag

Post by Stefan Kottwitz »

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: 640
Joined: Mon Dec 24, 2018 10:12 am

New "Run LaTeX here" feature breaks codebox tag

Post by Ijon Tichy »

Excellent job!
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Post Reply