Debian Codegraph @

texmf-dist/doc/latex/sdaps/html/_sources/FAQ.rst.txt

raw
1 Frequently Asked Questions
2 ==========================
3
4 Numeric field input
5 -------------------
6
7 Sometimes the input of longer numbers is required. Freeform text cannot be used
8 so that other methods are necessary. The method presented here is a field of
9 checkboxes, but further options may exist depending on the solution:
10
11 * Use of a unique questionnaire ID and be careful when handing out the questionnaire
12 * :ref:`Codeboxes`, i.e. text fields where a barcode sticker is placed
13
14 In this example, each digit of an 8 digit number is asked for using an
15 :environ:`optiongroup` environment.
16
17 .. sdaps:: Using optiongroup to input longer numbers
18 :sdapsclassic:
19
20 \begin{optiongroup}[vertical]{Please enter the 8 digit number}
21 % Set the value as it would be 1 based otherwise, so we can just
22 % use it directly from the data export
23 \choice[val=0]{0}
24 \choice[val=1]{1}
25 \choice[val=2]{2}
26 \choice[val=3]{3}
27 \choice[val=4]{4}
28 \choice[val=5]{5}
29 \choice[val=6]{6}
30 \choice[val=7]{7}
31 \choice[val=8]{8}
32 \choice[val=9]{9}
33 \question[text=d1]{$\bigsqcup$}
34 \question[text=d2]{$\bigsqcup$}
35 \question[text=d3]{$\bigsqcup$}
36 \question[text=d4]{$\bigsqcup$}
37 \question[text=d5]{$\bigsqcup$}
38 \question[text=d6]{$\bigsqcup$}
39 \question[text=d7]{$\bigsqcup$}
40 \question[text=d8]{$\bigsqcup$}
41 \end{optiongroup}
42
43
44 How can one use images?
45 -----------------------
46
47 The normal LaTeX commands will work as usual. As the image needs to be
48 available during and after the `setup` step of SDAPS extra steps will be
49 required though. The basic problem is that the given LaTeX file is copied
50 into a new directory and the images may not be available then. The following
51 ways exist to deal with this:
52
53 1. Copy all images by passing `--add` for each image
54 2. Place all images into a directory and use `--add` on the directory
55
56 The second option is a good strategy if you have more images. In the example
57 below a directory called `images` is used which has one file called `sdaps.png`.
58 The `\\graphicspath` command is used so that the image can be refered to by its
59 filename rather than the full relative path.
60
61 .. sdaps:: Using `graphicx` together with `\\graphicspath` to place images into a subdirectory
62 :sdapsclassic:
63 :preamble:
64 \usepackage{graphicx}
65 % Do not add a leading ./ as that will cause issues under some conditions!
66 \graphicspath{{images/}}
67
68 The SDAPS logo for the website is \raisebox{-0.8cm}{\includegraphics[width=2cm]{sdaps.png}}.
69
70 With that done, you need to run the following to setup the project
71
72 .. code-block:: shell
73
74 $ sdaps setup tex PROJECT_DIR questionnaire.tex --add images
75
76 Adjusting corner mark positions
77 -------------------------------
78
79 It is possible to adjust the positions of the corner marks. Currently this
80 needs to be done manually. You can override the positions and also update
81 the default page margins using code like the following in the preamble.
82
83 This requires SDAPS version 1.9.10 or later.
84
85 .. code-block:: tex
86
87 % Re-define the default margins (10mm -> 12mm, 12mm -> 15mm)
88 \ExplSyntaxOn
89 \dim_gset:Nn \g_sdaps_edge_left_margin_dim { 12mm }
90 \dim_gset:Nn \g_sdaps_edge_right_margin_dim { 12mm }
91 \dim_gset:Nn \g_sdaps_edge_top_margin_dim { 15mm }
92 \dim_gset:Nn \g_sdaps_edge_bottom_margin_dim { 15mm }
93 \ExplSyntaxOff
94
95 % Modify the top, bottom and left/right margins, these should be 2mm larger
96 \geometry{top=15mm}
97 \geometry{bottom=17mm}
98 \geometry{hmargin=14mm}
99