I am working on an R markdown document and was trying to see if we can right align the end of a sentence.
The sentence should look like :
This is the same sentence's first part <spacespacespace space space> this is the end of sentence.
I have tried comibining LaTeX syntax with it
This is the same sentence's first part
\begin{flushright}
sample end of sentence
\end{flushright}
But this doesnt give the desired effect.
Can someone please help?
PDF document
Use LaTeX
\hfill
command:
This is the same sentence's first part \hfill this is the end of sentence.
HTML document
Use CSS
float
property.
Since Pandoc 1.18, you can create a native span
with bracketed_spans
This is the same sentence's first part [this is the end of sentence.]{style="float:right"}
Both PDF & HTML?
You can use both LaTeX
\hfill
and a HTML
floating span (be careful, use a no-break-space between \hfill
and [this
):
This is the same sentence's first part \hfill [this is the end of sentence.]{style="float:right"}
<p><strong>PDF document</strong><br />
Use <code>LaTeX</code> <code>\hfill</code> command:</p>
<p>This is the same sentence’s first part this is the end of sentence.</p>
<p><strong>HTML document</strong><br />
Use <code>CSS</code> <code>float</code> property.<br />
Since Pandoc 1.18, you can create a native <code>span</code> with <a href="https://pandoc.org/MANUAL.html#extension-bracketed_spans"><code>bracketed_spans</code></a></p>
<p>This is the same sentence’s first part <span style="float:right;">this is the end of sentence.</span></p>
<p><strong>Both PDF & HTML?</strong><br />
You can use both <code>LaTeX</code> <code>\hfill</code> and a <code>HTML</code> floating span (be careful, use a no-break-space between <code>\hfill</code> and <code>[this</code>):</p>
<p>This is the same sentence’s first part <span style="float:right;">this is the end of sentence.</span></p>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With