How To Change Color Of Text In Tikz
Colors and fonts
Colored text
Commands that control foreground and groundwork colors need
\usepackage{color}
later the \documentclass
line just earlier \begin{certificate}
.
-
\textcolor{
colorname}{
text}
writes text in a colour which can be specified past name (black, white, red, green, blue or a color name y'all've defined), RGB components, or grayscale. -
\colorbox{
colorname}{
text}
writes text in a box with a colored background. -
\fcolorbox{
framecolor}{
boxcolor}{
text}
writes text in a colored frame. -
\pagecolor{
colorname}
sets the colour of the folio's background. -
\definecolor{
colorname}{
color specification}
lets you define new color names.
\definecolor{gold}{rgb}{0.85,.66,0} This is in \textcolor{carmine}{red} and this box is \colorbox{aureate}{gold}. Text color tin can exist prepare using RGB values (\textcolor[rgb]{0,1,0}{similar so}), or \textcolor[grayness]{0.2}{shades} \textcolor[gray]{0.5}{of} \textcolor[gray]{0.8}{gray}.
produces
This is in crimson and this box is . Text color tin be set using RGB values (similar so), or shades of grey.
Special characters
is created by \dag
, by \ddag
, § past \S
, ¶ by \P
, £ by \pounds
, ö by \"{o}
, © by \copyright
. Many others are available in the math surround, including all the lower instance greek letters and about of the upper case ones. If you only want to employ a few characters you lot can subclass the symbols using $
and $
rather than \begin{math}
and \terminate{math}
. Yous can put a slash through any of these characters by prefacing them with \non
\sqrt{i} | \sqrt[5]{ten+iy} | \ldots | |||
\cdots | \vdots | \ddots | |||
\blastoff | \beta | \gamma | |||
\delta | \omega | \Gamma | |||
\Theta | \Omega | \pm | |||
\mp | \times | \div | |||
\ast | \star | \circ | |||
\bullet | \cdot | \cap | |||
\bigcap | \cup | \bigcup | |||
\uplus | \biguplus | \sqcap | |||
\sqcup | \bigsqcup | \vee | |||
\bigvee | \wedge | \bigwedge | |||
\setminus | \wr | \diamond | |||
\bigtriangleup | \bigtriangledown | \triangleleft | |||
\triangleright | \oplus | ||||
\bigoplus | \ominus | \otimes | |||
\bigotimes | \oslash | \odot | |||
\bigodot | \bigcirc | \amalg | |||
\leq | \prec | \preceq | |||
\ll | \subset | \subseteq | |||
\in | \vdash | ||||
\geq | \succ | \succeq | |||
\gg | \supset | \supseteq | |||
\sqsupseteq | \ni | \dashv | |||
\equiv | \sim | \simeq | |||
\asymp | \approx | \cong | |||
\neq | \doteq | \propto | |||
\models | \perp | \mid | |||
\parallel | \bowtie | \smile | |||
\frown | \leftarrow | \Leftarrow | |||
\rightarrow | \Rightarrow | \leftrightarrow | |||
\Leftrightarrow | \mapsto | \hookleftarrow | |||
\leftharpoonup | \leftharpoondown | \rightleftharpoons | |||
\longleftarrow | \Longleftarrow | \longrightarrow | |||
\Longrightarrow | \longleftrightarrow | \Longleftrightarrow | |||
\longmapsto | \hookrightarrow | \rightharpoonup | |||
\rightharpoondown | \uparrow | \Uparrow | |||
\downarrow | \Downarrow | \updownarrow | |||
\nearrow | \searrow | \swarrow | |||
\nwarrow | \aleph | \hbar | |||
\imath | \jmath | \ell | |||
\wp | \Re | \Im | |||
\prime | \empty | \nabla | |||
\surd | \top | \bot | |||
\| | \angle | \forall | |||
\exists | \neg | \apartment | |||
\natural | \sharp | \backslash | |||
\fractional | \infty | \triangle | |||
\clubsuit | \diamondsuit | \heartsuit | |||
\spadesuit | \sum | \prod | |||
\coprod | \int | \oint |
Font Sizes
These are the available sizes.
tiny | scriptsize | footnotesize | small | normalsize |
large | Large | Big | huge | Huge |
If, for instance, you lot want to use the smallest size, do
{\tiny ... }
If Huge isn't big enough for you, you tin can scale a postscript font up using the commands in the graphicx parcel. \resizebox{!}{5cm}{BIG}
produces
Font Types
Independent of size, these font types are at your disposal :- \textrm
(roman), textit
(italic), \textsc
(Small CAPS), \emph
(emphasis, but note that if you employ emph within emphasized text, y'all will get roman text), \textsl
(slanting), \texttt
(teletype), \textbf
(boldface), \textsf
(sans serif). As long as there'south no disharmonize, these commands can be combined so that, for instance, this is assuming sans serif tin can be produced by \textsf{\textbf{this is bold sans serif}}
.
Postscript Fonts
It is easy to write a document that has postscript fonts. We have package support for helvetica (helvetic), utopia, times, optima, newcentury (newcentu), palatino and courier. To apply palatino, for instance, all y'all demand to exercise is add together
\usepackage{palatino}
to your file. The pifont package has special commands for using the Zapf Dingbats font. \dingfill{40}
completes the line with the specified symbol and \dingline{36}
draws a whole line of symbols.
It's a expert thought to apply a font that's installed in the printer you intend to use.
Font attributes
The commands above should requite y'all sufficient control over fonts. If you don't want to know more at the moment then turn to section 4
Every text font in L A TEX has 5 attributes:
- encoding
- This specifies the guild that characters appear in the font. The well-nigh common values for the font encoding is OT1.
- family
- The proper name for a collection of fonts, usually grouped under a common name by the font foundry. For example, `Adobe Times' and Knuth'southward `Figurer Mod Roman' are font families. In that location are far too many font families to list them all, simply some common ones are:
Internal fontname Fontname In ljmr1? cmr Figurer Mod Roman No cmss Computer Modernistic Sans No cmtt Reckoner Modern Typewriter No cmm Computer Modern Math Italic No cmsy Computer Modern Math Symbols No cmex Reckoner Modern Math Extensions No ptm Adobe Times Yep phv Adobe Helvetica Yes pcr Adobe Courier Yes pun Univers No ppl Palatino Yes pagk AvantGarde-Book Yes pagd AvantGarde-Demi Yeah pbk Bookman Aye put Utopia No popular Optima No pnc New Century Schoolbook Yeah pzd ZapfDingbats Yes rpad Garamond No - series
- How heavy or expanded a font is. For example, `medium weight', `narrow' and `bold extended' are all series. The about common values for the font series are:
chiliad Medium b Assuming bx Assuming extended sb Semi-bold c Condensed - shape
- The form of the letters within a font family unit. For example, `italic', `oblique' and `upright' are all font shapes. The most mutual values for the font shape are:
n Normal (that is `upright' or `roman') it Italic sl Slanted (or `oblique') sc Caps and small caps - size
- The blueprint size of the font, for example `10pt'.
These v parameters specify every L A TDue eastX font, for case:
Font | |||||
OT1 | cmr | m | n | 10pt | Computer Modern Roman 10pt |
OT1 | cmss | thousand | sl | 12pt | Calculator Modern Sans Oblique 12pt |
OML | cmm | m | it | 10pt | Computer Modern Math Italic 10pt |
T1 | ptm | b | information technology | 18pt | Adobe Times Bold Italic 18pt |
Selection commands
In that location are commands to fix attributes one at a time:
Command | Attribute | Value in article grade, 10pt |
\textrm{..} or \rmfamily | family unit | cmr |
\textsf{..} or \sffamily | family | cmss |
\texttt{..} or \ttfamily | family | cmtt |
\textmd{..} or \mdseries | serial | chiliad |
\textbf{..} or \bfseries | series | bx |
\textup{..} or \upshape | shape | n |
\textit{..} or \itshape | shape | it |
\textsl{..} or \slshape | shape | sl |
\textsc{..} or \scshape | shape | sc |
\tiny | size | 5pt |
\scriptsize | size | 7pt |
\footnotesize | size | 8pt |
\small | size | 9pt |
\normalsize | size | 10pt |
\large | size | 12pt |
\Big | size | 14.4pt |
\LARGE | size | 17.28pt |
\huge | size | twenty.74pt |
\Huge | size | 24.88pt |
The depression-level commands used to modify font attributes are equally follows.
\fontencoding{ encoding } |
\fontfamily{ family unit } |
\fontseries{ series } |
\fontshape{ shape } |
\fontsize{ size }{ baselineskip } |
Each of these commands sets ane of the font attributes; \fontsize
too sets \baselineskip
. The actual font in use is non altered by these commands, merely the current attributes are used to make up one's mind which font to use after the next \selectfont
command.
\selectfont
selects a text font, based on the current values of the font attributes. In that location must be a \selectfont
command immediately after any settings of the font parameters by (some of) the five \font<parameter>
commands, before whatsoever post-obit text. For example, it is legal to say:
\fontfamily{ptm}\fontseries{b}\selectfont Some text.
to select bold Times Roman, but it is not legal to say:
\fontfamily{ptm} Some \fontseries{b}\selectfont text.
\usefont{
encoding }{
family }{
series }{
shape }
is short paw for the equivalent \font
... commands followed by\selectfont
.
Source: http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/latex_advanced/colorandfonts.html
Posted by: holderbray1962.blogspot.com
0 Response to "How To Change Color Of Text In Tikz"
Post a Comment