3

I tried to insert a TikZ picture provided below into a beamerposter document. Normal picture

It is generated by the following code (except the arrow in the middle of the "incident beam", it's an excessive detail):

\begin{tikzpicture}
    % axes and origin
    \coordinate (O) at (0, 0);
    \draw node[anchor=north east] {$O$};
    \draw [->] (-3,0)--(3,0) node [pos=0.98, below] {$x$};
    \draw [->] (0,-1)--(0,3) node [pos=0.98, left] {$z$};
    % orts
    \draw [thick, ->] (O)--(1,0) node[pos=1, below] {$\vc e_x$};
    \draw [thick, ->] (O)--(0,1) node[pos=1, left] {$\vc e_z$};
    % vector k and its angle chi
    \coordinate (K) at ({2.6*sin(30)},{2.6*cos(30)});
    \draw [thick, ->] (O)--(K) node[pos=1, right] {$\vc k$};
    \draw ([shift=(60:0.5)] O) arc (60:90:0.5) node[pos=0.35, above] {$\chi$};
    % k projections
    \coordinate (Kx) at (K |- O);
    \coordinate (Kz) at (K -| O);
    \draw [thick, ->](O)--(Kx) node[pos=1.15, below] {$\vc k_x$};
    \draw [thick, ->](O)--(Kz) node[pos=1, left] {$\vc k_z$};
    \draw [dashed] (K)--(Kz);
    \draw [dashed] (K)--(Kx);
    % foton beam
    \draw (-3, 2)--(O) node[pos=0.45, above] {$\ \hbar \omega$};
\end{tikzpicture}

When I insert this piece of code anywhere in the beamerposter document (either within \begin{block}...\end{block}, or just inside the frame), I get this ugly result (the image spans the whole poster width): enter image description here

MWE

\documentclass[final, 24pt]{beamer}\usetheme{Frankfurt}\usecolortheme{orchid}\usefonttheme[onlymath]{serif}\mode<presentation>
\usepackage[orientation=portrait,size=a0,scale=1.4,debug]{beamerposter}
\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage[english, russian]{babel}
\usepackage{tikz}

\newcommand{\vc}[1]{\mathbf {#1}}
\begin{document}
    \begin{frame}{}
        \begin{center}
            \begin{tikzpicture} 
                 % ... picture code given above
            \end{tikzpicture}
        \end{center}
    \end{frame}
\end{document}

How do I make its appearance acceptable? Rescaling by means of

\scalebox{2.2}{
    \begin{tikzpicture}[scale=3] 
          % picture code
    \end{tikzpicture}
}

produces this output (spans the full paper width as well) enter image description here

Then I can make some adjustments to line widths (\draw[..., line width=0.33ex] for example) manually to get reasonable output: enter image description here

I want to ask the community whether there is another way to get the desired result (maybe it is a widely known issue but I have failed to google it directly) and why does direct 'porting' of nice image code from a4 document produce such a garbage?

  • I would simply adjust the tikzpicture to look good with standalone, then use \scalebox or \resizebox to make it bigger. Avoid the [scale=...] option of tikz. – John Kormylo Mar 7 at 19:32
  • @JohnKormylo Excuse me, why should I avoid scale option? Is it deprecated? – StaticZero Mar 7 at 19:47
  • No, but it changes the appearance. IIRC, the tikz manual itself said to avoid scaling the entire plot. – John Kormylo Mar 7 at 20:21
2

Welcome to TeX-SE! You could append some directives to the every path and every node styles. Here is an example.

   \documentclass[final, 24pt]{beamer}\usetheme{Frankfurt}\usecolortheme{orchid}\usefonttheme[onlymath]{serif}\mode<presentation>
\usepackage[orientation=portrait,size=a0,scale=1.4,debug]{beamerposter}
\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage[english, russian]{babel}
\usepackage{tikz}

\newcommand{\vc}[1]{\mathbf {#1}}
\begin{document}
    \begin{frame}{}
        \begin{center}
         \begin{tikzpicture}[scale=12,every path/.append style={
         line width=4*\pgflinewidth},every node/.append style={scale=0.2,transform
         shape}]
             % axes and origin
             \coordinate (O) at (0, 0);
             \draw node[anchor=north east] {$O$};
             \draw [->] (-3,0)--(3,0) node [pos=0.98, below] {$x$};
             \draw [->] (0,-1)--(0,3) node [pos=0.98, left] {$z$};
             % orts
             \begin{scope}[thick]
             \draw [->] (O)--(1,0) node[pos=1, below] {$\vc e_x$};
             \draw [->] (O)--(0,1) node[pos=1, left] {$\vc e_z$};
             % vector k and its angle chi
             \coordinate (K) at ({2.6*sin(30)},{2.6*cos(30)});
             \draw [thick, ->] (O)--(K) node[pos=1, right] {$\vc k$};
             \end{scope}
             \draw ([shift=(60:0.5)] O) arc (60:90:0.5) node[pos=0.35, above] {$\chi$};
             % k projections
             \coordinate (Kx) at (K |- O);
             \coordinate (Kz) at (K -| O);
             \begin{scope}[thick]
             \draw [->](O)--(Kx) node[pos=1.15, below] {$\vc k_x$};
             \draw [->](O)--(Kz) node[pos=1, left] {$\vc k_z$};
             \end{scope}
             \draw [dashed] (K)--(Kz);
             \draw [dashed] (K)--(Kx);
             % foton beam
             \draw (-3, 2)--(O) node[pos=0.45, above] {$\ \hbar \omega$};
         \end{tikzpicture}
        \end{center}
    \end{frame}
\end{document}

enter image description here

Of course I do not know what you like best but you can adjust the scalings to your needs.

EDIT: Fixed the arrows. Because of the way TikZ parses the paths the arguably simplest option is to set the line width via scopes.

  • But vectors here are not recognizable due to the absence of any arrows... – StaticZero Mar 7 at 10:48
  • @StaticZero Good point! I fixed it. – marmot Mar 7 at 16:47

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.