# dotted line with appropriate length for answering a question?

Kindly have a look at this code

\documentclass{article}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\usepackage[small,sf,bf]{titlesec}
\setromanfont{Georgia}
\usepackage{amssymb}
\newcommand{\checkbox}{$\square$}
\begin{document}
If appropriate \checkbox  . Why appropriate, specify? ...........
If inappropriate \checkbox . Why inappropriate, specify? ..............
If appropriate \checkbox . Why appropriate, specify? ...........\\
If inappropriate \checkbox . Why inappropriate, specify? ...........
\end{document}


How can I make a dotted like, of appropriate length so that it is depressed, fainter, has consistent length so that it occupies the remaining white space in the line or has specified length.

What you are probably looking for is \dotfill. Like \hfill, it spreads as much as possible, but inserting dots instead of white space. If you lock \dotfill into a box of fixed width, you get dots of a specific width. The \fillin command takes this width as an optional argument; if it's missing, the width defaults to 3cm.

\documentclass{article}
\usepackage{amssymb}
\newcommand{\checkbox}{$\square$}
\newcommand\fillin[1][3cm]{\makebox[#1]{\dotfill}}
\begin{document}
If appropriate \checkbox  . Why appropriate, specify? \fillin\
If inappropriate \checkbox . Why inappropriate, specify? \fillin[4cm]
If appropriate \checkbox . Why appropriate, specify? \dotfill\\
If inappropriate \checkbox . Why inappropriate, specify? \fillin[2cm]
\end{document}


You can define a macro with an optional variable of the length. If it is not given the dotted line stretches as long as it can (to the end of line).

\documentclass{article}
\usepackage{amssymb}
\newcommand{\checkbox}{$\square$}
%%%%%
\makeatletter

In the definition of \answerline there is a check if an optional argument is given, and then chooses one of the two following commands (first one with optional argument and the second without).