0

MWE:

\documentclass[a4paper, 14pt, table]{extarticle}
\usepackage{fontspec}
\usepackage{amsmath}
\usepackage{formular}
\usepackage{unicode-math}

\linespread{1.3}

\setmainfont{Liberation Serif}
\setmathfont{Liberation Serif}
\setsansfont{Liberation Serif}
\setmonofont{Liberation Mono}

\setFRMfontencoding{\encodingdefault}
\setFRMdfontencoding{\encodingdefault}
\setFRMfontfamily{\sfdefault}
\setFRMdfontfamily{\sfdefault}
\setFRMinlinestyle\setFRMfontsize{14pt}\newFRMenvironment{specialFRM}{This stuff breaks }{2}

\begin{document}
\begin{specialFRM}First Line \\Second Line \end{specialFRM}
\end{document}

I have tried looking into CTAN package manual, but English isn't my first language, so I don't understand what I need to do to make this package respect line spacing: https://ctan.org/pkg/formular. Compiler is xetex.

enter image description here

4
  • the package uses its own baseline setting, you have increased the document baseline by 1.3 but you have decreased the packge baseline from its default 18pt to 14pt, perhaps you want something bigger like \setFRMbaselineskip{24pt} instead? Commented Jun 20, 2021 at 22:58
  • Yes, I removed \setFRMbaselineskip{14pt} from the MWE, it still breaks. I actually tried to fix it with \setFRMbaselineskip{24pt} but it didn't work - it moves the line further down with the text.
    – Jzuken
    Commented Jun 20, 2021 at 23:06
  • oh I see what you mean, the coding in the package is a little strange:-) Commented Jun 20, 2021 at 23:28
  • What I want is to get a second line that doesn't get crossed in the picture, my goal is quite simple. But for whatever reason formular just doesn't want to respect line spacing and thinks it works in a one-space environment. So "Second line" that is controlled by \\ gets shifted down further than formular expects, and gets crossed by formulars line. Unfortunately, \setFRMbaselineskip{24pt} just shifts both the line and the "Second line" further down.
    – Jzuken
    Commented Jun 20, 2021 at 23:33

1 Answer 1

1

The package doesn't cope with \linespread that is probably fixable but would take multiple changes all over, simpler is to locally set it back to 1 then use the packages own command to set the font size and baselineskip_

enter image description here



\documentclass[a4paper, 14pt, table]{extarticle}
\usepackage{fontspec}
\usepackage{amsmath}
\usepackage{formular}
\usepackage{unicode-math}


\linespread{1.3}


\setmainfont{Liberation Serif}
\setmathfont{Liberation Serif}
\setsansfont{Liberation Serif}
\setmonofont{Liberation Mono}

\setFRMfontencoding{\encodingdefault}
\setFRMdfontencoding{\encodingdefault}



\setFRMfontfamily{\sfdefault}
\setFRMdfontfamily{\sfdefault}
\setFRMinlinestyle
\setFRMfontsize{14pt}
\setFRMbaselineskip{34pt}
\newFRMenvironment{specialFRM}{This stuff breaks }{2}

\begin{document}

{\linespread{1}
\begin{specialFRM}First Line \\Second Line \end{specialFRM}
}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .