Tag Info

Hot answers tagged

16

The full explanation can be found in Appendix H of the TeXbook. When TeX considers a word for hyphenation, it splits it into “subwords”. The example in the TeXbook uses “hyphenation”. Markers are added at either end, represented by ., and subwords are considered: . h y p h e n a t i o n . .h hy yp ph he en na at ti io on n. .hy hyp yph phe hen ena nat ati ...


8

I don't know how is this feature implemented in the font, but I guess that Luaotfload is missing support for it. The following code is just quick fix for this issue, it should be fixed in Luaotfload ideally. The full code follows, some explanation is provided bellow: \documentclass{article} \usepackage{fontspec} \usepackage{luacode} \begin{luacode*} local ...


8

If you use the amsmath package, you could employ its \nobreakdash macro to insert a dash or en-dash after which no line break is allowed. Three examples (all from the user guide of the amsmath package): $p$\nobreakdash-adic $n$\nobreakdash-dimensional pages 1\nobreakdash--9 Basically, where you'd normally write - ("dash") in the input file, you would ...


6

You can reset the url-Breaks in the bib-entry with the execute key: @Article{Zwaan2004, Title = {Moving words: Dynamic representations in language comprehension}, Author = {Zwaan, Rolf A. and Madden, Carol J. and Yaxley, Richard H. and Aveyard, Mark E.}, Date = {2004}, Journaltitle ...


3

The seqsplit package is exactly for this. In the example I use the Bera Mono font, because the default monospaced font doesn't have a boldface version. \documentclass{article} \usepackage[T1]{fontenc} \usepackage{beramono} \usepackage{seqsplit} \begin{document} \noindent\texttt{\seqsplit{% ...


3

The seqsplit package is done for that. Here is a little demo of the possibilities (which probably have nothing to do with what you really need). If you don't know it you also might take a look at the dnaseq package. I also give a demo of it \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{lmodern} \usepackage[showframe]{geometry}% ...


3

The autolang=hyphen option does what you want. Here's your example but I've made the margins deliberately large to show the hyphenation. Because of the very big margins this still results in some bad boxes, but this is to be expected. For comparison, the example without autolang=hyphen is given also. (I also corrected the month field to a numeric field, ...


3

This is by no means ideal, but you could define the breakpoint as a \discretionary{<pre-break>}{<post-break>}{<no-break>}: \documentclass{article} \usepackage{showframe}% Just for this example \newcommand{\AB}{% \textsf{A}% \discretionary{\mbox{ is}}{\mbox{contained in }}{\mbox{${}\subseteq{}$}}% \textsf{B/string}% } ...


3

As @AlanMunn has already noted in a comment, you need to use a font encoding other than OT1 (TeX's original font encoding, and still the default for most LaTeX document classes). Assuming you need "only" glyphs that occur in Western and Central European languages, you should probably use the T1 font encoding. Assuming further that one ore more of the long ...


3

If you want to allow hyphenation in a word which already has a hyphen you can use in your language (as I can do it in german) "= \documentclass{article} \usepackage[nynorsk]{babel} \begin{document} \parbox{0pt}{Dr."=disputas} \end{document}


2

The cases of Dr.-disputas and Dr.disputas are completely different. An explicit hyphen makes TeX break the chunk only at it, ignoring hyphenation patterns in the rest of the word parts. With babel for Norsk or Nynorsk you can use "- that allows hyphenation past the hyphen. When Dr.disputas is considered, the general rule for hyphenation enters: it is ...


2

If using LuaLaTeX is an option for you, you may give the following code a try: % !TEX TS-program = lualatex \documentclass{article} \usepackage[nynorsk]{babel} \begin{document} \parbox{0pt}{Dr.-\hspace{0pt}disputas} \end{document} Note that Lua(La)TeX doesn't possess the well-known problem of pdf(La)TeX and Xe(La)TeX of not being able to hyphenate the ...


2

The automatic hyphenation mechanism works by implicitly inserting the equivalent of \discretionary{\char\hyphenchar\font}{}{} which, under normal conditions, means \discretionary{\char`\-}{}{} The primitive \discretionary has three arguments: the pre-break text, the post-break text and the no-break text. The first two are used when a break should be ...


2

With the babel package loaded there is \babelhyphen{nobreak} available (alongside \babelhyphen{soft}, \babelhyphen{hard} and a few others). While it prohibits a break after the dash the following word may still be hyphenated: $n$\babelhyphen{nobreak}dimensional The language ngerman (maybe others, too) defines a shorthand for a non-breaking hyphen: "~. ...


1

hyphenation can be suppressed more directly by setting \hyphenpenalty=10000 to suppress ordinary hyphenation, and \exhyphenpenalty=10000 to prohibit line breaks at explicit hyphens. if un-hyphenated words now extend out into the margins, you probably need to increase the "tolerance" and allow more stretch between words; \tolerance=1000 \emergencystretch=2em ...


1

The simplest way to get correct English hyphenation in your setup is to use \foreignlanguage: \documentclass{article} \usepackage{fontspec} \usepackage{polyglossia} \setmainfont{Cambria} \setsansfont{Candara} \setmonofont{Consolas} \setmainlanguage{greek} \setotherlanguage{english} \begin{document} Αυτό το κείμενο είναι στα ελληνικά ...



Only top voted, non community-wiki answers of a minimum length are eligible