Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 908235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:41:03+00:00 2026-05-15T16:41:03+00:00

I’ve got a framed environment of the memoir class with content like this: \begin{framed}

  • 0

I’ve got a framed environment of the memoir class with content like this:

\begin{framed}
\subsection{Article 1}
Content of Article 1
\subsection{Article 2}
Content: Article 2
\end{framed}

This renders in the following way:

._________________.
|                 |   <-- superfluous whitespace
| Article 1       |
| Content of Art- |
| icle 1          |
|                 |
| Article 2       |
| Content: Artic- |
| le 2            |
.-----------------.

The \subsection{} is introducing the whitespace preceding itself, which I’d prefer not to be there inside this framed environment, though I do want such whitespace in regular text (i.e. outside the framed environment) and for subsections-after-the first one.

When inside the framed environment, I’d like to have formatting essentially like this:

._________________.
| Article 1       |
| Content of Art- |
| icle 1          |
|                 |
| Article 2       |
| Content: Artic- |
| le 2            |
.-----------------.

Any thoughts or suggestions as to how one may achieve this modification to headings at the beginning of the framed environment would be much appreciated.


Edit: Based on mkluwe‘s comments, I’ve rooted out the \subsection command in memoir.cls:

 3314 \newcommand{\subsection}{%
 3315   \subsechook%
 3316   \@startsection{subsection}{2}%  level 2
 3317       {\subsecindent}%            heading indent
 3318       {\beforesubsecskip}%        skip before the heading
 3319       {\aftersubsecskip}%         skip after the heading
 3320       {\normalfont\subsecheadstyle}} % font
 3321 \newcommand{\subsechook}{}
 3322 \newcommand{\setsubsechook}[1]{\renewcommand{\subsechook}{#1}}
 3323 \newlength{\subsecindent}
 3324 \newcommand{\setsubsecindent}[1]{\setlength{\subsecindent}{#1}}
 3325   \setsubsecindent{\z@}
 3326 \newskip\beforesubsecskip
 3327 \newcommand{\setbeforesubsecskip}[1]{\setlength{\beforesubsecskip}{#1}}
 3328   \setbeforesubsecskip{-3.25ex \@plus -1ex \@minus -.2ex}
 3329 \newskip\aftersubsecskip
 3330 \newcommand{\setaftersubsecskip}[1]{\setlength{\aftersubsecskip}{#1}}
 3331   \setaftersubsecskip{1.5ex \@plus .2ex}

So a corollary to my question above would seem to be: How can one refine this subsection command such that e.g. if it’s the first element in an environment (such as the framed environment) its \beforesubsecskip is very small?


Thank you for reading.

Sincerely,

Brian

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:41:03+00:00Added an answer on May 15, 2026 at 4:41 pm

    If it happens infrequently enough you could just use a vspace command as first entry inside each frame. You could even create a new frame environment to do it automatically. In any case you would need to tweak the vspace to take away the right amount of padding. As you want, the new environment below will remove padding for first subsection entry but not for the subsequent ones:

    \newenvironment{subsectframe}{\begin{framed}\vspace{-1.0\baselineskip}}{\end{framed}}
    
    \begin{document}
    
    \begin{subsectframe}
    \subsection{Article 1}
    Content of Article 1
    \subsection{Article 2}
    Content: Article 2
    \end{subsectframe}
    
    \end{document}
    

    I do understand that the problem is “with the subsection”. However I think fixing it by creating a new environment is going to be cleaner solution than trying to alter the subsection command so it intelligently avoids adding space depending on where it is.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.