From b33b1ab395d5377c1d4dedc5ae0cd05234c2d865 Mon Sep 17 00:00:00 2001 From: Wandmalfarbe Date: Mon, 1 Jul 2019 20:42:58 +0200 Subject: [PATCH] Fixed #2: Long lines in code blocks wrap automatically. --- eisvogel.tex | 11 ++++++++++ examples/without-listings/without-listings.md | 22 ++++++++----------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/eisvogel.tex b/eisvogel.tex index 42d5d3b..c9c9814 100644 --- a/eisvogel.tex +++ b/eisvogel.tex @@ -311,6 +311,17 @@ $if(lhs)$ $endif$ $if(highlighting-macros)$ $highlighting-macros$ + +% Workaround/bugfix from jannick0. +% See https://github.com/jgm/pandoc/issues/4302#issuecomment-360669013) +% or https://github.com/Wandmalfarbe/pandoc-latex-template/issues/2 +% +% Redefine the verbatim environment 'Highlighting' to break long lines (with +% the help of fvextra). Redefinition is necessary because it is unlikely that +% pandoc includes fvextra in the default template. +\usepackage{fvextra} +\DefineVerbatimEnvironment{Highlighting}{Verbatim}{breaklines,commandchars=\\\{\}} + $endif$ $if(tables)$ \usepackage{longtable,booktabs} diff --git a/examples/without-listings/without-listings.md b/examples/without-listings/without-listings.md index 9cf0fab..f8848c5 100644 --- a/examples/without-listings/without-listings.md +++ b/examples/without-listings/without-listings.md @@ -9,23 +9,21 @@ lang: "en" # Vinaque sanguine metuenti cuiquam Alcyone fixus -## Aesculeae domus vincemur et Veneris adsuetus lapsum - -Lorem markdownum Letoia, et alios: figurae flectentem annis aliquid Peneosque ab -esse, obstat gravitate. +Lorem markdownum Letoia, et alios: figurae flectentem annis aliquid Peneosque +abesse obstat. ```java public class Example implements LoremIpsum { - public static void main(String[] args) { - if(args.length < 2) { - System.out.println("Lorem ipsum dolor sit amet"); + public static void map(String[] sortedLeft, Long[] sortedRight, int splitIndex) { + if(sortedLeft == null || sortedRight == null) { + System.err.println("Lorem ipsum dolor sit amet"); } } // Obscura atque coniuge, per de coniunx } ``` -Porrigitur et Pallas nuper longusque cratere habuisse sepulcro pectore fertur. Obscura atque coniuge, per de coniunx, sibi medias -commentaque virgine anima tamen comitemque petis, sed. +Porrigitur et Pallas nuper longusque cratere habuisse sepulcro pectore fertur +obscura atque coniuge. ```html @@ -40,14 +38,12 @@ commentaque virgine anima tamen comitemque petis, sed. ``` -Vertitur iura tum nepotis causa; motus. Diva virtus! Acrota -destruitis vos iubet quo et classis excessere Scyrumve spiro subitusque mente -Pirithoi abstulit, lapides. +Vertitur iura tum nepotis causa; motus. Diva virtus! Acrota destruitis vos +iubet quo et classis excessere. ```sql CREATE TYPE person_t AS ( firstName VARCHAR(50) NOT NULL, - lastName VARCHAR(50) NOT NULL ); CREATE Or REPLACE FUNCTION getFormattedName(person) RETURNS text AS