Discussion:
How to read Web pages with funny backslashes?
(too old to reply)
Stefan Ram
2024-07-31 13:36:19 UTC
Permalink
I'm totally out of the loop with what the young'uns are up
to on the interwebs these days. The other day I stumbled
across this webpage that said:

|Many textbooks, for instance, will tell you that the metric
|tensor of special relativity takes a form like
|
|\[ \eta_{\mu\nu}=\begin{pmatrix}-1&0&0&0\\0&1&0&0\\0&0&1&0 . . .

How am I supposed to make heads or tails of this? I figured
it was meant to be LaTeX, so I tried to copy it into LaTeX as,

|\documentclass[a4paper]{article}
|\begin{document}
|Here's something that caused me undue confusion over the years . . .
|Many textbooks, for instance, will tell you that the metric . . .
|\[ \eta_{\mu\nu}=\begin{pmatrix}-1&0&0&0\\0&1&0&0\\0&0&1&0\\ . . .

, but I got hit with:

|! Misplaced alignment tab character &.
|l.12 \[ \eta_{\mu\nu}=\begin{pmatrix}-1&
| 0&0&0\\0&1&0&0\\0&0&1&0\\0& . . .
|
|?

.
Stefan Ram
2024-07-31 13:56:47 UTC
Permalink
Post by Stefan Ram
|\[ \eta_{\mu\nu}=\begin{pmatrix}-1&0&0&0\\0&1&0&0\\0&0&1&0 . . .
Now I see that it seems to be required to activate JavaScript
in the browser as the source code of the HTML web page is:

|<p><script type="text/x-mathjax-config">
| MathJax.Hub.Config({
| extensions: ["tex2jax.js"],
| jax: ["input/TeX","output/HTML-css"],
| tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]}
| });
|</script>
|<script type="text/javascript" src="/mathjax/MathJax.js"></script>
|
|Here's something that caused me undue confusion over the
|years as I was learning about tensors.</p>
|
|<p>Many textbooks, for instance, will tell you that the
|metric tensor of special relativity takes a form like</p>
|
|<p>\[
|\eta_{\mu\nu}=\begin{pmatrix}-1&amp;0&amp;0&amp;0\\0&amp;1&amp;0 . . .
|\]</p>

. Still, it would be interesting if anyone could comment
on what "dialect" of TeX/LaTeX is used there and how one
could format it using an implementation of TeX or LaTeX!
Axel Berger
2024-07-31 13:59:12 UTC
Permalink
Post by Stefan Ram
. Still, it would be interesting if anyone could comment
on what "dialect" of TeX/LaTeX is used there and how one
could format it using an implementation of TeX or LaTeX!
Simple. Those look like lines inside a table. You have to provide the
table(-like) environment around them.
--
/¯\ No | Dipl.-Ing. F. Axel Berger Tel: +49/ 221/ 7771 8067
\ / HTML | Roald-Amundsen-Straße 2a Fax: +49/ 221/ 7771 8069
 X in | D-50829 Köln-Ossendorf http://berger-odenthal.de
/ \ Mail | -- No unannounced, large, binary attachments, please! --
Marc Olschok
2024-07-31 22:33:21 UTC
Permalink
Post by Stefan Ram
Post by Stefan Ram
|\[ \eta_{\mu\nu}=\begin{pmatrix}-1&0&0&0\\0&1&0&0\\0&0&1&0 . . .
Now I see that it seems to be required to activate JavaScript
|<p><script type="text/x-mathjax-config">
| MathJax.Hub.Config({
| extensions: ["tex2jax.js"],
| jax: ["input/TeX","output/HTML-css"],
| tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]}
| });
|</script>
|<script type="text/javascript" src="/mathjax/MathJax.js"></script>
|
|Here's something that caused me undue confusion over the
|years as I was learning about tensors.</p>
|
|<p>Many textbooks, for instance, will tell you that the
|metric tensor of special relativity takes a form like</p>
|
|<p>\[
|\eta_{\mu\nu}=\begin{pmatrix}-1&amp;0&amp;0&amp;0\\0&amp;1&amp;0 . . .
|\]</p>
. Still, it would be interesting if anyone could comment
on what "dialect" of TeX/LaTeX is used there and how one
could format it using an implementation of TeX or LaTeX!
It is ordinary LaTeX inside the \[ ... \] marks (if you happen to use
math.stackechange or mathoverflow ore the nlab etc. you probably have
already seen this). The strange thing is that the & inside the matrix
are replaced by the &amp; , so they will display as & but of course not
compile. I do not know if this is meant to be this way or an error on
the web page.
--
M.O.
Stefan Ram
2024-07-31 22:51:17 UTC
Permalink
Post by Marc Olschok
It is ordinary LaTeX inside the \[ ... \] marks (if you happen to use
math.stackechange or mathoverflow ore the nlab etc. you probably have
already seen this). The strange thing is that the & inside the matrix
are replaced by the &amp; , so they will display as & but of course not
compile. I do not know if this is meant to be this way or an error on
the web page.
Oh, that only happened because I showed the HTML source code
of the webpage in my second post. But the problem still exists
even if you replace "&amp;" with "&".

In the meantime, I asked my buddy, the chatbot, to convert it
into acceptable LaTeX for me, and he nailed it! His trick? He
added a "\usepackage{amsmath}"!
Ulrich D i e z
2024-08-01 03:07:46 UTC
Permalink
Post by Stefan Ram
Post by Stefan Ram
|\[ \eta_{\mu\nu}=\begin{pmatrix}-1&0&0&0\\0&1&0&0\\0&0&1&0 . . .
Now I see that it seems to be required to activate JavaScript
|<p><script type="text/x-mathjax-config">
| MathJax.Hub.Config({
| extensions: ["tex2jax.js"],
| jax: ["input/TeX","output/HTML-css"],
| tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]}
| });
|</script>
|<script type="text/javascript" src="/mathjax/MathJax.js"></script>
|
|Here's something that caused me undue confusion over the
|years as I was learning about tensors.</p>
|
|<p>Many textbooks, for instance, will tell you that the
|metric tensor of special relativity takes a form like</p>
|
|<p>\[
|\eta_{\mu\nu}=\begin{pmatrix}-1&amp;0&amp;0&amp;0\\0&amp;1&amp;0 . . .
|\]</p>
. Still, it would be interesting if anyone could comment
on what "dialect" of TeX/LaTeX is used there and how one
could format it using an implementation of TeX or LaTeX!
That is a conglomerate of commands that are frequently seen in the
source code for documents that are to be compiled by a LaTeX compiler
like latex or lualatex or xelatex or pdflatex and that are defined in
the LaTeX 2ε-kernel or in some packages for LaTeX 2ε.

