TeX - LaTeX Stack Exchange is a question and answer site for
users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
I have some string in variable \somevar, eg. foo\\bar. How can I force LaTeX to ignore newline in \somevar. When I write content of the variable there should be
Why do you store a newline in your variable if you don't want to display it? Maybe you need to make a wrapper around your macro to split the usage? – ℝaphinkMay 10 '11 at 12:23
1
The variable is in document class. Content of the variable comes from user's document and user can put newlines there. One time I can print the variable with newline and another time the newlines are not acceptable but this is still the same text. – jesperMay 10 '11 at 12:28
How about providing an option like \chapter does? You can write \chapter[alternative title]{title} where one can have newlines and the other can't. – ℝaphinkMay 10 '11 at 12:30
\chapterdoes? You can write\chapter[alternative title]{title}where one can have newlines and the other can't. – ℝaphink May 10 '11 at 12:30