I would like to align the text to bottom in the second cell.
The first cell extends to 2 lines, because of insufficent width and that's OK
But the text in the second cell is only one line and shows up at the top of the cell.
How can I align it to bottom?
I tried vertical-align="bottom" text-align="bottom" text-align="end" on
row , cell and block levels.. Any of them worked?!?
<fo:table font="normal 10 pt Arial, sans-serif" width="100%">
<fo:table-column column-width="40mm"/>
<fo:table-column column-width="130mm"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell padding-before="3pt" padding-after="3pt">
<fo:block font-weight="bold">Pricing Rate in % p.a. / "Pensionssatz in % p.a.":</fo:block>
</fo:table-cell>
<fo:table-cell padding-before="3pt" padding-after="3pt">
<fo:block>
**This text I want to be aligned to bottom (in the second line)**
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
Use display-align="after" on the table cell:
<fo:table-cell padding-before="3pt" padding-after="3pt" display-align="after">
<fo:block>
**This text I want to be aligned to bottom (in the second line)**
</fo:block>
</fo:table-cell>
Just in case someone found this issue:
If you have an image and text above you don't want to align after but before:
<fo:table-cell display-align="before">
<!-- Your image & text separated in blocks -->
<fo:table-cell>
Related
I have an SVG on my website that displays text along a path. This works everywhere except on iOS devices. Here the text is duplicated below the paths. See the image below for what I mean by "duplicated". Any idea on why Safari behaves strangely here? If you need more information about the code let me know. The tspans at the bottom simply have a string inside them
<g>
{/* Line connecting the start of the arc with the fairy icon */}
{index >= 5 && last && <line stroke='#fff' strokeWidth="2" x1={fairyPos?.[0]} y1={fairyPos?.[1]} x2={x} y2={y} />}
{/* Rotate the whole group by 90deg in order to initially hide it */}
<g className="-rotate-90" style={{ transform: `rotate(${rotation}deg)` }}>
{/* Gradient along the path */}
<defs>
<linearGradient id={`gradient${index}`}>
<stop offset="0%" stopColor={fairyGradient?.[0]} />
<stop offset="100%" stopColor={fairyGradient?.[1]} />
</linearGradient>
</defs>
{/* Border around the arc */}
<path id={`msg${index}`} d={arc} fill="none" stroke="#fff" strokeWidth={width} strokeLinecap="round" className="drop-shadow-[4px_4px_0_rgba(0,0,0,0.25)]" />
{/* Arc container of the message */}
<path d={arc} stroke={`url(#gradient${index})`} strokeWidth={width - 4} strokeLinecap="round" fill='none' />
{/* Circle at the start of the arc */}
<circle cx={arcStart[0]} cy={arcStart[1]} r={width / 2 - 1} fill={`url(#gradient${index})`} stroke="#fff" strokeWidth="2" />
{/* Text inside the arc */}
<text color="#446688" fontSize="12px" fontFamily="'Kiwi Maru'" className="text-outline-light">
<textPath startOffset={width / 2 - 1 + 5} xlinkHref={`#msg${index}`}>
<tspan x="0" alignmentBaseline={lines > 1 ? "before-edge" : "central"} dy={lines > 1 ? -(width / 2) + 4 : -1} >{text[0]}</tspan>
{text.length > 1 && text.slice(1).map((v, i) => <tspan key={index + '-' + i} x="0" alignmentBaseline="before-edge" dy="1em">{v}</tspan>)}
</textPath>
</text>
</g>
</g>
Figured it out after individually deleting every single property on my svg elements.
The problem was the className="text-outline-light" on the <text> element. The class was used for text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff; and apparently Safari doesn't like it, if you define more than one shadow at once.
I deleted that class and used paintOrder="stroke" stroke="#fff" strokeWidth="1.5", which seems a bit better to use anyways.
I am writing a Gantt chart in latex. But the activities on the left do not align left. So can anybody tells me how can I make all the WBS activities in Gantt Chart align left in latex? Thank you very much! Here is the code of latex:
\documentclass[11pt,oneside]{book}
\usepackage[margin=1.2in]{geometry}
\usepackage{setspace}
\usepackage[toc,page]{appendix}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{pgfgantt}
\usepackage[none]{hyphenat} % turn hyphenation off by default
\usepackage{graphicx}
\usepackage{hyperref}
\begin{document}
\section{Risk Analysis}
\section{Project Plan}
\definecolor{barblue}{RGB}{153,204,254}
\definecolor{groupblue}{RGB}{51,102,254}
\definecolor{linkred}{RGB}{165,0,33}
\renewcommand\sfdefault{phv}
\renewcommand\mddefault{mc}
% \renewcommand\bfdefault{bc}
\setganttlinklabel{s-s}{START-TO-START}
\setganttlinklabel{f-s}{FINISH-TO-START}
\setganttlinklabel{f-f}{FINISH-TO-FINISH}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.
{
\sffamily
\begin{ganttchart}[
canvas/.append style={fill=none, draw=black!5, line width=.75pt},
hgrid style/.style={draw=black!5, line width=.75pt},
vgrid={*1{draw=black!5, line width=.75pt}},
title/.style={draw=none, fill=none},
title label font=\bfseries\footnotesize,
title label node/.append style={below=7pt},
include title in canvas=false,
bar label font=\mdseries\small\color{black!70},
bar label node/.append style={left=2cm},
bar/.append style={draw=none, fill=black!63},
bar incomplete/.append style={fill=barblue},
bar progress label font=\mdseries\footnotesize\color{black!70},
group incomplete/.append style={fill=groupblue},
group left shift=0,
group right shift=0,
group height=.5,
group peaks tip position=0,
group label node/.append style={left=.6cm},
group progress label font=\bfseries\small,
link/.style={-latex, line width=1.5pt, linkred},
link label font=\scriptsize\bfseries,
link label node/.append style={below left=-2pt and 0pt}
]{1}{14}
\gantttitle[
title label node/.append style={below left=7pt and -3pt}
]{WEEKS:\quad1}{1}
\gantttitlelist{2,...,14}{1} \\
\ganttgroup[progress=0]{WBS 1 More Research}{1}{1}\\
\ganttgroup[progress=0]{WBS 2 Speaker Verification}{2}{3} \\
\end{ganttchart}
}
\end{document}
Can anybody tell me how can I make all the WBS activities align left? Thank you very much!
If you give all your WBS activities a fixed text width, e.g. group label node/.append style={text width=5.5cm}, they will automatically be left aligned:
\documentclass[11pt,oneside]{book}
\usepackage[margin=1.2in]{geometry}
\usepackage{setspace}
\usepackage[toc,page]{appendix}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{pgfgantt}
\usepackage[none]{hyphenat} % turn hyphenation off by default
\usepackage{graphicx}
\usepackage{hyperref}
\begin{document}
\section{Risk Analysis}
\section{Project Plan}
\definecolor{barblue}{RGB}{153,204,254}
\definecolor{groupblue}{RGB}{51,102,254}
\definecolor{linkred}{RGB}{165,0,33}
\renewcommand\sfdefault{phv}
\renewcommand\mddefault{mc}
% \renewcommand\bfdefault{bc}
\setganttlinklabel{s-s}{START-TO-START}
\setganttlinklabel{f-s}{FINISH-TO-START}
\setganttlinklabel{f-f}{FINISH-TO-FINISH}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.
{
\sffamily
\begin{ganttchart}[
canvas/.append style={fill=none, draw=black!5, line width=.75pt},
hgrid style/.style={draw=black!5, line width=.75pt},
vgrid={*1{draw=black!5, line width=.75pt}},
title/.style={draw=none, fill=none},
title label font=\bfseries\footnotesize,
title label node/.append style={below=7pt},
include title in canvas=false,
bar label font=\mdseries\small\color{black!70},
bar label node/.append style={left=2cm},
bar/.append style={draw=none, fill=black!63},
bar incomplete/.append style={fill=barblue},
bar progress label font=\mdseries\footnotesize\color{black!70},
group incomplete/.append style={fill=groupblue},
group left shift=0,
group right shift=0,
group height=.5,
group peaks tip position=0,
% group label node/.append style={left=.6cm},
group progress label font=\bfseries\small,
link/.style={-latex, line width=1.5pt, linkred},
link label font=\scriptsize\bfseries,
link label node/.append style={below left=-2pt and 0pt},
group label node/.append style={text width=5.5cm},
]{1}{14}
\gantttitle[
title label node/.append style={below left=7pt and -3pt}
]{WEEKS:\quad1}{1}
\gantttitlelist{2,...,14}{1} \\
\ganttgroup[progress=0]{WBS 1 More Research}{1}{1}\\
\ganttgroup[progress=0]{WBS 2 Speaker Verification}{2}{3} \\
\end{ganttchart}
}
\end{document}
We have a requirement in which need to convert XML into Fixed Length File. First record is as header and after that we have actual records..From 2 record onwards we need to apply the logic which is mentioned below:
After length 45, consider 10 numbers 0000001000, what ever be the last digit we need to check and replace by following the below table.
Same logic we need to repeat at position 59th to 74th.
77th to 80th we need to get the value 5152 and store into one variable
I had asked the question with 1st logic and got the awesome response, now I am left with 2nd and 3rd logic
For Positive: (0000001000) - (000000100{)
{= 0
A = 1
B = 2
c = 3
D = 4
E = 5
F = 6
G = 7
H = 8
I = 9
Request anyone to help me to achieve the same, I have mentioned the XSLT which I got from previous answers.Thanks
Input:
<ZR>
<INPUT>
<I_FIL>ERES</I_FIL>
</INPUT>
<TABLES>
<T_ER>
<item>
<DATA> HEADER1111111122222222333333344456</DATA>
</item>
<item>
<DATA>778944 D4E2 EA 1234567891 2018-11-060000001000EA 0000000000000100005152D04YA30TRE0000000XXXYYY 800{ Q 2018-11-05</DATA>
</item>
<item>
<DATA>987654 D4E2 EA 1987654321 2018-11-060000002001EA 0000000000000100005152D04YA30UUU0000000XXXLRB 100{ Q 2018-11-05</DATA>
</item>
.
.
.
.
.
.
.
.
<item>
<DATA>12345678912345678934562754378909726533297TRAILER</DATA>
</item>
</T_ER>
</TABLES>
</ZR>
XSLT:
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fn="http://www.w3.org/2005/xpath-functions">
<xsl:output omit-xml-declaration="yes" />
<xsl:param name="break" select="'
'" />
<xsl:template match="/">
<xsl:value-of select="ZR/TABLES/T_ER/item[1]/DATA" />
<xsl:value-of select="$break" />
<xsl:for-each select="ZR/TABLES/T_ER/item[position() != 1]">
<xsl:variable name="length" select="string-length(substring(DATA,0,46))" />
<xsl:variable name="tenNumbers" select="substring(DATA, ($length + 1),
10)"/>
<xsl:variable name="charToReplace" select="translate(substring($tenNumbers, string-length($tenNumbers), 1),'0123456789','{ABCDEFGHI')" />
<xsl:value-of select="concat(substring(DATA,0,46), substring(DATA, ($length + 1), 9), $charToReplace, substring(DATA,($length+11),(string-length(DATA) + 1)))"/>
<xsl:value-of select="$break" />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
OR
<xsl:template match="/">
<xsl:value-of select="
ZR/TABLES/T_ER/item[1]/DATA,
ZR/TABLES/T_ER/item[position() > 1]/DATA/concat(
substring(., 1, 54),
substring('{ABCDEFGHI', number(substring(., 55, 1)) + 1, 1),
substring(., 56)
)" separator="
" />
</xsl:template>
Expected Output:
HEADER1111111122222222333333344456
778944 D4E2 EA 1234567891 2018-11-06000000100{EA
000000000000010{005152D04YA30TRE0000000XXXYYY 800{ Q 2018-11-05
987654 D4E2 EA 1987654321 2018-11-06000000200AEA
000000000000010{005152D04YA30UUU0000000XXXLRB 100{ Q 2018-11-05
.
.
.
.
12345678912345678934562754378909726533297TRAILER
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fn="http://www.w3.org/2005/xpath-functions">
<xsl:output omit-xml-declaration="yes" />
<xsl:param name="break" select="'
'" />
<xsl:template match="/">
<xsl:value-of select="ZR/TABLES/T_ER/item[1]/DATA" />
<xsl:value-of select="$break" />
<xsl:for-each select="ZR/TABLES/T_ER/item[position() != 1]">
<xsl:variable name="length" select="string-length(substring(DATA,0,46))" />
<xsl:variable name="tenNumbers" select="substring(DATA, ($length + 1), 10)" />
<xsl:variable name="sixteenNumbers" select="substring(DATA, (string-length(substring(DATA,0,59)) + 1), 16)" />
<xsl:variable name="firstCharToReplace" select="translate(substring($tenNumbers, string-length($tenNumbers), 1),'0123456789','{ABCDEFGHI')" />
<xsl:variable name="secondCharToReplace" select="translate(substring($sixteenNumbers, string-length($sixteenNumbers), 1),'0123456789','{ABCDEFGHI')" />
<xsl:choose>
<xsl:when test="string-length($tenNumbers) != 10">
<xsl:value-of select="concat(substring(DATA,0,46), substring(DATA, ($length + 1), 9))" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(substring(DATA,0,46),
substring(DATA, ($length + 1), 9),
$firstCharToReplace,
substring(DATA,($length+11), 18),
$secondCharToReplace,
substring(DATA,($length+30),(string-length(DATA) + 1)))" />
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$break" />
<xsl:variable name="temp" select="substring(DATA,77,4)" />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
It depends on what condition you want to replace the char.
If it is based on after EA (as per comment) the solution would be different.
For now, I have implemented it solely length based with both points 2 & 3 covered.
http://xsltfiddle.liberty-development.net/6r5Gh38/1
EDIT:
http://xsltfiddle.liberty-development.net/6r5Gh38/2
EDIT 2:
Brief about the points mentioned in comment:
1. <xsl:when test="string-length($tenNumbers) != 10"> This condition is added to remove that extra R appearing for last <item> .
It means if the 10 numbers we are taking in variable is actually having 10 numbers or not.
In the last case,
<item>
<DATA>12345678912345678934562754378909726533297TRAILER</DATA>
</item>
We don't get 10 numbers after 46th character. We get less than that. That's the reason the output has been separated out for two different cases.
2. substring(DATA,0,46) --> which will take first 45 characters to match 778944 D4E2 EA 1234567891 2018-11-06
substring(DATA, ($length + 1), 9) --> which will take 9 characters from index 46th to match 000000100
$firstCharToReplace --> This will replace 10th character as your requirement of 1st question i.e. {
substring(DATA,($length+11), 18) --> It will start remaining string from index (45+11)th to 18 characters that matches EA 000000000000010
$secondCharToReplace --> This will replace (45+11+18)= 74th character as your requirement of 2nd question i.e. {
substring(DATA,($length+30),(string-length(DATA) + 1)) --> It starts from (45+30)= 75th character to last index and gives 005152D04YA30TRE0000000XXXYYY 800{ Q 2018-11-05
Note: In your case, there are extra tabs and white-spaces exist in between the string. That's why the index number has been changed to match your expected output.
My requirement is to concatenate values coming at run time in the ref element. I could get separate values for each element and the concatenate it but still i will miss out text in between.
I have edited my questions as per suggestion made by Martin.
Here is my input XML:
<?xml version="1.0" encoding="UTF-8"?><rootelement>
<nref ref="f1"/> <nref ref="f2"/> <nref ref="f3"/>
<nref ref="f4"/> <nref ref="f5"/>
<pnotes>
<pnote id="f1">
<p>Some Text.</p>
</pnote>
<pnote id="f2">
<p><ref><year>1812</year>, <vol>3</vol><series>F. &
F.</series><pages>22</pages></ref>, at p. 27.</p>
</pnote>
<pnote id="f3">
<p><ref>[<year>1914</year>],
<vol>2</vol><series>A.B.C.</series><pages>94</pages></ref>.</p>
</pnote>
<pnote id="f4">
<p><ref><year>1955</year>,
<vol>2</vol><series>A.B.C</series><pages>509</pages></ref>.</p>
</pnote>
<pnote id="f5">
<p><ref>[<year>1805</year>], <series>A.C.</series><pages>21</pages> </ref>.</p>
</pnote>
</pnotes></rootelement>
I have tried following XSLT
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="2.0">
<xsl:template match="#*|node()">
<xsl:copy>
<xsl:apply-templates select="#*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="nref">
<xsl:variable name="ref" select="#ref"/>
<noteref>
<xsl:for-each select="//pnotes/pnote">
<xsl:if test="#id = $ref">
<xsl:value-of select="."/>
</xsl:if>
</xsl:for-each>
</noteref>
</xsl:template>
<xsl:template match="//pnotes[not(pnotes)]"/>
</xsl:stylesheet>
The result i get is not correct.
I need spaces in between the text.
Result :
<?xml version="1.0" encoding="UTF-8"?>
<rootelement>
<noteref> Some Text. </noteref>
<noteref> 1812, 3F. & F.22, at p. 27. </noteref>
<noteref> [1914], 2A.B.C.94. </noteref>
<noteref> 1955, 2A.B.C509. </noteref>
<noteref> [1805], A.C.21. </noteref>
</rootelement>
Required Result is:
<?xml version="1.0" encoding="UTF-8"?>
<rootelement>
<noteref> Some Text. </noteref>
<noteref> 1812, 3 F. & F. 22, at p. 27. </noteref>
<noteref> [1914], 2 A.B.C. 94. </noteref>
<noteref> 1955, 2 A.B.C 509. </noteref>
<noteref> [1805], A.C.21. </noteref>
</rootelement>
Can somebody help me please? Thanks in advance.
You are iterating over elemnts and anyone of them have square brackets:
When you make your first iteration, you get the element <year> and its value is 1902, not [1902]. Your square brackets are in the element <noteref>.
Change your XML to store the year as [1902] or change your for-each to print the square brackets manually.
Simply output the string value of the element to get all text, if you don't want the line breaks the also normalize the string:
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:template match="#*|node()">
<xsl:copy>
<xsl:apply-templates select="#*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="ref">
<noteref>
<xsl:value-of select="normalize-space()"/>
</noteref>
</xsl:template>
</xsl:transform>
Result is
<rootelement>
<pnote>
<P>
<noteref>[1902], A.C. 12</noteref>.</P>
</pnote>
<pnote>
<P>
<noteref>1902 B.A. 98</noteref>.</P>
</pnote>
<pnote>
<P> This is a text </P>
</pnote>
<pnote>
<P>
<noteref>[1912], 1 R.B. 160</noteref>, at pp. 165, 169.</P>
</pnote>
</rootelement>
Online at http://xsltransform.hikmatu.com/b4GWV2.
I was wondering how I can adjust the frame size of an lstlisting to my beamer code. This is my code:
\lstset{
backgroundcolor=\color{white},
basicstyle=\scriptsize,
breakatwhitespace=false,
breaklines=true,
commentstyle = \textit,
deletekeywords={...},
escapeinside={\%*}{*)},
extendedchars=true,
frame=single,
keepspaces=true,
language=R,
otherkeywords={*,...},
numbers=left,
numbersep=5pt,
numberstyle=\tiny\color{mygray},
rulecolor=\color{black},
showspaces=false,
showstringspaces=false,
showtabs=false,
stepnumber=2,
tabsize=2,
}
\begin{lstlisting} [title = \lstname \scriptsize bla]
library(ggplot2)
qplot(x, y, data =, color =, shape =, fill=, alpha=, geom=, method=, formula=, facets=,
xlim=, ylim=, xlab=, ylab=, main=, sub=)
\end{lstlisting}
What I get is:
But what I would actually like to have is this:
I used to get the frame of the second picture before but I changed my settings in \lstset and now it doesn't work anymore and I cannot find any source that explains how to resize my frame.
I'd be really glad if anybody knew the answer!