I tried to make a document in which the text wraps around the images.
I have some images that do not get wrapped wich I have included by \includegraphics and the other one with using wrapfigure.
The first wrapfigure works and is at the same place as the text below (However the text is a little bit more above).
The text which should be around the next wrapfigure is also wrapped around the first one and the the picture is moved 3 pages down. On that page no other content appears.
I also tried putting a \newpage before and after the block with the second wrapfigure and its text but it just created a new page with only the text on it and nothing else and the picture was still moved down.
How can I make the picture and its text appear at the same place?
\documentclass[a4paper,11pt]{letter}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{ngerman}
\usepackage{sidecap}
\usepackage{float}
\usepackage{wrapfig}
\signature{name}
\begin{document}
\begin{letter}{}
\opening{Lorem ipsum,}
% corps of the letter
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
\includegraphics[width=1\textwidth]{picture.jpg}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
\includegraphics[width=1\textwidth]{picture.jpg}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\includegraphics[width=1\textwidth]{picture.jpg}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est.
\includegraphics[width=1\textwidth]{picture.jpg}
\includegraphics[width=1\textwidth]{picture.jpg}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
\begin{wrapfigure}{r}{0.5\textwidth}
\begin{center}
\includegraphics[width=0.48\textwidth]{picture.jpg}
\end{center}
\end{wrapfigure}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.
\begin{wrapfigure}{r}{0.5\textwidth}
\begin{center}
\includegraphics[width=0.48\textwidth]{picture.jpg}
\end{center}
\end{wrapfigure}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\includegraphics[width=1\textwidth]{picture.jpg}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\includegraphics[width=1\textwidth]{picture.jpg}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\includegraphics[width=1\textwidth]{picture.jpg}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\includegraphics[width=1\textwidth]{picture.jpg}
\begin{wrapfigure}{r}{0.5\textwidth}
\begin{center}
\includegraphics[width=0.48\textwidth]{picture.jpg}
\end{center}
\end{wrapfigure}
\includegraphics[width=1\textwidth]{picture.jpg}
%%%%%
\closing{Lorem}
\end{letter}
\end{document}
Set a \clearpage before the 2nd wrapfigure. In your MWE this should solve the problem.
A few further Tips:
Use \centering in your wrapfigure-environment, the center-environment just addes useless space.
wrapfigure has an optional parameter \begin{wrapfigure}[numberOfLinesToWrap]{position}{width}, so you can control the amount of lines the pachages is to use for wrapping.
Use \vskip-12345\baselineskip inside the wrapfigure to control vertical placement / alignment of your picture. Please replace 1234 with a good number.
Related
im using google sheets and want to extract emails and phone numbers. Lets assume i have a text in one cell:
"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem b.hoang#hotmail.de ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. +49 176 420 59178 At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet"
How would you proceed to get the email and phone details?
For email, you can try
=REGEXEXTRACT(your text,"[a-zA-Z0-9-_.]+#[a-zA-Z0-9-_.]+")
For phone number, try
=REGEXEXTRACT(A1,"\+[0-9]+ [0-9]+ [0-9]+ [0-9]+")
I have a problem with react-quill which is a rich text editor.
I need to let the quill editor focus on a specific part of a long text, e.g. a specific line or a specific sentence. There is the "focus()" method and I assume but it's not working for anybody who can help me with that. check my code if there is any issue please let me know about it. thanks
import React from 'react';
import ReactQuill from "react-quill"
import "quill-mention";
import './App.css';
import "../node_modules/react-quill/dist/quill.snow.css"
class App extends React.Component {
constructor(props) {
super(props)
this.state = { text: outside_text, received : true, focus : null,}
this.handleChange = this.handleChange.bind(this)
}
modules = {
toolbar: [
[{ 'header': [1, 2, false] }],
['bold', 'italic', 'underline'],
['link', 'image'],
[{'list': 'ordered'}, {'list': 'bullet'}],
['clean']
],
}
formats = [
'header',
'bold', 'italic', 'underline',
'list', 'bullet',
'link', 'image'
]
handleChange(value) {
this.setState({ text: value})
}
handleFocus(value) {
/*to Do!*/
this.setState({focus: value})
}
activateLasers(){
this.setState({received : true });
}
checkreceived(received){
if (received===true){
this.setState({text: "Information from the button was received!",received : false })
}
}
render() {
this.checkreceived(this.state.received)
return (
<div>
<button
onClick={() => this.setState({received : true})}>
Activate Lasers !
</button>
<ReactQuill
value={this.state.text}
onChange = {this.handleChange}
modules={this.modules}
formats = {this.formats}
onFocus = {this.handleFocus}
theme = "snow"
/>
<textarea
disabled
value={this.state.text}
/>
<textarea
disabled
value={String(this.state.focus)}
/>
</div>
)
}
}
const outside_text = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,'
export default App;
BitBucket Markdown has a simplified features set to avoid HTML insertion etc. Whatever the reasons are, I can not find a way to insert blank lines between lists.
Please do not redirect me to How to write one new line in Bitbucket markdown?, because this is NOT the same case, that case is about breaking the line and not inserting a blank line.
With the following text:
# This is the problem:
* Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium
* Lorem ipsum dolor sit amet
* consectetur adipiscing elit
* sed do eiusmod tempor incididunt
* At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum
* Lorem ipsum dolor sit amet
* consectetur adipiscing elit
* sed do eiusmod tempor incididunt
* Ut enim ad minima veniam, quis nostrum exercitationem
* Lorem ipsum dolor sit amet
* consectetur adipiscing elit
* sed do eiusmod tempor incididunt
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
I obtain this output:
The problem is the lack of enough space in the transition from inner bullet paragraphs to outer bullet paragraphs, pointed by red arrows here (blue arrows show correct spacing):
If a BLANK LINE can be inserted, that can be a workaround (more or less), but I can't find a way (I have tried HTML, escape sequences, Unicode break chars etc).
Type two spaces to the end of the last line.
Leave a blank line between the two lists.
Insert a zero-width Unicode character in the blank line. You can copy a zero-width space from this Wikipedia article.
Example
* Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium
* Lorem ipsum dolor sit amet
* consectetur adipiscing elit
* sed do eiusmod tempor incididunt<space><space>
<zero-width character>
* At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum
* Lorem ipsum dolor sit amet
[...]
Result
I have a number of Anchor-tags within a webpage that I display in my iPhone app utilizing WKWebView.
The problem is that clicking on the href tags does not take me to the corresponding anchor. This use to work fine when I was using UIWebView but now that I've migrated to WKWebView, it's not working.
I'm setting the anchor tags as follows, trying to be HTML5 compliant:
Test1.
<h2 id="Test1">
When I display the webpage on any browser, or html editor, or within XCode external editor the anchor tags work just fine, but not within WKWebView.
This is the stripped down test html (though it does have long text strings):
<!DOCTYPE HTML>
<html>
<head>
<title> </title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
.btt {
font-size: 10pt;
color: #000080;
}
</style>
</head>
<body>
<h2 id="toc">
Table of Contents.
</h2>
<ul>
<li> Test1. </li>
<li> Test2. </li>
<li> Test3. </li>
<li> Test4. </li>
</ul>
<h2 id="Test1">
Test1 <a class="btt" href="#toc">Back to Top</a>
</h2>
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
erat, sed diam voluptua. At vero eos et accusam et justo duo dolores
et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est
Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur
sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
et dolore magna aliquyam erat, sed diam voluptua. At vero eos et
accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum
dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum
dolor sit amet.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse
molestie consequat, vel illum dolore eu feugiat nulla facilisis at
vero eros et accumsan et iusto odio dignissim qui blandit praesent
luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
volutpat.
</p>
<h2 id="Test2">
Test2 <a class="btt" href="#toc">Back to Top</a>
</h2>
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
erat, sed diam voluptua. At vero eos et accusam et justo duo dolores
et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est
Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur
sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
et dolore magna aliquyam erat, sed diam voluptua. At vero eos et
accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum
dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum
dolor sit amet.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse
molestie consequat, vel illum dolore eu feugiat nulla facilisis at
vero eros et accumsan et iusto odio dignissim qui blandit praesent
luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
volutpat.
</p>
<h2 id="Test3">
Test3 <a class="btt" href="#toc">Back to Top</a>
</h2>
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
erat, sed diam voluptua. At vero eos et accusam et justo duo dolores
et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est
Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur
sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
et dolore magna aliquyam erat, sed diam voluptua. At vero eos et
accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum
dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum
dolor sit amet.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse
molestie consequat, vel illum dolore eu feugiat nulla facilisis at
vero eros et accumsan et iusto odio dignissim qui blandit praesent
luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
volutpat.
</p>
<h2 id="Test4">
Test4 <a class="btt" href="#toc">Back to Top</a>
</h2>
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
erat, sed diam voluptua. At vero eos et accusam et justo duo dolores
et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est
Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur
sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
et dolore magna aliquyam erat, sed diam voluptua. At vero eos et
accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum
dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum
dolor sit amet.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse
molestie consequat, vel illum dolore eu feugiat nulla facilisis at
vero eros et accumsan et iusto odio dignissim qui blandit praesent
luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
volutpat.
</p>
</body>
</html>
This is how I create WKWebView and load the html file in Obj-C:
- (void) viewDidLoad
{
[super viewDidLoad];
htmlContent = #"failexample";
NSString *path = [[NSBundle mainBundle] pathForResource:htmlContent
ofType:#"html"];
NSFileHandle *readHandle = [NSFileHandle fileHandleForReadingAtPath:path];
NSString *htmlString = [[NSString alloc] initWithData:[readHandle readDataToEndOfFile]
encoding:NSUTF8StringEncoding];
WKWebViewConfiguration *wkWebConfig = [[WKWebViewConfiguration alloc] init];
webView = [[WKWebView alloc] initWithFrame:[UIScreen mainScreen].bounds
configuration:wkWebConfig];
webView.navigationDelegate = self;
webView.UIDelegate = self;
[webView loadHTMLString:htmlString baseURL:nil];
[self.view addSubview:webView];
}
I know that the click is processed in decidePolicyForNavigationAction:
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction
decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
if (navigationAction.navigationType == WKNavigationTypeLinkActivated) {
NSLog(#"Got a click"):
}
decisionHandler(WKNavigationActionPolicyAllow);
}
Anyone have any idea what I'm doing wrong or what I need to do to get this to work?
I met the same problem recently. The html string was read from a server and the html string include lots of anchor statements "href = '#XXX' ". The anchor statement does not jump first.
solution: Just injected the viewport meta statement. Use javascript to dynamically inject to the html string head part. Problem solved. anchor jumps perfectly.
Your example works fine in iOS 10, so I would have to suggest you've found a bug in iOS 11. The best course would be to package everything up as a simple example project and submit to Apple as a bug report.
(A little testing will reveal that much of what you're doing, including the id and the navigation delegate, is irrelevant. The bug is that we don't scroll to internal links at all. You should prune out whatever can be pruned out, to show the issue in the simplest form possible.)
As a workaround, load your file thru a URLRequest:
let url = Bundle.main.url(forResource: "failexample", withExtension: "html")!
let req = URLRequest(url: url)
wv.load(req)
Or, use a local file URL:
let url = Bundle.main.url(forResource: "failexample", withExtension: "html")!
wv.loadFileURL(url, allowingReadAccessTo: url)
The internal links will then work. (However, this workaround may not always be practical; I regard the problem as a bug nonetheless, especially since it worked fine in iOS 10.)
UPDATE: This is fixed in iOS 12.
I would like to parse a text like
Lorem ipsum dolor \tag{sit} amet, \git{consetetur} sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut \tag{labore \git{et} dolore magna aliquyam
erat, sed} diam voluptua. At vero eos et accusam et justo duo dolores et ea
\tag{rebum.}
into
Lorem ipsum dolor sit amet, \git{consetetur} sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore \git{et} dolore magna aliquyam
erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea
rebum.
i.e., remove all the \tag{...} environments. They can be nested and can span over multiple lines.
As learned here, regular expression tools are not suited for the task.
Is there a language or Unix tool that is ideal for this kind of problem?
You can accomplish that with perl:
perl -0ne 's/\\tag{//g;$i=0;while(/./gs){$i-- if $& eq "{";$i++ if $& eq "}"; if ($i<1){print $&}else{$i=0}}'
All the credits should be for bartus11