How to change the font size of line numbers using the Minted Latex Package - latex

I tried redefining the \FancyVerbLine to have a \large, but that didn't help. Is there another way to do this?

That should do the trick. How exactly does your \FancyVerbLine look like? Notice that it’s not enough to put the formatting in – you also need to include the counter command:
\renewcommand\theFancyVerbLine{\large\arabic{FancyVerbLine}}
This should work.

Related

no automatically word wrap with bibliography

I have a problem with my biblatex. My booktitles don't automaticly break lines in my bibliography. Has someone got a hint how to solve this? Is it possible to get an automatic break or do I have to set them manually? And if I so, how do I do that?
Here my biblatex code snippets:
\usepackage[backend=biber,style=authoryear,sorting=nyt,citestyle=authoryear]{biblatex}
\printbibliography[type=book,title={Books}]
See this example at IEEE: after Metrics is a linebreak is missing.
EDIT: I found the solution here
I was curious about the \emph{} style (mine was always underlining). I put a single \normalem in front of the \printbibliography command and it works fine :)
\normalem
\printbibliography[type=book,title={Books}]
Your book titles are underlined, which is preventing line breaks (underlined text doesn't break). I don't think this is a standard behavior, book titles are usually displayed in italics. Perhaps you are using \underline{} inside your bibliography items definitions?

How to prevent LaTeX from hyphenating words containing a dash?

I would like to globally prevent LaTeX from hyphenating 'Objective-C'. I am aware of the \hyphenation command, but I don't see how I can make use of it. If I pass 'Objective-C' to this command, the dash will be treated as a hint to hyphenate the word there.
One solution I found is wrapping Objective-C into an mbox each time I use it. However, the document I am writing contains this name a lot, and wrapping it into an mbox each time is ugly (as is defining a command and using this over and over again in the source code).
Why is defining a new command ugly? It's how \LaTeX\ defines itself.
\def\ObjectiveC{\mbox{Objective-C}}
Use \nobreakdash. That's what LyX produces when I insert a nonbreakingdash and convert it to tex.
As suggested here, you could define a command like this:
\newcommand\dash{\nobreakdash-\hspace{0pt}}
and use it like this
Consider the $n$\dash dimensional manifold ...
Also, you could use the babel package and use "~ as a protected hyphen. I'm not sure if using babel is advisable when writing in english, though.

Latex Beamer: How is it possible to make piece of text in a frame in italics?

I am using Beamer in order to make a presentation. In one of the frames I want to write something like this:
"Italics is like that"
I used a command \it of Beamer for doing this:
\it{Italics} is like that
But as a result I get:
"Italics is like that"
Is it possible to make italics only a piece of text?
I believe you're looking for \textit{}.
Also, in the future, consider asking LaTeX questions on the TeX - LaTeX Stack Exchange site.
\it is a switch, it changes the font series starting from the point it was issued till the end of the current block. Therefore you have to enclose the block of text it should affect:
{\it Italics} is like that
Alternatively you can use \textit as suggested by gotgenes which only affects the text passed to the command within braces:
\textit{Italics} is like that.
What about \emph{text} ?

URL latex linebreak

When a URL is over a line and goes onto a second line, the hyperlink only uses the first line. Is there a way to get around this and yet still have the URL on multiple lines?
You should use the url package:
\usepackage{url}
...
\url{http://long.url.com/... .../stuff}
and it will break it for you at an appropriate place.
I suggest using package:
\usepackage{xurl}
This works fine for me on overleaf.
Example:
\url{https://www.tudelft.nl/ewi/over-de-faculteit/afdelingen/intelligent-systems/pattern-recognition-bioinformatics/pattern-recognition-laboratory/data-and-software/dd-tools/}
At the preamble, just put \usepackage{breakurl} somewhere after \usepackage{hyperref}. The \burl command is defined and, by default, the package also turns the \url command into a synonym of \burl.
Do it the following way. You are good to go!
\begin{document}
\sloppy
For me only this worked:
\PassOptionsToPackage{hyphens}{url}
\usepackage{hyperref}
and with this code to add line breaks after every normal alphabetic character and with *-~'":
\expandafter\def\expandafter\UrlBreaks\expandafter{\UrlBreaks% save the current one
\do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j%
\do\k\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t%
\do\u\do\v\do\w\do\x\do\y\do\z\do\A\do\B\do\C\do\D%
\do\E\do\F\do\G\do\H\do\I\do\J\do\K\do\L\do\M\do\N%
\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V\do\W\do\X%
\do\Y\do\Z\do\*\do\-\do\~\do\'\do\"\do\-}%
answer complited from this site:
https://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url/10401
What packages (hyperref,url) and drivers (pdftex, dvips, etc.) are you using? Are you using the breaklinks option to hyperref?
According to the TeX FAQ you might want to try the breakurl package, though it appears you may simply be out of luck in some cases.
What worked best for me (with pdflatex) was
\usepackage[pdftex]{hyperref}
and then just \url{http://stackoverflow.com/} to create URLs. It only broke URLs at . and /, which was okay for my document. Importantly, other approaches I tried created PDFs where only the first line of the URL was a clickable link, and the destination URL was truncated to this portion, which is pretty confusing and bad.
Long URLs that contain underscores (_) in path segments will not be broken when using \PassOptionsToPackage{hyphens}{url}\usepackage{hyperref}. However, I found that I could solve this problem by manually breaking lines in the displayed label using \\\\, like this:
\href{http://www.researchgate.net/profile/Nick\_Brooks2/publication/220012411\_Cultural\_responses\_to\_aridity\_in\_the\_Middle\_Holocene\_and\_increased\_social\_complexity/links/0922b4f398ad68bc96000000.pdf}{http://www.researchgate.net/profile/Nick\_Brooks2/publication/220012411\_\\Cultural\_responses\_to\_aridity\_in\_the\_Middle\_Holocene\_and\_increased\_social\_\\complexity/links/0922b4f398ad68bc96000000.pdf}
This results in URLs that are a bit prettier (IMO) than the use of \usepackage{breakurl} and \burl, as suggested by Debajyoti Mondal, and allows you to display the full URL if you wish.
There is a simple answer. Use \usepackage[hidelinks]{hyperref} before \begin{document}

Annotated Table of Contents in LaTeX

I'd like to use LaTeX's \tableofcontents command (or some equivalent) to automatically generate a table of contents, but I'd also like to add a sentence or two to each line in the table of contents that describes what the referenced section is about. How can I do this?
The tocloft package and its \cftchapterprecistoc command solved my problem.
Try
\addcontentsline{toc}{section}{sample text}
Follwoing Oliver and simon's advice:
You could redefine the sectioning commands to take a second (possibly optional) argument, and use that to build your argument to \addtocontentsline, and then involk the cooresponding section* command.
I expect you can brute force and ignorance something using addcontentsline.
eg:
\addcontentsline{toc}{section}{text}
however, this will conflict with automagically generated lines if you don't use the starred versions of sections it refers to.
Anything more clean will require messing about with the relevant macros....unless I'm missing something.
I would change the {section} part to {subsection}.
\addcontentsline{toc}{subsection}{sample text}

Resources