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}
  • 相关阅读:
    centos8上添加sudoer用户
    centos平台scp通过密钥远程复制文件(免密登录)
    使用 TestNG 并发测试 ;
    maven 添加tomcat依赖
    maven Web项目中POM的配置信息
    找xpath好用的工具(比较少用,针对只能在IE上打开的网站)
    maven 实践 :管理依赖
    maven将依赖打入jar包
    maven scope含义的说明
    Maven编译打包出错:找不到符号
  • 原文地址:https://www.cnblogs.com/zhangzujin/p/10151821.html
Copyright © 2011-2022 走看看