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;








7















I've tried to write textitP(Eell H) or textitP(E to write | sign . But it didn't work.










share|improve this question









New contributor



Shakhawat Hossain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.














  • 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






  • 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











  • Might mid be what you're looking for?

    – Michael Hardy
    Jun 9 at 16:04

















7















I've tried to write textitP(Eell H) or textitP(E to write | sign . But it didn't work.










share|improve this question









New contributor



Shakhawat Hossain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.














  • 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






  • 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











  • Might mid be what you're looking for?

    – Michael Hardy
    Jun 9 at 16:04













7












7








7








I've tried to write textitP(Eell H) or textitP(E to write | sign . But it didn't work.










share|improve this question









New contributor



Shakhawat Hossain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I've tried to write textitP(Eell H) or textitP(E to write | sign . But it didn't work.







pdftex






share|improve this question









New contributor



Shakhawat Hossain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










share|improve this question









New contributor



Shakhawat Hossain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share|improve this question




share|improve this question








edited Jun 9 at 4:38









siracusa

6,33411733




6,33411733






New contributor



Shakhawat Hossain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








asked Jun 9 at 3:32









Shakhawat HossainShakhawat Hossain

362




362




New contributor



Shakhawat Hossain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




New contributor




Shakhawat Hossain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









  • 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






  • 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











  • Might mid be what you're looking for?

    – Michael Hardy
    Jun 9 at 16:04












  • 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






  • 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











  • 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










2 Answers
2






active

oldest

votes


















8














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):



enter image description here



documentclassarticle
begindocument
$P(E mid H)$ or, better yet, $Pr(E mid H)$.
enddocument





share|improve this answer

























  • It worked. Thanks.

    – Shakhawat Hossain
    Jun 10 at 11:57


















5














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:



enter image description here



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





share|improve this answer


















  • 2





    Did you mean P(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 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






  • 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












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.









draft saved

draft discarded


















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









8














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):



enter image description here



documentclassarticle
begindocument
$P(E mid H)$ or, better yet, $Pr(E mid H)$.
enddocument





share|improve this answer

























  • It worked. Thanks.

    – Shakhawat Hossain
    Jun 10 at 11:57















8














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):



enter image description here



documentclassarticle
begindocument
$P(E mid H)$ or, better yet, $Pr(E mid H)$.
enddocument





share|improve this answer

























  • It worked. Thanks.

    – Shakhawat Hossain
    Jun 10 at 11:57













8












8








8







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):



enter image description here



documentclassarticle
begindocument
$P(E mid H)$ or, better yet, $Pr(E mid H)$.
enddocument





share|improve this answer















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):



enter image description here



documentclassarticle
begindocument
$P(E mid H)$ or, better yet, $Pr(E mid H)$.
enddocument






share|improve this answer














share|improve this answer



share|improve this answer








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

















  • 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













5














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:



enter image description here



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





share|improve this answer


















  • 2





    Did you mean P(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 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






  • 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
















5














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:



enter image description here



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





share|improve this answer


















  • 2





    Did you mean P(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 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






  • 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














5












5








5







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:



enter image description here



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





share|improve this answer













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:



enter image description here



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






share|improve this answer












share|improve this answer



share|improve this answer










answered Jun 9 at 3:49









AndrewAndrew

33.8k35088




33.8k35088







  • 2





    Did you mean P(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 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






  • 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





    Did you mean P(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 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






  • 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











Shakhawat Hossain is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form