Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{scrbook}
- usepackage[Export]{adjustbox}
- usepackage{multicol}
- usepackage{graphicx}
- usepackage{calc}
- RequirePackage{expl3}
- RequirePackage{xparse}
- ExplSyntaxOn
- keys_define:nn {pic}
- {
- path .tl_set:N = l_path,
- lines .fp_set:N = l_lines,
- }
- DeclareDocumentCommandpic{m}{
- group_begin:
- IfNoValueF {#1} { keys_set:nn {pic} {#1} }
- fp_set:Nn l_lineheight {fp_eval:n {baselineskip*fp_use:N l_lines }}
- newlength{help}
- setlength{help}{heightof{includegraphics{l_path}}}
- fp_set:Nn l_picheight {help}
- fp_compare:nNnTF {l_lineheight}<{l_picheight}
- {
- fp_set:Nn l_help {fp_eval:n {l_picheight-l_lineheight}}
- noindentincludegraphics[trim=0 0 0 5baselineskip,clip]{l_path}
- }
- {
- noindentincludegraphics{l_path}
- }
- group_end:
- }
- ExplSyntaxOff
- begin{document}
- begin{multicols}{2}
- Some Text
- pic{lines=5,path={example.jpg}}
- end{multicols}
- end{document}
Add Comment
Please, Sign In to add comment