The question is simple. I want to type |left|left|right|.
But the outcome after clicking on typesetting button is shown: —left— left —right
It's dash, rather than my desired |.
Many thanks in advance!
TeXworks ⇒ mistakes on typing |
- Stefan Kottwitz
- Site Admin
- Posts: 10308
- Joined: Mon Mar 10, 2008 9:44 pm
mistakes on typing |
The | is one of the special symbols that are not supported in the old default original font encoding of LaTeX. You can switch to a modern font encoding this way, then it works:
Stefan
\usepackage[T1]{fontenc}
Stefan
LaTeX.org admin
mistakes on typing |
Great, that works! Thank you so much!
Could you explain what's the distinguishable function of this package [T1]{fontenc}?
Could you explain what's the distinguishable function of this package [T1]{fontenc}?
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
mistakes on typing |
By the way, i can recommend a great read: LaTeX for complete novices.
It is a free introduction written by Nicola Talbot that gets you familiar with all the basics you need.
It is a free introduction written by Nicola Talbot that gets you familiar with all the basics you need.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
- Stefan Kottwitz
- Site Admin
- Posts: 10308
- Joined: Mon Mar 10, 2008 9:44 pm
mistakes on typing |
The symbols in a font (glyphs) have to be used with an internal numbering. So we have tables with numbers for fonts. Assigning numbers to font elements is called encoding. It's similar to ASCII code but not just for standard characters but for font symbols, that can be thousands. The default encoding in LaTeX just supports fewer symbols, such as normal characters/letters. Letters with accents are then made as combination of latter and an accent symbol over it. Modern encoding, such as the so called T1 encoding, have big font tables with a lot of symbols including real accented letters and many more symbols. That's what this line above does, it activates that.
Using this, I also recommend to add
This changes the default font (Computer Modern) to Latin Modern that is very similar but with proper T1 encoding support. I would say it's better to use it.
Stefan
Using this, I also recommend to add
\usepackage{lmodern}
This changes the default font (Computer Modern) to Latin Modern that is very similar but with proper T1 encoding support. I would say it's better to use it.
Stefan
LaTeX.org admin