## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Fontsize in tikz \node Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
thag1987
Posts: 17
Joined: Sun Jun 14, 2015 11:19 pm

### Fontsize in tikz \node

I hope this is posted in the right forum. Feel free to give advice how to make these requests better.

I'm trying to deconstruct the figgeri-cv and make changes/simplify wherever possible to start learning latex and at the same time build something useful. Any idea why the \fontsize will not be applied, how could I make it work?

\documentclass[]{article}\usepackage[utf8]{inputenc} % xcolor defines document wide colors that can be easily referenced\RequirePackage{xcolor}	\definecolor{white}{RGB}{255,255,255}	\definecolor{black}{RGB}{0,0,0}	\definecolor{grey}{RGB}{77,77,77}  %%%%%%%%%%% Header %%%%%%%%%%% % TikZ creates PGF (portable graphics) - let's you draw\RequirePackage{tikz}	\newcommand{\header}[3]{%		\begin{tikzpicture}[remember picture,overlay]			% node[<options>](<name>){<text>}			% simple shape with text on it			% [1] creates rectangle 4cm high (grey) box at top of page			\node [rectangle, 					fill={grey},					anchor=north, 					minimum width=\paperwidth, 					minimum height=4cm]					(box) at (current page.north){};			% [2] text {firstname}{lastname} in center of box			\node [anchor=center] 					(name) at (box) {%		      			\fontsize{99pt}{}\color{white}%		      			{#1}{#2}		    		};		    % [3] text under textbox[2] {job title}		    \node [anchor=north]		    		(name) at (name.south) {%				      	\fontsize{999pt}{}\color{white}%				      	{#3}%				    };		\end{tikzpicture}	} \begin{document}	\header{first}{last}	{Job Title}\end{document}

Thanks in advance, I appreciate all comments.

Tags:

Johannes_B
Site Moderator
Posts: 4163
Joined: Thu Nov 01, 2012 4:08 pm
Don't use friggeri-cv as a base to learn LaTeX. Use a decent introduction like LaTeX for complete novices to learn and you will make progress fast.

\selectfont
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Stefan Kottwitz
Posts: 9568
Joined: Mon Mar 10, 2008 9:44 pm
Hi thag!

Learning by reverse engineering and hacking is also a nice way to start and to proceed. At least as addition, also I recommend to take a look into a LaTeX introduction, to get to know the concepts. Behind the code, there are interesting thoughts.

Yes, every time when you set a font attribute, such as by
• \fontencoding{...}
• \fontfamily{...}
• \fontseries{...}
• \fontshape{...}
• \fontsize{...}{...}
you need to call \selectfont finally, so LaTeX looks for a font that matches the attributes.

But that's not basic LaTeX, such commands are usually used by class authors.

Stefan

thag1987
Posts: 17
Joined: Sun Jun 14, 2015 11:19 pm
Thanks guys, \selectfont was the missing part.

I'm looking for the best documentation to learn LaTex, however most beginner resources focus on very basic stuff, like how to create an article and embed some formulas, whereas I'd like to focus a bit more on things beyond that. I'll definitely have a look at the recommended pdf.

Johannes_B
Site Moderator
Posts: 4163
Joined: Thu Nov 01, 2012 4:08 pm
TikZ is a huge and powerful beast, the docmentation has over a thousand pages. It is so big, that my machine has serious problems displaying the pdf.

You might be interested in the reference manual (unofficial): latex2e.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.