marginnote adds spacing before paragraph
Unwanted spacing
The marginnote package introduces some extra spacing between the section header and the start of a paragraph (this is unwanted). How can this be corrected?
Example


MWE
documentclass{extarticle}
usepackage{lipsum}
usepackage{marginnote}
usepackage{titlesec}
% Shorten the spacing after section headings
titlespacingsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
begin{document}
subsection{Normal spacing}
lipsum[1-4]
subsection{Unwanted spacing}
marginnote{Something very long and interesting. Something very long and interesting.}
lipsum[1]
end{document}
spacing marginnote
add a comment |
Unwanted spacing
The marginnote package introduces some extra spacing between the section header and the start of a paragraph (this is unwanted). How can this be corrected?
Example


MWE
documentclass{extarticle}
usepackage{lipsum}
usepackage{marginnote}
usepackage{titlesec}
% Shorten the spacing after section headings
titlespacingsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
begin{document}
subsection{Normal spacing}
lipsum[1-4]
subsection{Unwanted spacing}
marginnote{Something very long and interesting. Something very long and interesting.}
lipsum[1]
end{document}
spacing marginnote
add a comment |
Unwanted spacing
The marginnote package introduces some extra spacing between the section header and the start of a paragraph (this is unwanted). How can this be corrected?
Example


MWE
documentclass{extarticle}
usepackage{lipsum}
usepackage{marginnote}
usepackage{titlesec}
% Shorten the spacing after section headings
titlespacingsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
begin{document}
subsection{Normal spacing}
lipsum[1-4]
subsection{Unwanted spacing}
marginnote{Something very long and interesting. Something very long and interesting.}
lipsum[1]
end{document}
spacing marginnote
Unwanted spacing
The marginnote package introduces some extra spacing between the section header and the start of a paragraph (this is unwanted). How can this be corrected?
Example


MWE
documentclass{extarticle}
usepackage{lipsum}
usepackage{marginnote}
usepackage{titlesec}
% Shorten the spacing after section headings
titlespacingsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
begin{document}
subsection{Normal spacing}
lipsum[1-4]
subsection{Unwanted spacing}
marginnote{Something very long and interesting. Something very long and interesting.}
lipsum[1]
end{document}
spacing marginnote
spacing marginnote
asked Jan 25 at 17:19
oliversmoliversm
442312
442312
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
This code with a simple marginpar seems to improve the layout:
documentclass{extarticle}
usepackage{lipsum}
usepackage{titlesec}
% Shorten the spacing after section headings
titlespacingsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
begin{document}
subsection{Normal spacing}
lipsum[1-4]
subsection{Unwanted spacing}
leavevmodemarginpar{raggedright Something very long and interesting. Something very long and interesting.}
lipsum[1]
end{document}

If I add aleavevmodeit adds a small indent at the start of the paragraph. (My real document usessetlength{parindent}{0mm}, and hence why I've noticed it). Can this side effect be resolved as well?
– oliversm
Jan 29 at 14:58
It probably adds an interword space. See if addinghspace*{-fontdimen2font(just afterleavevmode) solves your problem.
– Bernard
Jan 29 at 19:44
add a comment |
Adding the hrule makes the spacing more obvious. Evidently marginnote adds a strut at the beginning instead of a simple leavevmode.
documentclass{extarticle}
usepackage{lipsum}
usepackage{marginnote}
usepackage{titlesec}
% Shorten the spacing after section headings
titlespacingsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
begin{document}
subsection{Normal spacing}
lipsum[1-4]
subsection{Unwanted spacing}
%hrule
smash{marginnote{Something very long and interesting. Something very long and interesting.}}%
lipsum[1]
end{document}
This adds in the space for an entire line and gets rid of the vertical alignment.
– oliversm
Jan 29 at 15:02
Did you run it twice? marginnote gets its vertical position from the previous run.
– John Kormylo
Jan 29 at 17:35
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f471867%2fmarginnote-adds-spacing-before-paragraph%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
This code with a simple marginpar seems to improve the layout:
documentclass{extarticle}
usepackage{lipsum}
usepackage{titlesec}
% Shorten the spacing after section headings
titlespacingsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
begin{document}
subsection{Normal spacing}
lipsum[1-4]
subsection{Unwanted spacing}
leavevmodemarginpar{raggedright Something very long and interesting. Something very long and interesting.}
lipsum[1]
end{document}

If I add aleavevmodeit adds a small indent at the start of the paragraph. (My real document usessetlength{parindent}{0mm}, and hence why I've noticed it). Can this side effect be resolved as well?
– oliversm
Jan 29 at 14:58
It probably adds an interword space. See if addinghspace*{-fontdimen2font(just afterleavevmode) solves your problem.
– Bernard
Jan 29 at 19:44
add a comment |
This code with a simple marginpar seems to improve the layout:
documentclass{extarticle}
usepackage{lipsum}
usepackage{titlesec}
% Shorten the spacing after section headings
titlespacingsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
begin{document}
subsection{Normal spacing}
lipsum[1-4]
subsection{Unwanted spacing}
leavevmodemarginpar{raggedright Something very long and interesting. Something very long and interesting.}
lipsum[1]
end{document}

If I add aleavevmodeit adds a small indent at the start of the paragraph. (My real document usessetlength{parindent}{0mm}, and hence why I've noticed it). Can this side effect be resolved as well?
– oliversm
Jan 29 at 14:58
It probably adds an interword space. See if addinghspace*{-fontdimen2font(just afterleavevmode) solves your problem.
– Bernard
Jan 29 at 19:44
add a comment |
This code with a simple marginpar seems to improve the layout:
documentclass{extarticle}
usepackage{lipsum}
usepackage{titlesec}
% Shorten the spacing after section headings
titlespacingsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
begin{document}
subsection{Normal spacing}
lipsum[1-4]
subsection{Unwanted spacing}
leavevmodemarginpar{raggedright Something very long and interesting. Something very long and interesting.}
lipsum[1]
end{document}

This code with a simple marginpar seems to improve the layout:
documentclass{extarticle}
usepackage{lipsum}
usepackage{titlesec}
% Shorten the spacing after section headings
titlespacingsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
begin{document}
subsection{Normal spacing}
lipsum[1-4]
subsection{Unwanted spacing}
leavevmodemarginpar{raggedright Something very long and interesting. Something very long and interesting.}
lipsum[1]
end{document}

edited Jan 26 at 0:51
answered Jan 25 at 20:20
BernardBernard
168k772197
168k772197
If I add aleavevmodeit adds a small indent at the start of the paragraph. (My real document usessetlength{parindent}{0mm}, and hence why I've noticed it). Can this side effect be resolved as well?
– oliversm
Jan 29 at 14:58
It probably adds an interword space. See if addinghspace*{-fontdimen2font(just afterleavevmode) solves your problem.
– Bernard
Jan 29 at 19:44
add a comment |
If I add aleavevmodeit adds a small indent at the start of the paragraph. (My real document usessetlength{parindent}{0mm}, and hence why I've noticed it). Can this side effect be resolved as well?
– oliversm
Jan 29 at 14:58
It probably adds an interword space. See if addinghspace*{-fontdimen2font(just afterleavevmode) solves your problem.
– Bernard
Jan 29 at 19:44
If I add a
leavevmode it adds a small indent at the start of the paragraph. (My real document uses setlength{parindent}{0mm}, and hence why I've noticed it). Can this side effect be resolved as well?– oliversm
Jan 29 at 14:58
If I add a
leavevmode it adds a small indent at the start of the paragraph. (My real document uses setlength{parindent}{0mm}, and hence why I've noticed it). Can this side effect be resolved as well?– oliversm
Jan 29 at 14:58
It probably adds an interword space. See if adding
hspace*{-fontdimen2font (just after leavevmode) solves your problem.– Bernard
Jan 29 at 19:44
It probably adds an interword space. See if adding
hspace*{-fontdimen2font (just after leavevmode) solves your problem.– Bernard
Jan 29 at 19:44
add a comment |
Adding the hrule makes the spacing more obvious. Evidently marginnote adds a strut at the beginning instead of a simple leavevmode.
documentclass{extarticle}
usepackage{lipsum}
usepackage{marginnote}
usepackage{titlesec}
% Shorten the spacing after section headings
titlespacingsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
begin{document}
subsection{Normal spacing}
lipsum[1-4]
subsection{Unwanted spacing}
%hrule
smash{marginnote{Something very long and interesting. Something very long and interesting.}}%
lipsum[1]
end{document}
This adds in the space for an entire line and gets rid of the vertical alignment.
– oliversm
Jan 29 at 15:02
Did you run it twice? marginnote gets its vertical position from the previous run.
– John Kormylo
Jan 29 at 17:35
add a comment |
Adding the hrule makes the spacing more obvious. Evidently marginnote adds a strut at the beginning instead of a simple leavevmode.
documentclass{extarticle}
usepackage{lipsum}
usepackage{marginnote}
usepackage{titlesec}
% Shorten the spacing after section headings
titlespacingsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
begin{document}
subsection{Normal spacing}
lipsum[1-4]
subsection{Unwanted spacing}
%hrule
smash{marginnote{Something very long and interesting. Something very long and interesting.}}%
lipsum[1]
end{document}
This adds in the space for an entire line and gets rid of the vertical alignment.
– oliversm
Jan 29 at 15:02
Did you run it twice? marginnote gets its vertical position from the previous run.
– John Kormylo
Jan 29 at 17:35
add a comment |
Adding the hrule makes the spacing more obvious. Evidently marginnote adds a strut at the beginning instead of a simple leavevmode.
documentclass{extarticle}
usepackage{lipsum}
usepackage{marginnote}
usepackage{titlesec}
% Shorten the spacing after section headings
titlespacingsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
begin{document}
subsection{Normal spacing}
lipsum[1-4]
subsection{Unwanted spacing}
%hrule
smash{marginnote{Something very long and interesting. Something very long and interesting.}}%
lipsum[1]
end{document}
Adding the hrule makes the spacing more obvious. Evidently marginnote adds a strut at the beginning instead of a simple leavevmode.
documentclass{extarticle}
usepackage{lipsum}
usepackage{marginnote}
usepackage{titlesec}
% Shorten the spacing after section headings
titlespacingsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
begin{document}
subsection{Normal spacing}
lipsum[1-4]
subsection{Unwanted spacing}
%hrule
smash{marginnote{Something very long and interesting. Something very long and interesting.}}%
lipsum[1]
end{document}
answered Jan 26 at 16:36
John KormyloJohn Kormylo
44.2k12568
44.2k12568
This adds in the space for an entire line and gets rid of the vertical alignment.
– oliversm
Jan 29 at 15:02
Did you run it twice? marginnote gets its vertical position from the previous run.
– John Kormylo
Jan 29 at 17:35
add a comment |
This adds in the space for an entire line and gets rid of the vertical alignment.
– oliversm
Jan 29 at 15:02
Did you run it twice? marginnote gets its vertical position from the previous run.
– John Kormylo
Jan 29 at 17:35
This adds in the space for an entire line and gets rid of the vertical alignment.
– oliversm
Jan 29 at 15:02
This adds in the space for an entire line and gets rid of the vertical alignment.
– oliversm
Jan 29 at 15:02
Did you run it twice? marginnote gets its vertical position from the previous run.
– John Kormylo
Jan 29 at 17:35
Did you run it twice? marginnote gets its vertical position from the previous run.
– John Kormylo
Jan 29 at 17:35
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f471867%2fmarginnote-adds-spacing-before-paragraph%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown