1

I'm using the content published in this link to draw the figure of a computer in TikZ. The options allow me to customize several aspects of the computer, such as color, text and text color. But I don't know how to make the text bigger. The font option in the comp/.style tikzset is already with the \Huge command. As you can see in the image included on the link, the text in the surrounding computers is small. How can I make it larger?

Thank you very much in advance. The link itself provides a MWE to draw the same image I'm refering to.

  • 1
    You should show in question, what you try so far or where you stuck with accommodation of mentioned MWE. – Zarko Mar 23 '17 at 20:18
3

Big enough?

enter image description here

% Computer diagram
% Author: Elke Schubert
\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{fit}

\usepackage{type1cm}


\tikzset{
  comp/.style = {
    minimum width  = 8cm,
    minimum height = 4.5cm,
    text width     = 8cm,
    inner sep      = 0pt,
    text           = green,
    align          = center,
    font           = \fontsize{64}{64}\selectfont,
    transform shape,
    thick
  },
  monitor/.style = {draw = none, xscale = 18/16, yscale = 11/9},
  display/.style = {shading = axis, left color = black!60, right color = black},
  ut/.style      = {fill = gray}
}
\tikzset{
  computer/.pic = {
    % screen (with border)
    \node(-m) [comp, pic actions, monitor]
      {\phantom{\parbox{\linewidth}{\tikzpictext}}};
    % display (without border)
    \node[comp, pic actions, display] {\tikzpictext};
    \begin{scope}[x = (-m.east), y = (-m.north)]
      % filling the lower part
      \path[pic actions, draw = none]
        ([yshift=2\pgflinewidth]-0.1,-1) -- (-0.1,-1.3) -- (-1,-1.3) --
        (-1,-2.4) -- (1,-2.4) -- (1,-1.3) -- (0.1,-1.3) --
        ([yshift=2\pgflinewidth]0.1,-1);
      % filling the border of the lower part
      \path[ut]
        (-1,-2.4) rectangle (1,-1.3)
        (-0.9,-1.4) -- (-0.7,-2.3) -- (0.7,-2.3) -- (0.9,-1.4) -- cycle;
      % drawing the frame of the whole computer
      \path[pic actions, fill = none]
        (-1,1) -- (-1,-1) -- (-0.1,-1) -- (-0.1,-1.3) -- (-1,-1.3) --
        (-1,-2.4) coordinate(sw)coordinate[pos=0.5] (-b west) --
        (1,-2.4) -- (1,-1.3) coordinate[pos=0.5] (-b east) --
        (0.1,-1.3) -- (0.1,-1) -- (1,-1) -- (1,1) -- cycle;
      % node around the whole computer
      \node(-c) [fit = (sw)(-m.north east), inner sep = 0pt] {};
    \end{scope}
  }
}
% We have two rectangle nodes with the common anchors available
% screen (with border): <picname>-m, whole computer: <picname>-c
% The anchor of the whole pic is <picname>-m.center and cannot be changed
\begin{document}
\begin{tikzpicture}
  \pic(comp0) [
    draw,
    fill = gray!30,
    pic text = {Very long}
  ]
  {computer};
  \path(comp0-c.center) pic 
    foreach[count=\i] \farbe in {yellow, orange, red, red!50!blue, blue, green}
    (comp\i) [
      draw = \farbe,
      fill = \farbe!30,
      display/.append style = {left color=\farbe!80!black!80},
      scale = 0.25,
      pic text = {Text \i}
    ] at +(60*\i:8){computer};
  \foreach \i in {1,2,4,5} \draw (comp\i-c) -- (comp0-c);
  \foreach \i in {3,6} \draw (comp\i-m) -- (comp0-c);
\end{tikzpicture}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.