I use the fancyvrb package and I'd like that my Verbatim code is always written with 2pt indention. How can I do that?

closed as unclear what you're asking by Bobyandbob, TeXnician, Troy, siracusa, Zarko Sep 20 '18 at 21:47

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Welcome to TeX.SX! Could you show us a minimal working example (MWE), that illustrates your problem. – Bobyandbob Sep 12 '18 at 14:52
  • 1
    \fvset{xleftmargin=2pt} in the document preamble. – egreg Sep 12 '18 at 14:58
  • I'm voting to close this question as off-topic because it is solved by @egreg comment. – Zarko Sep 20 '18 at 21:47

Let's look at the manual for fancyvrb

Section 4:

Several verbatim environments are available, each with a lot of parameters to customize them. In the following examples we use the Verbatim environment, which is the equivalent of the standard verbatim. The parameters can be set globally using the \fvset macro or in an optional argument after the start of the environment.

Section 4.1.13:

xleftmargin (dimension): indentation to add at the start of each line (Default: 0pt — no left margin).


Add, in your document preamble,

  • Ok, let to say, I have a article document with leftmargin=20mm. And I would like, that any Verbatim listings will be started at \leftmargin position. How can I do that? – Dmitry Voronin Sep 12 '18 at 15:23
  • @DmitryVoronin What do you mean by “a document with leftmargin=20mm”? – egreg Sep 12 '18 at 15:37
  • I mean, that I set leftmargin as article parameter. – Dmitry Voronin Sep 12 '18 at 15:44
  • @DmitryVoronin How do you do it? What do you mean? – egreg Sep 12 '18 at 15:46
  • 3
    @DmitryVoronin Please, add a minimal example of what you mean to your question. A small, but complete document, showing the details. In my experiment, Verbatim respects the inner margin of enumerated lists. – egreg Sep 12 '18 at 16:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.