问题
我正在制作一份拍卖出价表。每张表包含两栏。每栏顶部有拍卖品描述,下方需要有水平线,供竞标者填写出价金额。
我不知道如何执行由水平线组成的垂直填充。有人能告诉我正确的方向吗?
概念输出
This is a description This is a description
on the left column in the right side that
that is followed by also with lines.
lines. ______________________
____________________ ______________________
____________________ ______________________
____________________ ______________________
乳胶
\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{lipsum}
\usepackage{multicol}
\begin{document}
\begin{multicols}{2}
\lipsum[1]
\vspace*{\fill} % How do I add horizontal lines here?
\columnbreak
\lipsum[2]
\vspace*{\fill} % How do I add horizontal lines here?
\end{multicols}
\end{document}
答案1
像这样吗?
\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{lipsum}
\usepackage{fillwith}
\fillwithset{style=rule}
\begin{document}
\noindent
\parbox[t][\textheight]{.475\textwidth}{%
\lipsum[1]
\fillwith
}\hfill
\parbox[t][\textheight]{.475\textwidth}{%
\lipsum[2]
\fillwith
}
\end{document}
基于 Harish Kumar 编写的代码,如前所述。将以下内容保存为fillwith.sty
TeX 可以找到的某个位置<TEXMFHOME>/tex/latex/fillwith/fillwith.sty
,例如,<TEXMFHOME>
您的个人 TEXMF 树的根目录在哪里。
% !TEX encoding = UTF-8 Unicode
\NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX)
[1994/12/01]% LaTeX date must December 1994 or later
\ProvidesPackage{fillwith}
\RequirePackage{xparse,l3keys2e,xcolor}
% BEGIN Expl pkg option setup
\ExplSyntaxOn
\keys_define:nn { fillwith }
{
color .meta:n = {
colour = #1,
},
colour .code:n = {
\colorlet{fillwithcolour}{#1}
},
dotted color .meta:n = {
dotted colour = #1,
},
dotted colour .code:n = {
\colorlet{fillwithdottedcolour}{#1}
},
lliw .meta:n = {
colour = #1,
},
colour .initial:n = gray,
dotted colour .initial:n = black,
}
\ProcessKeysPackageOptions { fillwith }
\NewDocumentCommand\fillwithset { +m }{
\keys_set:nn { fillwith } { #1 }
}
\dim_new:N \l_fillwith_ht_dim
\cs_new_protected_nopar:Nn \fillwith_style: {}
\keys_define:nn { fillwith }
{
cont .bool_set:N = \l_fillwith_cont_bool,
cont .default:n = true,
fillwith~ht .tl_set:N = \l_fillwith_ht_tl,
fillwith~ht .initial:n = 2,
style .choices:nn =
{
rule , dots , unknown
}{
\if_case:w \l_keys_choice_int
\or: \cs_set_protected_nopar:Nn \fillwith_style: { \hrulefill }
\or: \cs_set_protected_nopar:Nn \fillwith_style: { \dotfill }
\else: \cs_set_protected_nopar:Nn \fillwith_style: { \use:c { \l_keys_choice_tl } }
\fi:
},
style .initial:n = dots,
}
% END Expl pkg option setup
% BEGIN \fillwith_fill:
% ref: http://tex.stackexchange.com/a/241139/ Harish Kumar
\cs_new_protected_nopar:Nn \fillwith_fill:
{
\dim_set:Nn \l_fillwith_ht_dim { \medskipamount + \l_fillwith_ht_tl \baselineskip }
\color{fillwithcolour}
\ifhmode
\bool_if:NTF \l_fillwith_cont_bool
{
\vrule height \l_fillwith_ht_dim depth \c_zero_skip width \c_zero_skip
\fillwith_style:
\par
}{
\par
}
\fi
\hrule height \c_zero_skip
\nobreak
\setbox0=\hbox to \hsize{
\skip_horizontal:n { \@totalleftmargin }
\vrule height \l_fillwith_ht_dim depth \c_zero_skip width \c_zero_skip
\fillwith_style:
}
\cleaders \copy0 \vfill \hbox{}
\normalcolor
}
% END \fillwith_fill:
% BEGIN fillwith
\NewDocumentCommand \fillwith { s o }
{%
\group_begin:
\IfValueT { #2 }
{
\keys_set:nn { fillwith } { #2 }
}
\IfBooleanTF { #1 }
{
\bool_set_true:N \l_fillwith_cont_bool
}{
\bool_set_false:N \l_fillwith_cont_bool
}
\fillwith_fill:
\group_end:
}
% END fillwith
% BEGIN fillwithdottedlines
\NewDocumentCommand \fillwithdottedlines { s O { 2 } }
{
\group_begin:
\IfBooleanTF { #1 }
{
\bool_set_true:N \l_fillwith_cont_bool
}{
\bool_set_false:N \l_fillwith_cont_bool
}
\keys_set:nn { fillwith } { style = dots, fillwith~ht=#2 }
\fillwith_fill:
\group_end:
}
% END fillwithdottedlines
\ExplSyntaxOff
\endinput