My document is a mixture of regular text and code, where I format the code with \texttt{}. To make this a little easier, I added a new command:
\newcommand {\ttt} {\texttt}
so now I just write, \ttt{my code}
whenever I'm referencing code. The problem is that these code sections often have very long "words" between the whitespaces, so I'd like LaTeX to insert linebreaks into my code arbitrarily, without worrying about whether it's at a whitespace or not. Is there some way to add this rule to my new command?
(Edit) Here is a minimal working example of a document where I'd like to have the line break added to the middle of the function name:
\documentclass{article}
\newcommand {\ttt} {\texttt}
\begin{document}
One of the functions in my software is \ttt{myVeryLongFunctionName.MoreFunctionName(parameter1,parameter2,parameter3,parameter4,parameter5)}. It's a very nice function.
\end{document}
\ttt
macro? If not, then the problem isn't with\ttt
, but rather with the hyphenation of your particular set of really long words. Ideally, you should edit your question and provide a small self-contained example of a document that shows what you are describing.\texttt
rules either with or without the macro, but the issue is that I'd like to have line breaks at any location in the text, not just at whitespace characters.