1

Need to represent a moving car through a service center in beamer. A motion is depicted on the link How to make the length of a car moving on a roller coaster track remain unchanged?. Need a similar type of format. The car needs to move to service center and then leave and this movement should go on. enter image description here

I have tried the following:

\documentclass[aspectratio=169]{beamer}                 % Document class
\usepackage{subcaption}
\usepackage[english]{babel}             % Set language
\mode<presentation>                     % Set options
{
    \usetheme{default}                    % Set theme
    \usecolortheme{rose}              % Set colors
    \usefonttheme{default}                % Set font theme
    \setbeamertemplate{caption}[numbered] % Set caption to be numbered
    }
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\usetikzlibrary{overlay-beamer-styles}
\usetikzlibrary{shapes.geometric, arrows}
\usetikzlibrary {arrows.meta}

\begin{document}
\begin{frame}{Example} \begin{tikzpicture} \draw[black, thick] (0,0) rectangle (3,2) node[pos=.5] {Service center}; \draw[-stealth] (-3,1) -- (0,1) node[midway,above] {Car}; \draw[-stealth] (3,1) -- (6,1) node[midway,above] {Car}; \end{tikzpicture} \end{frame} \end{document}

enter image description here

mathslove
  • 141

1 Answers1

3

Using @CarLaTeX's red sports car from https://github.com/TikZlings/Extravaganza2018/blob/main/samcarter/CarlaDriving/carlatex.pdf

\documentclass[aspectratio=169]{beamer}                 % Document class
\usepackage{subcaption}
\usepackage[english]{babel}             % Set language
\usepackage{subcaption}
\usepackage[english]{babel}             % Set language
\usepackage{nicematrix,tikz}
\mode<presentation>                     % Set options
{
    \usetheme{default}                    % Set theme
    \usecolortheme{rose}              % Set colors
    \usefonttheme{default}                % Set font theme
    \setbeamertemplate{caption}[numbered] % Set caption to be numbered

} \usepackage{tabularx} \usepackage{booktabs, caption} % For table rules \usepackage{fontawesome} \usepackage{charter} % serif \usepackage{colortbl} \usepackage{pdflscape,array,booktabs} \usepackage[font=scriptsize]{caption}

\usepackage{tikz} \usetikzlibrary{tikzmark} \usetikzlibrary{overlay-beamer-styles} \usetikzlibrary{shapes.geometric, arrows} \usetikzlibrary {arrows.meta} \setbeamertemplate{frametitle}[default][center]

\begin{document} \begin{frame} \transduration<1->{0} \frametitle{Example \dots} \begin{tikzpicture}[remember picture,overlay] \node[draw,rectangle,minimum height=2cm,minimum width=3cm] (foo) at (current page.center) {Service center}; \draw[-stealth] ([xshift=1cm]current page.west) -- (foo); \draw[-stealth] (foo) -- ([xshift=-1cm]current page.east); \foreach \x in {1,1.25,...,15}{ \node<+>[xscale=-1] at ([xshift=\x cm]current page.west) {\includegraphics[width=1cm]{carlatex}}; } \node[draw,fill=white,rectangle,minimum height=2cm,minimum width=3cm] at (current page.center) {Service center};
\end{tikzpicture} \end{frame} \end{document}

enter image description here