# Tag Info

6

Please always post complete documents, especially in this case where the problem is in code you have not shown. LaTeX already makes it an infinitely bad place to break after the heading, so if it does break there, something else on the page made the constraints infeasible, and all options were infinitely bad. Consider \documentclass{article} ...

1

There are different ways of keeping it together: use the \needspace command from the needspace package put your paragraph in a \vbox that won't be break use the samepage package For the needspace command: \usepackage{needspace} \begin{document} ... \needspace{5em} \paragraph{A paragraph} Some more text \end{document} For the \vbox strategy: ...

0

Edit: This solution attemp does not work. \startlinecorrection and \stoplinecorrection disables the grid, but also disables page-breaking.

3

1

Journal submissions should be left untouched, since the publisher will most likely reformat things to suit their needs. apa6 does issue \raggedright as part of the document class. You could update the justification by loading the ragged2e package and issuing a \justifying wherever you want to have justified paragraphs. \documentclass[man]{apa6}% ...

3

Redefining thebibliography with the help of \parshape can be a solution. Add these lines to your preamble and adjust the length of \listindent to your needs. \newlength\listindent \setlength\listindent{50pt} \newlength\labellength \let\oldthebibliography\thebibliography \let\oldendthebibliography\endthebibliography \renewenvironment{thebibliography}[1] ...

6

Perhaps a list environment is all you need? \documentclass{article} \newenvironment{hangingpar}[1] {\begin{list} {} {\setlength{\itemindent}{-#1}%%' \setlength{\leftmargin}{#1}%%' \setlength{\itemsep}{0pt}%%' \setlength{\parsep}{\parskip}%%' \setlength{\topsep}{\parskip}%%' } ...

4

Here are two examples where you don't need to specify an explicit length: \documentclass[fontsize=12pt,paper=A5,DIV=20,headinclude=true,footinclude=true,headings=small,pagesize,parskip=half]{scrartcl} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english,naustrian]{babel} ...

1

Here is another suggestion using the changepage package: We make use of the adjustwidth environment that controls the left and right margin of the text in question: \begin{adjustwidth}{0in}{1in} % Here 1in defines the extra tabbing you need. \begin{flushright} 3. Mary nodded, \emph{pa rum pum pum pum},\\ the ox and lamb kept time, \emph{pa rum ...

6

You can simply specify a different \rightskip inside the flushright. flushright works by putting \rightskip to 0pt and \leftskip to exandable glue. Replace the \rightskip value by some positive length, e.g. by \begin{flushright}% \setlength{\rightskip}{3em}% ... \end{flushright} ...

9

Stealing gratuitously from topskip's answer (although I did vote for it as well:-) He showed how to push the whatsit into the horizontal list (which is basically what \textcolor{}.. does as opposed to \color) But if you want the whatsit to be in the vertical list but have no break point before the following paragraph, you can do as I suggest in comments and ...

11

You should add the whatsit into paragraph itself (i.e. the horizontal list). I guess you have something like this: \documentclass{article} \usepackage{luacode,luatexbase} \begin{document} \begin{luacode*} w = node.new("whatsit","user_defined") w.type=100 function foo(head) new_head = node.insert_before(head, head, w) return new_head end ...

13

A whatsit (user-defined or not) is always non-discardable. So if glue follows it, that glue constitutes a break point. If glue precedes it, that might stretch along with the rest of the page. To make it adhere to the following paragraph, you can make it part of the paragraph. The LaTeX way is to put \leavevmode before it. That positions the whatsit at the ...

0

0

Here is a solution (you can set the value "3em" to what you want) : \makeatletter \newenvironment{exemple} {\list{}{% \leftmargin 3em} \item\relax} {\endlist} \makeatother MWE : documentclass[12pt]{article} \makeatletter \newenvironment{exemple} {\list{}{% \leftmargin 3em} \item\relax} {\endlist} \makeatother ...

2

At the end? Rather at the beginning. And generally: \everypar{\looseness=-1} However it does not mean that every paragraph will be one line shorter.

1

Presumably one should worry about page breaking between the paragraph and the right-aligned text. Here's a non-breaking version: \documentclass{article} \begin{document} A paragraph of ordinarily justified text blah blah blah followed by a line which has a different alignment.\rule[-.5cm]{0cm}{.5cm}\\* \null\hfill the right aligned text. \end{document} ...

1

As far as I understand: \documentclass{article} \begin{document} \newlength{\myskip} \setlength{\myskip}{0.5cm} \addtolength{\myskip}{-\baselineskip} A paragraph of ordinarily justified text blah blah blah followed by a line which has a different alignment. And some more and more text. \vskip\myskip \rightline{the right aligned text} \end{document} ...

4

You can also use \indent\llap{x}Hello

13

\llap is not a LaTeX box command and does not start a paragraph. \documentclass{article} \begin{document} \parindent=2cm \makebox[0pt][r]{x}Hello H\makebox[0pt][r]{x}ello \end{document}

Top 50 recent answers are included