But, actually, this is not LaTeX 2ε code or code for whatsoever flavor
of TeX or LaTeX at all. This is code for MathJax.

MathJax is a JavaScript display engine for LaTeX, MathML, and AsciiMath
notation. Unlike TeX, which is a print layout engine, MathJax renders
web content that is to be displayed on some display device.

More information about MathJax can be found at
https://www.mathjax.org/
https://docs.mathjax.org/en/latest/basic/mathjax.html
https://docs.mathjax.org/en/latest/input/tex/index.html


Sincerely

Ulrich

Ulrich D i e z
2024-08-01 02:40:30 UTC
Permalink
Post by Stefan Ram
I'm totally out of the loop with what the young'uns are up
to on the interwebs these days. The other day I stumbled
|Many textbooks, for instance, will tell you that the metric
|tensor of special relativity takes a form like
|
|\[ \eta_{\mu\nu}=\begin{pmatrix}-1&0&0&0\\0&1&0&0\\0&0&1&0 . . .
If this is mathjax and you copy paste to a text file to compile with a
real LaTeX engine, then in the text file holding he LaTeX code you need
to load packages so that all environments and commands are defined.

E.g., https://de.overleaf.com/learn/latex/Matrices says that the
environment pmatrix is defined by the package amsmath, so in the
preamble of your LaTeX code you need to load that package, e.g., via
\usepackage{amsmath}
Post by Stefan Ram
How am I supposed to make heads or tails of this? I figured
it was meant to be LaTeX, so I tried to copy it into LaTeX as,
|\documentclass[a4paper]{article}
|\begin{document}
|Here's something that caused me undue confusion over the years . . .
|Many textbooks, for instance, will tell you that the metric . . .
|\[ \eta_{\mu\nu}=\begin{pmatrix}-1&0&0&0\\0&1&0&0\\0&0&1&0\\ . . .
|! Misplaced alignment tab character &.
|l.12 \[ \eta_{\mu\nu}=\begin{pmatrix}-1&
| 0&0&0\\0&1&0&0\\0&0&1&0\\0& . . .
|
|?
.
Is this the only error message you get?

Sincerely

Ulrich
Loading...