Is there a way to get the size of \vfill
? I want to do some math with the spacing, and I already tried to do:
\newlength{\newtest}
\settowidth{\newtest}{\vfill}
I got an error.
Any sugestions?
spacing
Is there a way to get the size of \vfill
? I want to do some math with the spacing, and I already tried to do:
\newlength{\newtest}
\settowidth{\newtest}{\vfill}
I got an error.
Any sugestions?
I think you had too many columns and too much markup generally, I think I 'd do this unless you really need the lists to break over a page.
\documentclass{article}
\usepackage{longtable,array}
\setlength\extrarowheight{3pt}
\begin{document}
\begin{longtable}{| p{3.5cm} | p{9cm} |}
\caption{Use case detail}\label{chap3:tab1}\\[12pt]
\endfirsthead
\multicolumn{2}{c}{\tablename\ \thetable\ -- \textit{Continued from previous page}}\\[12pt]
\hline
\endhead
\hline
\multicolumn{2}{r}{\tablename\ \thetable\ -- \textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot
\hline
% --------------------------------------------------------------------------------------------------------------
Use Case ID: & 1\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Use Case Name: & FIXME - Section Name\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Created by:&\hspace{2cm}\vrule\ Date created:\hspace{2cm}\vrule\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Actors &
Doctor\newline
Patient\newline
Patients' Database\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Description: &
The doctor logs into the system, creates/updates the patient medical record, prints the informed consent form and collects it after the patient has signed it.\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Preconditions: &\mbox{}\par\vspace{-\baselineskip}
\begin{enumerate}
\item The doctor is logged into the web software.
\item There is no record for the patient on the patients' database.
\end{enumerate}\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Postconditions: & \\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Trigger: & The doctor logs in the system and presses the \textit{Login} button\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Normal flow: &\mbox{}\par\vspace{-\baselineskip}
\begin{enumerate}
\item the doctor clicks on the \textit{Patients} icon;
\item the doctor clicks on the \textit{Add} button;
\item the doctor prints the consent form by clicking on the dedicated button;
\item the doctor fills in the patient's details;
\item the doctor collects the signed patient's consent form and ticks the dedicated check box;
\end{enumerate}\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Alternative flows: & \\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Exceptions: & \\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Notes and issues: &\\
% --------------------------------------------------------------------------------------------------------------
\hline
\end{longtable}
\end{document}
Spaces are obeyed in verbatim mode and Verbatim
uses \
(backslash-space) when it finds a space in the input. There are some workarounds. In all the examples I omitted \catcode`^=7
, preferring \sp
instead of ^
; but your option can be employed as well.
\documentclass{article}
\usepackage{fancyvrb}
\begin{document}
\begin{Verbatim}[commandchars=\\\{\}]
# visit each \(\langle{}x,y\rangle\in{}s\sp{2}\)
for x in s:
for y in s:
foo(x, y)
\end{Verbatim}
\end{document}
This adds ordinary math atoms, but it should rarely be a concern with respect to spacing.
\documentclass{article}
\usepackage{fancyvrb}
\begin{document}
\newcommand{\?}{}
\begin{Verbatim}[commandchars=\\\{\}]
# visit each \(\langle\?x,y\rangle\in\?s\sp{2}\)
for x in s:
for y in s:
foo(x, y)
\end{Verbatim}
\end{document}
This avoids all possible spacing issues. Notice that a control symbol is used, so there's no need to delimit it with spaces.
\documentclass{article}
\usepackage{fancyvrb}
\begin{document}
\makeatletter
\newcommand{\verbmathspace}{\let\FV@Space\space}
\makeatother
\begin{Verbatim}[commandchars=\\\{\},
codes=\everymath\expandafter{\the\everymath\verbmathspace}]
# visit each \(\langle x, y\rangle\in s\sp{2}\)
for x in s:
for y in s:
foo(x, y)
\end{Verbatim}
\end{document}
In math mode the space is reverted to a normal space, so it will be ignored by TeX rule.
Best Answer
\vfill
is infinite glue. The amount is not a fixed value, but a "rubber length" that can span from0pt
to "infinity". Its real length is known, when TeX constructs its parental vertical box. Experts can inspect the box and determine the exact settings that TeX has chosen. However, there is also an easier way. Many TeX compilers support a feature that tells the position: pdfTeX (the inventor of the feature) in both modes PDF and DVI, XeTeX, LuaTeX). The position is known at the time, when the page is shipped out. Modulesavepos
of packagezref
provides a wrapper that deals with the internals. It records the positions in the auxiliary file (.aux
) as references and makes them available in the next LaTeX run.For the experts that want to debug TeX boxes:
\showbox
expects a box handle and shows the box with its node contents in the.log
file.\showlists
without parameters displays the current vertical main list.\showboxbreadth
and\showboxdepth
are integer registers that control how much of the box contents is shown (boxes can be very huge). Their default values are-1
in LaTeX that suppresses the output..log
file only unless\tracingonline
(also an integer register) is set to a positive value.