Creating an R Markdown document.
Trying to get a hyperlink to center on the page.
Script:
\begin{center]
SOLUTION LINK
\end{center}
Output: It does kinda what it's supposed to. It centers the line, but strips the hyperlink and just knits the text onto the pdf.
Let me know if this sounds clear.
with the closing ] on the first line was going to be a problem all on its own, but even fixing it doesn't make centered markdown style links work right. Here's one way to do it, and you probably would need to do something similar for environments other than {center}
\newcommand{\soln}{https://forum.posit.co/t/hyperlinks-and-latex-centering-hyperlink-and-knitting-to-pdf/145171}
\begin{center}
\href{\soln}{SOLUTION LINK}
\end{center}
1 Like
SWEET!!! That worked perfectly! So happy!
1 Like
cderv
August 21, 2022, 2:17pm
4
For reference, Using Markdown inside LaTeX block does not work because this is still an unsupported feature from Pandoc
opened 05:56PM - 15 Oct 15 UTC
enhancement
format:Markdown
reader
This is a feature request to add a Markdown extension `markdown_in_tex_blocks` l… ike `markdown_in_html_blocks` according to the discussion in the mailing list: https://groups.google.com/forum/#!msg/pandoc-discuss/ggcrRN-ja-s/lNeILZdlBwAJ Thanks!
that is why one need to used LaTeX between the \begin ... \end
block here.
Other solution for this would be to add a Lua filter to process such syntax
::: center
[Link](to/solution)
:::
like shown in request: syntax for centering text · Issue #719 · jgm/pandoc · GitHub as there is not built-in center syntax in Pandoc yet.
Hope it helps understand
1 Like
system
Closed
August 28, 2022, 2:18pm
5
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.