0

I have written a command to put a text in bold and give a line break. It works fine for me in single line text, but if I want to pass it an argument with pair it doesn't work for me.

How could I resolve this error?

This is my EMV:

\documentclass[ebook,11pt,twoside,openright,showtrims]{memoir}

\newcommand{\ccesec}[1]{%
    \par% Start a new paragraph
    \addvspace{\baselineskip}% Space above
    \textbf{#1}%
    %\par
}
\begin{document}
    \ccesec{Cristo se ofreció a su Padre por nuestros pecados \par Toda la vida de Cristo es oblación al Padre}
\end{document}

If I delete \par the error disappears, but I need one new paragraph in this case. In other cases there will be lines without \par.

4
  • 3
    use {\bfseries#1} rather passing the argument to \textbf Feb 12 at 17:20
  • It's fine! Thanks @DavidCarlisle.
    – A. Cedano
    Feb 12 at 17:26
  • Logically they seem line new lines (\\ rather than new paragraphs?) If my Reading of thetext is correct. Feb 12 at 17:27
  • @You are right, this is a new line.
    – A. Cedano
    Feb 12 at 17:31
4

This is more naturally a forced line break than a new paragraph I think, so you could mark it up as

\documentclass[ebook,11pt,twoside,openright,showtrims]{memoir}

\newcommand{\ccesec}[1]{%
    {\par\raggedright% Start a new paragraph
    \addvspace{\baselineskip}% Space above
    \textbf{\ignorespaces#1}%
    \par}%
}
\begin{document}
    \ccesec{
Cristo se ofreció a su Padre por nuestros pecados\\
Toda la vida de Cristo es oblación al Padre}
\end{document}

But if you want to use a paragraph, use the declaration form, \bfseries

\documentclass[ebook,11pt,twoside,openright,showtrims]{memoir}

\newcommand{\ccesec}[1]{%
    {\par\raggedright% Start a new paragraph
    \addvspace{\baselineskip}% Space above
    \bfseries\ignorespaces#1%
    \par}
}
\begin{document}
    \ccesec{
Cristo se ofreció a su Padre por nuestros pecados

Toda la vida de Cristo es oblación al Padre}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.