-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linebreaks for a single \mintinline #31
Comments
The "I want automatic line breaks for long lines" applies to environments only. I've clarified the docs. The current implementation of It seems possible to do what you want, but it will require a completely new version of |
Ok, thanks for the quick answer. |
The |
@gpoore how can I define the option? |
@gembez For all inline content: |
@gembez The default |
I've the same problem as @gembez |
@benkuly I was forgetting that all of the special \usepackage{minted}
\makeatletter
\renewcommand{\minted@inputpyg}{%
\expandafter\let\expandafter\minted@PYGstyle%
\csname PYG\minted@get@opt{style}{default}\endcsname
\VerbatimPygments{\PYG}{\minted@PYGstyle}%
\ifthenelse{\boolean{minted@isinline}}%
{\ifthenelse{\equal{\minted@get@opt{breaklines}{false}}{true}}%
{\let\FV@BeginVBox\relax
\let\FV@EndVBox\relax
\def\FV@BProcessLine##1{%
\FancyVerbFormatLine{%
\FV@BreakByTokenAnywhereHook
\FancyVerbFormatText{\FancyVerbBreakStart##1\FancyVerbBreakStop}}}%
\minted@inputpyg@inline}%
{\minted@inputpyg@inline}}%
{\minted@inputpyg@block}%
}
\makeatother You can change the symbol that appears at the break using |
Hm okay, but this only works when I want to break within the |
@benkuly If you're dealing with a case where a break within the |
Thank you very much 👍 👍 |
When I try to use the code given by gpoore:
This does not make Anyways, I can't find the word |
@arch-linux-tux The code does usually work, but your particular example is failing due to TeX's hyphenation system. \begingroup
\setlength{\rightskip}{0pt plus 1 fil}
<paragraph with \mintedinline that won't normally break>
\endgroup |
By accident, I discovered a strange combination that worked. Up top, I declared \documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{minted}
\usemintedstyle{borland}
\setmintedinline{breaklines} % necessary for breakanywhere to work later on.
\title{EECE5354 Computer Vision: Assignment 1}
\author{Zhanwen Chen}
\date{January 27, 2019}
\begin{document}
\maketitle
\section{Introduction}
This assignment requires implementation of three image processing functions: separation filter with a Gaussian kernel, and two more with my choosing. In addition, other deliverables include a function to limit all image processing functions to only process a sub-region specified by a rectangle, and an example video output with specific operations.
\vspace{5mm}
In my solution, I first refactored the assignment starter script, \mintinline[breakanywhere]{python}{testcv_mt_vid.py}, to use object-oriented approach where I replaced with state attributes all global variables that the program modifies during running.
\section{Implementation of Separation Filter}
1. \mintinline[breakanywhere]{python}{sepFilter2D()} with a Gaussian Kernel that you generate using \mintinline[breakanywhere]{python}{getGaussianKernel()}. (Note that you can get the same results using the module called \mintinline{python}{GaussianBlur()}. But I want you to use \mintinline{python}{sepFilter2D} with a Gaussian Kernel so that you learn how to apply an arbitrary separable filter to an image.)
\end{document} |
What about documents with custom margins? |
@caniko2 Custom margins shouldn't affect |
Is there a way to have a \mintinline|...| that wraps around? I don't really care if it's automatic linebreaks, or if I specify manually where to add a linebreak.
I've read the item I want automatic line breaks for long lines in the documentation, but if I put the first hack given there into my preamble, minted environments are ok but every \mintinline|code here| is rendered so that it's is followed by a newline. (I didn't try the second hack as I don't have linenos installed).
Aside from that, I don't need nor want global auto-linebreaks. What I'd like to have is just something like
\mintinlineautowrap|foo(bar, baz, quux, bla, x, y, z)|
which would automatically wrap around if the line is too short, or
which would be printed with "foo(bar, baz," on one line, and "quux, bla, x, y, z)" on the next.
The text was updated successfully, but these errors were encountered: