How to write sign “|” (or) in LaTeX?GraphViz and LaTeX; gives blank PDFPhantom equals sign in aligned equationNo “=” sign in math mode with newtxmath! pdfTeX error (ext4): pdfendlink ended up in different nesting level than pdHow I can align 2 equations with LaTeX?How to write a long integral in LatexHow to change PDF name when piping to pdflatex?How to cancel the pagenumber of content page?Cyrilic characters in label and ref in pdflatexHow do I produce this Greek letter koppa: Ϟ in pdfLaTeX?
Catching a robber on one line
Is there a risk to write an invitation letter for a stranger to obtain a Czech (Schengen) visa?
How do I become a better writer when I hate reading?
Can you cover a cube with copies of this shape?
What is "dot" sign in •NO?
Will users know a CardView is clickable?
How do credit card companies know what type of business I'm paying for?
On George Box, Galit Shmueli and the scientific method?
At what temperature should the earth be cooked to prevent human infection?
Interview was just a one hour panel. Got an offer the next day; do I accept or is this a red flag?
Digital signature that is only verifiable by one specific person
Leveraging cash for buying car
How could I create a situation in which a PC has to make a saving throw or be forced to pet a dog?
How can I maintain game balance while allowing my player to craft genuinely useful items?
2 Managed Packages in 1 Dev Org
First occurrence in the Sixers sequence
Testing thermite for chemical properties
High-end PC graphics circa 1990?
New Site Design!
How do I run a script as sudo at boot time on Ubuntu 18.04 Server?
How to address players struggling with simple controls?
Cut power on a remote Raspberry Pi 3 via another raspi
Is there any effect in D&D 5e that cannot be undone?
How to write a nice frame challenge?
How to write sign “|” (or) in LaTeX?
GraphViz and LaTeX; gives blank PDFPhantom equals sign in aligned equationNo “=” sign in math mode with newtxmath! pdfTeX error (ext4): pdfendlink ended up in different nesting level than pdHow I can align 2 equations with LaTeX?How to write a long integral in LatexHow to change PDF name when piping to pdflatex?How to cancel the pagenumber of content page?Cyrilic characters in label and ref in pdflatexHow do I produce this Greek letter koppa: Ϟ in pdfLaTeX?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I've tried to write textitP(Eell H)
or textitP(E
to write |
sign . But it didn't work.
pdftex
New contributor
add a comment |
I've tried to write textitP(Eell H)
or textitP(E
to write |
sign . But it didn't work.
pdftex
New contributor
2
Normally logical or is denoted by a wedge pointing downwards:∨
(U+2228 LOGICAL OR). In LaTeX this symbol is available aslor
.
– Henri Menke
Jun 9 at 4:18
1
In case you are trying to typeset source code snippets or other verbatim text in your document, better use packages likelistings
orminted
that provide commands for exactly this purpose.
– siracusa
Jun 9 at 4:40
Might mid be what you're looking for?
– Michael Hardy
Jun 9 at 16:04
add a comment |
I've tried to write textitP(Eell H)
or textitP(E
to write |
sign . But it didn't work.
pdftex
New contributor
I've tried to write textitP(Eell H)
or textitP(E
to write |
sign . But it didn't work.
pdftex
pdftex
New contributor
New contributor
edited Jun 9 at 4:38
siracusa
6,33411733
6,33411733
New contributor
asked Jun 9 at 3:32
Shakhawat HossainShakhawat Hossain
362
362
New contributor
New contributor
2
Normally logical or is denoted by a wedge pointing downwards:∨
(U+2228 LOGICAL OR). In LaTeX this symbol is available aslor
.
– Henri Menke
Jun 9 at 4:18
1
In case you are trying to typeset source code snippets or other verbatim text in your document, better use packages likelistings
orminted
that provide commands for exactly this purpose.
– siracusa
Jun 9 at 4:40
Might mid be what you're looking for?
– Michael Hardy
Jun 9 at 16:04
add a comment |
2
Normally logical or is denoted by a wedge pointing downwards:∨
(U+2228 LOGICAL OR). In LaTeX this symbol is available aslor
.
– Henri Menke
Jun 9 at 4:18
1
In case you are trying to typeset source code snippets or other verbatim text in your document, better use packages likelistings
orminted
that provide commands for exactly this purpose.
– siracusa
Jun 9 at 4:40
Might mid be what you're looking for?
– Michael Hardy
Jun 9 at 16:04
2
2
Normally logical or is denoted by a wedge pointing downwards:
∨
(U+2228 LOGICAL OR). In LaTeX this symbol is available as lor
.– Henri Menke
Jun 9 at 4:18
Normally logical or is denoted by a wedge pointing downwards:
∨
(U+2228 LOGICAL OR). In LaTeX this symbol is available as lor
.– Henri Menke
Jun 9 at 4:18
1
1
In case you are trying to typeset source code snippets or other verbatim text in your document, better use packages like
listings
or minted
that provide commands for exactly this purpose.– siracusa
Jun 9 at 4:40
In case you are trying to typeset source code snippets or other verbatim text in your document, better use packages like
listings
or minted
that provide commands for exactly this purpose.– siracusa
Jun 9 at 4:40
Might mid be what you're looking for?
– Michael Hardy
Jun 9 at 16:04
Might mid be what you're looking for?
– Michael Hardy
Jun 9 at 16:04
add a comment |
2 Answers
2
active
oldest
votes
If you're trying to typeset "the conditional probability of event E given event H", you should write it -- in math mode -- as
P(E mid H)
or, better yet,
Pr(E mid H)
The macro Pr
is a "math operator" and its output (the letter pair "Pr") is typeset using upright Latin letters. The macro mid
inserts a vertical bar and surrounds it with whitespace, as is appropriate for a relational operator symbol.
In TeX and LaTeX, there is an absolutely fundamental distinction between text mode and math mode. Do familiarize yourself with the basics of LaTeX coding. A good starting point is the document A (Not So) Short Introduction to LaTeX, which is available in about two dozen languages.
A full MWE (minimum working example):
documentclassarticle
begindocument
$P(E mid H)$ or, better yet, $Pr(E mid H)$.
enddocument
It worked. Thanks.
– Shakhawat Hossain
Jun 10 at 11:57
add a comment |
You can use either |
or mid
. Using mid
is better as this adds the appropriate amount of spacing around the operator.
More importantly, you should enclose all of these in $...$
to put them in math-mode. You will get an error if you use ell
or mid
outside of math-mode.
Compare:
The full code:
documentclassarticle
usepackage
begindocument
text: P(E$ell$ H) or P(E|H) or P(E$mid$ H)
math-mode: $P(Eell H)$ or $P(E|H)$ or $P(Emid H)$
enddocument
2
Did you meanP(E$mid$H)
?
– Henri Menke
Jun 9 at 4:15
2
@HenriMenke No, I didn't. I was contrasting using math-mode against not using math-mode and I am strongly in favour of using it. Rather this this I would in any case useP($mid$H)
:)
– Andrew
Jun 9 at 5:30
The braces around everything in math mode are superfluous.P($mid$)H
does exactly the same.
– alephzero
Jun 9 at 8:30
2
@alephzero : Are you sure? Look at $3+$ and $3+$ and you will see that they are different. And there is good reason for that. (But I'm not sure if that's what you meant.)
– Michael Hardy
Jun 9 at 16:07
@alephzero That's not true. Braces around an operator in math-mode remove the spacing around it. Try comparing$Amid B$
and$AmidB$
.
– Andrew
Jun 9 at 22:31
|
show 1 more comment
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Shakhawat Hossain is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f494899%2fhow-to-write-sign-or-in-latex%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you're trying to typeset "the conditional probability of event E given event H", you should write it -- in math mode -- as
P(E mid H)
or, better yet,
Pr(E mid H)
The macro Pr
is a "math operator" and its output (the letter pair "Pr") is typeset using upright Latin letters. The macro mid
inserts a vertical bar and surrounds it with whitespace, as is appropriate for a relational operator symbol.
In TeX and LaTeX, there is an absolutely fundamental distinction between text mode and math mode. Do familiarize yourself with the basics of LaTeX coding. A good starting point is the document A (Not So) Short Introduction to LaTeX, which is available in about two dozen languages.
A full MWE (minimum working example):
documentclassarticle
begindocument
$P(E mid H)$ or, better yet, $Pr(E mid H)$.
enddocument
It worked. Thanks.
– Shakhawat Hossain
Jun 10 at 11:57
add a comment |
If you're trying to typeset "the conditional probability of event E given event H", you should write it -- in math mode -- as
P(E mid H)
or, better yet,
Pr(E mid H)
The macro Pr
is a "math operator" and its output (the letter pair "Pr") is typeset using upright Latin letters. The macro mid
inserts a vertical bar and surrounds it with whitespace, as is appropriate for a relational operator symbol.
In TeX and LaTeX, there is an absolutely fundamental distinction between text mode and math mode. Do familiarize yourself with the basics of LaTeX coding. A good starting point is the document A (Not So) Short Introduction to LaTeX, which is available in about two dozen languages.
A full MWE (minimum working example):
documentclassarticle
begindocument
$P(E mid H)$ or, better yet, $Pr(E mid H)$.
enddocument
It worked. Thanks.
– Shakhawat Hossain
Jun 10 at 11:57
add a comment |
If you're trying to typeset "the conditional probability of event E given event H", you should write it -- in math mode -- as
P(E mid H)
or, better yet,
Pr(E mid H)
The macro Pr
is a "math operator" and its output (the letter pair "Pr") is typeset using upright Latin letters. The macro mid
inserts a vertical bar and surrounds it with whitespace, as is appropriate for a relational operator symbol.
In TeX and LaTeX, there is an absolutely fundamental distinction between text mode and math mode. Do familiarize yourself with the basics of LaTeX coding. A good starting point is the document A (Not So) Short Introduction to LaTeX, which is available in about two dozen languages.
A full MWE (minimum working example):
documentclassarticle
begindocument
$P(E mid H)$ or, better yet, $Pr(E mid H)$.
enddocument
If you're trying to typeset "the conditional probability of event E given event H", you should write it -- in math mode -- as
P(E mid H)
or, better yet,
Pr(E mid H)
The macro Pr
is a "math operator" and its output (the letter pair "Pr") is typeset using upright Latin letters. The macro mid
inserts a vertical bar and surrounds it with whitespace, as is appropriate for a relational operator symbol.
In TeX and LaTeX, there is an absolutely fundamental distinction between text mode and math mode. Do familiarize yourself with the basics of LaTeX coding. A good starting point is the document A (Not So) Short Introduction to LaTeX, which is available in about two dozen languages.
A full MWE (minimum working example):
documentclassarticle
begindocument
$P(E mid H)$ or, better yet, $Pr(E mid H)$.
enddocument
edited Jun 9 at 16:49
answered Jun 9 at 6:22
MicoMico
294k32405795
294k32405795
It worked. Thanks.
– Shakhawat Hossain
Jun 10 at 11:57
add a comment |
It worked. Thanks.
– Shakhawat Hossain
Jun 10 at 11:57
It worked. Thanks.
– Shakhawat Hossain
Jun 10 at 11:57
It worked. Thanks.
– Shakhawat Hossain
Jun 10 at 11:57
add a comment |
You can use either |
or mid
. Using mid
is better as this adds the appropriate amount of spacing around the operator.
More importantly, you should enclose all of these in $...$
to put them in math-mode. You will get an error if you use ell
or mid
outside of math-mode.
Compare:
The full code:
documentclassarticle
usepackage
begindocument
text: P(E$ell$ H) or P(E|H) or P(E$mid$ H)
math-mode: $P(Eell H)$ or $P(E|H)$ or $P(Emid H)$
enddocument
2
Did you meanP(E$mid$H)
?
– Henri Menke
Jun 9 at 4:15
2
@HenriMenke No, I didn't. I was contrasting using math-mode against not using math-mode and I am strongly in favour of using it. Rather this this I would in any case useP($mid$H)
:)
– Andrew
Jun 9 at 5:30
The braces around everything in math mode are superfluous.P($mid$)H
does exactly the same.
– alephzero
Jun 9 at 8:30
2
@alephzero : Are you sure? Look at $3+$ and $3+$ and you will see that they are different. And there is good reason for that. (But I'm not sure if that's what you meant.)
– Michael Hardy
Jun 9 at 16:07
@alephzero That's not true. Braces around an operator in math-mode remove the spacing around it. Try comparing$Amid B$
and$AmidB$
.
– Andrew
Jun 9 at 22:31
|
show 1 more comment
You can use either |
or mid
. Using mid
is better as this adds the appropriate amount of spacing around the operator.
More importantly, you should enclose all of these in $...$
to put them in math-mode. You will get an error if you use ell
or mid
outside of math-mode.
Compare:
The full code:
documentclassarticle
usepackage
begindocument
text: P(E$ell$ H) or P(E|H) or P(E$mid$ H)
math-mode: $P(Eell H)$ or $P(E|H)$ or $P(Emid H)$
enddocument
2
Did you meanP(E$mid$H)
?
– Henri Menke
Jun 9 at 4:15
2
@HenriMenke No, I didn't. I was contrasting using math-mode against not using math-mode and I am strongly in favour of using it. Rather this this I would in any case useP($mid$H)
:)
– Andrew
Jun 9 at 5:30
The braces around everything in math mode are superfluous.P($mid$)H
does exactly the same.
– alephzero
Jun 9 at 8:30
2
@alephzero : Are you sure? Look at $3+$ and $3+$ and you will see that they are different. And there is good reason for that. (But I'm not sure if that's what you meant.)
– Michael Hardy
Jun 9 at 16:07
@alephzero That's not true. Braces around an operator in math-mode remove the spacing around it. Try comparing$Amid B$
and$AmidB$
.
– Andrew
Jun 9 at 22:31
|
show 1 more comment
You can use either |
or mid
. Using mid
is better as this adds the appropriate amount of spacing around the operator.
More importantly, you should enclose all of these in $...$
to put them in math-mode. You will get an error if you use ell
or mid
outside of math-mode.
Compare:
The full code:
documentclassarticle
usepackage
begindocument
text: P(E$ell$ H) or P(E|H) or P(E$mid$ H)
math-mode: $P(Eell H)$ or $P(E|H)$ or $P(Emid H)$
enddocument
You can use either |
or mid
. Using mid
is better as this adds the appropriate amount of spacing around the operator.
More importantly, you should enclose all of these in $...$
to put them in math-mode. You will get an error if you use ell
or mid
outside of math-mode.
Compare:
The full code:
documentclassarticle
usepackage
begindocument
text: P(E$ell$ H) or P(E|H) or P(E$mid$ H)
math-mode: $P(Eell H)$ or $P(E|H)$ or $P(Emid H)$
enddocument
answered Jun 9 at 3:49
AndrewAndrew
33.8k35088
33.8k35088
2
Did you meanP(E$mid$H)
?
– Henri Menke
Jun 9 at 4:15
2
@HenriMenke No, I didn't. I was contrasting using math-mode against not using math-mode and I am strongly in favour of using it. Rather this this I would in any case useP($mid$H)
:)
– Andrew
Jun 9 at 5:30
The braces around everything in math mode are superfluous.P($mid$)H
does exactly the same.
– alephzero
Jun 9 at 8:30
2
@alephzero : Are you sure? Look at $3+$ and $3+$ and you will see that they are different. And there is good reason for that. (But I'm not sure if that's what you meant.)
– Michael Hardy
Jun 9 at 16:07
@alephzero That's not true. Braces around an operator in math-mode remove the spacing around it. Try comparing$Amid B$
and$AmidB$
.
– Andrew
Jun 9 at 22:31
|
show 1 more comment
2
Did you meanP(E$mid$H)
?
– Henri Menke
Jun 9 at 4:15
2
@HenriMenke No, I didn't. I was contrasting using math-mode against not using math-mode and I am strongly in favour of using it. Rather this this I would in any case useP($mid$H)
:)
– Andrew
Jun 9 at 5:30
The braces around everything in math mode are superfluous.P($mid$)H
does exactly the same.
– alephzero
Jun 9 at 8:30
2
@alephzero : Are you sure? Look at $3+$ and $3+$ and you will see that they are different. And there is good reason for that. (But I'm not sure if that's what you meant.)
– Michael Hardy
Jun 9 at 16:07
@alephzero That's not true. Braces around an operator in math-mode remove the spacing around it. Try comparing$Amid B$
and$AmidB$
.
– Andrew
Jun 9 at 22:31
2
2
Did you mean
P(E$mid$H)
?– Henri Menke
Jun 9 at 4:15
Did you mean
P(E$mid$H)
?– Henri Menke
Jun 9 at 4:15
2
2
@HenriMenke No, I didn't. I was contrasting using math-mode against not using math-mode and I am strongly in favour of using it. Rather this this I would in any case use
P($mid$H)
:)– Andrew
Jun 9 at 5:30
@HenriMenke No, I didn't. I was contrasting using math-mode against not using math-mode and I am strongly in favour of using it. Rather this this I would in any case use
P($mid$H)
:)– Andrew
Jun 9 at 5:30
The braces around everything in math mode are superfluous.
P($mid$)H
does exactly the same.– alephzero
Jun 9 at 8:30
The braces around everything in math mode are superfluous.
P($mid$)H
does exactly the same.– alephzero
Jun 9 at 8:30
2
2
@alephzero : Are you sure? Look at $3+$ and $3+$ and you will see that they are different. And there is good reason for that. (But I'm not sure if that's what you meant.)
– Michael Hardy
Jun 9 at 16:07
@alephzero : Are you sure? Look at $3+$ and $3+$ and you will see that they are different. And there is good reason for that. (But I'm not sure if that's what you meant.)
– Michael Hardy
Jun 9 at 16:07
@alephzero That's not true. Braces around an operator in math-mode remove the spacing around it. Try comparing
$Amid B$
and $AmidB$
.– Andrew
Jun 9 at 22:31
@alephzero That's not true. Braces around an operator in math-mode remove the spacing around it. Try comparing
$Amid B$
and $AmidB$
.– Andrew
Jun 9 at 22:31
|
show 1 more comment
Shakhawat Hossain is a new contributor. Be nice, and check out our Code of Conduct.
Shakhawat Hossain is a new contributor. Be nice, and check out our Code of Conduct.
Shakhawat Hossain is a new contributor. Be nice, and check out our Code of Conduct.
Shakhawat Hossain is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f494899%2fhow-to-write-sign-or-in-latex%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Normally logical or is denoted by a wedge pointing downwards:
∨
(U+2228 LOGICAL OR). In LaTeX this symbol is available aslor
.– Henri Menke
Jun 9 at 4:18
1
In case you are trying to typeset source code snippets or other verbatim text in your document, better use packages like
listings
orminted
that provide commands for exactly this purpose.– siracusa
Jun 9 at 4:40
Might mid be what you're looking for?
– Michael Hardy
Jun 9 at 16:04