0

I'm trying to generate a few documents based on answers in an Excel sheet. One of the questions in the excel sheet generates a \newcommand that is quite long.

For example:

\newcommand\articles{\colorbox{teal}{inhumande treatment (article 3), religious compulsion (article 9), and \his right for protec lorem ipsum dolor sit amet (article 9)\xspace}}

I then use this \articles to input this text piece in several places in my document.

However I cannot get it to "flow" like normal text and it will always place itself on one row, wheras I want it to flow just like any other text and break row if needed.

Any suggestions?

Update The \colorbox prohibited the text to flow normally, after removal of the colorbox inside the \newcommand, everything worked as expected.

3
  • 3
    please show a small but complete example from your description articles (onot \article) should act the same way as inhumande treatment (article 3), religious compulsion (article 9), and \his right for protec lorem ipsum dolor sit amet (article 9)\xspace so if somethig s preventing that from line breaking it is code not show and unrelated to \newcommand Commented Sep 27, 2022 at 12:53
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Sep 27, 2022 at 13:11
  • Everything updated to match. Answer added. Commented Sep 27, 2022 at 13:19

1 Answer 1

1

Colorbox does not allow the text to flow naturally, when I removed the color box, it simply worked fine.

The reason for the colorbox was to debug and really make sure that we proofread all the variables in the text.

3
  • 2
    This answer references code not mentioned in the question so only you have seen, so it is not so useful to anyone else. Please fix the question to have an example of the problem, Commented Sep 27, 2022 at 12:55
  • Updated question to match. Commented Sep 27, 2022 at 13:13
  • Please add a MWE to your question. As it is only you can understand the question and the answer Commented Jun 27, 2023 at 2:54

You must log in to answer this question.

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