narkive is for sale. Interested? (dismiss)
Discussion:
surprised by result of typo
(too old to reply)
Phillip Helbig (undress to reply)
2020-05-30 20:58:21 UTC
Permalink
What do you expect the following to produce?

\documentclass{article}
\begin{document}

$|R|a(t)$

|R|a(t)

\end{document}

Answer is down below; think about it first.









































































First, I see

|R|a(t)

but in math italic, which is what I expect. Then I see

---R---a(t)

where "---" appears to be what LaTeX normally creates out of "---", i.e.
an em-dash.

The typo was forgetting the dollar signs and easily corrected. However,
I didn't expect the output. What is the explanation for it?
Peter Flynn
2020-05-30 22:31:48 UTC
Permalink
Post by Phillip Helbig (undress to reply)
What do you expect the following to produce?
[...]
Post by Phillip Helbig (undress to reply)
Post by Phillip Helbig (undress to reply)
Then I see
---R---a(t)
where "---" appears to be what LaTeX normally creates out of "---", i.e.
an em-dash.
The typo was forgetting the dollar signs and easily corrected. However,
I didn't expect the output. What is the explanation for it?
The vertical bar is a math-mode symbol and is meaningless anywhere else.
In a text-mode context, I think it used to issue an error message, but
will now use the character in the "|" location from the font in use,
depending on the encoding.

The vertical bar character is ASCII '174 octal, and this location in
(for example) CMR10 is occupied by the em-rule, which is what you get in
both latex and pdflatex.

However, if you process your example with XeLaTeX, the second version
comes out as vertical bars, but with upright, not italic, other characters.

Peter
Phillip Helbig (undress to reply)
2020-05-30 22:39:07 UTC
Permalink
Post by Peter Flynn
Post by Phillip Helbig (undress to reply)
What do you expect the following to produce?
[...]
Post by Phillip Helbig (undress to reply)
Post by Phillip Helbig (undress to reply)
Then I see
---R---a(t)
where "---" appears to be what LaTeX normally creates out of "---", i.e.
an em-dash.
The typo was forgetting the dollar signs and easily corrected. However,
I didn't expect the output. What is the explanation for it?
The vertical bar is a math-mode symbol and is meaningless anywhere else.
Right.
Post by Peter Flynn
In a text-mode context, I think it used to issue an error message,
That must have been a very long time ago.
Post by Peter Flynn
but
will now use the character in the "|" location from the font in use,
depending on the encoding.
The vertical bar character is ASCII '174 octal, and this location in
(for example) CMR10 is occupied by the em-rule, which is what you get in
both latex and pdflatex.
That explains it.
Post by Peter Flynn
However, if you process your example with XeLaTeX, the second version
comes out as vertical bars, but with upright, not italic, other characters.
OK, it interprets the character literally, so to speak. But of course
the other characters are upright, as there is no reason why they
shouldn't be.
Peter Flynn
2020-05-31 10:08:09 UTC
Permalink
[...]
Post by Phillip Helbig (undress to reply)
Post by Peter Flynn
However, if you process your example with XeLaTeX, the second version
comes out as vertical bars, but with upright, not italic, other characters.
OK, it interprets the character literally, so to speak. But of course
the other characters are upright, as there is no reason why they
shouldn't be.
That actually surprised me. Yes, certainly they should be upright
without any mention of math, but I didn't realise XeLaTeX interpreted
the vertical bars and decided to give them to you.

So I tried <R>a(t) and yes, you get less-than and greater-than signs.

But if you try ^R_a(t) you still get the error message about Missing $
inserted, but nevertheless it gives you a superscript Rand a subscript a
against the opening parentheses.

As I am neither a mathematician nor an expert in XeLaTeX it's clear I
have some RTFM to do :-)

Peter
Phillip Helbig (undress to reply)
2020-05-31 10:23:29 UTC
Permalink
Post by Peter Flynn
That actually surprised me. Yes, certainly they should be upright
without any mention of math, but I didn't realise XeLaTeX interpreted
the vertical bars and decided to give them to you.
I've never used XELaTeX, only traditional LaTeX (then DVIPS then PS2PDF
(via GhostScript)), mostly on VMS but also some on various flavours of
unix (including linux), and pdflatex.
Peter Flynn
2020-05-31 21:03:11 UTC
Permalink
Post by Phillip Helbig (undress to reply)
Post by Peter Flynn
That actually surprised me. Yes, certainly they should be upright
without any mention of math, but I didn't realise XeLaTeX interpreted
the vertical bars and decided to give them to you.
I've never used XELaTeX, only traditional LaTeX (then DVIPS then PS2PDF
(via GhostScript)), mostly on VMS but also some on various flavours of
unix (including linux), and pdflatex.
I recently switch to using XeLaTeX so that I could be reasonably sure
that Unicode UTF-8 characters would be readable, and so that I could use
fonts I needed to use. It's been an interesting experience but I shall
not be going back to pdflatex.

P
Ulrike Fischer
2020-05-31 13:04:12 UTC
Permalink
Am Sat, 30 May 2020 20:58:21 +0000 (UTC) schrieb
Post by Phillip Helbig (undress to reply)
What do you expect the following to produce?
\documentclass{article}
\begin{document}
$|R|a(t)$
|R|a(t)
\end{document}
One of the reason why I always use \usepackage[T1]{fontenc} with
pdflatex.

OT1 has too many oddities.
--
Ulrike Fischer
https://www.troubleshooting-tex.de/
Phillip Helbig (undress to reply)
2020-05-31 16:37:13 UTC
Permalink
Post by Ulrike Fischer
Post by Phillip Helbig (undress to reply)
What do you expect the following to produce?
\documentclass{article}
\begin{document}
$|R|a(t)$
|R|a(t)
\end{document}
One of the reason why I always use \usepackage[T1]{fontenc} with
pdflatex.
OT1 has too many oddities.
This was not with pdflatex, just traditional LaTeX.
Uwe Siart
2020-05-31 18:09:50 UTC
Permalink
Post by Phillip Helbig (undress to reply)
This was not with pdflatex, just traditional LaTeX.
Shouldn't make a difference here. "Traditional LaTeX" is nothing but
pdflatex in DVI mode.
--
Uwe
Phillip Helbig (undress to reply)
2020-05-31 18:41:56 UTC
Permalink
Post by Uwe Siart
Post by Phillip Helbig (undress to reply)
This was not with pdflatex, just traditional LaTeX.
Shouldn't make a difference here. "Traditional LaTeX" is nothing but
pdflatex in DVI mode.
I'm pretty sure that that's not the case on my system, which is running
VMS and has a [TEXMF] installation from more than 20 years ago. Did
pdflatex even exist then? Did pdf even exist then?
Stéphane CARPENTIER
2020-05-31 21:28:08 UTC
Permalink
Le 31-05-2020, Phillip Helbig (undress to reply)
Post by Phillip Helbig (undress to reply)
I'm pretty sure that that's not the case on my system, which is
running VMS and has a [TEXMF]
I know nothing about your distribution, I won't comment on it.
Post by Phillip Helbig (undress to reply)
installation from more than 20 years ago. Did pdflatex even exist
then?
It depends about your more, because 40 years ago the answer is no. If
you consider pdflatex and pdftex being the same program and by more, you
say 21 or 22 years, the answer is yes. On the ctan, it looks like pdftex
exist from 1996.
Post by Phillip Helbig (undress to reply)
Did pdf even exist then?
Obviously, pdf is older than pdftex, so the answer should be the same.
From wikipedia, the first version of pdf is 1993.
--
Si vous avez du temps à perdre :
https://scarpet42.gitlab.io
Loading...