There is currently no text in this page. You can search for this page title in other pages, or search the related logs, but you do not have permission to create this page.
LaTeX-tips font size color box and math
Comments
GeoGebra use JLaTeXMath (a powerful ally) to show mathematical formulas (text and symbols) using LaTeX.
The first thing to remember is that LaTeX works in two modes text mode and math mode. Enter text must be in text mode and writing mathematical in math mode.
By default when checking the box "LaTeX formula" that enters math mode(font in italic), if we enter text (roman font) must switch to text mode by typing:\text{text text text}
or \mbox{text text text}
Fonts[edit]
Font size[edit]
The size of the fonts can be changed globally with the following commands:
\tiny | \scriptsize | \footnotesize | \small | \normalsize |
\large | \Large | \LARGE | \huge | \Huge |
The command \normalsize back font to its original size. If you want to combine different font sizes should add the commands in braces {...}. This is an example of combination of sizes in math mode:
{\scriptsize A}{\footnotesize B}{\small C}{\normalsize D}{\large E}{\Large F}{\LARGE G}{\huge H}{\Huge I}
This is an example of combination of sizes in text/math mode using \oldstylenums{ ...} command (only math mode):
We can also use the command in text/math mode:\scalebox{h_scale}[v_scale]{...}
where {h_scale} is a positive(negative) number (mandatory) and [v_scale] is a positive number (optional), numbers can be sliders.
\scalebox{2}{\text{{\Huge GeoGebra}, the most powerful, {\small since }}\oldstylenums{ 2001-2012}}
Font Family[edit]
In text mode we have the following families of text, we can use globally or using braces {...}: \rm or {\rm }
\sf or {\sf }
\tt or {\tt }
This is an example:
In math mode we have the following families (default mathrm):
\mathcal{ABC} | \mathrm{abc} | \mathbf{abc} | \mathsf{abc} | \mathit{abc} |
\mathtt{abc} | \mathfrak{abc} | \mathbb{ABC} | \mathscr{ABC} |
Font Series[edit]
For text mode use \bf or {\bf ...} and for math mode use \mathbf{...},
Font Shapes[edit]
For Small Caps in text mode use:\text{{\sc GeoGebra} or \textsc{GeoGebra}
Quotation marks[edit]
Straight quotes "..." is a special character for GeoGebra, should never be used directly in LaTeX.
For a single quotation marks in text mode use:
\text{'Simple'}
and for double quotation marks use:\text{''Doble''}
For more info see http://www.geogebra.org/forum/viewtopic.php?f=8&t=20512&p=77283&hilit=quotes#p77283
Horizontal space.[edit]
For a single spaced in text mode use the space bar for other spaces we have the following commands:\quad
\qquad
\hspace{...}
The command \hspace{...} (and \quad, \qquad also available in math mode) supports the following units of measurement (positive and negative) :
pt | point | (1 in = 72.27 pt) | pc | pica | (1 pc = 12 pt) |
in | inch | (1 in = 25.4 mm) | bp | big point | (1 in = 72 bp) |
cm | centimetre | (1 cm = 10 mm) | mm | millimetre | |
dd | didot point | (1157 dd = 1238 pt) | sp | scaled point | (65536 sp = 1 pt) |
In math mode we have the following commands:
\, | a small space | \: | a medium space | \; | a large space | \! | a negative space (moves things back to the left) |
Boxes and Color (In both modes)[edit]
Text and Math in Color[edit]
The colors supported directly by JLaTeXMath can be found in http://en.wikibooks.org/wiki/LaTeX/Colors#The_68_standard_colors_known_to_dvips
you can use the command:\textcolor{color}{...}
\text{\textcolor{WildStrawberry}{Geo}\textcolor{blue}{G}\textcolor{red}{ebra}}\,\textcolor{green}{\oldstylenums{4.2}
Adding Colors[edit]
If you need to create new color, you can use the command:
\definecolor{mycolour}{rgb}{a,b,c}
the numbers a, b and c must be between 0 and 1, can be a slider, for example:
\definecolor{a}{rgb}{0.63,0.39,0.17}
\definecolor{b}{rgb}{0.63,0.17,0.39}
\definecolor{c}{rgb}{0.39,0.63,0.17}
\definecolor{d}{rgb}{0.39,0.17,0.63}
\definecolor{e}{rgb}{0.17,0.63,0.39}
\definecolor{f}{rgb}{0.17,0.39,0.63}
\text{\textcolor{a}C\textcolor{b}O\textcolor{c}L\textcolor{d}O\textcolor{e}U\textcolor{f}R}
Frame Boxes[edit]
For simple frame boxes (no colors) use :\boxed{2012\text{ is now!}
or\fbox{2012\text{ is now!}
Color Boxes[edit]
A. For a color box (same color in border and background) use:\colorbox{red}{2012\text{ is now!}
B. For a color box (diferent color in border and background) use:\fcolorbox{blue}{red}{2012\text{ is now!}
Rotate Boxes[edit]
If you need to rotate a box (or whatever) use:\rotatebox{angle}{...}
Reflect Boxes[edit]
If you need to reflect a box (or whatever) use:\reflectbox{...}
Phantom Boxes[edit]
Sometimes it is necessary to have these phantom boxes,for systems, control the height under a root, alignment on a formula, etc. It has these three commands:
\phantom{XXX} | space as wide and high as three X’s |
\hphantom{XXX} | space as wide as three X’s; height 0 |
\vphantom{X} | space of width 0, height = height of X |
I think that's all for now, in the future (if I have time) will write a little about tables and matrices. JLaTeXMath supports many mathematical environments (whitout *) I recommend reading Short Math Guide for LATEX ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf If other forum users wish to contribute with examples (math environments) would be great.
LATEX environment[edit]
JLaTeXMath provides a number of different environments work. Each environment begins and ends in the same manner.
\begin{environment}[options]<br/>
...<br/>
\end{environment}
The following environments are supported:
• tabular | • array | • matrix (and variants) | • eqnarray |
• align | • cases | • split | • multline |
Tabular and Array[edit]
The tabular and array environment found in similar way, can be used to typeset material with optional horizontal and vertical lines. The options are:
l | left-justified column | c | centered column | r | right-justified column |
| |
vertical line | || |
double vertical line | & |
column separator |
\\ |
start new row | \hline|| horizontal line
|
\begin{tabular}{| l |c ||r |}
\hline
1 & 2 & 3 \\ \hline
4 & 5 & 6 \\ \hline
7 & 8 & 9 \\
\hline
\end{tabular}
Other example , using \multicolumn and array:
\begin{array}{|c|c|}
\hline
\multicolumn{2}{|c|}{\text{Title}} \\
\hline
x & y\\ \hline
a & b\\
c & c\\
d & e\\ \hline
\end{array}
If you need add column separator (+ for example) and space (1cm), use @{\hspace{1cm}+\hspace{1cm}}:
Matrix[edit]
A basic matrix may be created using the matrix environment, the structures is similar to table-array , entries are specified by row, with columns separated using &
and a new rows separated with \\
. Matrices are usually enclosed in delimiters (default none) of some kind, and while it is possible to use the \left
and \right
commands. The predefined environments which automatically include delimiters:
pmatrix | ( ) |
bmatrix | [ ] |
Bmatrix | { }
|
vmatrix | | | |
Vmatrix | || ||
|
$\mathsf{A}_{m,n} =
\begin{Vmatrix}
a_{1,1} &a_{1,2} &\cdots &a_{1,n} \\
a_{2,1} &a_{2,2} &\cdots &a_{2,n} \\
\vdots & \vdots & \ddots &\vdots \\
a_{m,1} &a_{m,2} &\cdots &a_{m,n}
\end{Vmatrix}$
Small Matrix[edit]
Sometimes you need to write a matrix within text, for this environment have smallmatrix, this works the same way the matrix environment, for example:
Eqnarray[edit]
This environment is designed to write multiline equations or equations that exceed the width of line, it behaves like an array of three columns where the Vrst aligned right, center second and third left. The equations we want to present in this way must be enclosed between \begin{eqnarray}
and \end{eqnarray}
, an example:
Align[edit]
Like eqnarray, but more powerful, you can insert text between lines with the command \intertext{...}
, for example:
Cases[edit]
For piece wise function or definitions use cases environment:
\left\vert x\right\vert =
\begin{cases}
\hphantom{-}x &,\, \text{if }x\geq 0 ,\\
-x&,\, \text{if }x<0
\end{cases}
Split[edit]
For split long math block
Multline[edit]
For multiple lines of math