打印出所有相关的文件信息。(也许是一个包裹?)

打印出所有相关的文件信息。(也许是一个包裹?)

我开始制作一个表格,在一个表格中打印出所有相关的文档信息,就像

  • 实际纸张宽度,
  • 字数,
  • 实际字体大小
  • 实际字体类型
  • ...

是否有可用的软件包?或者有人知道我可以在哪里找到缺少的命令(打印出单词数、打印出当前字体、当前字体大小)

\begin{table}[]
\footnotesize
\centering
\begin{tabular}{ll}  
\toprule
Feature & Value\\
\midrule
actual paper width in [cm] &  \printinunitsof{cm}\prntlen{\textwidth}  \\
actual font size & <??> \\   \bottomrule 
\end{tabular}
\end{table}

答案1

我在表格环境中列出了一些对我有用的信息。也许这可以帮助别人:

\documentclass {scrbook}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{array} 
\usepackage{tikz} 
\usepackage{xcolor} 
\usepackage{booktabs} 
\usepackage[showframe]{geometry}
\usepackage{layouts}
\usepackage{lmodern}

%//Colour definitions\\%
\newcommand{\fillOne}{green!35!black}
\newcommand{\fillTwo}{black!10}
\newcommand{\fillThree}{red!10!}
\newcommand{\fillFour}{black!10!blue}

\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} 

% display some document properties
\edef\defaultfont{\fontname\font}  
\edef\defaultsize{\csname f@size\endcsname}  
\newcommand{\currentfont}{\fontname\font}
\newcommand{\currentsize}{\csname f@size\endcsname}


\begin{document}

\newcommand{\printProperties}
{
\newlength{\freewidth}
\begin{table}[]
\footnotesize
\setlength{\freewidth}{\dimexpr\textwidth-6\tabcolsep}
\begin{tabular}{L{.7\freewidth}L{.2\freewidth}L{.10\freewidth}}   
\toprule
Feature & Value \\
\midrule
PaperWidth in [cm]& \printinunitsof{cm}\prntlen{\paperwidth}\\
PaperHeight in [cm]& \printinunitsof{cm}\prntlen{\paperheight}\\
TextWidth in [cm] &  \printinunitsof{cm}\prntlen{\textwidth}  \\
TextHeight in [cm] & \printinunitsof{cm}\prntlen{\textheight}\\
\midrule
MarginParSep in [cm] & \printinunitsof{cm}\prntlen{\marginparsep}\\
MarginParWidth in [cm] & \printinunitsof{cm}\prntlen{\marginparwidth}\\
FootSkip in [cm]& \printinunitsof{cm}\prntlen{\footskip}\\
\midrule
Default Font &  \defaultfont \\
Default Size   & \defaultsize \\
Current Font &  \currentfont \\
Current Size &  \currentsize \\
\midrule
Colour1 & \fillOne & \begin{tikzpicture} \draw[fill=\fillOne, draw=none] (0,0) rectangle (1,.2); \end{tikzpicture}\\
Colour2 & \fillTwo & \begin{tikzpicture} \draw[fill=\fillTwo, draw=none] (0,0) rectangle (1,.2); \end{tikzpicture}\\
Colour3 & \fillThree & \begin{tikzpicture} \draw[fill=\fillThree, draw=none] (0,0) rectangle (1,.2); \end{tikzpicture}\\
Colour4 & \fillFour & \begin{tikzpicture} \draw[fill=\fillFour, draw=none] (0,0) rectangle (1,.2); \end{tikzpicture}\\
\bottomrule 
\end{tabular}
\end{table}
}

\printProperties

\end{document}

其结果是:

在此处输入图片描述

相关内容