Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{scrartcl}
- usepackage[T1]{fontenc}
- usepackage[utf8]{inputenc}
- usepackage{scrlayer-scrpage, scrlayer-notecolumn, lmodern, blindtext,
- ragged2e}
- %% step 1: counter
- newcounter{snmark}
- setcounter{snmark}{0}
- %% step 2: hanging sidenotes, definition from tugboat
- makeatletter
- newcommand*{hangfrom}[1]{%
- setbox@tempboxahbox{{#1}}%
- hangindent wd@tempboxa
- noindentbox@tempboxa}
- makeatletter
- %% step 3: define sidenote marks in the text
- newcommand{makesidenotemark}{%
- textsuperscript{thesnmark}
- }%
- %% step 4: and now the definition of sidenotes
- newcommand{sidenote}[1]{%
- refstepcounter{snmark}% Zähler erhöhen
- makesidenotemark{}% Nummer im Text setzen.
- makenote[paragraphs]{%
- hangfrom{%
- makebox[1em][l]{%
- thesnmark}
- }
- protectRaggedRight{} #1}% Text setzen im Rand
- }
- %% this is, except for the values (».7«) from scrguide.pdf to define
- %% the notecolumn.
- newlength{paragraphscolwidth}
- AfterCalculatingTypearea{%
- setlength{paragraphscolwidth}{.4textwidth}%
- addtolength{paragraphscolwidth}{-marginparsep}%
- }
- recalctypearea
- DeclareNewNoteColumn[%
- position=oddsidemargin+1in
- +.7textwidth
- +marginparsep,
- width=paragraphscolwidth,
- font=footnotesize
- ]{paragraphs}
- %% Delete all sidenotes:
- %renewcommand{sidenote}[1]{relax}
- begin{document}
- begin{addmargin}[0pt]{.3textwidth}
- This is the text with a sidenote{See here.blindtext}.
- blindtext
- And here we have a second paragraph and a second
- sidenotesidenote{blindtext}.
- blindtext
- And this is the big hit: We can have sidenotes which include
- pagebreaks!sidenote{Proof of concept: blindtext{}}
- syncwithnotecolumns[paragraphs]
- And now we somewhere have a table:
- begin{table}[b]
- centering
- begin{tabular}{ll}
- Proofsidenote{From inside the float} & of concept\
- end{tabular}
- caption{This is a table}
- label{tab:table}
- end{table}
- Besides that, we even can have tabulars in the marginsidenote{%
- Tabular in the margin:
- protectbegin{tabular}{|l|l|}protecthline
- a& b\protecthline
- a& b\protecthline
- a& b\protecthline
- protectend{tabular}
- }, but they have
- to be narrow and well protected.
- end{addmargin}
- end{document}
- usepackage{environ}
- makeatletter
- NewEnviron{margintable}{%
- expandafter@margintableexpandafter{BODY}%
- }
- newcommand*@margintable[1]{%
- makenote[paragraphs]{%
- protectbegin{nonfloattable}detokenize{#1}protectend{nonfloattable}
- }%
- }
- newenvironment{nonfloattable}{%
- parnoindentbegin{minipage}{linewidth}
- def@captype{table}%
- }{%
- end{minipage}par
- }
- documentclass{scrartcl}
- usepackage[T1]{fontenc}
- usepackage[utf8]{inputenc}
- usepackage{scrlayer-scrpage, scrlayer-notecolumn, lmodern, blindtext,
- ragged2e}
- %% step 1: counter
- newcounter{snmark}
- setcounter{snmark}{0}
- %% step 2: hanging sidenotes, definition from tugboat
- makeatletter
- newcommand*{hangfrom}[1]{%
- setbox@tempboxahbox{{#1}}%
- hangindent wd@tempboxa
- noindentbox@tempboxa}
- makeatletter
- %% step 3: define sidenote marks in the text
- newcommand{makesidenotemark}{%
- textsuperscript{thesnmark}
- }%
- %% step 4: and now the definition of sidenotes
- newcommand{sidenote}[1]{%
- refstepcounter{snmark}% Zähler erhöhen
- makesidenotemark{}% Nummer im Text setzen.
- makenote[paragraphs]{%
- hangfrom{%
- makebox[1em][l]{%
- thesnmark}
- }
- protectRaggedRight{} #1}% Text setzen im Rand
- }
- %% this is, except for the values (».7«) from scrguide.pdf to define
- %% the notecolumn.
- newlength{paragraphscolwidth}
- AfterCalculatingTypearea{%
- setlength{paragraphscolwidth}{.4textwidth}%
- addtolength{paragraphscolwidth}{-marginparsep}%
- }
- recalctypearea
- DeclareNewNoteColumn[%
- position=oddsidemargin+1in
- +.7textwidth
- +marginparsep,
- width=paragraphscolwidth,
- font=footnotesize
- ]{paragraphs}
- usepackage{environ}
- makeatletter
- NewEnviron{margintable}{%
- expandafter@margintableexpandafter{BODY}%
- }
- newcommand*@margintable[1]{%
- globalletlabeltoset@empty
- @tempcntavalue{table}%
- begin{lrbox}{@tempboxa}
- begin{minipage}{paragraphscolwidth}
- deflabel##1{%
- xdeflabeltoset{%
- labeltoset
- noexpandprotected@writenoexpand@auxout{}{%
- noexpandstringnoexpandnewlabel{##1}{{@currentlabel}{thepage}}}%
- }%
- }%
- def@captype{table}%
- #1%
- end{minipage}
- end{lrbox}%
- setcounter{table}{@tempcnta}%
- makenote[paragraphs]{%
- protectbegin{nonfloattable}detokenize{#1}protectend{nonfloattable}
- }%
- labeltoset
- }
- newenvironment{nonfloattable}{%
- parnoindentbegin{minipage}{linewidth}
- def@captype{table}%
- }{%
- end{minipage}par
- }
- %% Delete all sidenotes:
- %renewcommand{sidenote}[1]{relax}
- begin{document}
- begin{addmargin}[0pt]{.3textwidth}
- This is the text with a sidenote{See here.blindtext}.
- blindtext
- And here we have a second paragraph and a second
- sidenotesidenote{blindtext}.
- blindtext
- And this is the big hit: We can have sidenotes which include
- pagebreaks!sidenote{Proof of concept: blindtext{}}
- syncwithnotecolumns[paragraphs]
- And now we somewhere have a table:
- begin{table}[b]
- centering
- begin{tabular}{ll}
- Proofsidenote{From inside the float} & of concept\
- end{tabular}
- caption{This is a table}
- label{tab:table}
- end{table}
- Besides that, we even can have tabulars in the marginsidenote{%
- Tabular in the margin:
- protectbegin{tabular}{|l|l|}protecthline
- a& b\protecthline
- a& b\protecthline
- a& b\protecthline
- protectend{tabular}
- }, but they have
- to be narrow and well protected.
- begin{margintable}
- centering
- begin{tabular}{|l|l|}hline
- a& b\hline
- a& b\hline
- a& b\hline
- end{tabular}
- caption{This is a second table}%
- label{tab:secondtable}
- end{margintable}
- See also table~ref{tab:secondtable}.
- end{addmargin}
- listoftables
- end{document}
- documentclass{scrartcl}
- usepackage[T1]{fontenc}
- usepackage[utf8]{inputenc}
- usepackage{scrlayer-scrpage, scrlayer-notecolumn, lmodern, blindtext,
- ragged2e}
- %% step 1: counter
- newcounter{snmark}
- setcounter{snmark}{0}
- %% step 2: hanging sidenotes, definition from tugboat
- makeatletter
- newcommand*{hangfrom}[1]{%
- setbox@tempboxahbox{{#1}}%
- hangindent wd@tempboxa
- noindentbox@tempboxa}
- makeatletter
- %% step 3: define sidenote marks in the text
- newcommand{makesidenotemark}{%
- textsuperscript{thesnmark}%
- }%
- %% step 4: and now the definition of sidenotes
- newcommand{sidenote}[1]{%
- refstepcounter{snmark}% Zähler erhöhen
- makesidenotemark{}% Nummer im Text setzen.
- makenote[paragraphs]{%
- hangfrom{%
- makebox[1em][l]{%
- thesnmark}%
- }%
- protectRaggedRightdetokenize{#1}}% Text setzen im Rand
- }
- %% this is, except for the values (».7«) from scrguide.pdf to define
- %% the notecolumn.
- newlength{paragraphscolwidth}
- AfterCalculatingTypearea{%
- setlength{paragraphscolwidth}{.4textwidth}%
- addtolength{paragraphscolwidth}{-marginparsep}%
- }
- recalctypearea
- DeclareNewNoteColumn[%
- position=oddsidemargin+1in
- +.7textwidth
- +marginparsep,
- width=paragraphscolwidth,
- font=footnotesize
- ]{paragraphs}
- usepackage{environ}
- makeatletter
- NewEnviron{margintable}{%
- expandafter@margintableexpandafter{BODY}%
- }
- newcommand*@margintable[1]{%
- makenote*[paragraphs]{%
- begin{nonfloattable}#1end{nonfloattable}%
- }%
- }
- newenvironment{nonfloattable}{%
- parnoindentbegin{minipage}{linewidth}
- def@captype{table}%
- }{%
- end{minipage}par
- }
- usepackage{makeidx}
- %% Delete all sidenotes:
- %renewcommand{sidenote}[1]{relax}
- begin{document}
- begin{addmargin}[0pt]{.3textwidth}
- This is the text with a sidenotesidenote{See here.blindtext}.
- blindtext
- And here we have a second paragraph and a second
- sidenotesidenote{blindtext}.
- blindtext
- And this is the big hit: We can have sidenotes which include
- pagebreaks!sidenote{Proof of concept: blindtext{}}
- syncwithnotecolumns[paragraphs]
- And now we somewhere have a table:
- begin{table}[b]
- centering
- begin{tabular}{ll}
- Proofsidenote{From inside the float} & of concept\
- end{tabular}
- caption{This is a table}
- label{tab:table}
- end{table}
- Besides that, we even can have tabulars in the marginsidenote{%
- Tabular in the margin:
- begin{tabular}{|l|l|}hline
- a& b\hline
- a& b\hline
- a& b\hline
- end{tabular}%
- }, but they have
- to be narrow and well protected.
- begin{margintable}
- centering
- begin{tabular}{|l|l|}hline
- a& b\hline
- a& b\hline
- a& b\hline
- end{tabular}
- caption{This is a second table}%
- label{tab:secondtable}
- end{margintable}
- See also table~ref{tab:secondtable}.
- listoftables
- end{addmargin}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement