Text FormattingFormatting text inline with fancyvrb package

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
nick1234
Posts: 4
Joined: Thu Nov 11, 2010 12:39 pm

Formatting text inline with fancyvrb package

Post by nick1234 »

Hello,

Hopefully someone can help with this, I seem to be constantly struggling to get some feature of latex to work. I am using xelatex to dynamically generate pdfs depending on certain parameters passed in to a php function. This all works fine but i need a way of ensuring that the text passed in is safe for output in latex e.g. £*_% etc.

I have been trying to use the fancyvrb package because I was hoping this would mean the text I output could be done so using the default document font and not monospaced font. I guess my problem can be broken down into a few questions:

- Is there a command that enables me to select the default font set for the document? Is this \\normalfont?
- My text needs to be output inline and I dont know how to select a font for the inline \\Verb command. I see how to do it using the \\begin{Verbatim} environment but this results in a new line in my text.
- I also would ideally like it to break the line where it would normally in the flow of the text.

Not much to ask :-)

Im not in any way attached to the fancyvrb package (infact it's seeming like this is the wrong package to be using) so if there is something else easier/better out there that can make safe the latex special characters, output them in the default document font, inline, and line breaking where it normally would, i would happily use this.

Thanks in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply