Numbered bibliographies for each section - bibliography

I am compiling my theses, but I am struggling to get the individual bibliographies number for each chapter. I manged to generate seperate bibliograpies and include them int he table of contents, but they remain unnummbered. Any adivse would be apprecieted.
Kind regards,
Mighael
Packaginges currenltly used:
\documentclass[11pt,oneside]{report}
\usepackage[english]{babel}
\usepackage{usbib}
\usepackage{url}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\graphicspath{{images/}}
\usepackage{fancyhdr}
\usepackage{vmargin}
\usepackage{subfig}
\usepackage{enumitem}
\usepackage{booktabs}
\usepackage{setspace}
\usepackage{titlesec}
\usepackage[titletoc]{appendix}
\usepackage{indentfirst}
\usepackage{multirow}
\usepackage[labelfont=bf]{caption}
\usepackage[skip=0pt plus0pt, indent=0pt]{parskip}
\usepackage{lscape}
\usepackage[sectionbib]{chapterbib}
\usepackage[nottoc]{tocbibind}`
I also notices thaat when I use the standard:
\bibliographystyle{abbrv}
\bibliography{references}
code, the referneces work fine. However, when change the style, e.g. to
\bibliographystyle{science}
\bibliography{references}
a ? is displayed woth an error. Any advise?

Related

Add colors to ascii table with discordjs

I've created an ascii table using ascii-table3 that gets posted to discord. The table gets posted no problem with no issues like in pic below, but I'm trying to integrate colors to the table, but can't seem to get that part working. As far as I know colors only work with code blocks so I'm using inlineCode from #discordjs/builders to put the ascii table inside of, but it doesn't seem to recognize the markdown language. When I try to add markdown language it breaks the table like this when doing table.addRow('```diff\n+' + position.value + 'n\n```') for a row. Adding newLines does seem problematic though with ascii-table3 so perhaps there's a better way...
So my question is how can I build a table in discord and add colors? Maybe a different library or my syntax might be off, but I don't think it is. I know that markdown syntax is sensitive to things like spaces though so maybe that is the problem... I appreciate any help!
UPDATED
for (let position of positions) {
table.addRow(
position.value,
position.value,
position.value,
position.value,
position.value,
position.value,
'+' + position.value
);
}
table.setAlign(1, AlignmentEnum.CENTER);
table.setAlign(2, AlignmentEnum.CENTER);
table.setAlign(3, AlignmentEnum.CENTER);
table.setAlign(4, AlignmentEnum.CENTER);
table.setAlign(5, AlignmentEnum.CENTER);
table.setAlign(6, AlignmentEnum.CENTER);
table.setAlign(7, AlignmentEnum.CENTER);
table.setStyle('unicode-single');
return inlineCode('```diff\n' + table.toString() + '```');
[![enter image description here][3]][3]

May I know how to create / generate XML using elementtree

...
para1= ET.SubElement(root,'para')
anchortag=ET.SubElement(para1,'anchor')
anchortag.set()
para1.text= " sometexthere"
I tried with the above code snippet,but couldn't get the expected output.I don't want to create a new para tag that would take the text to newline.
result of above code :
<para> sometexthere<anchor> xyxyy</anchor></para>
Expected code
<para><anchor> xyxyy</anchor> sometexthere </para>
You have to make a couple of changes, and it should work:
First, change
anchortag.set()
to
anchortag.text='xyxy'
and then, given that you want sometexthere to be at the tail end of the element,
change
para1.text= " sometexthere"
to
para1.tail= "sometexthere"

How can I emphasize an impex macro if it is part of a string?

How can I emphasize an impex macro if it is part of a string?
We can do something like this:
$prefix=alpha
$contentCatalog=$prefixContentCatalog
... and $contentCatalog will return "alphaContentCatalog".
Can I make the macro more explicit with something like:
$contentCatalog={$prefix}ContentCatalog
... so that I can immediately see that the macro is $prefix? Is there a syntax for this? (NOTE: The curly brace is just an example. This syntax/symbol doesn't exist for this purpose)
Another example: If I have something like below, it becomes confusing:
$prefix=electronics
$contentCatalog=$prefixContentCatalog
$contentCatalogFolderName=$contentCatalogFolder
But it can be easier to understand if it can be written as:
$prefix=electronics
$contentCatalog={$prefix}ContentCatalog
$contentCatalogFolderName={$contentCatalog}Folder
Hhmmm, unfortunately I don't think there is anything for this. I only see some workarounds like special naming for macro variables:
$_prefix_=electronics
$_contentCatalog_=$_prefix_ContentCatalog
$contentCatalogFolderName=$_contentCatalog_Folder
there is an alternate way to customize the micro via injecting property in local.properties and using ConfigPropertyImportProcessor.
UPDATE GenericItem[processor = de.hybris.platform.commerceservices.impex.impl.ConfigPropertyImportProcessor]; pk[unique = true]
$contentCatalog = $config-ly.br.content.catalog
$contentCV = catalogVersion(CatalogVersion.catalog(Catalog.id[default = $contentCatalog]), CatalogVersion.version[default = Staged])[default = $contentCatalog:Staged]
and entries should be added in local.properties.
ly.br.content.catalog=TestContentCatalog
Note:This is useful when we have multi-country.

Latex: How to encapsulate text in an amsmath block

My first stackoverflow question. I take the easy way out and directly ask the following. How is it possible to produce an output in LaTeX, like the one pictured below?
More holistic, what are the best ways to encapsulate text in an amsmath eg. equation, align, block?
You should use a tabular environment. This code:
\documentclass{article}
\begin{document}
\begin{tabular}{ll}
$ID_V$ & = identifier of $V$\\
$P_C$ & = password of user on $C$\\
$AD_C$ & = network address of $C$\\
$K_V$ & = secret encryption key shared by $AS$ and $V$
\end{tabular}
\end{document}
produces:
Then you can indent or align the tabular as you prefer.
Only a hint about the second part of your question. Keep in mind which environments, like tabular, have text as default content (hence math must be included in $...$) and which ones, like array, align, equation, etc., have math as default (so that text must be included in a box or in \text{...}).
You can use the \text{} command to write text in amsmath blocks:
\documentclass[11pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
ID_V &= \text{identifier of $V$} \\
P_C &= \text{password of user on $C$}
\end{align}
\begin{alignat}{2}
&ID_V &&= \text{identifier of $V$} \\
&P_C &&= \text{password of user on $C$}
\end{alignat}
\end{document}

String replacement in latex

I'd like to know how to replace parts of a string in latex. Specifically I'm given a measurement (like 3pt, 10mm, etc) and I'd like to remove the units of that measurement (so 3pt-->3, 10mm-->10, etc).
The reason why I'd like a command to do this is in the following piece of code:
\newsavebox{\mybox}
\sbox{\mybox}{Hello World!}
\newlength{\myboxw}
\newlength{\myboxh}
\settowidth{\myboxw}{\usebox{\mybox}}
\settoheight{\myboxh}{\usebox{\mybox}}
\begin{picture}(\myboxw,\myboxh)
\end{picture}
Basically I create a savebox called mybox. I insert the words "Hello World" into mybox. I create a new length/width, called myboxw/h. I then get the width/height of mybox, and store this in myboxw/h. Then I set up a picture environment whose dimensions correspond to myboxw/h. The trouble is that myboxw is returning something of the form "132.56pt", while the input to the picture environment has to be dimensionless: "\begin{picture}{132.56, 132.56}".
So, I need a command which will strip the units of measurement from a string.
Thanks.
Use the following trick:
{
\catcode`p=12 \catcode`t=12
\gdef\removedim#1pt{#1}
}
Then write:
\edef\myboxwnopt{\expandafter\removedim\the\myboxw}
\edef\myboxhnopt{\expandafter\removedim\the\myboxh}
\begin{picture}(\myboxwnopt,\myboxhnopt)
\end{picture}
Consider the xstring package at https://www.ctan.org/pkg/xstring.
The LaTeX kernel - latex.ltx - already provides \strip#pt, which you can use to strip away any reference to a length. Additionally, there's no need to create a length for the width and/or height of a box; \wd<box> returns the width, while \ht<box> returns the height:
\documentclass{article}
\makeatletter
\let\stripdim\strip#pt % User interface for \strip#pt
\makeatother
\begin{document}
\newsavebox{\mybox}
\savebox{\mybox}{Hello World!}
\begin{picture}(\stripdim\wd\mybox,\stripdim\ht\mybox)
\put(0,0){Hello world}
\end{picture}
\end{document}

Resources