Warning: Constant MULTISITE already defined in /home/pbmalartu/public_html/wp-config.php on line 107
Warning: Constant SUBDOMAIN_INSTALL already defined in /home/pbmalartu/public_html/wp-config.php on line 108
Warning: Constant DOMAIN_CURRENT_SITE already defined in /home/pbmalartu/public_html/wp-config.php on line 109
Warning: Constant PATH_CURRENT_SITE already defined in /home/pbmalartu/public_html/wp-config.php on line 110
Warning: Constant SITE_ID_CURRENT_SITE already defined in /home/pbmalartu/public_html/wp-config.php on line 111
Warning: Constant BLOG_ID_CURRENT_SITE already defined in /home/pbmalartu/public_html/wp-config.php on line 112
Warning: The magic method Pressbooks\Book::__wakeup() must have public visibility in /home/pbmalartu/public_html/wp-content/plugins/pressbooks/inc/class-book.php on line 62
Warning: Cannot modify header information - headers already sent by (output started at /home/pbmalartu/public_html/wp-config.php:107) in /home/pbmalartu/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1758
Warning: Cannot modify header information - headers already sent by (output started at /home/pbmalartu/public_html/wp-config.php:107) in /home/pbmalartu/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1758
Warning: Cannot modify header information - headers already sent by (output started at /home/pbmalartu/public_html/wp-config.php:107) in /home/pbmalartu/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1758
Warning: Cannot modify header information - headers already sent by (output started at /home/pbmalartu/public_html/wp-config.php:107) in /home/pbmalartu/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1758
Warning: Cannot modify header information - headers already sent by (output started at /home/pbmalartu/public_html/wp-config.php:107) in /home/pbmalartu/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1758
Warning: Cannot modify header information - headers already sent by (output started at /home/pbmalartu/public_html/wp-config.php:107) in /home/pbmalartu/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1758
Warning: Cannot modify header information - headers already sent by (output started at /home/pbmalartu/public_html/wp-config.php:107) in /home/pbmalartu/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1758
Warning: Cannot modify header information - headers already sent by (output started at /home/pbmalartu/public_html/wp-config.php:107) in /home/pbmalartu/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1758
{"id":440,"date":"2016-09-27T20:49:48","date_gmt":"2016-09-27T20:49:48","guid":{"rendered":"https:\/\/pb.malartu.org\/pbuserguide\/chapter\/equations-and-formulas\/"},"modified":"2018-09-20T17:12:21","modified_gmt":"2018-09-20T17:12:21","slug":"equations-and-formulas","status":"publish","type":"chapter","link":"https:\/\/pb.malartu.org\/pbuserguide\/chapter\/equations-and-formulas\/","title":{"rendered":"Equations and Formulas: How to Use LaTeX"},"content":{"raw":"
\n\nIn many academic fields, you may find yourself needing to include a mathematical equation or other formula that requires special characters and formatting. Pressbooks currently supports LaTeX codes, which enables you to simply format these formulas and ensure that they will display correctly in all outputs. This chapter will cover:\n
\n \t
What is LaTeX?<\/li>\n \t
How to create a LaTeX code<\/li>\n \t
Other uses for LaTeX<\/li>\n \t
Other solutions for equations and formulas<\/li>\n<\/ul>\n<\/div>\n
What is LaTeX?<\/h2>\nLaTeX is a programming language used for technical and scientific documents, but in small snippets, it can also be used to easily create formulas and equations in Pressbooks. Each character has its own code, and there are functions for common\u00a0formatting as well.\n\nIf you're familiar with regular expressions, it's similar in that it looks far more complicated than it is, and once you get the basics, you'll never look back. For example, here are a few character codes:\n
\n\n
\n
[latex]alpha[\/latex]<\/td>\n
alpha<\/td>\n<\/tr>\n
\n
[latex]beta[\/latex]<\/td>\n
beta<\/td>\n<\/tr>\n
\n
[latex]cos[\/latex]<\/td>\n
cos<\/td>\n<\/tr>\n
\n
[latex]leq[\/latex]<\/td>\n
leq<\/td>\n<\/tr>\n
\n
[latex]simeq[\/latex]<\/td>\n
simeq<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\nAnd some of the\u00a0formatting options:\n
\n\n
\n
[latex]sqrt{abc}[\/latex]<\/td>\n
sqrt{abc}<\/td>\n<\/tr>\n
\n
[latex]frac{abc}{xyz}[\/latex]<\/td>\n
frac{abc}{xyz}<\/td>\n<\/tr>\n
\n
[latex]overleftarrow{abc}[\/latex]<\/td>\n
overleftarrow{abc}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\nBy combining these character and formatting codes, you can create nearly any formula you can think of. Think of the process as having three elements:\n
\n \t
Your\u00a0formula or equation<\/li>\n \t
LaTeX, a language into which you translate your formula<\/li>\n \t
The shortcode, which Pressbooks uses to translate LaTeX into a\u00a0properly formatted digital version of your formula<\/li>\n<\/ul>\n
How to Use LaTeX<\/h2>\nYou have two options for inputting LaTeX. You can either use PB LaTeX, or you can enable the QuickLaTeX plugin in order to type native LaTeX syntax directly into your chapters.\n
PB LaTeX<\/h3>\nInserting LaTeX into Pressbooks uses shortcodes to keep things simple. Shortcodes are like shortcuts that let you do some formatting with very little effort.\u00a0To add your formula to your book, you simply need to wrap it in the LaTeX shortcode shown\u00a0below, and insert it directly into your chapter, in the visual<\/strong> editor:\n\n
This will automatically convert your formula to a small image to preserve its formatting across exports.<\/p>\n