-1

ETA: This is the original MWE in LyX How to change margin of the document title?

and I have the exact same question, for LyX, just for KOMA article class instead of the standard article class. Unfortunately I can't switch to the standard class instead and I have been unable to figure out on my own how to adapt the code from the answer to KOMA article. Any help would be much appreciated!

LaTeX MWE

\documentclass{scrartcl}

\title{This is a fairly long title for the document which should start at the top of the page}

\begin{document}

\maketitle

\end{document}

Images of the desired behaviour with solution for standard article class here: How to change margin of the document title?

Neridi
  • 21
  • Have you read about \coverpagetopmargin in the KOMA documentation? – henryflower Apr 21 '23 at 10:55
  • I have now, unfortunately I’m still at a loss how to adapt the code to make it work for me. Where LaTeχ is concerned, I’m a user, I don’t have the required knowledge to properly understand how a lot of the code works or which modifications are needed to reach the desired result. If you could provide some more direction, that would be great, thank you. – Neridi Apr 21 '23 at 23:35
  • \coverpagetopmargin is supposed to be adjustable by \renewcommand, so, e.g. \renewcommand{\coverpagetopmargin}{yourdesiredlength}. However, without a minimal example from you it is difficult to demonstrate or test. – henryflower Apr 22 '23 at 07:44
  • An answer would, e.g., depend on whether you are using an in-page title (option titlepage=false, which is default with scrartcl) or a title page (option titlepage=true). And maybe is also depend on other information. So please add a minimal working example starting with \documentclass including \begin{document} and ending with \end{document}. The example should also include eventually used packages relevant for the title and all commands to reproduce your title problem. – cabohah Apr 24 '23 at 06:47
  • @henryflower: Thank you, I tried it, it doesn't seem to be working either.

    Regarding the MWE, as the tags say, I am working with LyX, which has a different syntax than regular LaTeX. The reason why I didn't provide an MWE is because I have linked the question with the precise MWE applying to my situation first thing in my post - except that I, as stated, am using KOMA instead of the regular article class.

    Because of the different syntax, to generate a LaTeX MWE, I would have to export the LyX document to LaTeX, then import it back, which kind of defies the point of using LyX.

    – Neridi Apr 24 '23 at 08:51
  • @henryflower Having once more tried to understand the documentation, I believe \renewcommand{\coverpagetopmargin}{yourdesiredlength} doesn't work because it also requires you to call titlepage=firstiscover, which is however explicitly not what I am looking for, as I want the title to be on the same page as the rest of the text, as dictated by the article layout. – Neridi Apr 24 '23 at 10:21
  • You can also add a minimal working example, if you are using LyX → LyX user questions on TeX stackexchange – cabohah Apr 24 '23 at 14:20
  • @cabohah The example requested with images, with an accepted answer, is linked. It is the exact parallel to my problem, with only one parameter changed, the class. I would've asked under that post, except I lack reputation to do so, a situation not helped by downvoting this question. Which I have answered myself, adapting the code from the original answer as asked. Please explain how backlinking (which is done all the time on this platform) to the precise same problem with a suitable MWE (question is not closed for clarity) and posting the adjusted answer here justifies closing the question. – Neridi Apr 25 '23 at 07:19
  • @Neridi I've already linked a question about how to ask questions about LyX. The answer also explains how to add either a LyX example or a corresponding LaTeX example. So IMHO everything is said and I don't need to explain more. – cabohah Apr 25 '23 at 08:35
  • @cabohah Here. Now you can go ahead and mark it as a duplicate, and thank you for reminding me that it's apparently not enough to do your research, link to the most likely solution for the problem and ask for how the solution already provided can be adapted. I thought it was site policy to read links provided, but apparently that only applies to people like me who couldn't possibly have a clue what they are talking about. – Neridi Apr 26 '23 at 16:30

1 Answers1

0

So the problem appears to have simply been that in the .cls, the command is not \newpage\null\vskip 2em, but \null\vskip 2em. Therefore

\usepackage{etoolbox}
\makeatletter
\patchcmd{\@maketitle}% <cmd>
  {\newpage\null\vskip 2em}{}% <search><replace>
  {}{}% <success><failure>
\makeatother

had to be changed to

\usepackage{etoolbox}
\makeatletter
\patchcmd{\@maketitle}% <cmd>
  {\null\vskip 2em}{}% <search><replace>
  {}{}% <success><failure>
\makeatother

to make it work. The result now is precisely what it should be: enter image description here

Neridi
  • 21