Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odevzdávací Systém MO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Odevzdávací Systém MO
Commits
18e1c548
Commit
18e1c548
authored
4 years ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
Protokoly: Zkracujeme příliš dlouhé kolonky
parent
79257f58
No related branches found
No related tags found
1 merge request
!81
Generování protokolů a zpracování scanů
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mo/tex/protokol.tex
+37
-1
37 additions, 1 deletion
mo/tex/protokol.tex
mo/tex/test.tex
+1
-0
1 addition, 0 deletions
mo/tex/test.tex
with
38 additions
and
1 deletion
mo/tex/protokol.tex
+
37
−
1
View file @
18e1c548
...
...
@@ -23,7 +23,43 @@
\def\kolo
{
TODO
}
\def\kat
{
TODO
}
\def\field
#1#2
{
\hbox
to #1
{
#2
\hss
}}
\newbox\ellipsisbox
\setbox\ellipsisbox
=
\hbox
{
\bf
~
\dots
~~
}
\directlua
{
function cut
_
box(box
_
nr, max
_
w)
local box = tex.box[box
_
nr]
% nodetree.analyze(box)
local n
local total
_
w = 0
local last
_
visible
for n in node.traverse(box.head) do
local w, h, d = node.dimensions(n, n.next)
total
_
w = total
_
w + w
if total
_
w > max
_
w then
local new = node.copy
_
list(box.head, last
_
visible.next)
tex.box[box
_
nr] = node.hpack(new)
% nodetree.analyze(tex.box[box_nr])
return
end
if n.id == 0 or n.id == 2 or n.id == 29 then
% hlist, rule, glyph
last
_
visible = n
end
end
end
}
\def\limitedbox
#1#2
{
%
\setbox
0=
\hbox
{
#2
}
%
\ifdim
\wd
0 > #1
\relax
\dimen
0=
\dimexpr
#1 -
\wd\ellipsisbox\relax
\directlua
{
cut
_
box(0, tex.dimen[0])
}
%
\setbox
0=
\hbox
{
\box
0
\copy\ellipsisbox
}
%
\fi
\box
0
}
\def\field
#1#2
{
\hbox
to #1
{
\limitedbox
{
#1
}{
#2
}
\hss
}}
\def\fillin
#1
{
\smash
{
\lower
2pt
\hbox
to #1
{
\hrulefill
}}}
% \proto{kód}{jméno}{třída}{škola}{příklad}
...
...
This diff is collapsed.
Click to expand it.
mo/tex/test.tex
+
1
−
0
View file @
18e1c548
...
...
@@ -7,6 +7,7 @@
\proto
{
MO:70-P-III-2:12345
}{
Pokusný Králík
}{
4/4
}{
Gymnázium Na Paloučku, Králíky
}{
P-III-2
}
\proto
{
MO:70-P-III-3:12345
}{
Pokusný Králík
}{
4/4
}{
Gymnázium Na Paloučku, Králíky
}{
P-III-3
}
\proto
{
MO:70-P-III-4:12345
}{
Pokusný Králík
}{
4/4
}{
Gymnázium Na Paloučku, Králíky
}{
P-III-4
}
\proto
{
MO:70-P-III-4:12345
}{
Pokusný Králík
}{
4/4
}{
MŠ, ZŠ a SŠ pro sluchově postižené, Valašské Meziříčí
}{
P-III-4
}
\universal
\blank
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment