如何模仿passwordcard.org生成的卡片?

如何模仿passwordcard.org生成的卡片?

假设我们已经生成了卡片的内容(即,不包括顶部标题行和左侧索引列),例如使用一些伪随机生成器脚本。如何渲染这些内容以模仿来自 passwordcard.org 的外观?

是否可以将内容放入模板(例如纯 txt,或某些支持 csv 的环境等),以便可以轻松复制和粘贴内容,而无需重新输入到单个单元格中(或编写脚本来执行此操作)?

如何生成类似于 passwordcard.org 的卡片,例如这个: 在此处输入图片描述

可能没有边框并且底部有代码,如下所示:

在此处输入图片描述

具有定义的页面尺寸(适合标准名片,3.5 英寸 × 2 英寸)。

答案1

干得好 …

我使用colortbl(loaded by xcolor) 为表格中的行着色,并使用 TikZ 在其周围绘制框架。代码注释中还有一些解释,如果我需要更详细地解释某些内容,请告诉我。

在此处输入图片描述

\documentclass[fontsize=8.5pt]{scrartcl}

% set page size
\usepackage{geometry}
\geometry{
   paperwidth = 3.5in,
   paperheight = 2in,
   margin = 0.15in,
}

% load array for the '>{stuff}' syntax in tabular
\usepackage{array}

% load xcolor to define the colors
% 'table' option loads colortbl (reccomended way)
\usepackage[table]{xcolor}
% define the colors for the rows
\definecolor{row1}{HTML}{FFFFFF}
\definecolor{row2}{HTML}{C1C1C1}
\definecolor{row3}{HTML}{F0C4C1}
\definecolor{row4}{HTML}{D6FDC2}
\definecolor{row5}{HTML}{FFFFC3}
\definecolor{row6}{HTML}{C1C2FF}
\definecolor{row7}{HTML}{F0C5FF}
\definecolor{row8}{HTML}{D6FEFF}

% make rows a bit higher
\renewcommand{\arraystretch}{1.25}

% we want to use TikZ to add the border around the page
% to get it at the right position, compile twice!
\usepackage{tikz}
   \usetikzlibrary{calc}

\begin{document}
% content should be centered and in monotype font:
\centering\ttfamily
% 1. the border, relative to the 'current page' node
\begin{tikzpicture}[remember picture, overlay]
   \draw [rounded corners = 3mm, thick] ($(current page.north west)+(0.1in,-0.1in)$)
      rectangle ($(current page.south east)+(-0.1in,0.1in)$);
\end{tikzpicture}
% 2. the table containing the random codes
% - '>{\scriptsize}' manes add '\scriptsize' to every cell in this col
% - '\rowcolor{row1}' colors the row – who had guessed that ;-)
\begin{tabular}{>{\scriptsize}ll}
                  & Header row with same amount of characters \\
\rowcolor{row1} 1 & Some quite random charachters in this row \\
\rowcolor{row2} 2 & Some quite random+=!@\#\$\%\textasciicircum\&*()\_-\textbackslash|'"`\textasciitilde \\
\rowcolor{row3} 3 & \verb?Some quite random+=!@#$%^&*()_-\|'"`~? \\
\rowcolor{row4} 4 & Some quite random charachters in this row \\
\rowcolor{row5} 5 & Some quite random charachters in this row \\
\rowcolor{row6} 6 & Some quite random charachters in this row \\
\rowcolor{row7} 7 & Some quite random charachters in this row \\
\rowcolor{row8} 8 & Some quite random charachters in this row \\
\end{tabular}

% 3. the smaller code at the bottom
% - \vfill inserst a stretchabe space, so the code is shifted to the
%   bottom of the page
\vfill
\scriptsize
Smaller code
\end{document}

要找到第一行的符号,你可以看看symbols-a4.pdf或者如何查找符号或识别数学符号或字符?

附言:我太懒了,没有从你的图片中输入字符串;-)

相关内容