I use LaTeX after a while, but never got dirty hands announcing a new team as I try to avoid this.
However, I need to add monospaced text often in my document, and I use it \verbfor that, which is good, except that the font size of the verb is larger than the regular font of the text. So I need to resize the font and cancel it like \small{}\verb#My monospace code#\normalsize{}. This is not very convenient and error prone.
\verb
\small{}\verb#My monospace code#\normalsize{}
Is there a better way to do this? Can I define a new team for this? How?
Defining new commands that act like verbatim commands is actually quite complicated. The LaTeX package verbatimcontains some materials that will help.
verbatim
If you use the package times, Computer Modern text font is not suitable for PostScript times fonts. For a more suitable font font (typewriter) try
times
\renewcommand{\ttdefault}{aett}
Why not use the command \texttt{}to get a monospaced text?
\texttt{}
, \verb , ( \verb , , \texttt{}). , , :
\newcommand{\smalltt}[1]{{\small\texttt{#1}}}
[1] , ( .) , , \smalltt{my smaller monospaced text.}.
[1]
\smalltt{my smaller monospaced text.}
, \verb . , :
\documentclass{article} \begin{document} Text and \verb|verbatim % text|. \end{document}
, , . fancyvrb .
.sty, : \ Renewcommand {\ @} {\ ttfamily\}
:
\newcommand{\zope}{Zope}
, \zope , , . , , .
\zope
\newcommand{\bi}{\begin{itemize}} \newcommand{\ei}{\end{itemize}}
\bi \item 1st item \item 2nd item \item and so on... \ei
, .
.
\newcommand{\filepath}[1]{\verb!#1!}
, - \filepath{abc.xml}, \verb!abc.xml! .
\filepath{abc.xml}
\verb!abc.xml!
\newcommand{\ida}[1]{\textcolor{blue}{#1}}
\ida{myVariable} \textcolor{blue}{myVariable}
\ida{myVariable}
\textcolor{blue}{myVariable}
Hope this little tutorial helps serve the purpose.
Source: https://habr.com/ru/post/1723492/More articles:LINQ to SQL, ExecuteQuery, etc. - sqlA simple XSLT question: how can I add a closing "/" at the end of a single tag? - xhtmlList in a dictionary loop in Python - pythonC # Drag and drop from my custom application to notepad - c #IOError with Python and OpenCV - pythonCreating NSMatrix programmatically, Snow Leopard - objective-chttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1723494/irepository-and-relational-data&usg=ALkJrhgvVs6buvmXgFXMbVe7Kel3uDw5rAАутентификация ASP.NET, SilverLight, WCF и форм - Как настроить конечные точки? - silverlightHow to create NSMatrix NSImageCell in Builder interface in 10.6 - objective-cHow to configure pub sub for multiple subscribers using Rhino Service Bus? - servicebusAll Articles