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}
  • 相关阅读:
    gin使用validator库参数校验若干实用技巧
    在gin框架中使用JWT
    使用zap接收gin框架默认的日志并配置日志归档
    gin框架路由拆分与注册
    Gin框架介绍及使用
    GO学习-(39) 优雅地关机或重启
    GO学习-(38) Go语言结构体转map[string]interface{}的若干方法
    WPF中不规则窗体与WindowsFormsHost控件的兼容问题完美解决方案
    [ 夜间模式 ] NightVersion
    HDU1518 Square(DFS)
  • 原文地址:https://www.cnblogs.com/zhangzujin/p/10151821.html
Copyright © 2011-2022 走看看