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}
  • 相关阅读:
    day16-bootstrap和django
    day18-2-django之分页和session
    day17-django的ORM与其他
    day18--django3之Ajax
    day12--前端基础之css
    day12--前端基础之html
    面向对象高级、异常处理和socket
    回归python培训——类与对象、继承、多态和多态性、封装、绑定方法和非绑定方法、反射
    python函数、装饰器、迭代器、生成器
    nginx反向代理时保持长连接
  • 原文地址:https://www.cnblogs.com/zhangzujin/p/10151821.html
Copyright © 2011-2022 走看看