in HTML, we can have a clickable image like this :
<!DOCTYPE html>
<html>
<head>
<title>HTML Image as link</title>
</head>
<body>
<img src="https://www.w3schools.com/html/pic_trulli.jpg">
</body>
</html>
you can click everywhere and you redirect to the website .also in LaTeX, we can have a clickable image like this
\documentclass[10pt,a4paper]{article}
\usepackage{hyperref,graphicx}
\begin{document}
\href{http://www.blog.com}{\includegraphics{blog}}
\end{document}
but the problem is The whole image is not clickable,there is a small point left-hand side it is very small.
i want the image can be clickable like fonts and text all-over the image
\href{http://www.blog.com}{Hello}
\Huge\href{http://www.blog.com}{\faGithub}
my editor is : TeXstudio 4.1.2 (git n/a)
Using Qt Version 5.12.8, compiled with Qt 5.12.8 R
latex compiler is : XeLaTeX
thanks
xelatex does not support non-text hyperlinks. The easiest solution is to use another engine. For example lualatex can do pretty much everything that xelatex can do.
(For the odd case in which changing the engine is not an option, there are workaround for to make non-text elements clickable, see e.g. https://github.com/josephwright/beamer/issues/332#issuecomment-774659976 )
Related
I've tried to write own rst-classes and apply it to H1, H2 (headers like ====== or ~~~~~~~) and it works good when I make html. But in PDF it looks like headers, it is unexpected.
Please help me to solve this problem. I need to provide my report with good title page for my university but I don't know how to do it in ReST.
P.s. Sorry for my english, I'm russian =)
In the PDF here https://docdro.id/NRaWdDf each part is on its own page, like this
and the Contents.rst is at https://github.com/greenstm137/RWOfStudents/blob/4c8153969ed4d7e8de937d0ae33ccbaa7af03cdd/source/contents.rst
You might want to add raw latex code to center it. Try this:
|lstartcenter| My Text is Centered! Cool! |lendcenter|
.. |lstartcenter| raw:: latex
\begin{center}
.. |lendcenter| raw:: latex
\end{center}
This code sets a start and an end tag with "raw:: latex" which inserts raw latex code if you compile it to latex.
"|lstartcenter|" starts making it centered, while "|lendcenter|" ends centering it.
When building my website, i faced an image with some text in it.
But the text only display when i changed background-color to black.
After some research, i think ít's a transparent image, and we have some online tools to replace background image.
Anyone know how remove background from an image really work ?
And why it make the text showed up ?
This is my image.
updated: Sorry, my question is not clear. Here is my code
https://codepen.io/ging2507/pen/wvWJeyR
when i remove comment of navbar, the Text of image show up(not the normal text 123131). And i dont know why this happened
.navbar {
background-color: #14425D;
}
The image doesn't change at all. It just has some pixels that are marked as transparent.
Consider a sheet of glass. Paint on it using white paint. Put it on a sheet of white paper. Now you can't see what was painted on it. Replace the white paper with black paper. Not you can see what was painted on it.
I am not sure if I understand your question correctly. You have an image that you want to remove the grey background from? I have tried to use this tool and this is the following output that I got. The text cannot be read since it is it white and blends together with the background. I hope this helped
Edit: The tool that I have posted can also replace the background as you can see here
EDIT
You can also use CSS to add background to the image.
I have mananged to add linear gradient to the image using CSS. You can see the code
.logo {
background: linear-gradient(
105deg,
rgba(34, 193, 195, 1) 0%,
rgba(253, 187, 45, 1) 100%
);
}
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=">
<title></title>
</head>
<body>
<img src="https://i.stack.imgur.com/Pawab.png" alt="some logo" class="logo">
</body>
</html>
Here is a link to codepen if you want to play around with it.
I have a markdown file with numerous images that displays great in visual studio code.
I created the markdown file in R by scraping a section of our agencies legacy website.
The last step is to convert this md to pdf for archiving. I am doing this step in R
rmarkdown::pandoc_convert(here::here("myfile.md"),output="myfile.pdf")
The process completes, everything looks good except that the images are not centered and the figure captions do not display under the image (they wrap).
The code i am using for the images in markdown is
![label](figures/fig1.png) Figure 1 Time series of stuff
If i use html to center the image in markdown then the conversion to pdf doesn't display properly. If i enclose the figure with
\begin{figure} or \begin{center}
\end{figure} or \end{center}
then the conversion fails with an error.
Any advice. Spent too much time already reading articles not applicable
On my iPhone 7 in Safari a 3in wide div is about 1.8in in real.
Why didn't they set devicePixelRatio so that 3in in css are 3in in real?
Is there a specification on how to set devicePixelRatio?
Is there a workaround?
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
</head>
<body style="margin:0">
<div style="width:3in;background:orange">3in</div>
</body>
</html>
The CSS units such as inch and cm are not recommended to use according to w3.org, except you're planning to print out your webpage:
The only place where you could use pt (or cm or in) for setting a font size is in style sheets for print, if you need to be sure the printed font is exactly a certain size. But even there using the default font size is usually better.
If you really need to use inches as units, please take a look at this answer here
I have a series of markdown files that I am turning into slides using Pandoc and the Beamer template. I am creating my own custom Beamer template in order to format those slides.
pandoc --slide-level 2 -fmarkdown-implicit_figures -t beamer --template mytemplate.beamer -o test.pdf *.md
I am struggling with making certain elements look the way I would like them to.
My simplified markdown looks like this:
## Header
Normal Body Text
![Image](images/Image1.png "Image")
Specifically, my images are coming out left justified. I can't figure out how to get them to center. If I remove the -fmarkdown-implicit_figures option, then the images are properly centered, but includes captions that I don't want. Adding that flag eliminates the captions but also eliminates the centering.
At the same time, I want the normal body text to be centered as well. So in the above example I would like the text Normal Body Text to be centered. Again, I can't figure out how to do that. I have managed to center other elements (such as the header), but I can't find an appropriate name for the element that represents normal body text.
Can anyone offer a solution to either of these issues?
I found a way to center the images. It may not be the best option, but this seems to work:
\usepackage{letltxmacro}
% Save the meaning of \includegraphics
\LetLtxMacro\latexincludegraphics\includegraphics
% Update the include graphics command to include centering
\renewcommand{\includegraphics}[2][]{%
\centering
\latexincludegraphics[#1]{#2}}
To ensure the normal text was centered, I used the following, again I am unsure if this is the best way:
% Center Text By Default
\usepackage{ragged2e}
\centering