zoukankan      html  css  js  c++  java
  • tex 进度条

    documentclass{beamer}
    usepackage{tikz}
    usetikzlibrary{calc}
    
    definecolor{pbblue}{HTML}{0A75A8}% filling color for the progress bar
    definecolor{pbgray}{HTML}{575757}% background color for the progress bar
    
    makeatletter
    defprogressbar@progressbar{} % the progress bar
    
    ewcountprogressbar@tmpcounta% auxiliary counter
    
    ewcountprogressbar@tmpcountb% auxiliary counter
    
    ewdimenprogressbar@pbht %progressbar height
    
    ewdimenprogressbar@pbwd %progressbar width
    
    ewdimenprogressbar@tmpdim % auxiliary dimension
    
    progressbar@pbwd=linewidth
    progressbar@pbht=1.5ex
    
    % the progress bar
    defprogressbar@progressbar{%
    
        progressbar@tmpcounta=insertframenumber
        progressbar@tmpcountb=inserttotalframenumber
        progressbar@tmpdim=progressbar@pbwd
        multiplyprogressbar@tmpdim by progressbar@tmpcounta
        divideprogressbar@tmpdim by progressbar@tmpcountb
    
      egin{tikzpicture}[rounded corners=2pt,very thin]
    
        shade[top color=pbgray!20,bottom color=pbgray!20,middle color=pbgray!50]
          (0pt, 0pt) rectangle ++ (progressbar@pbwd, progressbar@pbht);
    
          shade[draw=pbblue,top color=pbblue!50,bottom color=pbblue!50,middle color=pbblue] %
            (0pt, 0pt) rectangle ++ (progressbar@tmpdim, progressbar@pbht);
    
        draw[color=normal text.fg!50]  
          (0pt, 0pt) rectangle (progressbar@pbwd, progressbar@pbht) 
            node[pos=0.5,color=normal text.fg] {	extnormal{%
                 pgfmathparse{insertframenumber*100/inserttotalframenumber}%
                 pgfmathprintnumber[fixed,precision=2]{pgfmathresult}\,\%%
            }%
        };
      end{tikzpicture}%
    }
    
    addtobeamertemplate{headline}{}
    {%
      egin{beamercolorbox}[wd=paperwidth,ht=4ex,center,dp=1ex]{white}%
        progressbar@progressbar%
      end{beamercolorbox}%
    }
    makeatother
    
    egin{document}
    
    egin{frame}
    test
    end{frame}
    
    egin{frame}
    test
    end{frame}
    
    egin{frame}
    test
    end{frame}
    
    egin{frame}
    test
    end{frame}
    
    end{document}
  • 相关阅读:
    jQuery诞生记-原理与机制
    你所不知的 CSS ::before 和 ::after 伪元素用法
    http中get与post的区别
    Http请求方法
    TCP/IP详解学习笔记(4)-ICMP协议,ping和Traceroute
    TCP/IP详解学习笔记(3)-IP协议,ARP协议,RARP协议
    TCP/IP详解学习笔记(2)-数据链路层
    TCP/IP详解学习笔记(1)-基本概念
    全面解析Java的垃圾回收机制
    深入Java虚拟机:JVM中的Stack和Heap
  • 原文地址:https://www.cnblogs.com/zhangzujin/p/10151821.html
Copyright © 2011-2022 走看看